Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2004, 12:07 PM
the Sandman's Avatar
the Sandman the Sandman is offline
 
Join Date: Aug 2003
Location: Tampa, FL
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default First Post Conditional

I need a conditional that will allow me to differentiate first posts from the rest of the posts in a Thread.

I've removed the Title field from the newreply template so members replying to a Thread cannot add a title. So, only the frst post in the Thread has a title. Now, I'd like to remove the Thread icon and the line that goes beneath the Thread icon and title on any post after the first post.

Zachery posted (at vBulletin.com) that "$post[count] is the varible - it numbers each post in the thread". But I've been unable to construct a proper conditional - no matter what I've tried either all the posts have the Thread icon and title area or none do. How can I accomplish what I want?
Reply With Quote
  #2  
Old 05-05-2004, 12:18 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<if condition="$FIRSTPOSTID == $post['postid']">
    <!-- this is the first post -->
<else />
    <!-- this is the second, third etc post -->
</if>
Reply With Quote
  #3  
Old 05-05-2004, 12:48 PM
the Sandman's Avatar
the Sandman the Sandman is offline
 
Join Date: Aug 2003
Location: Tampa, FL
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I must be screwing somethin up. Here's the part of the postbit template in question:
Code:
			   <if condition="$show['messageicon'] OR $post['title']">
						<!-- icon and title -->
						<div class="smallfont">
								 <if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
								 <if condition="$post['title']"><strong>$post[title]</strong></if>
						</div>
						<hr size="1" color="$stylevar[tborder_bgcolor]" />
						<!-- / icon and title -->
		  </if>
Where would you add the conditional statements to show the usual message icon and title for the first post and only a linebreak in that area for any other posts? I tried a couple of ways and each time was unable to get the first post correct.
Reply With Quote
  #4  
Old 05-05-2004, 01:12 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<if condition="$show['messageicon'] OR $post['title']">
	<!-- icon and title -->
	<if condition="$FIRSTPOSTID == $post['postid']">
	<div class="smallfont">
			 <if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
			 <if condition="$post['title']"><strong>$post[title]</strong></if>
	</div>
	</if>
	<hr size="1" color="$stylevar[tborder_bgcolor]" />
	<!-- / icon and title -->
</if>
Reply With Quote
  #5  
Old 05-05-2004, 01:22 PM
the Sandman's Avatar
the Sandman the Sandman is offline
 
Join Date: Aug 2003
Location: Tampa, FL
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for taking time and helping me with this... but the first post is still not shown differently from the others. In other words, the message icon and title are not displayed in any posts including the first post.
Reply With Quote
  #6  
Old 05-05-2004, 01:26 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lee, shouldn't that actually be this?

HTML Code:
<if condition="$post['postid'] == $FIRSTPOSTID">
Reply With Quote
  #7  
Old 05-05-2004, 02:27 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I found the solution to your problem. This is what you need to use to find the first post in a thread:

HTML Code:
<if condition="$post['postid'] == $thread['firstpostid']">
Reply With Quote
  #8  
Old 05-05-2004, 03:03 PM
the Sandman's Avatar
the Sandman the Sandman is offline
 
Join Date: Aug 2003
Location: Tampa, FL
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Boofo, that's got it!
Quote:
Originally Posted by Boofo
Ok, I found the solution to your problem. This is what you need to use to find the first post in a thread:

HTML Code:
<if condition="$post['postid'] == $thread['firstpostid']">
Reply With Quote
  #9  
Old 05-05-2004, 05:14 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by the Sandman
Thanks Boofo, that's got it!
You're very welcome, sir.

Just curious. What are you doing with this?
Reply With Quote
  #10  
Old 05-05-2004, 05:21 PM
the Sandman's Avatar
the Sandman the Sandman is offline
 
Join Date: Aug 2003
Location: Tampa, FL
Posts: 229
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See This Thread at vBulletin.com. Basically, I have removed the Title field from the newreply box so that when replying to a thread users have no option to add a title to their post. Then, using the conditional you gave me, I've removed the message icon and title area of all posts after the first to clean up the postbit. Check it out in any Thread at the Admin Zone and let me know what you think.
Reply With Quote
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 11:05 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.07228 seconds
  • Memory Usage 2,261KB
  • Queries Executed 11 (?)
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
  • (5)bbcode_html
  • (2)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
  • (2)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_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