The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Folks-
In a threadbit template, am trying to take three separate actions when a thread : is new, has been posted in by the user, or is locked. I have come up with the following conditionals: PHP Code:
Thanks! --don |
#2
|
|||
|
|||
![]()
I don't think there's a better way unless you want to use a plugin. You could use a plugin on hook location threadbit_process to set values in the $thread array to check in the template, then you wouldn't need to use in_array(). It would be cleaner in the template and may be worth doing just for that reason, but you'd just be moving the checks to the plugin, so I don't know that it's any more elegant.
|
#3
|
|||
|
|||
![]() Quote:
A big part of this undertaking is to see how far I can push template modification...so, absent a more elegant approach, I don't really want to shove the kudginess off into a plugin. |
#4
|
|||
|
|||
![]()
In the past, I was never fond of 'in_array' due to speed, but you have such little data that it really does not play into account. In PHP 5.4 they drastically improved 'in_array', so there goes my argument. In that case, code readability is king, (in my opinion), and yours is straight forward. @Kh99 has already covered the plugin option. So there you go...
I got nothing. ![]() (Back to my own coding mess, at work, this was suppose to be a distraction for a few minutes. ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|