The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need help with, if condition
Hello,
In the postbit template. I need to show code at the end of every user post but only once per page of thread. Its like "show an user's signature only once per page hack" How to do that ? Thank you |
#2
|
|||
|
|||
This is going to take a little more than a simple if conditional; you'll need to create some cache array that stores whether or not a specific user has displayed a signature already.
|
#3
|
|||
|
|||
Oh, i do not know how to do that.
Any one can help with this ? Thank you |
#4
|
||||
|
||||
Quote:
https://vborg.vbsupport.ru/showthread.php?t=139689 It's just template conditionals and manages to show the sig only once per page??? I read the code but can't figure it out- it doesn't even look like it should work. |
#5
|
|||
|
|||
Explanation:
I install a hack, "show user last 5 threads above his signature". If user has more than post on the same thread, Show only one time his last 5 threads above his signature. Like this: <if condition=" THIS IS THE FIRST USER REPLY ON THE THREAD show user last 5 threads above his signature <if condition=" THIS IS THE The second, third, or fourth REPLY ON THE THREAD DO NOT show user last 5 threads above his signature I hope that is Clare |
#6
|
|||
|
|||
Good find by BirdOfPrey, I wouldn't have thought to do that but it works because an assignment has a value and can be put in a conditional, so you can create an array like Danny mentioned without needing a plugin.
Modifying the mod that BirdOfPrey found, I think something like this should work: Code:
<if condition="!$vboptions['shownlinks'][$post[userid]] AND $vboptions['shownlinks'][$post[userid]] = true"> // Show user's links </if> |
#7
|
||||
|
||||
kh99 - could you walk be through the logic of this- I just don't get it
$post[userid] is just a number, right? so it's like !$vboptions['shownlinks'][999] AND $vboptions['shownlinks'][999] = true Maybe I'm not getting how $vboptions['shownlinks'] works? |
#8
|
|||
|
|||
Quote:
WOW, Thats work greatttttttttttttttt But only one thing now If the user did not have any threads its show empty links box. Is there any way to hide the box when user did not have any threads ? Like this: <if condition="USER DID NOT HAVE ANY THREADS" DO NOT SHOW ANYTHING </if> I really very appreciate your patience and cooperation. Many many many Thanks |
#9
|
|||
|
|||
What code are you using to show the links?
|
#10
|
|||
|
|||
Helo,
I use this code PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|