vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Add-On Releases - Add "LIKE" button and other Facebook plugins to threads. (https://vborg.vbsupport.ru/showthread.php?t=243319)

Xtrigit 05-25-2010 10:00 PM

Add "LIKE" button and other Facebook plugins to threads.
 
1 Attachment(s)
UPDATED: 7/4/10

What's new?
Facebook Comment Box


I recently added the new facebook "Like" button to my forum and I want to share with everyone!

Yes, this is IE,Firefox, Opera, Safari compatible.
Yes, this will also show a "comment" box when hover over.

First thing's first:

1. Go to http://www.facebook.com/developers/createapp.php (Facebook account required)

2. Enter your site name in the "Application Name" field... "agree" - "Create new app"

3. Click the Website tab

4: Enter your site URL in the "Connect URL" field.

i.e. http://www.DOMAIN.com/ (Don't forget the SLASH).

5. Enter DOMAIN.com in the "Base Domain" field and save.

6. In the next page you will see an "Application ID" number. (you'll need it later... keep the window open for now)

Template Edits:

headinclude:
Under:
PHP Code:

<meta name="generator" content="vBulletin $vboptions[templateversion]/> 

Paste:
PHP Code:

<meta property="og:title" content="$threadinfo[title]"/>
<
meta property="og:site_name" content="$vboptions[bbtitle]"/>
<
meta property="og:type" content="website" />
<
meta property="og:image" content="IMAGEPATH"/>
<
meta property="fb:admins" content="YOUR PROFILE ID"/> 


* Replace IMAGEPATH with the actual path to the image you want to be displayed on people's facebook wall. (You can use your site logo)
*YOUR PROFILE ID = http://www.facebook.com/profile.php?id=randomnumbers

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++

SHOWTHREAD
Find:
PHP Code:

<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]lang="$stylevar[languagecode]"

Replace with:
PHP Code:

<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]xmlns:fb="http://www.facebook.com/2008/fbml" lang="$stylevar[languagecode]"

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++

under:
PHP Code:

<body onload="$onload"

Paste:
PHP Code:

<div id="fb-root"></div>
<
script src="/images/fb.js" type="text/javascript"></script

*Download and open the attached .js file, Replace "APP ID" with your actual app ID. (not to be confused with profile ID)
*Save and upload fb.js to root/images
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++

Find:
PHP Code:

<!-- / multiquote scripts -->
</if> 

Add below:
PHP Code:

<!-- Facebook Comment --> 
<
br /> 
<if 
condition="in_array($bbuserinfo[usergroupid],array(1))"><div align="center">
<
fb:comments numposts="3" width="800"></fb:comments>
</
div></if>
<!-- / 
Facebook Comment --> 

*This will place the Facebook Comment box below the last post, you may change the width to your liking.
*The comment box will only be shown to guests.
++++++++++++++++++++++++++++++++++++++

Now we need to place the "LIKE" button somewhere visible.

I use postbit_legacy so, this is what I did:
Find:
PHP Code:

<if condition="$post['title']"><strong>$post[title]</strong></if>
            </
div

Add below:
PHP Code:

<if condition="$post[postcount] == 1"><table style="background-color: #ff0000;">
<
tr style="background-color: yellow;">
<
td style="background-color: #fff;" align="right"><fb:like href="$vboptions[bburl]/showthread.php$session[sessionurl]?p=$post[postid]width="260"></fb:like></td>
</
tr>
</
table></if> 

* This will place the like button below the first post of every thread.
* you may change the table color to suit your needs.
---------------------------------------------------------------------------
Thanks to BirdOPrey5 for pointing out some mistakes.

Mark as Installed if you use this modification.


DONE! =]

RobbieZ 05-26-2010 08:23 PM

The colouring in is extraordinary.

Thanks.

Xtrigit 05-26-2010 10:19 PM

No problem ;)

Frank Sinatra 05-27-2010 03:35 AM

Thanks a lot, was waiting some like this.

stamos2003 05-27-2010 12:36 PM

the right title and link is not posted correct at facebook,
seems like the topic ID doesn't come over

stamos2003 05-27-2010 01:01 PM

ok here is the fix and the hint for showing it only for the first post:

Code:


<if condition="$post[postcount] == 1">
<fb:like href="http://www.YOURSITE.COM/forum/showthread.php$session[sessionurl]?p=$post[postid]" width="500"></fb:like> 
</if>

i have put mine in the postbit template after "CONTROLS" and it works fine now :)

Brandon Sheley 05-27-2010 02:08 PM

nice mod, how is it different then the other 2?

Xtrigit 05-27-2010 04:50 PM

Quote:

Originally Posted by Loco.M (Post 2044103)
nice mod, how is it different then the other 2?

Not much difference, this one just makes use of the meta tags as recommended by facebook, works in all major browsers , adds the picture of the person who LIKED the content, adds a cookie so that a user can only like a thread once, the ability to add a comment (comment will appear on the person's "wall"). and... that's it!

Also, in facebook, you will see something like:

Joe likes "page title" on "site name"

rather than:

Joe likes "page title".

:)

UnganWeb 05-28-2010 12:38 AM

Error :( (I think stems Zoints Seo)

kall 05-28-2010 01:23 AM

Quote:

Originally Posted by Xtrigit (Post 2044190)
Not much difference, this one just makes use of the meta tags as recommended by facebook, works in all major browsers , adds the picture of the person who LIKED the content, adds a cookie so that a user can only like a thread once, the ability to add a comment (comment will appear on the person's "wall"). and... that's it!

Also, in facebook, you will see something like:

Joe likes "page title" on "site name"

rather than:

Joe likes "page title".

:)

So you haven't seen mine then.

Xtrigit 05-28-2010 02:36 AM

Quote:

Originally Posted by UnganWeb (Post 2044374)
Error :( (I think stems Zoints Seo)

Need more details to be able to assist you.

Quote:

Originally Posted by kall (Post 2044382)
So you haven't seen mine then.

Correct. The only one that I found for 3.8.x was the one made by hubie but people were reporting it didn't work in IE and the "comment" box would not appear.

kall 05-28-2010 04:55 AM

Quote:

Originally Posted by Xtrigit (Post 2044401)
Need more details to be able to assist you.



Correct. The only one that I found for 3.8.x was the one made by hubie but people were reporting it didn't work in IE and the "comment" box would not appear.

That's probably why Brandon mentioned the other 2. :)

You could make it fewer edits required if you popped $vboptions[bbtitle] instead of YOURSITENAME.

MagicThemeParks 05-28-2010 12:18 PM

kall, does yours work in 3.8x? Looks like it's for vB4.

Thanks Xtrigit, gonna try this one out this weekend! :)

ceho 05-29-2010 07:05 AM

1 Attachment(s)
Hi, I would like to finish the installation as your mod seems to be working well.

However I have problems with the position of the button. I put it into postbit_legacy under >!-- controls -->, and it's somewhere in the middle of that bit. I couldn't find a way how to change it (except for an align=left), and it seems that the class is coming from FB directly (as far as I understand...).

Here is what it looks like:

Attachment 117718

This is what it should look like:

Attachment 117719

And there is obviously a problem with the comment field which is not working properly:

Attachment 117720

Any help is much appreciated, really. Thanks a lot!

kall 05-29-2010 07:30 AM

Quote:

Originally Posted by MagicThemeParks (Post 2044584)
kall, does yours work in 3.8x? Looks like it's for vB4.

Thanks Xtrigit, gonna try this one out this weekend! :)

Yep, there's a 3.8.x version as well.

RvG2 06-04-2010 05:07 PM

Worked with 3.8.x

ryancooper 06-05-2010 03:54 PM

IS there a way to NOT show the icons (or faces) of the people who clicked?

Xtrigit 06-07-2010 02:50 AM

Quote:

Originally Posted by ryancooper (Post 2048797)
IS there a way to NOT show the icons (or faces) of the people who clicked?

Replace the last code edit with this:

PHP Code:

<fb:like href="$vboptions[bburl]/showthread.php$session[sessionurl]?t=$threadidshow_faces="false" width="500"></fb:like


Daisyboo 06-07-2010 08:12 PM

Is there any way to stop it showing in sensitive areas of the board?

jakobility 06-12-2010 10:06 PM

thanks, great addon! :)

UnganWeb 06-13-2010 07:59 PM

Quote:

Originally Posted by Xtrigit (Post 2044401)
Need more details to be able to assist you.



Correct. The only one that I found for 3.8.x was the one made by hubie but people were reporting it didn't work in IE and the "comment" box would not appear.

when I try to share a link on Facebook it cant be read. I dig into other vbulletin sites that use zoints seo and the problem is same. When I deactivate zoints seo its alright but I must not deactivate it. I cant understand the problem with zoints seo

MissKalunji 06-13-2010 09:08 PM

The code was missing something, View the "red" part

Works Nice i changed it cause the Thread part wasn't working

i changed to this instead


Quote:

showthread.php$session[sessionurl]?p=$post[postid]&amp;show_faces=false&amp

Thanks!

jakobility 06-14-2010 09:04 PM

As I said, nice addon!

But I wonder about the long loading time. Is it possible to make it faster?
You can see the addon here on my website and it takes so much time to load.. :(

MissKalunji 06-15-2010 12:23 PM

are you positive it's not something else causing this?

cause it loads fine for me?

jakobility 06-15-2010 12:40 PM

Okay, now it loads fine.

So probably it was because of the cookies ect..
After removing it, it works well! :)

Thank you very much! :)

Noli 06-15-2010 06:49 PM

is it just me or is the create app page down?

jakobility 06-18-2010 03:39 PM

After installing this addon, I have problems with like button.
By the button it shows me an red error. If I click on it, there comes a popup from facebook with the following message (translated from german):
You have to set a ?href?-attribute for the inlineframe. For example <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Ffoo%2Fbar .html"></iframe>
Is there anything wrong in the configuration at facebook.com/developers or do I have to change the code in my website?

My configurations on facebook:
Canvas Callback URL
http://tablet-faq.de/
Connect URL
http://tablet-faq.de/
Base Domain
tablet-faq.de
Canvas URL
http://apps.facebook.com/tablet-faq/
FBML/iframe
iframe
Developer Mode
Off
Application Type
Website
Private Install
No

MissKalunji 06-18-2010 07:56 PM

I think this addon already has the LIKE integrated by the way

Dcoy 06-24-2010 02:38 PM

Quote:

(Yes, you can place it ANYWHERE! I chose the ad template because it's closer to the reply button xD)
I cannot place it anywhere... I tried it and the code will not work properly... the post that will be posted on FB with the link of the thread that you "Like" will becomes an error if I put it in other places like ad_showthread_firstpost_sig and ad_showthread_firstpost_start

so is it really possible to place it on another location? because currently the location of the Like button is kinda messed up.... here's a screenshot http://i49.tinypic.com/2a9cq4h.jpg

its kinda floating between the first post and the new reply botton which is kinda annoying... is there a way to put it besides the edit button or the thanks button so its more cleaner and pleasant to look at

I hope someone can help me

yamahapaul 06-24-2010 03:03 PM

1 Attachment(s)
I can get it to show here if thats any good??

Dcoy 06-25-2010 12:52 AM

Quote:

Originally Posted by yamahapaul (Post 2058862)
I can get it to show here if thats any good??

yeah thats fine... how can I do that?

kjsmith84 06-25-2010 04:35 PM

I already have made my site page made off of my personal page but I want this info to post to my site page not my personal page- where do I find the info to do this or change the path on where it posts on facebook

m_7 06-25-2010 07:01 PM

thanx man ,,, I will try it later

profanitytalker 06-26-2010 08:21 AM

I'm getting this error...

Code:

You must specify an "href" attribute to the iframe. Something like <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Ffoo%2Fbar.html"></iframe>

MissKalunji 06-26-2010 04:19 PM

Quote:

Originally Posted by profanitytalker (Post 2059772)
I'm getting this error...

Code:

You must specify an "href" attribute to the iframe. Something like <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Ffoo%2Fbar.html"></iframe>

see what i post here

Quote:

Originally Posted by MissKalunji (Post 2053105)
The code was missing something, View the "red" part

Works Nice i changed it cause the Thread part wasn't working

i changed to this instead





Thanks!


Dcoy 06-28-2010 05:59 AM

any help about this please

Quote:

I cannot place it anywhere... I tried it and the code will not work properly... the post that will be posted on FB with the link of the thread that you "Like" will becomes an error if I put it in other places like ad_showthread_firstpost_sig and ad_showthread_firstpost_start

so is it really possible to place it on another location? because currently the location of the Like button is kinda messed up.... here's a screenshot http://i49.tinypic.com/2a9cq4h.jpg

its kinda floating between the first post and the new reply botton which is kinda annoying... is there a way to put it besides the edit button or the thanks button so its more cleaner and pleasant to look at

BirdOPrey5 07-02-2010 05:08 AM

Installed but not working... I went to "like" a thread and I got asked for the comment, I added a comment and posted but got the dreaded red "Error" when I click on "Error" I get a page popup that says:
The page at could not be reached.
Facebook ©2010
Then when i reload the thread, OR ANY OTHER THREAD, it says that I like the thread already, and it says 3,398 other people like the same thing- impossible, I only have about 250 active users and 95% of them weren't online.
this is all in firefox...
in IE I get another popup error when I click "Like" I get:
An error occurred with Facebook Platform Opt In. Please try again later.
It also says 3,298 other people like it.

I've double checked the meta tags and my app id, all valid/correct. Any ideas?

Oh, and facebook of course never posts it.

BirdOPrey5 07-02-2010 05:18 AM

I don't know if it makes a difference but the link in the template edit: http://www.facebook.com/2008/fbml doesn't work/page not found error.

i couldn't get it to work, no idea why, it's the same code Facebook themselves gives out... so i switched to an iframe version of the code and all works well- just no comments posted.

Daisyboo 07-02-2010 02:53 PM

I had this working fine but now instead of posting the name of the thread it posts the name of the forum and when clicked it says No Thread specified. If you followed a valid link, please notify the administrator

Daisyboo 07-02-2010 03:07 PM

Never mind uninstalled.


All times are GMT. The time now is 05:03 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.01413 seconds
  • Memory Usage 1,872KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (11)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete