![]() |
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? |
HTML Code:
<if condition="$FIRSTPOSTID == $post['postid']"> |
I must be screwing somethin up. Here's the part of the postbit template in question:
Code:
<if condition="$show['messageicon'] OR $post['title']"> |
HTML Code:
<if condition="$show['messageicon'] OR $post['title']"> |
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.
|
Lee, shouldn't that actually be this?
HTML Code:
<if condition="$post['postid'] == $FIRSTPOSTID"> |
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']"> |
Thanks Boofo, that's got it!
Quote:
|
Quote:
Just curious. What are you doing with this? |
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. :D
|
Awesome! Thanks for this request Sandman! I've been looking for something like this myself! Let me see if this works now. ^_^
EDIT: Whee! Works perfectly! |
Quote:
|
Quote:
|
Quote:
|
Quote:
Do I get some special prize over to the Admin Zone now? ;) |
Quote:
|
Quote:
I kept it in in case I want to add a title to a message somewhere in the thread for whatever reason. I like having the option in case I would ever need it. Maybe like a contest to see who can find where I posted what. ;) |
Quote:
|
Quote:
|
Quote:
|
Quote:
I'll check out my perks. Thank you, sir. ;) |
I tried to add that code to my editpost template, but it does not work. I still see the Title field in all the posts.
Code:
<!-- subject field --> |
The conditional needs to be in the postbit and postbit_legacy templates.
Quote:
|
Sandman is right because $thread['firstpostid'] isn't defined in the editpost.php, only in the functions_showthread.php.
|
I'm confused. What exactly do I have to do then to make it so the Title field only shows up when Editing the first post?
I assumed the editpost template needed to be modified only. |
OK - I figured out how to modify the editpost template to remove the title field and message icon box when editing posts which are replies (not first posts). To do this simply use the conditional:
Code:
<if condition="$show['firstpostnote']"> Code:
Code:
|
Thank you Sandman! Now it works perfect. :)
|
Works like a charm fellas! Thanks. Exactly what I needed. I noticed that a "Preview" still has the Subject field in it tho... not a big deal... just thought I'd mention it.
|
All times are GMT. The time now is 11:16 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|