View Full Version : Mini Mods - Facebook Videos updated BBCODE
naveeid
05-29-2015, 09:00 PM
https://vborg.vbsupport.ru/external/2015/05/2.jpg
This mod will update the old cold of vbulletin mod to the latest code released until 1st june 2015 by facebook administration.
This mod will perform 2 major operations
1) update the old video codes posted through video button on vbulleten4 WYSWYG editor
2) we will create a new bbcode for facebook videos. e.g. Video id
1) First of all make it sure that your facebook Platform is enabled for your forum.
Admin CP -> Settings -> Options -> Facebook options -> enable facebook platform
you need to create an application for your website on facebook , and configure all the settings. its easy , just search how to do it.
2) Go to style manager , edit templates -> BBCODE layout templates -> bbcode_video
Select FROM THIS LINE
<vb:elseif condition="$provider == 'facebook'" />
UNTIL THIS LINE
</vb:if>
and replace these lines with this code
<div class="fb-video" data-href="https://www.facebook.com/video.php?v={vb:raw code}"
data-width="500" data-allowfullscreen="true"></div>
<br><br><br><br>
<div class="fb-like" data-href="https://www.facebook.com/nidokidos1" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div>
Now untill here we have updated the code of all the existing facebook videos on the forun
and now we will make a new BBCode for facebook videos
3) Go to admincp -> Custom BB code -> add a new BBCODE
Title :- Facebook videos
BB Code Tag Name :- fb
replacement :-
<div class="fb-video" data-href="https://www.facebook.com/video.php?v={param}"
data-width="500" data-allowfullscreen="true"></div>
<br><br><br><br>
<div class="fb-like" data-href="https://www.facebook.com/nidokidos1" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div>
Example :- 1411628811495
description :- give video id between [fb] tags
Use option :- NO
Disable BB Code Within This BB Code :- Yes
Disable Smilies Within This BB Code :- Yes
Disable Word Wrapping Within This BB Code :- Yes
Disable Automatic Link Parsing Within This BB Code :- NO
Now save that BB code
and you have done it.
Note:- Please replace https://www.facebook.com/nidokidos1 with your website official page on facebook if you have any.
Thanks.
Demo Page
http://www.nidokidos.org/threads/232632
screen shots are attached
thenicehorizon
05-30-2015, 10:23 AM
great job
thank you very much
naveeid
05-30-2015, 10:31 AM
welcome sir
djbaxter
05-30-2015, 02:20 PM
Suggestion: Duplicate this to fix You-Tube BB code so it recognizes https://
naveeid
05-31-2015, 11:29 PM
ok sir i will try but right now youtube is not working in my country.
sticky
06-09-2015, 06:42 AM
Get this error:
The following BB Code replacement may not be properly formed. All HTML attributes should be enclosed within double quotes.
<div class="fb-video" data-href="https://www.facebook.com/video.php?v={param}" data-width="500" data-allowfullscreen="true"></div> <br><br><br><br> <div class="fb-like" data-href="https://www.facebook.com/nidokidos1" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div>
concepts
06-09-2015, 01:43 PM
Ignore it.... I did, code still works perfectly. Just choose continue
edgeless
07-01-2015, 05:46 PM
Yes, ignore the warning and click 'continue'. The code works beautifully! Thank you kindly, naveeid :)
akz645
08-04-2015, 06:06 PM
It worked :)
Here are some 'improvements'/ 'further help' for those who need it:
The bbcode_video template is located here:
Admin CP -> Styles & Templates -> Style Manger -> Edit templates (http://i.imgur.com/IG1FZzj.png) -> BB Code Layout Templates (double click) -> bbcode_video (edit)
1) you need to create an application for your website on facebook , and configure all the settings. its easy , just search how to do it.
Link: https://www.vbulletin.com/docs/html/facebook_enable
Note: Skip the 'quick settings' once you select that you're using for a website (the WWW. circle)
Then you'll see:
https://vborg.vbsupport.ru/external/2015/08/46.png
Select FROM THIS LINE
<vb:elseif condition="$provider == 'facebook'" />
UNTIL THIS LINE
</vb:if> You get an error if you remove the first and last line. Hence I didn't remove them.
In other words, I replaced this:
<vb:elseif condition="$provider == 'facebook'" />
<object class="restrain" type="application/x-shockwave-flash" width="576" height="432" data="//www.facebook.com/v/{vb:raw code}">
<param name="movie" value="//www.facebook.com/v/{vb:raw code}" />
<param name="wmode" value="{vb:raw wmode}" />
<!--[if IE 6]>
<embed width="576" height="432" type="application/x-shockwave-flash" src="//www.facebook.com/v/{vb:raw code}" />
<![endif]--></object>
</vb:if>
With:
<vb:elseif condition="$provider == 'facebook'" />
<div class="fb-video" data-href="https://www.facebook.com/video.php?v={vb:raw code}"
data-width="500" data-allowfullscreen="true"></div>
<br><br><br><br>
<div class="fb-like" data-href="https://www.facebook.com/nidokidos1" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div></vb:if>
Oh & I didn't like the whole 'like' button below the facebook video + it was much lower down than the video.
Hence I removed things from the replacement code (when adding a new BB code):
<div class="fb-video" data-href="https://www.facebook.com/video.php?v={param}" data-width="500" data-allowfullscreen="true"></div>
Finally, I'd recommend switching your bbcode_video template (except for the FB edit you did above) to this:
https://vborg.vbsupport.ru/showthread.php?t=283594
ximcix
08-24-2015, 05:09 AM
Hello guys.
I have a problem here. I tried the above mod and it did not work for me.
Facebook now shows video url with the person's (or page's) vanity url in the string:
https://www.facebook.com/JustForFunTvVideos/videos/883585621689227
I tried embedding the URL above as
https://www.facebook.com/JustForFunTvVideos/videos/883585621689227
and it just displayed the URL as a link.
Then I tried an excerpt from you code and used https://www.facebook.com/video.php?v=883585621689227
same result. But if I click the link, the video plays on facebook
after taking a break for a couple hours, I remembered that the old Facebook video URL format was actually https://www.facebook.com/video/video.php?v=
so I tried https://www.facebook.com/video/video.php?v=883585621689227 and it worked.
Now my issue is, if the average user wants to share a video on my forum, copies a url such as: https://www.facebook.com/JustForFunTvVideos/videos/883585621689227
they will just see the URL as a link on the page.
SUMMARY
All of the following links point to the same video and they all load on facebook.com, but only the one with "/video/video.php?v=" worked for me using the mod above:
https://www.facebook.com/JustForFunTvVideos/videos/883585621689227
https://www.facebook.com/video.php?v=883585621689227
https://www.facebook.com/video/video.php?v=883585621689227
akz645
08-24-2015, 09:05 PM
Hello guys.
I have a problem here. I tried the above mod and it did not work for me.
You're doing it incorrectly. Please follow all the steps. This allows facebook to work in a BB code, it does not fix vbulletins built in video BB code for facebook.
If you're unsure about the original post, please look at my post here for further clarification -> Click this (https://vborg.vbsupport.ru/showpost.php?p=2552091&postcount=9).
On the BB code, you only need to insert the ID, you do not insert anything else.
For example:
http://i.imgur.com/2j9USMi.png -> http://i.imgur.com/ud8gggN.png
883585621689227
The full video link is:
https://www.facebook.com/JustForFunTvVideos/videos/883585621689227
mapleleaffans
08-31-2015, 04:38 PM
Just installed this and it works fantastic. Thank you naveeid for sharing this mod with us! :)
Keyser Soze
09-09-2015, 10:49 AM
Hello guys.
I have a problem here. I tried the above mod and it did not work for me.
Facebook now shows video url with the person's (or page's) vanity url in the string:
https://www.facebook.com/JustForFunTvVideos/videos/883585621689227I'm also interested in how vbulletin's internal video parser can be fixed so it will detect Facebook's new video-url-structure. If anyone could tell me where in the code for this is located in the vbulletin software, I can try to fix it. But I don't know where it is located.
akz645
09-09-2015, 05:13 PM
I'm also interested in how vbulletin's internal video parser can be fixed so it will detect Facebook's new video-url-structure. If anyone could tell me where in the code for this is located in the vbulletin software, I can try to fix it. But I don't know where it is located.
https://vborg.vbsupport.ru/showthread.php?t=283594&page=3
That's where I discuss it with BOP5 (moderator on this website).
It is located here:
AdminCP -> Styles & Templates -> Search in Template: bbcode_video (http://i.imgur.com/tAnVoJd.png) -> bbcode_video (edit) (http://i.imgur.com/jbD2OU9.png)
The bottom vb if condition is for facebook.
You can also edit a file from your FTP.
/includes/xml/bbcode_video_vbulletin.xml file
-> http://tracker.vbulletin.com/browse/VBIV-15670
However the fix BOP5 provided no longer works.
Good luck :up:
Keyser Soze
09-10-2015, 08:16 AM
Thanks, I was able to fix it by extending the regular expression in the file bbcode_video_vbulletin.xml with
https?:\/\/www\.facebook\.com\/(?:[0-9a-z\.\-_]+)\/videos\/([0-9]+)\/
After doing that, you will have to set your admincp to debug mode an click on "Rebuild -> Rebuild Video BB Codes" to import the changes from the xml file.
akz645
09-10-2015, 07:10 PM
Thanks, I was able to fix it by extending the regular expression in the file bbcode_video_vbulletin.xml with
https?:\/\/www\.facebook\.com\/(?:[0-9a-z\.\-_]+)\/videos\/([0-9]+)\/
Could you be a little more specific please?
I changed this:
https?:\/\/www\.facebook\.com\/(?:video\/video|photo)\.php\?v=([0-9]+)
To:https?:\/\/www\.facebook\.com\/(?:[0-9a-z\.\-_]+)\/videos\/([0-9]+)\/
I'm assuming I did this incorrectly. But I don't know where I should add that code inside the xml file...
From my template, I still kept it as this:
<vb:elseif condition="$provider == 'facebook'" />
<object class="restrain" type="application/x-shockwave-flash" width="576" height="432" data="//www.facebook.com/v/{vb:raw code}">
<param name="movie" value="//www.facebook.com/v/{vb:raw code}" />
<param name="wmode" value="{vb:raw wmode}" />
<!--[if IE 6]>
<embed width="576" height="432" type="application/x-shockwave-flash" src="//www.facebook.com/v/{vb:raw code}" />
<![endif]--></object>
</vb:if>
--
I tried:
https://www.facebook.com/WilliamSinge/videos/10153926357545620
But it didn't work.
Keyser Soze
09-11-2015, 05:04 AM
Here's an improved version of my previous RegExp that should also work with video-URLs that don't have a trailing slash. https?:\/\/www\.facebook\.com\/(?:[0-9a-zA-Z\.\-_]+)\/videos\/([0-9]+)((?:\/[0-9a-z\.\-\?\&\/]?)?)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.