vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - Add New Facebook "Like" button to your threads (https://vborg.vbsupport.ru/showthread.php?t=241011)

ericgtr 04-21-2010 10:00 PM

Add New Facebook "Like" button to your threads
 
1 Attachment(s)
Please remember to click Mark as Installed if you use this modification.

Facebook has just launched their latest "Like" button to developers to use on any site. What this does is utilizes the Advertising module to add the "Like" button to the first post of each thread. Please see screenshots to get an idea.

In your Admin CP go to Advertising > New Ad > Choose "Thread" from the dropdown and then select the first thread box. Give it a title (I called mine FB Like) leave "First Post Content" at default and paste in this code:
HTML Code:

<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}#post{vb:raw post.postid}&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>
<!-- / Facebook Like -->

Be sure to change YOURSITE.com to your URL including your forum.

The VBSEO team has instructions on how to make this work for their product here http://www.vbseo.com/f2/facebook-lik...95/#post265997

===========================================
Option 2 (different from above, do not use together) will show at top, see screenshot #3

In Postbit (or legacy) find:
Code:

{vb:raw ad_location.thread_first_post_content}
Add this after:
Code:

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"
<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/{vb:link thread, {vb:raw thread}}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe>
<!-- / Facebook Like -->
</vb:if>

For additional information on this button and different parameters please visit http://developers.facebook.com/docs/...e/plugins/like

=================================================

For those who have asked, here is the modification adds both the "Like" button and comments to a users profile https://vborg.vbsupport.ru/showthread.php?t=239424

=================================================
Additional locations to place this code:

For CMS, in vbcms_content_article_page add the code below this:
Code:

{vb:raw comment_block}
For pictures, in template album_pictureview add the code below this:
Code:

{vb:raw picturecomment_commentarea}
For Blog, in template blog_show_entry add at the very top.

saviola8x 04-22-2010 03:17 PM

1 Attachment(s)
Fix with me ! Demo : http://s2facebook.com/forum/showthread.php?854

Open Postbit temp search
Code:

{vb:raw ad_location.thread_first_post_content}
Add below :
Code:

<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://DOMAIN.com/forum/{vb:link thread, {vb:raw thread}}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe>
<!-- / Facebook Like -->

Done.

pjdaley 04-22-2010 03:29 PM

I also get "error"

The page at http://mysitehere.net/showthread.php?t could not be reached.

Also it seems not to work with VBSeo

Doctor Death 04-22-2010 03:38 PM

Would be great to have a dislike button as well.

Can it also be tagged to each post in a thread or can it only deal with first post?

saviola8x 04-22-2010 03:50 PM

Quote:

Originally Posted by Doctor Death (Post 2025445)
Can it also be tagged to each post in a thread or can it only deal with first post?

Wherever you want. :up:

trackpads 04-22-2010 04:35 PM

I changed the width to =50 so that it didnt push the content around

trackpads 04-22-2010 04:35 PM

Suggestion: Can you create a hack like this so users can like members profiles?

ericgtr 04-22-2010 04:49 PM

To anyone getting a submit error, be sure your URL is correct. Also, I have not tested with vbseo and it will most likely need to be re-worked for that.

@trackpads I will look into that, I'm sure the parameters will have to be modified for that page.

PixelFx 04-22-2010 04:54 PM

looks like sweet addon thanks :D

wacnstac 04-22-2010 05:21 PM

Can this also be used with 3.8.X?

pjdaley 04-22-2010 05:26 PM

Very cool little add-on, but will need to re-work it to work with vbSEO

installed+rating good job :)

dirtycrow 04-22-2010 05:45 PM

i get an error =

Quote:

The page at http://%5BB%5Dhttp//forums.orderofth...pe-cod-edition could not be reached.

dirtycrow 04-22-2010 05:47 PM

Quote:

Originally Posted by dirtycrow (Post 2025500)
i get an error =

nvm, i think i got it to work.

dirtycrow 04-22-2010 05:49 PM

Quote:

Originally Posted by pjdaley (Post 2025497)
Very cool little add-on, but will need to re-work it to work with vbSEO

installed+rating good job :)

i agree 100 percent. with out the thread title of what you are liking its not descriptive enough to get people to visit.

ericgtr 04-22-2010 05:49 PM

Quote:

Originally Posted by wacnstac (Post 2025494)
Can this also be used with 3.8.X?

As it stands it will not work with 3.8 because the variable names have changed. I do not have a 3.x board to test on anymore.

ericgtr 04-22-2010 05:52 PM

Quote:

Originally Posted by pjdaley (Post 2025497)
Very cool little add-on, but will need to re-work it to work with vbSEO

installed+rating good job :)

Quote:

Originally Posted by dirtycrow (Post 2025504)
i agree 100 percent. with out the thread title of what you are liking its not descriptive enough to get people to visit.

Understood, let's see if we can get this working with VBSEO by presenting this question to them, we need to convert this to VBSEO:
Code:

{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}#post{vb:raw post.postid}
Please see if you can get one of their people to answer this and we can then add a VBSEO version of this mod here.

wacnstac 04-22-2010 05:53 PM

If someone could supply the variable names to make this work on 3.8.X I'd really appreciate it.

wacnstac 04-22-2010 06:07 PM

Even taking the stock "share" IFRAME from facebook, is giving me an error right now. Perhaps their system is overloaded?

Da-Vinci 04-22-2010 06:07 PM

Using the code from the 2nd post mine looks like this with VBSEO installed. and I think it's a pretty cool mod.

Obviously I'm using Adsense so it makes more sence to have the like button beneath the title, but I've found no problems with VBSEO.

https://vborg.vbsupport.ru/

One question, I have though is there a conditional, I can use to exclude certain forums?

ericgtr 04-22-2010 06:12 PM

Quote:

Originally Posted by wacnstac (Post 2025514)
Even taking the stock "share" IFRAME from facebook, is giving me an error right now. Perhaps their system is overloaded?

If it has the red "error" upon clicking then it most likely means the URL path isn't setup correctly. I would double check it.

kall 04-22-2010 06:25 PM

Quote:

Originally Posted by ericgtr (Post 2025507)
Understood, let's see if we can get this working with VBSEO by presenting this question to them, we need to convert this to VBSEO:
Code:

{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}#post{vb:raw post.postid}
Please see if you can get one of their people to answer this and we can then add a VBSEO version of this mod here.

I've taken the question to the devs.. it's odd. The link shows as the standard vB variable url inside the fb stuff, whether you use iframe or the js version.

Obviously the error is there to prevent people from having what they like link back to the wrong thing, but it's a tad annoying that it doesn't work with the way vbseo does it.

Does it work with the vB4 SEO options?

ericgtr 04-22-2010 06:34 PM

Quote:

Originally Posted by kall (Post 2025522)
I've taken the question to the devs.. it's odd. The link shows as the standard vB variable url inside the fb stuff, whether you use iframe or the js version.

Obviously the error is there to prevent people from having what they like link back to the wrong thing, but it's a tad annoying that it doesn't work with the way vbseo does it.

Does it work with the vB4 SEO options?

I'm afraid I don't have vbseo to test it on so I can't say. But yeah, like you say it checks the URL before it allows it which is good and bad I guess depending on how you look at it. The benefit to me for iframe is that it won't affect the board if it's slow for any reason.

giorgino 04-22-2010 07:13 PM

Quote:

Originally Posted by Da-Vinci (Post 2025516)
Using the code from the 2nd post mine looks like this with VBSEO installed. and I think it's a pretty cool mod.

Obviously I'm using Adsense so it makes more sence to have the like button beneath the title, but I've found no problems with VBSEO.

http://www.hostmypics.org/pictures/4...d39c6288bd.png

One question, I have though is there a conditional, I can use to exclude certain forums?


Great effect! How you have done? Can you give me the code please?

Da-Vinci 04-22-2010 07:32 PM

Yes it's in the 2nd post of this thread.

https://vborg.vbsupport.ru/showpost....32&postcount=2

Maybe the VBSEO problem is to do with the type of url rewrite you use, I use 002 - Hierarchic directory type URLs with content relevant threads (used at www.vBSEO.com) for my forumURL's, but obviously if your using a different type of URL rewrite it's not something you want to change.

Also not wanting to be a pest but can anybody answear this?

Is there a conditional, I can use to exclude certain forums?

The reason being we have a few private forums which I would prefer not to be displayed on Facebook, and although I can tell the members who have access to said forums not to click the Like button in the said sections, you will always get one or two, who will.

hiker 04-22-2010 07:38 PM

Nice mod. Will install it soon. I was waiting for this since the news of Facebook discontinuing the Facebook Connect soon.

Alien 04-22-2010 07:42 PM

On multi-page threads, it will put up the like text/icons at the top of every page.

Less than ideal, I'd like to see it only on page 1/post 1 of a thread...

Quote:

Originally Posted by saviola8x (Post 2025432)
Fix with me ! Demo : http://s2facebook.com/forum/showthread.php?854

Open Postbit temp search
Code:

{vb:raw ad_location.thread_first_post_content}
Add below :
Code:

<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://DOMAIN.com/forum/{vb:link thread, {vb:raw thread}}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe>
<!-- / Facebook Like -->

Done.


giorgino 04-22-2010 07:58 PM

Quote:

Originally Posted by Da-Vinci (Post 2025550)
Yes it's in the 2nd post of this thread.

https://vborg.vbsupport.ru/showpost....32&postcount=2

Maybe the VBSEO problem is to do with the type of url rewrite you use, I use 002 - Hierarchic directory type URLs with content relevant threads (used at www.vBSEO.com) for my forumURL's, but obviously if your using a different type of URL rewrite it's not something you want to change.

Also not wanting to be a pest but can anybody answear this?

Is there a conditional, I can use to exclude certain forums?

The reason being we have a few private forums which I would prefer not to be displayed on Facebook, and although I can tell the members who have access to said forums not to click the Like button in the said sections, you will always get one or two, who will.

Great work perfectly with vBSeo (with 002 rules like you). Thank you very much! :)

Da-Vinci 04-22-2010 08:03 PM

Cool glad it's worked for you, but I take no credit for any of the work, I just used what was available to me.

ericgtr 04-22-2010 08:05 PM

Quote:

Originally Posted by Alien (Post 2025552)
On multi-page threads, it will put up the like text/icons at the top of every page.

Less than ideal, I'd like to see it only on page 1/post 1 of a thread...

Here's the way around that:

In Postbit (or legacy) find:
Code:

{vb:raw ad_location.thread_first_post_content}
Add this after:
Code:

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"
<!-- Facebook Like -->
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.YOURSITE.com/{vb:link thread, {vb:raw thread}}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:75px"></iframe>
<!-- / Facebook Like -->
</vb:if>

This will only show on the first post no matter how many pages there are.

Alien 04-22-2010 08:10 PM

Excellent, eric. Thank you SO much. I'll just add an additional conditional to exclude some forums and we should be all set!

ericgtr 04-22-2010 08:14 PM

Quote:

Originally Posted by Alien (Post 2025569)
Excellent, eric. Thank you SO much. I'll just add an additional conditional to exclude some forums and we should be all set!

For reference, here is the code for it to only "show" in selected forums:

Code:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>

hiker 04-22-2010 08:15 PM

Quote:

Originally Posted by bogley (Post 2025551)
Nice mod. Will install it soon.

Nevermind, couldn't wait. Had to install it now. :D

Working perfectly!

SuperGLS 04-22-2010 08:19 PM

Very cool! I've done in like it post 29 and edited it so that the height=30 instead of 75 and it looks really good.

Would you put that forum conditional right underneath the code from post 29?

SuperGLS 04-22-2010 08:22 PM

Here's a screenshot.

https://vborg.vbsupport.ru/external/2010/04/13.png

neil. 04-22-2010 09:15 PM

Any luck with vbseo, none work for me:

I get errors like:
Code:

htp://forum.kitecrowd.com/%7Bvb:link%20thread,%20%7Bvb:raw%20thread%7D%7D could not be reached.
with http obv.

ericgtr 04-22-2010 09:26 PM

Quote:

Originally Posted by neil. (Post 2025599)
Any luck with vbseo, none work for me:

I get errors like:
Code:

htp://forum.kitecrowd.com/%7Bvb:link%20thread,%20%7Bvb:raw%20thread%7D%7D could not be reached.
with http obv.

Have you tried the code posted up in the second post of this thread?

TimberFloorAu 04-22-2010 09:34 PM

Works a treat thanks Eric

TimberFloorAu 04-22-2010 09:46 PM

Shouldnt :

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"

be

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">

Da-Vinci 04-22-2010 09:56 PM

Quote:

Originally Posted by ericgtr (Post 2025570)
For reference, here is the code for it to only "show" in selected forums:

Code:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>

Thank you Eric, but as for the conditional, is there not a way to just exclude certain forums rather than only show to certain forum as I have many many forums and sub forums that I would like to display the Like button on and only say 4 forums and 7 subforums I would like to exclude lol. I am just finding my way around conditional at the moment and will try to refer to the article that details the conditional to work this one out on my own, but any help is greatly appreciated.

Quote:

Originally Posted by TimberFloorAu (Post 2025616)
Shouldnt :

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')"

be

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">

I don't want to look stupid here but are those 2 conditionals not identical?

TimberFloorAu 04-22-2010 10:12 PM

No he forgot closing bracket ">"


All times are GMT. The time now is 03:18 AM.

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.03525 seconds
  • Memory Usage 1,851KB
  • 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
  • (16)bbcode_code_printable
  • (1)bbcode_html_printable
  • (19)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