Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Embed instagram post
#1
Photo 
Hello world, 

This is my first post, i'm a french admin on a small friends private forum and i just fork from something found on a phpbb help forum. A code for embedding an instagram post in forum. 

Here is the regex : 
Code:
\[insta\]https://www.instagram.com/p/(.*?)/\[/insta\]

and the replacement code : 
Code:
<iframe src="//instagram.com/p/$1/embed/captioned/" width="612" height="710" frameborder="0" scrolling="auto" allowtransparency="true" style="border: 1px #b2a998 solid; border-radius: 5px; box-shadow: 0px 0px 7px 0px rgba(106, 101, 91, 0.5); "
></iframe>

remove "captioned/" if you want.

Hope you enjoy it. 
Tell me if you find a better way (or if you have an idea to improve it in any way)
you user just have to copy/paste the share url of an instagram post and put it in [insta] [/insta] tags.
With some CSS (border, light shadow), it can be nicely integrated to your forum posts, i put it directly in replacement code but you cant have it here : 

Code:
border: 1px #b2a998 solid;
border-radius: 5px;
box-shadow: 0px 0px 7px 0px rgba(106, 101, 91, 0.5);

[Image: Capture_d_e_cran_2017_02_09_a_13_09_55.png]

Have a nice day.
N.
Reply
#2
Why don't just use the url as MyCode ?
regexp Wrote:https://www.instagram.com/p/(.*?)/
[ABP Central] - [MyBB 1.8 mods]
Do not ask me help through PM
Reply
#3
'Cause sometimes you want a link and sometimes you want embed ?
Reply
#4
I'm trying to use your code, Neo[blue],  but it doesn't work on my forum Sad
I also tried your code Crazycat (hello ! the world is so small !! Big Grin) but with no success Sad

I'm new to myBB, I might have done some mistake, somewhere...?

OOps !

Forgot my previous message...I've forgotten the final slash...huhu ^^
Reply
#5
(03-16-2017, 01:24 PM)myinnershelf Wrote: I'm trying to use your code, Neo[blue],  but it doesn't work on my forum Sad
I also tried your code Crazycat (hello ! the world is so small !! Big Grin) but with no success Sad

I'm new to myBB, I might have done some mistake, somewhere...?

OOps !

Forgot my previous message...I've forgotten the final slash...huhu ^^

Does it work now ?
Reply
#6
Quote:OOps !

Forgot my previous message...I've forgotten the final slash...huhu ^^


Yes !! Smile
Perfect ! Smile
Reply
#7
it doesnt work for me Sad why
Reply
#8
So, it only works if I manually remove the last bit from the link
For example:
If I want to embed 

PHP Code:
https://www.instagram.com/p/BYDVpZ3FGxV/?hl=en&taken-by=shireensungkar 
 I have to remove 
PHP Code:
?hl=en&taken-by=shireensungkar 


Fair enough, for me, I suppose but it may be confusing to members trying to utilize it
Reply
#9
It doesn't work. Nothing shows up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)