Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2010, 05:06 PM
skor skor is offline
 
Join Date: Jan 2010
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Conditional for after first post of a thread

I am trying to put some text only after the first post in a thread for a specific forum . I've tried...

<if condition="$forum['forumid'] == 24 AND !$GLOBALS['FIRSTPOSTID']">text here</if>

the only issue I am having is that it's appearing after the first post on every page for a thread that has multiple pages.

is there a conditional that would include it only after the first post of the whole thread so that it wouldn't show on the 2nd page?

thank you
Reply With Quote
  #2  
Old 12-10-2010, 05:08 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about including page number as part of the condition?
Reply With Quote
  #3  
Old 12-10-2010, 05:17 PM
skor skor is offline
 
Join Date: Jan 2010
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi thank you for the reply.

I tried...

<if condition="$forum['forumid'] == 24 AND !$GLOBALS['FIRSTPOSTID'] AND $pagenumber == 1"> but that didn't seem to work. Nothing showed up on any of the pages.

wasn't sure if it's because I am not allowed to use multiple AND's?
Reply With Quote
  #4  
Old 12-10-2010, 05:30 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just looked at that because someone asked something similar a couple days ago. If you are putting your "if" condition in a postbit template, I don't think the page number is available, but you could use a plugin to make it available if you wanted.
Reply With Quote
  #5  
Old 12-10-2010, 05:36 PM
skor skor is offline
 
Join Date: Jan 2010
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found this

https://vborg.vbsupport.ru/showthread.php?t=208945&highlight=$pagenumber

but does anyone know if that solution would cause any sort of additional db queries?

Do you know which plugin that is?
Reply With Quote
  #6  
Old 12-10-2010, 05:38 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's the same kind of thing I was talking about except editing the file instead of a plugin.

No, it won't add any db queries.

ETA: postbit_display_complete should work - of course you'd have to add a separate "global" line instead of adding to the existing one.
Reply With Quote
  #7  
Old 12-10-2010, 05:55 PM
skor skor is offline
 
Join Date: Jan 2010
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post

ETA: postbit_display_complete should work - of course you'd have to add a separate "global" line instead of adding to the existing one.
Thank you. I'm kind of lost on what you mean by this?

Is postbit_display_complete a template? Couldn't find it in the templates or in the php files?

And would I add something like

global $pagenumber; to the top of this file?

Sorry for my igorance...pretty much know how to search for things but not much else...
Reply With Quote
  #8  
Old 12-10-2010, 05:57 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I'm sorry I assumed you would know what I meant.

postbit_display_complete is a hook location, so you could create a new plugin and select that hook location and for the code use "global $pagenumber;" (you need a title so you'll remember what it is, and you need to select the "Yes" radio button on the bottom to activate it, but the other fields don't matter).

You could also edit the class_post.php file like that post suggests if you want, but I think it's easier to manage upgrades if you avoid editing your php files.
Reply With Quote
  #9  
Old 12-10-2010, 05:58 PM
skor skor is offline
 
Join Date: Jan 2010
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much!
Reply With Quote
  #10  
Old 12-10-2010, 06:02 PM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you editing the postbit template? How about something like this at the end of the postbit template instead?
Code:
<if condition="$post[postcount] == 1">
	<div style="padding-top:5px">
		text here
	</div>
</if>
Reply With Quote
Reply

Thread Tools
Display Modes

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 09:36 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.02144 seconds
  • Memory Usage 2,237KB
  • 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
  • (1)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
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete