The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
IF Condion in postbit template
I want to use a IF condition in postbit template like this
Code:
<if condition="$post['posts']>20"> SHOW SIGNATURE </if> any solution you guys can suggest? |
#2
|
|||
|
|||
You may need to add a line of code in the hook to do like $post[int_posts] = intval(str_replace(",","",$post[posts])). Then do your conditional on int_posts. I'm not sure if the integer value exists or not already in the $post array. I didn't read the code. If it does, you don't need a hook, just ID the var index and use it.
|
#3
|
|||
|
|||
Can I edit something in showthread.php to accommodate this
I am not sure how hooks works |
#4
|
||||
|
||||
$post['postcount'] is the variable you want.
|
#5
|
|||
|
|||
|
#6
|
||||
|
||||
Isn't $post[postcount] the post number in the thread? ie. this is post #6, thus $post[postcount] = 6
|
#7
|
|||
|
|||
Yes Postcount Does not work,its serial number of post in the thread
any idea how I can get User no of posts in thread page in integer without commas formatting. |
#8
|
||||
|
||||
Did you try the suggestion in post 2? I think that is how you will have to do it as the variable is not available for use (they write over it in class_postbit.php - $this->post['posts'] = vb_number_format($this->post['posts']); ).
|
#9
|
|||
|
|||
Try the code I suggested in post 2 on hook showthread_postbit_create.
That's the postbit loop. hook PHP Code:
HTML Code:
<if condition="$post[int_posts]>20"> SHOW SIGNATURE </if> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|