Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on June 23, 2015, 02:36:27 PM

Title: Embed Instagram BBCode
Post by: dougiefresh on June 23, 2015, 02:36:27 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4059)



EMBED INSTAGRAM BBCODE v2.1
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4059)



Introduction
This modification adds a BBCode to view Instagram videos and pictures.

The BBCode takes these forms:

[instagram]{instagram ID}[/instagram]
[instagram width=x height=y]{instagram ID}[/instagram]

where {instagram ID} is the 21wUvaPwwB part of the https://instagram.com/p/21wUvaPwwB URL, and x and y are parameters supporting both pixel and percentages for width and height (respectively).

Admin Settings
Under Admin => Modification Settings, there are some new options:
o Default width of embedded Instagram video
o Default height of embedded Instagram video
o Include Instagram link beneath?

Compatibility Notes
This mod was tested on SMF 2.0.15, but should work on SMF 2.1 Beta 2, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

This mod should be installed after Tapatalk mod (https://www.tapatalk.com/download_SimpleMachines.php), if you want to use it with Tapatalk.

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/embed-instagram-bbcode/?tab=1).

License
Copyright (c) 2015 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Instagram BBCode
Post by: villasg on June 26, 2015, 04:46:04 AM
Thanks nice mod work great in my 2.0.10
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on June 29, 2015, 06:47:18 PM
Uploaded v1.1 - June 29th, 2015
o Fixed errors when nothing was placed between the tags.
o Modified code so that nothing is output when nothing is placed between the tags.
o Modified code to allow full path to the Instagram post instead of just the post ID.
Title: Re: Embed Instagram BBCode
Post by: villasg on June 30, 2015, 08:26:43 AM
Hi need to remove old version to install the new one or not ?
Or only replace the Subs-BBCode-Instagram.php in /Sources with the new one ?
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on June 30, 2015, 03:36:24 PM
Quote from: villasg on June 30, 2015, 08:26:43 AM
Hi need to remove old version to install the new one or not ?
Or only replace the Subs-BBCode-Instagram.php in /Sources with the new one ?
All the changes take place in the Subs-BBCode-Instagram.php file, so simply replacing the file should upgrade the mod without having to uninstall and reinstall the mod....  Be mindful of the fact that your database will still report that you're using v1.0 instead of v1.1, though.....
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on July 27, 2015, 01:00:39 PM
Hey Dougie,

I was wondering, Can you help tweaking the icon to have the background / mouseover effect to match my other BBC Buttons?
(I tried using a smaller sized icon but it just appears normally..)  (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2F%28http%3A%2F%2Fwww.420connect.co.uk%2FThemes%2FRedsy%2Fimages%2Fbbc%2Finstagram.gif%29&hash=be99523b71f8ec788a94d8b6feb4c6729c1b4c47)

Many thanks!
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on July 27, 2015, 03:21:37 PM
Uploaded v1.2 - July 27th, 2015
o Replaced Instagram bbcode button images with better quality ones.




@420connect.info: I replaced the bbcode button images with better quality ones.  I didn't realize that the one for SMF 2.0 was seriously messed up, and for that, I apologize.  This version should fix that.....
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on July 27, 2015, 04:27:35 PM
Hmm.. Maybe that was my first problem upon testing this out!

I've just installed the new version but the icon was missing, so I went to check if it had copied to my theme as well as default..

It had but it seems the image you're using is 'empty' /blank or something?

(attached)

???
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on July 27, 2015, 04:59:46 PM
further testing:

it's coded for instagram.gif but the image supplied is Instagram.gif (capital at the start)
also, when I tried using an image I found myself, it does the same as before and sort of puts it on top of the background/hover effect

and also, when I use inspect element and change a random existing one's image to the url of the instagram.gif - it too becomes a 'broken' button, without the hover stuff..

:P Super-confused!

Title: Re: Embed Instagram BBCode
Post by: dougiefresh on July 27, 2015, 07:55:07 PM
I made a small change to the package-info.xml file to correct the image name that SHOULD be transferred, then reuploaded the v1.2 mod.  Hopefully this does the trick....  ???
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on July 28, 2015, 02:43:42 AM
Okay, after having another little play around I've figured out what I wasn't happy about!

Basically.. the existing BBC buttons I have all* have a transparent border around them, with a small-ish icon in the center of it - whereas the instagram one, just filled the entire space with no transparent border!

.. The new one you provided seems to have transparency one side, and the one I had found online had none (hence it looking big and weird)

Anyway! .. I've thrown together a little transparent .gif that blends in with the rest to suit my liking now :)
(attached) ~ Feel free to use it in the package if you like!

Glad thats solved!  :laugh:
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on August 06, 2015, 04:41:03 PM
Hey,  just a quick one whilst I notice it..
Is it possible to make the embedded part responsive to screen size?
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on August 07, 2015, 10:06:34 AM
Uploaded v1.3 - August 7th, 2015
o Added responsiveness to the Instagram iframe code.
o Replaced Instagram bbcode button images with one supplied by 420Connect.co.uk




@420Connect.co.uk: Thank you for the button image submission.  It's been included in this version!  And yes, the bbcode has been made responsive!
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on August 07, 2015, 10:08:21 AM
You're a legend, thanks doug'  ;)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on August 08, 2015, 09:45:25 AM
Uploaded v1.4 - August 8th, 2015
o Added bbcode form where "frameborder" is the only parameter taken.
o Added additional URL validation to make sure bbcode isn't misused.
o Modified parameters so that height parameter is now optional.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on August 08, 2015, 12:22:44 PM
Uploaded v1.5 - August 8th, 2015
o Removed support for SMF 2.1 Beta 1
o Added support for SMF 2.1 Beta 2
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on August 12, 2015, 04:08:20 PM
Uploaded v1.6 - August 12th, 2015
o Added settings to allow admin to set default size of the Instagram video.
o Altered code to use new default size settings when width and/or height isn't specified.
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on August 12, 2015, 04:21:33 PM
Take a well deserved break Dougie, you're churning out releases faster than we can install them haha!
Thank you so much for your generosity to the community!
Title: Re: Embed Instagram BBCode
Post by: villasg on August 15, 2015, 07:53:05 AM
Have problem to show instagram post .
i try https://instagram.com/p/6XDpmgIjEq/?taken-by=wbangkok
with this
[instagram]https://instagram.com/p/6XDpmgIjEq/?taken-by=wbangkok[/instagram]

receive :
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FwST9ZOS.png&hash=dfdc44cedef2fc22bdbff2b327257131d2665e06)

with this
[instagram]6XDpmgIjEq[/instagram]

receive
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FTUHQR4y.png&hash=7ec6d4223f7d6db9b2af45f4567402f03b14f69f)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on August 15, 2015, 09:35:14 AM
Uploaded v1.7 - August 15th, 2015
o Fixed issue where 10 character Instagram post ID wasn't displayed properly.
o Fixed CSS issue where instagram post was partly displayed within the specified area.




@villasg:  Thank you for bringing this to my attention.  I had also forgotten to copy over the fixed CSS file that I fixed before uploading v1.6.....
Title: Re: Embed Instagram BBCode
Post by: villasg on August 15, 2015, 03:23:11 PM
Now you are OK
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on August 24, 2015, 10:50:42 PM
This is a pretty good mod. Just to throw out an idea, could you make it automatic as well? Let's say an user posts a link without wrapping it, the mod recognizes it and wraps it automatiically? I am testing this, the tumblr one and the facebook one as well, don't know if it works for those but it would be nice.

And congrats for so much code dougie! :)
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on August 26, 2015, 01:05:26 AM
Further testings show that the mod fails 3 times at XHTML validation.

[quote]
Error Line 325, Column 191: there is no attribute "allowtransparency"
...="0" scrolling="no" allowtransparency="true"></iframe></div></div><br /><a cla...

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Error Line 325, Column 400: "async" is not a member of a group specified for any attribute
...e - Nick and Leezy 😍</a><script async src="//cdn.embedly.com/widgets/platform....

Error Line 325, Column 459: required attribute "type" not specified
...ync src="//cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script></div>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

The async is just annoying, I had the same issue before with other things, while the third one is easy to fix and it's annoying as well since it's not going to throw any error in HTML5 while it does in XHTML. On the other hand, I am unsure about the first.
Not suggesting the fixes, it's going to take more time to actually c/p them rather than fixing those for ya ;D

Quote from: Ninja ZX-10RR on August 24, 2015, 10:50:42 PM
This is a pretty good mod. Just to throw out an idea, could you make it automatic as well? Let's say an user posts a link without wrapping it, the mod recognizes it and wraps it automatiically?
*bump* missed? :)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on August 26, 2015, 05:13:33 PM
@Ninja ZX-10RR: I'm working on both of the issues you mentioned.  I've got the auto-embedding code figured out....  Trying to fix the HTML/CSS output so that the entire Instagram thingy is shown without scrollbars...  To test, look at this:
[instagram]https://instagram.com/p/6HCv5FQzGO[/instagram]
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on August 26, 2015, 08:51:56 PM
For the auto-embedding I should have mentioned... Just do it the way Suki did for the Youtube mod (http://custom.simplemachines.org/mods/index.php?mod=3268), got to admit it's pretty good besides a stupid XHTML error that I fixed myself in the topic :)

Going to have a look at that scrollbar thingy, if it's css-related I'm pretty sure I can help with that. Will edit/post again in a while if necessary. EDIT 1: not sure what you mean with that, I tried the link you provided and yes you get a scrollbar on low-res, but it's SMF-side, not mod-side. SMF was never designed to be responsive until they tried to roll out that responsive mod thingy which partly did it. I'm going to have a look if my fully responsive default is being broken by the mod itself, hang on. EDIT 2: no, it doesn't, but the Tumblr mod does break it (breaks on hover due to the lateral blocks moving everything up and down).

And of course thanks!
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on August 27, 2015, 01:14:27 PM
Uploaded v1.8 - August 27th, 2015
o Added ability to auto-embed Instagram URLs to the mod.
o Adjusted CSS file "padding-bottom" property from 100% to 112% to show entire embed.
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on August 27, 2015, 03:18:45 PM
Didn't have that issue on my forum O.o the auto-embed is working as intended (nice!), but the XHTML still fails, and checking again I have no idea how you could fix it, because it looks like it's Instagram side...?
Title: Re: Embed Instagram BBCode
Post by: villasg on September 02, 2015, 01:46:55 PM
Hello again .
I try to unistall the 1.7 and replace with 1.8 but receive errors in Post.php when try uninstall .
package in uninstallation search for '<img><iframe> to replace with '<img> 2 times .
But have this 2 lines with this and look like
line 1534 if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><div><div><iframe><iframe><div><iframe><div><iframe><div><object><embed><div><iframe>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false)) $post_errors[] = 'no_message';

line 2747
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><object><embed><iframe>')) === '')


Any help again please
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 02, 2015, 03:42:35 PM
Quote from: villasg on September 02, 2015, 01:46:55 PM
Hello again .
I try to unistall the 1.7 and replace with 1.8 but receive errors in Post.php when try uninstall .
package in uninstallation search for '<img><iframe> to replace with '<img> 2 times .
But have this 2 lines with this and look like
line 1534 if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><div><div><iframe><iframe><div><iframe><div><iframe><div><object><embed><div><iframe>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false)) $post_errors[] = 'no_message';

line 2747
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><object><embed><iframe>')) === '')


Any help again please
:o I've gone over something very similar with you here (http://www.simplemachines.org/community/index.php?topic=538070.msg3831316#msg3831316).  All I've done is alter the source file so that it matches what is expected.  ::)

In other words, if the mod expects <img><iframe> and you have <img><div><iframe>, you need to change the order of the tags (as the order isn't revelant to the function using them) so that you get <img><iframe><div>.  8)  The fact that you can find the issue suggests to me the ability to correct this minor issue on your own....   You can even go further and eliminate the duplicates from the string that we are editing....

That having been said, here is what you need to change the lines to:
Code (Line 1534) Select
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><iframe><div><div><iframe><div><iframe><div><iframe><div><object><embed><div><iframe>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false))
Code (Line 2747) Select
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><iframe><object><embed>')) === '')

Btw, as an off-topic note, SMF 2.1 deals with this different by adding all the tags it doesn't need to strip out in an array and collapsing the array for use by the strip_tags function.  This mod, when installed on SMF 2.1, adds the tag to the array and uninstalls properly without the need for this kind of modification.....
Title: Re: Embed Instagram BBCode
Post by: bjornforum on September 04, 2015, 08:11:45 AM
Hi! Thanks for your mod.
I do have a problem though: As soon as I install the modification, the bbcode settings in configuration -> Forum -> Topics & posts -> Bulletin Board Code disappear. Only the 'enable all bbcode' checkbox stays visible.

See attached screenshot.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 06, 2015, 01:05:28 PM
Uploaded v1.9 - Septmber 6th, 2015
o Fixed issue where BBCodes list was completely empty because of mod... (shrug)
Title: Re: Embed Instagram BBCode
Post by: bjornforum on September 07, 2015, 06:33:45 AM
Thanks!
Would you be able to also add Vine for embed?

Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 07, 2015, 08:50:12 AM
From the little bit of research I did this morning, it looks like Vine is seperate from Instagram....  So I'll can do a different mod to address this request, since the two don't really belong together IMHO....
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on September 07, 2015, 09:00:25 AM
As long as it doesn't have arrogant javascript inside of it ;D
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 07, 2015, 09:17:57 AM
UPDATE: Just for giggles, I took a copy of the Instagram mod and modified it for Vine Videos.  It's here (http://custom.simplemachines.org/mods/index.php?mod=4071), but it's currently unapproved.  I'm going to try to get it up on my forum over at www.xptsp.com shortly....

Quote from: Ninja ZX-10RR on September 07, 2015, 09:00:25 AM
As long as it doesn't have arrogant javascript inside of it ;D
Nope, it's a simple iframe mod.  No javascript involved!   :P




EDIT: It's available on my website: Embed Vine Video BBCode (http://www.xptsp.com/board/index.php?topic=581.0).

Title: Re: Embed Instagram BBCode
Post by: TLMB on September 18, 2015, 04:48:23 PM
Brilliant. Thank you very much!

May I suggest disabling the mod within code tags? I mean, I know it doesn't embed within code tags, but it does add the [ instagram ] tags, which means I can't tell users "just post the link, like this", because then they might think they have to add the tags.
A minor point, I admit. :)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 19, 2015, 03:55:01 AM
Okay, I'll make that change.....
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 21, 2015, 11:24:35 AM
Uploaded v1.10 - September 21st, 2015
o Fixed auto-embedding issue where URLs inside code tags where auto-linked.
Title: Re: Embed Instagram BBCode
Post by: TLMB on September 27, 2015, 02:23:04 PM
Thank you.
But how do I upgrade? Trying to install v1.10 tells me "it's already installed", but trying to uninstall v1.9 gives me Test Failed on
Quote*    2.    Execute Modification    ./Sources/Post.php    Test failed
      1.    Replace    ./Sources/Post.php    Test failed
      2.    Replace    ./Sources/Post.php    Test failed
*    3.    Execute Modification    ./Sources/Subs.php    Test failed
      1.    Replace    ./Sources/Subs.php    Test failed
I also have Antes' Tweet embed mod (http://custom.simplemachines.org/mods/index.php?mod=3837) and your facebook embed mod installed. Any conflict there?
Title: Re: Embed Instagram BBCode
Post by: TLMB on September 27, 2015, 06:14:55 PM
Update: I uninstalled your two mods in the reverse order that I installed them, and then installed the latest version of each, successfully.

Unfortunately I'm now getting a "the message body was left empty" error when I try to edit a post that has some instagram links in, amongst other stuff. (Googling suggests this may be to do with too many bbcodes in one post.) The post is shown as blank, even though clicking "modify" loads the post's full content in the edit window.

My forum now tells me that I have Subs-Post.php version 2.0.8 , and the latest version is 2.0.10. I'm running 2.0.11. I suspect it may be to do with this? Tempted to try your Faster BBC Parser mod to see if that magically fixes things... :)
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on September 28, 2015, 01:33:11 AM
Actually veriify that you successfully updated to 2.0.11 first, and only then think about mods. Sometimes the updates silently fail and you don't know it unless you manually click on each arrow to inspect each file edit while installing them. This is done because SMF assumes a mod has edited those strings of codes, so they no longer need to be updated (which is fairly questionable to me, but it's just me).
What you should do now is to manually verify that each update installed successfully in each file, and it's going to take not less than 3 hours. If you don't have many mods installed nor custom edits to files I'd recommend you just install a clean 2.0.11 from scratch and re-mod it again.
Title: Re: Embed Instagram BBCode
Post by: TLMB on September 28, 2015, 08:43:28 AM
Thanks Ninja. Unfortunately I have plenty of mods installed. Slog-work time, I guess.... :/
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 28, 2015, 09:00:01 AM
If a SMF update doesn't update a particular file, then the version number won't change.   I'm at work right now and can't verify that files version number.
Title: Re: Embed Instagram BBCode
Post by: margarett on September 28, 2015, 09:48:07 AM
Subs-Post is  * @version 2.0.10
But the file version is just recognized by this text string. What's important is the content.

So you need to make sure that the changes performed to it in both 2.0.9 and 2.0.10 are present at the file.
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on September 28, 2015, 11:13:40 AM
Quote from: TLMB on September 28, 2015, 08:43:28 AM
Thanks Ninja. Unfortunately I have plenty of mods installed. Slog-work time, I guess.... :/
Don't tell me, I have around 140 installed ;D
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on October 02, 2015, 03:10:13 PM
Uploaded v1.11 - October 2nd, 2015
o Rewrote auto-embedding code to deal with line-breaks and duplicate closing brackets.




@TLMB: Sorry about not responding lately.  I've been working multiple mandatory 12+ hour shifts and have just recently gotten off the mandatory crap....  This update will not solve your particular bug reports....  SOOOO, let's play catch-up!

Quote from: TLMB on September 27, 2015, 02:23:04 PM
Thank you.
But how do I upgrade? Trying to install v1.10 tells me "it's already installed", but trying to uninstall v1.9 gives me Test Failed on
Quote*    2.    Execute Modification    ./Sources/Post.php    Test failed
      1.    Replace    ./Sources/Post.php    Test failed
      2.    Replace    ./Sources/Post.php    Test failed
*    3.    Execute Modification    ./Sources/Subs.php    Test failed
      1.    Replace    ./Sources/Subs.php    Test failed
Attach your Sources/Post.php and Sources/Subs.php so that I can see what the problem is.....

Quote from: TLMB on September 27, 2015, 02:23:04 PM
I also have Antes' Tweet embed mod (http://custom.simplemachines.org/mods/index.php?mod=3837) and your facebook embed mod installed. Any conflict there?
I don't see any conflict between the three mods.  The Antes' Tweet embed mod (http://custom.simplemachines.org/mods/index.php?mod=3837) doesn't make changes to the same areas as either of my mods.  My Embed Facebook mod is designed to be installed alongside this mod....

Quote from: TLMB on September 27, 2015, 06:14:55 PM
Unfortunately I'm now getting a "the message body was left empty" error when I try to edit a post that has some instagram links in, amongst other stuff. (Googling suggests this may be to do with too many bbcodes in one post.)
The forum strips out all HMTL tags that it considers "unnecessary", in order to see if anything left is worth displaying.  So if the previous install statement didn't tell me that there is something wrong with your install, getting this message tells me there is definitely something wrong!

Quote from: TLMB on September 27, 2015, 06:14:55 PM
The post is shown as blank, even though clicking "modify" loads the post's full content in the edit window.
Show me what you are using in your post, so that I can see if it is something I can solve....

Quote from: TLMB on September 27, 2015, 06:14:55 PM
My forum now tells me that I have Subs-Post.php version 2.0.8 , and the latest version is 2.0.10. I'm running 2.0.11. I suspect it may be to do with this?
I'd be surprised if this particular "issue" had any play in this particular bug report.....  However, as margarett stated, you should make sure those changes are present, as the SMF updates are fairly (if not VERY) important!!

Quote from: TLMB on September 27, 2015, 06:14:55 PM
Tempted to try your Faster BBC Parser mod to see if that magically fixes things... :)
It wouldn't solve this particular problem.  The Faster BBC Parser mod is designed to replace some code, which in particular circumstances, can result in the forum crashing.  This is NOT one of them!  :P
Title: Re: Embed Instagram BBCode
Post by: TLMB on October 05, 2015, 08:46:32 AM
Hi Dougie,
No need to apologise - I quite understand. I haven't yet had time to try to do my own checking of the SMF upgrade changes yet.

Here is the post I'm trying to make. As a stopgap solution, I've split it into 2 posts at "OR..." , and those both post okay individually. As one complete message though, it fails.
Note: I've manually added spaces to the [c o d e] tags of my messages, so that it doesn't break the [c o d e] parsing of this post! The spaces in the first image url are also there deliberately.
Like this
1. ([b][color=purple]as an embedded image[/color][/b])
[c o d e][img] http :// kendama.co.uk/ images/ WatchmenKendama_sm .jpg [/img] (without spaces)[/ c o d e]
(You can click the little "Mona Lisa" button to get the [ img ] tags.)
..which will give you...
[img width=600 height=800]http://kendama.co.uk/images/WatchmenKendama_sm.jpg[/img]

NOTE: the URL you use must be a direct link to the [i]image file itself[/i], and not to a web page that the image [i]is on[/i].

If your image is on a website page that doesn't allow you to easily share the direct image URL (like Twitter or Instagram, for example), then just type the page URL into your post, without using any code tags. e.g.
"Copy link to tweet" from Twitter, and it will automatically embed, like this: [url=https://twitter.com/britishkendama/status/409024472771870720]https://twitter.com/britishkendama/status/409024472771870720[/url]
Or "Copy Share URL" from Instagram, and it will automatically embed, like this:
[url=http://instagram.com/p/i1AI5wiHk0/]http://instagram.com/p/i1AI5wiHk0/[/url]





Also, we have a Facebook auto-embed for facebook [b]posts[/b] (not images). Copy the link from the timestamp of the post, and paste it in your reply here.
[url=https://instagram.com/p/72tOPQCHvl/]https://instagram.com/p/72tOPQCHvl/[/url]

...and you get:

[url=https://www.facebook.com/BritishKendamaAssociation/posts/1003599909691776]https://www.facebook.com/BritishKendamaAssociation/posts/1003599909691776[/url]

OR...

2. Like this ([b][color=purple]as an attachment[/color][/b]). [b]Note the file size limits![/b] ([size=8pt][i]Please log in to see the attached image.[/i][/size])

There is a maximum of 500KB for any one image, or 1500Kb total for one post. Please check the size of the files you are trying to attach. Most modern digital cameras will probably produce images that are larger than this. You can host them on an image hosting site (e.g. Flickr) and post links to/embed the images here, or else you will need to compress your images with some software before you try to upload them as attachments. (Google "image compression software" for suggestions, and add "free" to that search term if you are skint!).

Suggested example:
If you have a jpg that is 4.5MB, and 4320x2880 pixels,
A. Reduce the resolution to 72 dots per inch (dpi), then
B. Reduce the scale to 800x533pixels, and then compress (Save As..) again as a jpg, at say, 87%.
Your new image will only ~53KB, and will fit easily on a computer screen, but will "look the same". (Exact numbers will vary, depending on your files/software.)

Edit: Here's a walk-through for compressing on an iOS device with a cheap app:
[url=http://www.idownloadblog.com/2014/02/22/how-to-reduce-pictures-file-size-on-iphone/]http://www.idownloadblog.com/2014/02/22/how-to-reduce-pictures-file-size-on-iphone/[/url]
Here's an alternative cheap app: [url=https://itunes.apple.com/gb/app/idownsize/id541063049?mt=8]https://itunes.apple.com/gb/app/idownsize/id541063049?mt=8[/url]

...and here's a free iOS app that we haven't tried:
[url=https://itunes.apple.com/gb/app/file-aid/id889655915?mt=8]https://itunes.apple.com/gb/app/file-aid/id889655915?mt=8[/url]

...and Fit2Web is simple and works well too:
Fit2Web Free by TwentySix TwentyEight
[url=https://appsto.re/gb/wwvcO.i]https://appsto.re/gb/wwvcO.i[/url]


As you can see, the forum had previously auto [ u r l ] 'd some of the links (pre-dating me installing your mods), so I thought that might be adding to the excess load of tags, so I thinned it out to.....

Like this
1. ([b][color=purple]as an embedded image[/color][/b])
[c o d e][img] http :// kendama.co.uk/ images/ WatchmenKendama_sm .jpg [/img] (without spaces)[/ c o d e]
(You can click the little "Mona Lisa" button to get the [ img ] tags.)
..which will give you...
[img width=600 height=800]http://kendama.co.uk/images/WatchmenKendama_sm.jpg[/img]

NOTE: the URL you use must be a direct link to the [i]image file itself[/i], and not to a web page that the image [i]is on[/i].

If your image is on a website page that doesn't allow you to easily share the direct image URL (like Twitter or Instagram, for example), then just type the page URL into your post, without using any code tags. e.g.
"Copy link to tweet" from Twitter, and it will automatically embed, like this:
https://twitter.com/britishkendama/status/409024472771870720
Or "Copy Share URL" from Instagram, and it will automatically embed, like this:
http://instagram.com/p/i1AI5wiHk0/





Also, we have a Facebook auto-embed for facebook [b]posts[/b] (not images). Copy the link from the timestamp of the post, and paste it in your reply here.
https://instagram.com/p/72tOPQCHvl/

...and you get:

https://www.facebook.com/BritishKendamaAssociation/posts/1003599909691776

OR...

2. Like this ([b][color=purple]as an attachment[/color][/b]). [b]Note the file size limits![/b] ([size=8pt][i]Please log in to see the attached image.[/i][/size])

There is a maximum of 500KB for any one image, or 1500Kb total for one post. Please check the size of the files you are trying to attach. Most modern digital cameras will probably produce images that are larger than this. You can host them on an image hosting site (e.g. Flickr) and post links to/embed the images here, or else you will need to compress your images with some software before you try to upload them as attachments. (Google "image compression software" for suggestions, and add "free" to that search term if you are skint!).

Suggested example:
If you have a jpg that is 4.5MB, and 4320x2880 pixels,
A. Reduce the resolution to 72 dots per inch (dpi), then
B. Reduce the scale to 800x533pixels, and then compress (Save As..) again as a jpg, at say, 87%.
Your new image will only ~53KB, and will fit easily on a computer screen, but will "look the same". (Exact numbers will vary, depending on your files/software.)

Edit: Here's a walk-through for compressing on an iOS device with a cheap app:
http://www.idownloadblog.com/2014/02/22/how-to-reduce-pictures-file-size-on-iphone/
Here's an alternative cheap app: https://itunes.apple.com/gb/app/idownsize/id541063049?mt=8

...and here's a free iOS app that we haven't tried:
https://itunes.apple.com/gb/app/file-aid/id889655915?mt=8

...and Fit2Web is simple and works well too:
Fit2Web Free by TwentySix TwentyEight
https://appsto.re/gb/wwvcO.i


.... but still no joy.

Those files are attached, although I did get past the problem of upgrading your mods. Have not yet tried to upgrade again to your latest versions of FB and IG embeds....

Thanks very much for your help.

Title: Re: Embed Instagram BBCode
Post by: dougiefresh on October 17, 2015, 07:10:23 PM
Uploaded v1.12 - October 17th, 2015
o Fixed auto-embedding code so that it embeds the URL if no tags are around it.




@Everybody: I'm working long hours and haven't been able to answer questions in a timely manner.  This may go on for the next month or so.  Please be patient, as I don't even have time for myself, much less these mods....  Thanks for understand.

@TLMB: I modified the auto-embedding code from another mod to serve this mod's purpose.  No longer will it improperly auto-embed URLs if there are tags around it, such as the url tag like in the previous post....  I apologize if this breaks anybody's forum....
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on November 12, 2015, 09:08:52 AM
*critical issue*
This mod along with the other embed Tumblr (and perhaps any others from you with similar coding) // Embed Instagram URLs in the instagram bbcode tags:
BBCode_Instagram_Embed($message);

// Embed Tumblr URLs in the Tumblr bbcode tags:
BBCode_Tumblr_Embed($message);
breaks the admin BBC interface at action=admin;area=postsettings;sa=bbc; please fix this.
Thanks in advance.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on November 12, 2015, 03:58:41 PM
I'm guessing that you have mod version 1.8 installed, because this issue was addressed in version 1.9.  I would recommend upgrading to the latest version.
Title: Re: Embed Instagram BBCode
Post by: natcip on November 14, 2015, 08:56:47 AM
I just noticed that when I embed the URL with "www", the result adds "[/instagram]" as text right after the embedded iframe.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on November 14, 2015, 11:53:47 AM
@natcip: I assume you aren't running the latest release.  Please update your mod to the latest version (v1.13), which was released on October 17th, 2015.  Thank you!
Title: Re: Embed Instagram BBCode
Post by: natcip on November 14, 2015, 12:07:08 PM
Quote from: dougiefresh on November 14, 2015, 11:53:47 AM
@natcip: I assume you aren't running the latest release.  Please update your mod to the latest version (v1.13), which was released on October 17th, 2015.  Thank you!
I have the version v1.12 installed. I downloaded it yesterday.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on November 14, 2015, 01:02:50 PM
Hmmm.... I'll look at it again.  However, can you provide me with a link that is causing you an issue?  It would be appreciated!
Title: Re: Embed Instagram BBCode
Post by: natcip on November 14, 2015, 02:32:47 PM
Quote from: dougiefresh on November 14, 2015, 01:02:50 PM
Hmmm.... I'll look at it again.  However, can you provide me with a link that is causing you an issue?  It would be appreciated!
Thanks!

Here's a post which I just edited with the "www" in the URL to give you an example.
http://brandy.4fans.net/index.php?topic=4420.msg176103#msg176103

And when the Instagram-URL has the "?taken-by=xxxx" parameter attached, it adds this as a text too.
Like this:
?taken-by=gwenstefani[/instagram]
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on November 14, 2015, 08:37:05 PM
@natcip:   :o Sigh....  First, I'm not a Brandy fan.  Second, I'm not signing up to your website just to see what the contents of your post is.  Third I see the results of the post message, but I NEED the contents in order to attempt to duplicate the problem.

All of this being said, I copied the comment link (right-click on Comment, then select Copy), which got me this:
https://instagram.com/p/-DO_iGtvPv
Changed it to this:
https://www.instagram.com/p/-DO_iGtvPv
And no visible change that I can see.  This just means I don't have the information that I need to look into the problem yet......  :o
Title: Re: Embed Instagram BBCode
Post by: natcip on November 15, 2015, 08:47:15 AM
Like I already said it's a regular link with www.

[instagram]https://www.instagram.com/p/-DO_iGtvPv/[/instagram]
[instagram]https://www.instagram.com/p/85aSlTuLbq/?taken-by=gwenstefani[/instagram]


Also, you said the newest version is v1.13, but the download page has v.1.12. ???
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on November 15, 2015, 09:45:25 AM
Uploaded v1.13 - November 15th, 2015
o Modified validation pattern to recognize URLs without the "/p" part as valid.
o Modified auto-embed regex pattern to require the "http" or "https" part of the URL.




@natcip:  Thank you for the bug report.  This update should solve this particular report!
Title: Re: Embed Instagram BBCode
Post by: natcip on November 15, 2015, 10:25:19 AM
Awesome, it works now. Thank you! :)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on November 30, 2015, 04:58:57 PM
Uploaded v1.14 - November 30th, 2015
o Modified auto-embed function for use as a hook with SMF 2.1.
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on December 27, 2015, 08:01:46 PM
Rather bad error log spamming, could reproduce on vanilla install.

2: Missing argument 4 for BBCode_Instagram_Embed(), called in /membri/ninjatest/Sources/Subs.php on line 1742 and defined
File: /Sources/Subs-BBCode-Instagram.php
Line: 104
2: Missing argument 3 for BBCode_Instagram_Embed(), called in /membri/ninjatest/Sources/Subs.php on line 1742 and defined
File: /Sources/Subs-BBCode-Instagram.php
Line: 104
2: Missing argument 2 for BBCode_Instagram_Embed(), called in /membri/ninjatest/Sources/Subs.php on line 1742 and defined
File: /Sources/Subs-BBCode-Instagram.php
Line: 104
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on December 28, 2015, 07:42:03 AM
Uploaded v1.15 - December 28th, 2015
o Fixed errors produced when calling BBCode_Instagram_Embed.




@Ninja ZX-10RR:  Thanks for the bug report!  It's been fixed!
Title: Re: Embed Instagram BBCode
Post by: d3vcho on December 28, 2015, 02:17:29 PM
Translation for Spanish_es

Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on December 28, 2015, 03:35:14 PM
Thanks for the fix dougie, nailed it :)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on January 01, 2016, 10:34:26 AM
Uploaded v1.16 - January 1st, 2016
o Added Spanish (ES) language translation to the mod.  Thanks, d3vcho (http://www.simplemachines.org/community/index.php?action=profile;u=422971)!
o Fixed issue where "/?taken-by={username}" at end of URL was not properly auto-embedded.




@d3vcho: Thank you for the Spanish translation!  It's been included in this update!
Title: Re: Embed Instagram BBCode
Post by: natcip on January 04, 2016, 04:28:06 PM
Hi,

I'm getting a "content not available" message when using any Instagram ID.

Here's an example URL
https://www.instagram.com/p/BAIGDmykOBg/
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on January 04, 2016, 04:51:21 PM
Are you using last version? Forum URL to see the problem rather than an instagram url? Might be more useful ;)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on January 04, 2016, 05:32:27 PM
Uploaded v1.17 - January 4th, 2016
o Fixed bbcode validation code so that more Instagram post IDs are properly recognized.




@natcip:  I tried the same link and get the same result.  It's was issue with the bbcode validation function, which only got 10 characters of the Instagram post ID.  The URL you posted has 11....  It's been fixed for this version.  Thank you for the bug report!

@Ninja ZX-10RR: Usually the Instagram URL is enough, because sometimes (like this case) it's an issue with the mod parsing the Instagram post URL correctly.  If I can't duplicate the report, then I need to see where you are using it....
Title: Re: Embed Instagram BBCode
Post by: natcip on January 04, 2016, 06:39:05 PM
Thanks for fixing it! :)
Title: Re: Embed Instagram BBCode
Post by: banznc on January 05, 2016, 03:03:51 PM
Hi, I'm using SMF 2.0.11 and keep getting the  Missing argument 3 for BBCode_Instagram_Embed() [site info] Sources/Subs.php on line 1745 and defined  it also has a link that shows with a -->> ==>104:    function BBCode_Instagram_Embed(&$message, &$smileys, &$cache_id, &$parse_tags)  in my logs, what would be the cause of this and or fix?  Thanks!
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on January 05, 2016, 03:38:35 PM
Quote from: banznc on January 05, 2016, 03:03:51 PM
Hi, I'm using SMF 2.0.11 and keep getting the  Missing argument 3 for BBCode_Instagram_Embed() [site info] Sources/Subs.php on line 1745 and defined  it also has a link that shows with a -->> ==>104:    function BBCode_Instagram_Embed(&$message, &$smileys, &$cache_id, &$parse_tags)  in my logs, what would be the cause of this and or fix?  Thanks!
Please upgrade to the latest version of the mod.  It's been fixed there.  If you insist on doing it yourself, then you need to edit Sources/Subs.php and search for BBCode_Instagram_Embed and change that line to this:
BBCode_Instagram_Embed($message, $smileys, $cache_id, $parse_tags);
That'll will fix this particular issue.  However, there have been several changes to the mod that make it worth the upgrade!  8)

Hope this helps!
Title: Re: Embed Instagram BBCode
Post by: banznc on January 05, 2016, 03:41:39 PM
Thanks, I have the latest release, I'll try your manual edit and post the results.  Thanks!
Title: Re: Embed Instagram BBCode
Post by: banznc on January 05, 2016, 03:47:25 PM
I do not have the BBCode_Instagram_Embed as you mentioned, but I do have the fix you mentioned already in the code.  The only one close to the one you mentioned is BBCode_Instagram_Embed($message);  I've attached my sub file
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on January 05, 2016, 04:58:11 PM
I've attached the modified version of Subs.php for ya....

OFF TOPIC:  :o  I'm not trying to be mean, so please don't take this next statement that way....  ???  I don't understand what is so difficult with the simple instruction I gave....  If you can't do the manual edits (and I DO NOT encourage it!), then upgrade your version of the mod!  The latest version is 1.17, and because of what bug symptoms you wrote, you must have 1.14 or below!
Title: Re: Embed Instagram BBCode
Post by: banznc on January 05, 2016, 05:14:28 PM
ok thanks, I got this a few days ago and see it was just updated yesterday, thanks for the help!
Title: Re: Embed Instagram BBCode
Post by: south_paw on January 05, 2016, 10:01:27 PM
ok tried to install the latest mod 1.17 with the package manager and was instructed that I already have this mod and must deleted the current mod to continue. I went and deleted 1.16(i didn't have 1.17 installed yet. files downloaded but not installed) and got this fatal error immediately.   

Fatal error: Call to undefined function BBCode_Instagram_Embed() in /home/content/76/10601576/html/Sources/Subs.php on line 1717


Tried to restore from prior database backup and no change. Please help. And go easy on me. I'm a car guy that is in over my head  :)
Title: Re: Embed Instagram BBCode
Post by: margarett on January 06, 2016, 05:06:35 AM
http://wiki.simplemachines.org/smf/A_mod_broke_my_forum

You don't need to touch the database in these cases ;)
Title: Re: Embed Instagram BBCode
Post by: south_paw on January 06, 2016, 06:47:03 AM
Thanks but I'm a little confused with the last line

Upload the files and directories from this file to your forum to overwrite what is there now.

how does that translate to these choices? Thanks in advance. 

(https://lh3.googleusercontent.com/-5O8qD0VNX-U/Voz-Nhp2_rI/AAAAAAAAQE4/IWP2LAXL81A/s512-Ic42/Screen%252520Shot%2525202016-01-06%252520at%2525206.41.15%252520AM.png)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on January 06, 2016, 08:20:12 AM
You have to two choices: one that will definitely work, and one that just might!

The choice that will definitely work:
Go into the Sources folder and edit the Subs.php file.  Look for this:
// Embed Instagram URLs in the instagram bbcode tags:
BBCode_Instagram_Embed($message, $smileys, $cache_id, $parse_tags);

and just remove it.  That should solve your issue, so that you can install 1.17....

Understand that manually removing a mod like this will leave bits (in this case, language modifications) in place.  This may not be a problem, but manual uninstallation is NOT recommended, nor is manual installation!

The choice that just may work:
Okay, you've restored your database from an old copy.  I'm going to assume that that database backup was made during a period of time when you had the "Embed Instagram BBCode" mod installed.  If this is correct, unzip the mod package, and upload the Subs-BBCode-Instagram.php file to your Sources folder.  If the hook exists in the database, your forum should just start working.  If not, upload the add_remove_hooks.php file to your forum root, then execute it.  What I mean by this is if your forum is at http://blegh.com, you would browse to http://belgh.com/add_remove_hooks.php.
Title: Re: Embed Instagram BBCode
Post by: south_paw on January 06, 2016, 06:58:00 PM
Ok thank you for the help guys.

Doug, choice one worked. I haven't tried uploading the mod yet. Gun shy I guess. Any idea what caused the fatal error? What did I do wrong?

Thanks. Learning as I go.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on January 06, 2016, 07:05:17 PM
Quote from: south_paw on January 06, 2016, 06:58:00 PM
Doug, choice one worked. I haven't tried uploading the mod yet. Gun shy I guess. Any idea what caused the fatal error? What did I do wrong?
Without knowing what you did, it would be impossible for me to know what you did wrong....  :P
Title: Re: Embed Instagram BBCode
Post by: south_paw on January 06, 2016, 07:26:08 PM
lol.
I was using the smf package manager and went to install the 1.17 mod update. The 1.16 was already installed. When i downloaded the 1.17, I was warned that this package was already installed and to continue I must delete the existing mod. I thought that was odd because the 1.17 was not installed, only the 1.16 was. So i double checked the file numbers and they were correct. At this point I went and deleted the 1.16 mod as instructed and that is when it went to the fatal error. All of this was done through the SMF software. 
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on January 07, 2016, 01:55:09 AM
There is a BIG difference between "Delete" and "Uninstall"... Big enough to crash your forum if you don't know what you are doing.
Title: Re: Embed Instagram BBCode
Post by: THE BRA1N on January 25, 2016, 12:53:50 AM
How do I change the default size so that the images don't take up the entire screen?
Title: Re: Embed Instagram BBCode
Post by: lagaiphone on January 25, 2016, 10:42:52 AM
If a SMF update doesn't update a particular file, then the version number won't change.   I'm at work right now and can't verify that files version number.
Title: Re: Embed Instagram BBCode
Post by: Ninja ZX-10RR on January 25, 2016, 03:00:43 PM
Quote from: lagaiphone on January 25, 2016, 10:42:52 AM
If a SMF update doesn't update a particular file, then the version number won't change.   I'm at work right now and can't verify that files version number.

Wrong topic?

Quote from: THE BRA1N on January 25, 2016, 12:53:50 AM
How do I change the default size so that the images don't take up the entire screen?
URL?
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on January 25, 2016, 04:18:34 PM
Quote from: THE BRA1N on January 25, 2016, 12:53:50 AM
How do I change the default size so that the images don't take up the entire screen?
Go to Admin -> Configuration -> Modification Settings.  You'll see 2 settings:
o Default width used for Instagram bbcode when not specified
o Default height used for Instagram bbcode when not specified

Quote from: Ninja ZX-10RR on January 25, 2016, 03:00:43 PM
Quote from: lagaiphone on January 25, 2016, 10:42:52 AM
If a SMF update doesn't update a particular file, then the version number won't change.   I'm at work right now and can't verify that files version number.
Wrong topic?
That looked like a quote I had said, so I did a search and BAM!  Word-for-word quote of something I said here (http://www.simplemachines.org/community/index.php?topic=537616.msg3840229;topicseen#msg3840229)....  WTF?!  Is that supposed to be a quote, but the question was forgotten?!
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on March 05, 2016, 08:08:24 AM
Dougie-Dougie-Dougie-Dougieeeee!  O:)

I hope you're well and hope that knee is on the mend!  ;)

I'm wondering if you can help with a little bug I've just realised happening..

I have a member who has their social media links displayed in the signature..
trouble is: their insta' url is being parsed, causing a big weird empty part in the signature..

You can see an example here:
http://www.420connect.co.uk/forum/index.php?topic=2185
(Topic Author's Signature)

could you help stop them being parsed in the sig?  :-\

(I'd do the cheat of breaking the url with bbc, but would prefer to fix it for future cases in advance!  O:))



Many thanks as always!


;)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 05, 2016, 09:08:30 AM
Wow, never thought about that situation!  I found the code in Load.php that parses members' signatures and can remove the URL there before it gets parsed.  There is really no other way that I can think to do it....
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on March 05, 2016, 09:17:33 AM
Quote from: dougiefresh on March 05, 2016, 09:08:30 AM
Wow, never thought about that situation!  I found the code in Load.php that parses members' signatures and can remove the URL there before it gets parsed.  There is really no other way that I can think to do it....

::) Why's it always me that finds weird bugs!
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 05, 2016, 09:28:26 AM
Well, I personally think that some users deliberately go out of their way to see if they can break something....  It's probably wrong, though  :P  It's always amusing (and sometimes frustrating) to see what they find to break, though.....

Anyways, this is a bug I probably should fix in all my video mods, though....
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 07, 2016, 01:58:52 PM
Uploaded v1.18 - March 7th, 2016
o Modified auto-embed code so that Instagram URLs in signature are embedded as [url]{link}[/url].




@420Connect.co.uk: This update should fix this weird bug you found...  :P ::)
Title: Re: Embed Instagram BBCode
Post by: 420Connect.co.uk on March 08, 2016, 12:49:02 PM
Strange..

I swear I had replied to your previous post (although I have been getting a lot of SMF white screen errors recently, so maybe it never posted or something?)

Anyway - I've just got round to testing it out and whatever you've done seems to have done the trick! :)

Nice one Doug, many thanks as always!


Title: Re: Embed Instagram BBCode
Post by: RX on May 12, 2016, 04:56:32 AM
This is a fantastic mod, can't use it now because if users post an Instagram user account instead of a specific post, it will show as content unavailable in the forum. Is there any workarounds for this?

Also, am wondering if there would be any plans to include captions.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on May 13, 2016, 08:53:08 AM
Quote from: pehxinyi on May 12, 2016, 04:56:32 AM
This is a fantastic mod, can't use it now because if users post an Instagram user account instead of a specific post, it will show as content unavailable in the forum. Is there any workarounds for this?
The embed API is per-post, not per-user.  At this point, I really don't know what to recommend.....  Can you give me a link to work with, please?

Quote from: pehxinyi on May 12, 2016, 04:56:32 AM
Also, am wondering if there would be any plans to include captions.
I've modified this mod to include captions automatically for all Instagram tags.  It will be available in the next version.
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 20, 2016, 04:27:16 PM
Uploaded v1.19 -September 20th, 2016
o Added captions to the displayed embedded Instagram post.
o Reverted CSS file "padding-bottom" property from 112% to 100%.
Title: Re: Embed Instagram BBCode
Post by: Paracelsus on September 20, 2016, 04:54:32 PM
Quote from: dougiefresh on September 20, 2016, 04:27:16 PM
Uploaded v1.19 -September 20th, 2016
o Added captions to the displayed embedded Instagram post.
o Reverted CSS file "padding-bottom" property from 112% to 100%.


Hi dougiefresh, how to install updated version, uninstall the old one first?
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on September 20, 2016, 04:59:23 PM
Quote from: Paracelsus on September 20, 2016, 04:54:32 PM
Hi dougiefresh, how to install updated version, uninstall the old one first?
Yes, you should uninstall the old version first, then install the new version.
Title: Re: Embed Instagram BBCode
Post by: Xpresskonami on October 03, 2016, 09:20:18 AM
This mod is having problem with signature in the site. I install the Instagram mod but I discover that my post content is not showing just because I fill some text in my signature through profile. how can I fix this? 
Title: Re: Embed Instagram BBCode
Post by: villasg on October 03, 2016, 10:51:34 AM
i have the same issue .
Check your error log for details .
Finaly i remove the mod
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on October 03, 2016, 11:33:04 AM
Quote from: Xpresskonami on October 03, 2016, 09:20:18 AM
This mod is having problem with signature in the site. I install the Instagram mod but I discover that my post content is not showing just because I fill some text in my signature through profile. how can I fix this? 
What are you putting in the signature area?  I need to know so that I can figure out how to fix the mod.....
:o ::) Nevermind, I left some debugging code in there.....  Let me remove it and publish a new version....
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on October 03, 2016, 11:57:47 AM
Uploaded v1.20 - October 3rd, 2016
o Removed some leftover debugging code for signatures.




@villasg and @Xpresskonami:  Thank you for the bug reports.  This issue has (hopefully) been fixed.....
Title: Re: Embed Instagram BBCode
Post by: Xpresskonami on October 03, 2016, 01:34:16 PM
Quote from: dougiefresh on October 03, 2016, 11:57:47 AM
Uploaded v1.20 - October 3rd, 2016
o Removed some leftover debugging code for signatures.




@villasg and @Xpresskonami:  Thank you for the bug reports.  This issue has (hopefully) been fixed.....

OK thanks. will re- download now.
Title: Re: Embed Instagram BBCode
Post by: Xpresskonami on October 20, 2016, 08:22:52 PM
This mode is not working for me. it show blank page whenever i include the instgram id, any solution to this, and it cause my twitter embeed to stop working too
see here

http://spyloadedtv.com/entertainments-board/i-want-twenty-kids-i-have-just-four-now-i-have-sixteen-to-go-9ice/ (http://spyloadedtv.com/entertainments-board/i-want-twenty-kids-i-have-just-four-now-i-have-sixteen-to-go-9ice/)
Title: Re: Embed Instagram BBCode
Post by: northearth on December 21, 2016, 10:57:58 AM
Good day, dougiefresh. Sorry for my Eng (googl trnslt)

SMF 2.0.12,

Really need this mod. Established (yet locally), setting no errors:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpiclink.xyz%2Fimage.php%3Fdi%3D1WY0&hash=0d2897874b175f153726ebeefc0008374e2ed6d5)

Mod inside:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpiclink.xyz%2Fimage.php%3Fdi%3DNN9U&hash=b6ae374a73c04e3ba22aeccb61b13b332a9fd338)

Configured:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpiclink.xyz%2Fimage.php%3Fdi%3DUDJN&hash=c0671939a3acbe9f1eb7029c63ecca64fef230f6)

Reference is made in different versions:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpiclink.xyz%2Fimage.php%3Fdi%3DE2ZG&hash=7cd77e2ea14673ed9bed5d644f0964c8b8623cfe)

And finally:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpiclink.xyz%2Fimage.php%3Fdi%3DW8Q5&hash=77e37ef2e552a60f6d034333c6a72605a87b41b6)

Link is work, white void is not work. The logs are no errors. Any thoughts? How to fix it?
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on December 25, 2016, 09:29:05 AM
Quote from: northearth on December 21, 2016, 10:57:58 AM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fpiclink.xyz%2Fimage.php%3Fdi%3DE2ZG&hash=7cd77e2ea14673ed9bed5d644f0964c8b8623cfe)
Can you quote the text you are trying to use?  Personally, I find trying to type out the contents of a picture quite irritating....

I used a different Instagram post and got the white box thing you described.  Instagram may have changed their embed stuff....

Title: Re: Embed Instagram BBCode
Post by: dougiefresh on December 25, 2016, 05:35:53 PM
Uploaded v1.21 - December 25th, 2016
o Fixed the embed code so that the Instagram post shows up in forum posts again.
Title: Re: Embed Instagram BBCode
Post by: Rob Lightbody on December 27, 2016, 08:22:46 AM
Thanks for this Mod.

Worked perfectly for me, first time.
Title: Re: Embed Instagram BBCode
Post by: northearth on December 28, 2016, 06:40:33 PM
Yeah! Everything worked! Thank you for your work. Also thank you for the other modes. They are beautiful! Do you still have time to do? ))

Also, I apologize for the particular presentation in my previous message. In our area it is a good practice. The explanation is simple - I'm spending too much time to put words in the drawing. If I spend time for the sake of the reader, so I respect him. Redneck, one word))

(If, suddenly, something breaks, I will write)
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on December 29, 2016, 09:49:28 AM
Quote from: northearth on December 28, 2016, 06:40:33 PM
Yeah! Everything worked! Thank you for your work. Also thank you for the other modes. They are beautiful! Do you still have time to do? ))
Thank you!  I still try to do mods....  I've got 7 in the approval queue right now :p

Quote from: northearth on December 28, 2016, 06:40:33 PM
Also, I apologize for the particular presentation in my previous message. In our area it is a good practice. The explanation is simple - I'm spending too much time to put words in the drawing. If I spend time for the sake of the reader, so I respect him. Redneck, one word))
No worries on that point.  I don't mind screenshots, except when the screenshot contains the parts of a post (or entire post) that I need to test against (aka: bbcode material).....
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on December 08, 2017, 09:33:19 PM
Uploaded v1.22 - December 8th, 2017
o Added URL embedding support for Tapatalk mod.
Title: Re: Embed Instagram BBCode
Post by: villasg on December 09, 2017, 02:43:00 AM
Work the way with  replace "Subs-Instagram.php" in "./Sources" or need uninstall and install the new ?
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on December 09, 2017, 09:55:55 AM
Quote from: villasg on December 09, 2017, 02:43:00 AM
Work the way with  replace "Subs-Instagram.php" in "./Sources" or need uninstall and install the new ?
Sadly, no.  For Tapatalk support, you need to uninstall the current version, then install the new version...  If you don't need Tapatalk support, then you don't need this update, cause nothing else changed.  This change happened in all of my video mods.....
Title: Re: Embed Instagram BBCode
Post by: Xpresskonami on December 10, 2017, 07:29:16 AM
the mod is not working for my forum so I make use of Html to Embeed see it here http://spyloadedng.com/?topic=10830.0
Title: Re: Embed Instagram BBCode
Post by: -Rock Lee- on December 11, 2017, 08:06:30 AM
Here is the .xml of the Spanish Latin translation 8)


Regards!
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on December 15, 2017, 08:28:42 PM
Uploaded v1.23 - December 15th, 2017
o Added Spanish Latin translation, courtsey of Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597)!




@Rock Lee:  Thanks for the translation!  It's been included in this version!
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 04, 2018, 09:56:09 PM
Uploaded v1.4 - March 4th, 2018
o Fixed an issue that prevents BBC manager from showing bbcodes.
Title: Re: Embed Instagram BBCode
Post by: Dwev on March 14, 2018, 12:49:38 PM
I've added this Mod, but don't want the button to show up on the Reply-form.

Normally that means I edit the Subs-Editor.php file, but I can't find an array for this button there after installing it.

Maybe someone here can help me with this conundrum?
(always liked that word...  ;)).
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 14, 2018, 10:14:04 PM
Hint:. It's in the subs file from the mod.  I'm at work and can't remember what I named the file, but if you open the mod, the filename is listed as something like Subs-Instagram.php.....
Title: Re: Embed Instagram BBCode
Post by: Dwev on March 15, 2018, 04:26:15 AM
@ dougiefresh: thanks, your hint gave me exactly what I was looking for.

I had looked at the parsed actions of the Mod, but missed the Move the included file "Subs-Instagram.php" to "./Sources" at the bottom.

In there I added double slashes before the following code:

$buttons[count($buttons) - 1][] = array(
'image' => 'instagram',
'code' => 'instagram',
'description' => 'Instagram',
'before' => '[instagram]',
'after' => '[/instagram]',
);


So it became this:

//$buttons[count($buttons) - 1][] = array(
// 'image' => 'instagram',
// 'code' => 'instagram',
// 'description' => 'Instagram',
// 'before' => '[instagram]',
// 'after' => '[/instagram]',
//);


And the button is gone.   :D

Different question: now that I'm using the mod I see that it cuts off quite a lot of the Instagram post.

The original post can be seen here: https://www.instagram.com/p/BgRHlLPDWqm/

The result in the attached screenshot.
Title: Re: Embed Instagram BBCode
Post by: Dwev on March 15, 2018, 11:38:10 AM
Just uninstalled this Mod, because it was impossible to vote in a new Poll, generating the following error:

7
Warning: Cannot modify header information - headers already sent by (output started at /home/cmsedit7/public_html/xxx-xxxx.xx/smf/Sources/Subs-Instagram.php:1) in /home/cmsedit7/public_html/xxx-xxxx.xx/smf/Sources/Subs.php on line 2950
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 15, 2018, 12:04:19 PM
Quote from: Dwev on March 15, 2018, 04:26:15 AM
@ dougiefresh: thanks, your hint gave me exactly what I was looking for.

I had looked at the parsed actions of the Mod, but missed the Move the included file "Subs-Instagram.php" to "./Sources" at the bottom.

In there I added double slashes before the following code:

$buttons[count($buttons) - 1][] = array(
'image' => 'instagram',
'code' => 'instagram',
'description' => 'Instagram',
'before' => '[instagram]',
'after' => '[/instagram]',
);


So it became this:

//$buttons[count($buttons) - 1][] = array(
// 'image' => 'instagram',
// 'code' => 'instagram',
// 'description' => 'Instagram',
// 'before' => '[instagram]',
// 'after' => '[/instagram]',
//);


And the button is gone.   :D
Or you could just add a return; before the $buttons[count($buttons) - 1][] statement and it would do the same thing....

Quote from: Dwev on March 15, 2018, 04:26:15 AM
Different question: now that I'm using the mod I see that it cuts off quite a lot of the Instagram post.

The original post can be seen here: https://www.instagram.com/p/BgRHlLPDWqm/

The result in the attached screenshot.
Have you tried using a height parameter in the instagram tag?  For example:

[instagram height=200]{some link here}[/instagram]


Quote from: Dwev on March 15, 2018, 11:38:10 AM
Just uninstalled this Mod, because it was impossible to vote in a new Poll, generating the following error:

7
Warning: Cannot modify header information - headers already sent by (output started at /home/cmsedit7/public_html/xxx-xxxx.xx/smf/Sources/Subs-Instagram.php:1) in /home/cmsedit7/public_html/xxx-xxxx.xx/smf/Sources/Subs.php on line 2950

There is a 7 at the very beginning of the Subs-Instagram.php.  Remove it and everything should work correctly again.  A new update will include this correction....
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 15, 2018, 04:46:42 PM
UPDATE:  The height and width parameters do not support percentages properly.  The next version will resolve this issue....
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on March 15, 2018, 05:26:38 PM
Uploaded v2.0 - March 15th, 2018
o Added height and captioned to bbcode without requiring width.
o Added ability to use percentages in width and height.
o Adjusted HTML building code to add appropriate CSS width and height styling.
o Added option to include Instagram link below embedded Instagram post.




@Dwev:  Hopefully, this update solves the bugs that you reported.  Please let me know if there are still issues....  Thanks!
Title: Re: Embed Instagram BBCode
Post by: dougiefresh on October 15, 2018, 11:41:44 AM
Uploaded v2.1 - October 15th, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: Embed Instagram BBCode
Post by: chinaren on April 27, 2020, 08:39:34 AM
Hello DF.  I tried uploading/installing this to my SMF2.1 RC2 forum, but it says it's not compatible with this version of SMF.


Will you be updating this mod at all?


Thank you!
Title: Re: Embed Instagram BBCode
Post by: Sir Osis of Liver on February 16, 2021, 04:51:42 PM
Anyone supporting this mod? 
Title: Re: Embed Instagram BBCode
Post by: sheryltoo on March 13, 2021, 02:17:15 PM
I just upgraded my forum to 2.0.18 and I see a tab for Instagram. Was this mod incorporated into a newer version? I never installed the mod or knew there was a mod for this. I wouldn't mind having it on my forum but It doesn't look like it does anything. Does the app not link to Instagram? Do you have to find your Instagram picture first before using the BB code?
Title: Re: Embed Instagram BBCode
Post by: Rob Lightbody on November 14, 2023, 01:48:16 PM
Sadly this seems to have stopped working.

Is there any alternative on SMF 2.0.19 to embed Instagram posts on the forum?
Title: Re: Embed Instagram BBCode
Post by: GL700Wing on November 14, 2023, 05:57:38 PM
Quote from: Rob Lightbody on November 14, 2023, 01:48:16 PMSadly this seems to have stopped working.

Is there any alternative on SMF 2.0.19 to embed Instagram posts on the forum?
Working fine for me on SMF 2.0.19 - can you post a screen capture of what is displayed when you use this BBCode?