The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi,
As the title says, I want to show something in the first post in a page (showthread) but not in the consecutive posts. Is there anyways I can detect this from within a template? I hope I am asking in the right place. Regards, Karan |
#2
|
||||
|
||||
![]() HTML Code:
<if condition="$post['postid']==$thread['firstpostid']"> Stuff for first post only here </if> |
#3
|
|||
|
|||
![]()
Ah thanks for the reply
![]() ![]() Sweet! Works like a charm. Thanks sir. |
#4
|
|||
|
|||
![]() Quote:
This code is perfect for detecting if the current post is the first post even in a thread. What I was wanting to achieve is to detected (yes/no) if the current post is the first post of a thread in that page. I am sure the answer is simple, but i am not sure of where to look. Looking forward to reply. Karan |
#5
|
||||
|
||||
![]()
That is more complicated. You basically need to get the variable for the postnumber (I'll call it $postnum) and the number of posts allowed on a page (there is a default, but don't forget the user can override that - I'll call this $pageposts) and then divide one by the other and if the remainder is 1 then it is the first post.
Say it is post 3, the user allows 15 posts to a page, so 3 / 15 is 0 with a remainder of 3 - so not the first post. Say it is post 46 and the user allows 15 posts to a page, so 46/15 is 3 with a remainder of 1, so it is the first post. This was actually all outlined in another thread and they may have actually come up with the code, but I don't have time to search for it. It's in the Community Discussions. Maybe search for "remainder" or something similar. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|