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)

Uberguilds 04-22-2010 10:31 PM

Postbit_Legacy:

With VBSEO
Code:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://(domain)$_SERVER[VBSEO_URI]?p=$post[postid]&amp;layout=button_count&amp;show_faces=true&amp;width=&amp;action=like&amp;colorscheme=light"
 scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe>




Without VBSEO
Code:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://(domain)/showthread.php$session[sessionurl]?p=$post[postid]&amp;layout=button_count&amp;show_faces=true&amp;width=&amp;action=like&amp;colorscheme=light"
 scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe>


puertoblack2003 04-22-2010 10:35 PM

this is nice and clean.It'll be nice to have something but for twitter:)

RedTrinity 04-22-2010 11:35 PM

I suppose there is no way to have this mod show the member's forum username, instead of their real name from FB?

ericgtr 04-22-2010 11:51 PM

Quote:

Originally Posted by RedTrinity (Post 2025654)
I suppose there is no way to have this mod show the member's forum username, instead of their real name from FB?

Unfortunately not.

TimberFloorAu 04-23-2010 12:45 AM

Code as follows mate:

<vb:if ........>

<--facebook code-->

</vb:if>

Uberguilds 04-23-2010 12:48 AM

Code:

<if condition="$forum[forumid] == 15 || $forum[forumid] == 12 || $forum[forumid] == 13 || $forum[forumid] == 14">
<iframe></iframe>

</if>


PixelFx 04-23-2010 01:06 AM

I had the error for setup .. found putting www.domain.com/forum/ .. in websitehere link above fixed the error for me. Tried both ad version and postbit version.

anyway awesome mod thanks for the work getting this out so fast.

wacnstac 04-23-2010 01:54 AM

So I got this working with 3.8.X and and able to click the like button and the numeric value goes up, but nothing every gets posted to my fb wall. What gives?

ericgtr 04-23-2010 01:56 AM

Quote:

Originally Posted by wacnstac (Post 2025711)
So I got this working with 3.8.X and and able to click the like button and the numeric value goes up, but nothing every gets posted to my fb wall. What gives?

Sorry, as stated I cannot test on 3.8 because I no longer have that version, chances are the URL is not correct though, to double check view the source of your page to see the output URL.

ericgtr 04-23-2010 01:57 AM

Quote:

Originally Posted by ericgtr (Post 2025712)
Sorry, as stated I cannot test on 3.8 because I no longer have that version, chances are the URL is not correct though, to double check view the source of your page to see the output URL.

For those who have asked about adding this to user profiles please see this mod https://vborg.vbsupport.ru/showthread.php?t=239424 which adds both the "Like" button and a comments box.

worried 04-23-2010 04:07 AM

Thank you TimberFloorAu and Uberguilds for posting your code. Unfortunately, I couldn't get either to work. I can get the mod to work by itself except everytime I try to exclude forums it doesn't work. I've tried all different ways:


Code:

<!-- Facebook Like -->
<vb:if condition="(THIS_SCRIPT == showthread) && ($post[postcount] == '1') && (in_array($forum[forumid],array(2,3,8,9,13)))">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
<!-- / Facebook Like -->


Code:

<!-- Facebook Like -->
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
</vb:if>
<!-- / Facebook Like -->

I bet I'm doing something simple that's wrong. I just don't see it.

kall 04-23-2010 04:20 AM

Quote:

Originally Posted by Uberguilds (Post 2025631)
Postbit_Legacy:

With VBSEO
Code:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://(domain)$_SERVER[VBSEO_URI]?p=$post[postid]&amp;layout=button_count&amp;show_faces=true&amp;width=&amp;action=like&amp;colorscheme=light"
 scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe>




Without VBSEO
Code:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://(domain)/showthread.php$session[sessionurl]?p=$post[postid]&amp;layout=button_count&amp;show_faces=true&amp;width=&amp;action=like&amp;colorscheme=light"
 scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe>


This is a 4.0 mod. The bit in bold and big kind of jumps out as being totally incorrect..

ericgtr 04-23-2010 04:27 AM

Quote:

Originally Posted by worried (Post 2025740)
Thank you TimberFloorAu and Uberguilds for posting your code. Unfortunately, I couldn't get either to work. I can get the mod to work by itself except everytime I try to exclude forums it doesn't work. I've tried all different ways:


Code:

<!-- Facebook Like -->
<vb:if condition="(THIS_SCRIPT == showthread) && ($post[postcount] == '1') && (in_array($forum[forumid],array(2,3,8,9,13)))">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
<!-- / Facebook Like -->


Code:

<!-- Facebook Like -->
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
</vb:if>
<!-- / Facebook Like -->

I bet I'm doing something simple that's wrong. I just don't see it.

I bet they have to be combined, I don't have time to look at it tonight but I'll play with it some tomorrow.

Da-Vinci 04-23-2010 04:46 AM

Quote:

Originally Posted by TimberFloorAu (Post 2025628)
No he forgot closing bracket ">"

Ah now I see it, give me a slap, I'll keep my mouth shut next time lol.

Thanks TimberFloorAu and everybody who has tweaked this, not forgetting EricGTR, I really like this mod and think overall, it's far better than Facebook Connect, I just hope Facebook don't decide to discontinue this like they the did with Facebook Connect.

worried 04-23-2010 04:51 AM

There is supposed to be a bug in 4.0.0 - 4.0.2 in which ads won't diplay at all if you set them for certain forums: http://www.vbulletin.com/forum/proje...d=34416&page=2

It's supposed to be fixed in 4.0.3 which I'm using yet I can't get it to work.

hubie 04-23-2010 05:16 AM

Here's an adaptation I made for 3.8.x: https://vborg.vbsupport.ru/showthread.php?t=241053

Cheers.

hiker 04-23-2010 05:17 AM

I just changed to option 2. Much better. Option 1 was wrapping my text strange, leaving big gaps.

reimic 04-23-2010 05:28 AM

How is the code for the CMS?

TimberFloorAu 04-23-2010 06:22 AM

Option 2 to hide specific forums.

Code:

<!-- Facebook Like -->
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
</vb:if>
<!-- / Facebook Like -->

Dont forget if your forum is in folder [forum] change the above code to:

Code:

<!-- Facebook Like -->
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
</vb:if>
<!-- / Facebook Like -->

The code
Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
This displays this MOD in these forum ID's

The code
Code:

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

To show in only ONE forum:
Replace
Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
use this
Code:

<vb:if condition="$forum[forumid] == x">Show this if forum id is x</vb:if>
Change x to the forum id of the forum you want this mod to display in.

AURFSCAN 04-23-2010 07:10 AM

Quote:

Originally Posted by TimberFloorAu (Post 2025789)
Option 2 to hide specific forums.

Code:

<!-- Facebook Like -->
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
</vb:if>
<!-- / Facebook Like -->

Dont forget if your forum is in folder [forum] change the above code to:

Code:

<!-- Facebook Like -->
<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.yourDomain.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>
</vb:if>
</vb:if>
<!-- / Facebook Like -->

The code
Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">

This displays this MOD in these forum ID's

The code
Code:

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

To show in only ONE forum:
Replace
Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
use this
Code:

<vb:if condition="$forum[forumid] == x">Show this if forum id is x</vb:if>
Change x to the forum id of the forum you want this mod to display in.


confusing..the display and hide are both the same?


how do you combine these conditions?

show in forum
Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
with
Code:

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

thx

TimberFloorAu 04-23-2010 08:11 AM

Quote:

Originally Posted by AURFSCAN (Post 2025802)
confusing..the display and hide are both the same?


how do you combine these conditions?

show in forum
Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
with
Code:

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

thx

Quite easily.

Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<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></vb:if>


Bellinis 04-23-2010 08:50 AM

One thing I don't understand yet: will this button also show up for users not using facebook/facebook connect?
For people not using FB, this like-button has no use, has it?

Ranger375 04-23-2010 11:37 AM

Is there a way to use option 2, but have it so that it doesnt show the names of the people who like the post?

worried 04-23-2010 11:42 AM

Quote:

Originally Posted by TimberFloorAu (Post 2025818)
Quite easily.

Code:

<vb:if condition="in_array($forum['forumid'],array(2,3,8,9,13))">
<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></vb:if>


TimberFloorAu, could you do me a favor and test your script on your forum. It's not working for me.

ericgtr 04-23-2010 01:18 PM

Quote:

Originally Posted by Bellinis (Post 2025826)
One thing I don't understand yet: will this button also show up for users not using facebook/facebook connect?
For people not using FB, this like-button has no use, has it?

Correct, but with 400 million people using FB most who visit forums will probably already have it.

Lizard King 04-23-2010 02:16 PM

vBSEO owners can use the following fix http://www.vbseo.com/f2/facebook-lik...95/#post265997 to get this mode compatible with vBSEO

War.Frog 04-23-2010 02:25 PM

I'm not really concerned with the private forums - when I create a Like link in one of those, it just says I like my domain (XXX likes www.domain.com). Not an overly bad thing IMO!

ericgtr 04-23-2010 02:30 PM

Quote:

Originally Posted by Lizard King (Post 2025986)
vBSEO owners can use the following fix http://www.vbseo.com/f2/facebook-lik...95/#post265997 to get this mode compatible with vBSEO

Thanks! Updated the first post with this.

dirtycrow 04-23-2010 02:31 PM

OK, so i don't have VBseo installed, i've tried with both "basic Friendly URLs" and "advanced Friendly URLs" in my Server Settings and Optimization Options panel in the admin cp and on my facebook wall it displayed "likes (the forum name)" as opposed to "like (thread title) on (forum name).

is this how its supposed to work? it there something i'm missing to get the title of the thread to display? please advise.

dirtycrow 04-23-2010 02:33 PM

i run a private forum, is that why my thread title are not being shown? my forum is set up so you have to have an account before you see any content.

ericgtr 04-23-2010 02:54 PM

Quote:

Originally Posted by dirtycrow (Post 2025996)
OK, so i don't have VBseo installed, i've tried with both "basic Friendly URLs" and "advanced Friendly URLs" in my Server Settings and Optimization Options panel in the admin cp and on my facebook wall it displayed "likes (the forum name)" as opposed to "like (thread title) on (forum name).

is this how its supposed to work? it there something i'm missing to get the title of the thread to display? please advise.

To be clear, this modification is setup to work with out of the box VB without VBSEO, that takes a separate plugin to work. As for it now showing the titles properly I would make sure that you don't have any other SEO mods/plugins running.

ericgtr 04-23-2010 02:56 PM

Quote:

Originally Posted by dirtycrow (Post 2025997)
i run a private forum, is that why my thread title are not being shown? my forum is set up so you have to have an account before you see any content.

That will do it, remember that FB has to be able to read the thread as a guest in order to display its title.

dirtycrow 04-23-2010 03:01 PM

Quote:

Originally Posted by ericgtr (Post 2026009)
That will do it, remember that FB has to be able to read the thread as a guest in order to display its title.

damn. no work around huh?

NFLfbJunkie 04-23-2010 03:05 PM

I inserted the code so that the FB Like will only show in certain forums, but it continues to show in all forums. I have seen this code in two different ways in this thread. Is either one correct.

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

<vb:if condition="in_array($forum['forumid'],array(2,14))">

This is what I have and it doesn't just show these two forums:

PHP Code:

<vb:if condition="in_array($forum['forumid'], array(2,14))">
<
vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
<!-- 
Facebook Like -->
<
iframe src="http://www.facebook.com/plugins/like.php?href=http://www.mydomain.com/forums/{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> 


hiker 04-23-2010 05:27 PM

Quote:

Originally Posted by Bellinis (Post 2025826)
One thing I don't understand yet: will this button also show up for users not using facebook/facebook connect?
For people not using FB, this like-button has no use, has it?

Maybe my screenshots will help. If you're not logged into facebook, you'll see this:

http://www.bogley.com/forum/attachme...1&d=1272003191

And when you are logged into facebook, you'll see this:

http://www.bogley.com/forum/attachme...1&d=1272003174

Obviously, the above examples are using Option 2.

Option 1 would look like this, and I didn't like the way it was wrapping the text.

http://www.bogley.com/forum/attachme...1&d=1272003056

And here's option 2 on the same thread:

http://www.bogley.com/forum/attachme...1&d=1272003108

Mutt 04-23-2010 05:27 PM

Quote:

Originally Posted by Ranger375 (Post 2025899)
Is there a way to use option 2, but have it so that it doesnt show the names of the people who like the post?


change
Code:

show_faces=true
to
Code:

show_faces=false

worried 04-23-2010 08:54 PM

Marked as unistalled. Although there seems to be no danger, it serves no purpose in a inaccessible forum.
EDIT: Installed. Having the code to specify forums changed my mind

dirtycrow 04-23-2010 09:02 PM

Quote:

Originally Posted by dirtycrow (Post 2026011)
damn. no work around huh?

why doesn't it pull from the URL in private forums? the url's are supposed to be SEO friendly after all.

ericgtr 04-23-2010 09:03 PM

Quote:

Originally Posted by dirtycrow (Post 2026187)
why doesn't it pull from the URL in private forums? the url's are supposed to be SEO friendly after all.

Because FB cannot access the URL as a guest. Try to think of FB as a guest on your site, if a guest cannot access a forum it cannot see the title.

AURFSCAN 04-23-2010 09:13 PM

ONLY DISPLAY IN CERTAIN FORUMS

29 and 133 being the forum ids you want this to show in.. more forums would be 29,44,123,49 etc


its not $forum[forumid] its $thread[forumid] :)




Code:



<vb:if condition="in_array($thread['forumid'],array(29,133))">
<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=false&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:30px"></iframe>
<!-- / Facebook Like -->
</vb:if>
</vb:if>



All times are GMT. The time now is 07:17 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.01578 seconds
  • Memory Usage 1,880KB
  • 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
  • (30)bbcode_code_printable
  • (1)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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