Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

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
  #52  
Old 08-13-2010, 10:19 PM
Kwikms Kwikms is offline
 
Join Date: Jul 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I try to show this button only in the first post without success. How can I do that?
Reply With Quote
  #53  
Old 08-13-2010, 11:28 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try wrapping it in this conditional, in the postbit or postbit_legacy templates, not sure if it can be called there or not though as I haven't tried it.

Code:
<if condition="$post['isfirstshown']">$ogfb_like_showthread</if>
Reply With Quote
  #54  
Old 08-15-2010, 11:01 AM
Kwikms Kwikms is offline
 
Join Date: Jul 2004
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.

I am just not able to put the like button any where else except in the showthread. It just dont show up. And it doesnt matter what I put in the plugin "OpenGraph/Facebook Integration - SHOWTHREAD variables". I can switch it to whatever I want (postbit_start e.g.) it still shows up in showthread but not in postbit_legacy.

Weird.
Reply With Quote
  #55  
Old 08-16-2010, 06:13 AM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kwikms View Post
Thanks.

I am just not able to put the like button any where else except in the showthread. It just dont show up. And it doesnt matter what I put in the plugin "OpenGraph/Facebook Integration - SHOWTHREAD variables". I can switch it to whatever I want (postbit_start e.g.) it still shows up in showthread but not in postbit_legacy.

Weird.
It's not weird, it's that the variable mustn't be available in the postbit templates.

There'll be a way round this, I'm just not sure what it is.
Reply With Quote
  #56  
Old 09-15-2010, 06:45 AM
benFF benFF is offline
 
Join Date: Jul 2004
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and works great I just wondered if there is any to get a list of all the "liked" threads somehow in FB.

Insights doesn't like my site application right now, or maybe that's because it hasn't been used enough?
Reply With Quote
  #57  
Old 02-25-2011, 08:34 PM
Chase Chase is offline
 
Join Date: May 2002
Location: Northern Ohio
Posts: 237
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's the difference between this? http://developers.facebook.com/docs/.../plugins/like/
Reply With Quote
  #58  
Old 02-26-2011, 03:00 AM
Edgespeeder06 Edgespeeder06 is offline
 
Join Date: Nov 2009
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool, any updates on this? In you original post, how did you get the fully custom profile page seen here? http://www.nzboards.com/members/kall/


I would like to set that up for www.NJStangers.org since I already have the Facebook Login bridge going.

Thanks!
Reply With Quote
  #59  
Old 02-26-2011, 05:59 PM
wicked80 wicked80 is offline
 
Join Date: Feb 2008
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mark.B View Post
It's not weird, it's that the variable mustn't be available in the postbit templates.

There'll be a way round this, I'm just not sure what it is.
Same issue, working in SHOWTHREAD but not in postbit_legacy...
any workaround guys to make it work in postbit_legacy???

Thanks
Reply With Quote
  #60  
Old 03-28-2011, 03:10 PM
moreilly moreilly is offline
 
Join Date: Feb 2005
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone explain to me or help me fix why after you "like" a post when I visit Facebook it has some random image next to it on my wall?

Sometimes it grabs a smiley face, or some random icon placed on my site.

Is there a way to make the image the same?
Reply With Quote
  #61  
Old 03-28-2011, 04:08 PM
moreilly moreilly is offline
 
Join Date: Feb 2005
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nvm, got that sorted.

Now I am a little undecided on where this button needs to go.

Anyone have some examples of where you guys have your button with this hack?

If you do, could you post which template and the code where you integrated it?
Reply With Quote
Reply


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 07:19 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05954 seconds
  • Memory Usage 2,348KB
  • Queries Executed 28 (?)
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
  • (4)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
  • (2)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_postinfo_query
  • fetch_postinfo
  • 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