News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Embed Facebook BBCode

Started by dougiefresh, July 11, 2015, 02:33:41 PM

Previous topic - Next topic

villasg

Today  i try many links from facebook and do not work ........
Can not make it to work .
What is my fault ?

links like

https://www.facebook.com/garlic.salon/videos/536857533086933
https://www.facebook.com/495741830461710/videos/874658245903398
https://www.facebook.com/marcia.lopes.9026040/videos/1103271836367499
https://www.facebook.com/OlympiakosEidisis.GR/videos/1673849002834862
https://www.facebook.com/DailyMail/videos/1020218588037889

syntax are : [facebook]https://www.facebook.com/DailyMail/videos/1020218588037889[/facebook]

dougiefresh

At this time, this mod doesn't support displaying Facebook videos, only posts....  I'll see what I can do about implementing support for Facebook videos....

dougiefresh

I've got support for Facebook videos implemented, however I've still got to add another option to control the default width for videos and posts....  Thought I'd let you know....

dougiefresh

@villasg: I've got two more strings for you to translate in order to properly support the new default width options..  Please translate the English lines, then send it back to me please.  Thank you!

villasg

Quote from: dougiefresh on August 17, 2015, 07:56:38 PM
@villasg: I've got two more strings for you to translate in order to properly support the new default width options..  Please translate the English lines, then send it back to me please.  Thank you!

done

dougiefresh

Uploaded v2.1 - August 18th, 2015
o Added support for responsive Facebook videos to the mod.
o Added option to control the default width of the post when it is not specified.
o Added option to control the default width of the video when it is not specified.
o Updated Greek UTF8 language modifications, due to several new strings to support new options.
o Moved text for mod options from "index" to "ManageSettings" language file.




@villasg:  Thank you for the translation!  It's been included in this version!

@Everybody: Facebook videos are now supported by this mod.  They typically take the form:
Quotehttps://www.facebook.com/garlic.salon/videos/536857533086933
where the first text in bold is the user name and the number in bold is the video ID number.   It may also take the form:
Quotehttps://www.facebook.com/video.php?v=536857533086933
I hope this helps those who need this functionality!

villasg

#26
Be careful .
If you have install EMBED INSTAGRAM BBCODE v1.7 after this mod , receive errors in unistall in post.php .
need to edit the install20x.xlm from   Embed Facebook BBCode V 2.0 package .
Need make this edits : replace "<img>" with "<img><iframe>"

<file name="$sourcedir/Post.php">
<operation>
<search position="replace"><![CDATA['<img>]]></search>
<add><![CDATA['<img><div>]]></add>
</operation>
<operation>
<search position="replace"><![CDATA['<img>]]></search>
<add><![CDATA['<img><div>]]></add>
</operation>
</file>


with

<file name="$sourcedir/Post.php">
<operation>
<search position="replace"><![CDATA['<img><iframe>]]></search>
<add><![CDATA['<img><iframe><div>]]></add>
</operation>
<operation>
<search position="replace"><![CDATA['<img><iframe>]]></search>
<add><![CDATA['<img><iframe><div>]]></add>
</operation>
</file>


@dougiefresh please check it if its corret and safe

dougiefresh

In this particular case, it seems easier to make the alteration to Sources/Post.php and change the order to match what is expected.  Just search for "<img>" and make it conform to what is expected.  For example, change <img><iframe><div> to <img><div><iframe>....  The order for those two operations doesn't really matter, as the function that uses them omits all HTML tags except for what is shown.

Is it safe to modify the mod?  Well.... I guess....  But I wouldn't advise it.  You risk breaking stuff when you install the next version, especially if you write stuff that my mod never had...  :P   I wrote my assorted video mods to be able to install all of them together.  And YES, I have installed all of them together on a test forum.  They all work.

Furthermore, I really wouldn't advise modifying the mod package without good reason.....  One good reason might be compatibility with another mod.  However, such concerns should be shared with the mod author....

I hope this helps....

villasg

Understand but my lines with <img> are this :


1534 if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><iframe><iframe><div><div><iframe><div><iframe><div><object><embed><div><iframe>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false))

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



How can modify this lines ?

dougiefresh

@villasg: Modifying the lines like this should work to correctly uninstall the mod:
Quote from: villasg on August 20, 2015, 02:42:11 AM

1534 if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><div><iframe><iframe><div><iframe><div><iframe><div><object><embed><div><iframe>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false))

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


villasg


villasg

Today i see  errors in my forum .
I have this error when i or any member visit the   [ Profile ]  my forum »Profile of *****» Account Settings every visiting i receive error in error log

Look :
http://www.*****/***/forum/index.php?action=profile;area=account
8: Undefined index: facebook_lang
File: /home/thai/public_html/forum/Sources/Subs-BBCode-Facebook.php
Line: 162


If visiting   forum» Profile of ****»Forum Profile
http://www.thai.gr/forum/index.php?action=profile;area=forumprofile;u=11
8: Undefined index: facebook_lang
File: /home/thai/public_html/forum/Sources/Subs-BBCode-Facebook.php
Line: 162


If visiting   forum» Profile of ****»Look and Layout
http://www.thai.gr/forum/index.php?action=profile;area=theme;u=11
8: Undefined index: facebook_lang
File: /home/thai/public_html/forum/Sources/Subs-BBCode-Facebook.php
Line: 162


If visiting   forum» Profile of ****»Personal Messaging
http://www.thai.gr/forum/index.php?action=profile;area=pmprefs;u=11
8: Undefined index: facebook_lang
File: /home/thai/public_html/forum/Sources/Subs-BBCode-Facebook.php
Line: 162



And in my forum »Profile of *****» Account Settings i do not see any Facebook field .

villasg


dougiefresh

Damn!  I missed this last message.  I'll look into it when I get home today....

dougiefresh

Uploaded v2.2 - August 23rd, 2015
o Correction of which language file to insert new strings into....




@villasg:  I'm sorry about the lateness of this update.  I had changed which language file got the new strings inserted into, but it was the wrong file....  I've changed the language file back to the proper one, which it was in v2.0.....

villasg

Quote from: dougiefresh on August 23, 2015, 04:57:45 PM
Uploaded v2.2 - August 23rd, 2015
o Correction of which language file to insert new strings into....

.................

Sorry but have the exact same issue with v2.2 :


dougiefresh

Uploaded v2.3 - August 24th, 2015
o Fixed stupid language bug that I completely missed in the last 2 versions.... (Sigh)




@villasg:  Whoops!  I should have better tested the mod package before releasing it into the wild....

dougiefresh

Uploaded v2.4 - August 25th, 2015
o Added ability to auto-embed Facebook URLs to the mod.

villasg


dougiefresh

Uploaded v2.5 - August 26th, 2015
o Fixed issue with auto-embedding code that created double bbcode tags around Facebook URLs.




@Everybody: This update fixes an auto-embedding issue in v2.4 where using the following:
[facebook]{facebook URL}[/facebook]
resulted in this:
[facebook][facebook]{facebook URL}[/facebook][/facebook]

Advertisement: