Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2013, 08:00 AM
ROTPAR ROTPAR is offline
 
Join Date: May 2004
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Facebook like button in first post

Hi, I would like to put the facebook like button on top of the first posting, so beneath the title or at the end of the first post instead of having it on top of the whole thread. How can I do that?
Reply With Quote
  #2  
Old 03-02-2013, 09:15 PM
ROTPAR ROTPAR is offline
 
Join Date: May 2004
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nobody?
Reply With Quote
  #3  
Old 03-05-2013, 09:41 PM
ROTPAR ROTPAR is offline
 
Join Date: May 2004
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, last try....can nobody hlep me out with this?
Reply With Quote
  #4  
Old 03-06-2013, 12:42 AM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi ROTPAR - looks like a template edit to me. In SHOWTHREAD, find:

Code:
		<vb:if condition="$show['fb_likebutton']">
			{vb:raw fblikebutton}
		</vb:if>
And put it in postbit. You'll probably need a conditional for post # in thread == 1, otherwise it'll show in/under every post
Reply With Quote
  #5  
Old 03-06-2013, 09:10 AM
ROTPAR ROTPAR is offline
 
Join Date: May 2004
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi there, thank you What do you mean with the condition? What do I have to write? Thanks a lot
Reply With Quote
  #6  
Old 03-06-2013, 10:49 AM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, this may sort of be like the blind leading the blind, but let me give it a shot

Try this in postbit_legacy and let me know how it works:

Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1">

<vb:if condition="$show['fb_likebutton']">
			{vb:raw fblikebutton}
		</vb:if>

</vb:if>
Within postbit_legacy, just search around for a good spot (like maybe after the infractions link?) Or maybe after this part:

Code:
				<vb:if condition="$post['title'] OR $show['messageicon']">
				<h2 class="title icon">
					<vb:if condition="$show['messageicon']"><img src="{vb:raw post.iconpath}" alt="{vb:raw post.icontitle}" /> </vb:if>{vb:raw post.title}
				</h2>
				</vb:if>
By the way, there is another conditional called <vb:if condition="$post['isfirstshown']">, but I think that's going to repeat for each page, so try the first one and let me know if that works okay
Reply With Quote
  #7  
Old 03-07-2013, 01:40 PM
ROTPAR ROTPAR is offline
 
Join Date: May 2004
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
<if condition="$post[postcount] % $vboptions[maxposts] == 1">

<vb:if condition="$show['fb_likebutton']">
{vb:raw fblikebutton}
</vb:if>

</vb:if>
THX After placing this code in postbit_legacy vbulletin tells me that the code is not ok... can'T translate it. Any ideas?
Reply With Quote
  #8  
Old 03-07-2013, 01:53 PM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, can you try this instead:

Code:
<vb:if condition="$post['isfirstshown']">

<vb:if condition="$show['fb_likebutton']">
{vb:raw fblikebutton}
</vb:if>

</vb:if>
This will show on the first post of each page, but I'm sure we can figure out a way to ensure only page 1 I just want to make sure it's the conditional breaking, not anything else. So let me know if that works!

If it doesn't, we may need to register fblikebutton to postbit_legacy, in which case you're going to want the help of someone who understands hooks
Reply With Quote
  #9  
Old 03-07-2013, 02:16 PM
ROTPAR ROTPAR is offline
 
Join Date: May 2004
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To get it on the first port, I tried this:
http://www.vbulletin.com/forum/forum...b-like-button?

but placing the likebutton code in there, shows just nothing

--------------- Added [DATE]1362670983[/DATE] at [TIME]1362670983[/TIME] ---------------

the problem seems to be this code:

<vb:if condition="$show['fb_likebutton']">
{vb:raw fblikebutton}
</vb:if>

This code does not work in postbit_legacy....how could I get it to work there?
Reply With Quote
  #10  
Old 03-07-2013, 03:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unless you write a plugin to register the variable $fblikebutton to the template postbit_legacy, it isn't going to spit anything out.

Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
Reply With Quote
Благодарность от:
findingpeace
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 01:48 AM.


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.04307 seconds
  • Memory Usage 2,257KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete