Advertisement:

Author Topic: Embed Facebook BBCode  (Read 45993 times)

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #20 on: August 16, 2015, 03:28:04 AM »
Today  i try many links from facebook and do not work ........
Can not make it to work .
What is my fault ?

links like
Code: [Select]
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]

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #21 on: August 16, 2015, 07:31:13 PM »
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....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #22 on: August 17, 2015, 05:03:09 PM »
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....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #23 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!

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #24 on: August 18, 2015, 08:35:46 AM »
@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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #25 on: August 18, 2015, 05:17:31 PM »
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:
Quote
https://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:
Quote
https://www.facebook.com/video.php?v=536857533086933
I hope this helps those who need this functionality!

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #26 on: August 19, 2015, 01:57:47 AM »
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>"

Code: [Select]
<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

Code: [Select]
<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
« Last Edit: August 19, 2015, 02:14:56 AM by villasg »

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #27 on: August 19, 2015, 07:42:03 PM »
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....

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #28 on: August 20, 2015, 02:42:11 AM »
Understand but my lines with <img> are this :
Code: [Select]

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 ?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #29 on: August 20, 2015, 03:55:43 AM »
@villasg: Modifying the lines like this should work to correctly uninstall the mod:
Code: [Select]
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>')) === '')

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #30 on: August 20, 2015, 04:36:10 AM »
Ty

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #31 on: August 21, 2015, 07:36:22 AM »
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 :
Code: [Select]
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
Code: [Select]
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
Code: [Select]
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
Code: [Select]
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 .

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #32 on: August 23, 2015, 08:47:17 AM »
Any idea for this errors ?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #33 on: August 23, 2015, 12:02:20 PM »
Damn!  I missed this last message.  I'll look into it when I get home today....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #34 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....



@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.....

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #35 on: August 24, 2015, 02:45:26 AM »
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 :


Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #36 on: August 24, 2015, 06:06:14 PM »
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....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #37 on: August 25, 2015, 06:46:56 PM »
Uploaded v2.4 - August 25th, 2015
o Added ability to auto-embed Facebook URLs to the mod.

Offline villasg

  • Full Member
  • ***
  • Posts: 484
Re: Embed Facebook BBCode
« Reply #38 on: August 26, 2015, 04:05:39 PM »
Tested all OK now thanks

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,756
  • Mod King
    • XPtsp.com Community
Re: Embed Facebook BBCode
« Reply #39 on: August 26, 2015, 04:43:28 PM »
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:
Code: [Select]
[facebook]{facebook URL}[/facebook]resulted in this:
Code: [Select]
[facebook][facebook]{facebook URL}[/facebook][/facebook]