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)

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


All times are GMT. The time now is 09:27 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.01560 seconds
  • Memory Usage 1,773KB
  • 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
  • (20)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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