Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
Add New Facebook "Like" Button to Threads and OpenGraph to Headinclude Automatically Details »»
Add New Facebook "Like" Button to Threads and OpenGraph to Headinclude Automatically
Version: 0.2.1, by kall kall is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.4 Rating:
Released: 05-14-2010 Last Update: 05-15-2010 Installs: 27
Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

From The Open Graph Protocol :
Quote:
The Open Graph protocol enables any web page to become a rich object in a social graph. For instance, this is used on Facebook to enable any web page to have the same functionality as a Facebook Page.
Quote:
Basic metadata
To turn your web pages into graph objects, you need to add basic metadata to your page. We've based the initial version of the protocol on RDFa which means that you'll place additional <meta> tags in the <head> of your web page. The four required properties for every page are:

og:title - The title of your object as it should appear within the graph, e.g., "The Rock".
og:type - The type of your object, e.g., "movie". Depending on the type you specify, other properties may also be required.
og:image - An image URL which should represent your object within the graph.
og:url - The canonical URL of your object that will be used as its permanent ID in the graph, e.g., "http://www.imdb.com/title/tt0117500/".
This modification will add these tags to all pages, and the <og:title> attribute to your SHOWTHREAD pages (for the moment.. additional Pages to be added soon), along with the Facebook 'Like Button' under the Thread Title (as we are supposed to put the Like button next to the thing the person is Liking).

Install Instructions:
AdminCP - Plugins & Products - Manage Products - [Add/Import Product] , browse to the location of the .xml file you downloaded from this thread, Import it.
Template Modifications
In SHOWTHREAD, find:
PHP Code:
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]
Replace with:
PHP Code:
<html xmlns="http://www.w3.org/1999/xhtml" <if condition="$vboptions['ogfb_onoff']">xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" </if>dir="$stylevar[textdirection]
Find:
PHP Code:
$headinclude 
Add under:
PHP Code:
$ogfb_metadata 
Wherever you want to add the Like Button, add
PHP Code:
$ogfb_like_showthread 
Configuration Instructions
AdminCP - Settings - Options - Opengraph/Facebook Integration
Global On/Off - Set to Yes to turn the system on.
FB - Page Admins - A comma-separated list of the Facebook IDs of the Admins of your pages on Facebook.
FB - App ID - The application ID of your Facebook Application.
OG - Site Name - A short, human-readable name for your site that will appear in the Like on the User's Facebook Activity Stream.

It is important to fill in these, as they are used by FB to fill in some of the information, and allows your pages (Showthread at the moment) to be referenced in the Open Graph.

What's Next?
This is an early beta release to gauge the interest in Open Graph/Facebook type stuff.
I intend to add the tags to other pages, and implement some of the other Facebook Social Plugins. These will all be On/Off configurable. Some can be seen in action at:

View Profile: kall - New Zealand Boards - Like for Member Profiles
http://www.nzboards.com/the-lounge/r...on-sale-90544/ - Activity and Recommendation Streams in first and last post.

(4.0.3 Version here: https://vborg.vbsupport.ru/showthread.php?t=242525)

Download Now

File Type: xml product-nzb_fbopengraph-3.8-v0.2.1.xml (4.7 KB, 207 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 05-17-2010, 05:39 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Loco.M View Post
could you check out my question about adding this in the postbit template


and how do we get our ID's
FB - Page Admins - A comma-separated list of the Facebook IDs of the Admins of your pages on Facebook.
my account is facebook.com/username/
Sorry dude, that super important request to cache two templates took precedence.

When you say postbit, do you mean every post, or are you going to conditional it to only appear in the first one (the reason it is in navbar is because the entire purpose of the Like button under current functionality is to Like the *page* that one is visiting. Putting it in a single post will result in multiple Like URLs for the resource (as that post can be visited via showpost.php or showthread.php among others), and putting it in every post won't work at all on showthread.php)?
Reply With Quote
  #23  
Old 05-17-2010, 05:40 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The ID is (as it should mention in the AdminCP bit) found by mousingover your avatar (usually, works for me anyway), or going into your Albums and looking for the common string of numbers that appears on each.
Reply With Quote
  #24  
Old 05-17-2010, 05:42 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I understand, no rush on my part
I have the first post conditioned out in the postibit template (see example)
This version seems to take a while to load, I may just revert back and use the small "like" button/count.

thx, found my ID
Reply With Quote
  #25  
Old 05-17-2010, 05:57 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Re it being slow: Conversation here seems to indicate using the FBML makes it faster than the iframe version: http://wiki.developers.facebook.com/...Talk:Fb:iframe

It should be possible to change the button to use the iframe though, keeping all the opengraph stuff.

In ogfb_like_showthread, delete everything and replace with this:

Code:
<div style="padding: 5px; border: 1px solid #3F6F81; background: #ffffff; font-size: 10px; width: 300px;">
<iframe src="http://www.facebook.com/plugins/like.php?href=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
</div>
Obviously though, by doing this we lose the app_id detail. Let me know how it works for you.
Reply With Quote
  #26  
Old 05-17-2010, 06:33 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To make the button display on other templates

Change the hook that the OpenGraph/Facebook Integration - SHOWTHREAD variables plugin executes on to an applicable hook.

(postbit - postbit_display_complete. or chuck it in global_start or something that's called on every page.)
Reply With Quote
  #27  
Old 05-17-2010, 06:58 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, checking it out now

still not working, I'll play around with this tonight

thx for the help Kall
Reply With Quote
  #28  
Old 05-17-2010, 07:07 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How's it not working man? Gimme a URL.

There is the issue of 'vBSEO needs to use slightly different code' and 'Brandon made me change my plugins while I had the flu' clouding the waters somewhat.
Reply With Quote
  #29  
Old 05-18-2010, 02:18 AM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kall View Post
and 'Brandon made me change my plugins while I had the flu' clouding the waters somewhat.
aww, sorry man
hope you get feeling better
I posted a link a few post up

I'll play with it again, but I had tried placing the $ogfb_like_showthread in my postbit template along with the digg, twitter and stumble one
and tried changing the hook location to the 2 you suggested and nothing showed.
I moved $ogfb_like_showthread back in the showthread template, and it shows.

I just about have it how I want it, thanks for the help
Reply With Quote
  #30  
Old 05-18-2010, 03:14 PM
staticrebelle staticrebelle is offline
 
Join Date: Jul 2004
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kall View Post
That's weird.. this mod was developed on a 3.8 forum running vBSEO.

Could you maybe provide a link to a page where it's like that, or the source code of the area?
Hope this helps

http://www.avrilbandaids.com/forums/...ound-site.html

You can see the white box above the reply button.
Reply With Quote
  #31  
Old 05-18-2010, 05:29 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh. One question - are you currently running YAFB or the default 4.0.3 Facebook Connect?

They're not compatible You would need to use the iframe code rather than the FBML version.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05868 seconds
  • Memory Usage 2,350KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (5)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete