Log in

View Full Version : Conditional list?


Gellpak
10-31-2005, 11:11 PM
Is there a list of conditionals that can be used in the templates?

I'm attempting to make the whole row of each thread with a new post have a different color than those which have no new posts. It's probably possible to do this with the $thread[statusicon] variable, but there are (looks like) 18 possible values of that, so it would get to be a headache. There has to be a variable already set that indicates whether the current thread has new posts...?

akanevsky
11-01-2005, 12:09 AM
No, there is no list of conditionals, just as there is no list of all the coding possibilities of any given language.
The list is only limited by your imagination and coding skills ;)

Gellpak
11-01-2005, 12:27 AM
No, there is no list of conditionals, just as there is no list of all the coding possibilities of any given language.
The list is only limited by your imagination and coding skills ;)

Fair enough, is there a preset variable that does what the above post describes? There must be, in order for vb to make the decisions it needs to on a post-to-post basis. These types of default existing variables were what I was referring to.

akanevsky
11-01-2005, 01:11 AM
I'd suggest using <if condition="$show['gotonewpost']"> for your particular case. :)

Gellpak
11-01-2005, 01:26 AM
I'd suggest using <if condition="$show['gotonewpost']"> for your particular case. :)

Hmm... didn't have any effect.

akanevsky
11-01-2005, 05:46 PM
This is just a tip. You need to figure out the rest of the HTML yourself...
Maybe:

...somehtmlcode...
<if condition="$show['gotonewpost']">
style="background-color:white;"
</if>
...morehtmlcode...

Gellpak
11-01-2005, 06:13 PM
Well that goes without saying... I put some sample code between those tags, just to see where it worked, and couldn't get it to ever show up, under various conditions.

<if condition="$show['gotonewpost']">NEW</if>

akanevsky
11-01-2005, 06:16 PM
Weird, it works on my board. What template are you trying to use that code in?

T3MEDIA
11-01-2005, 06:26 PM
Is there a list of conditionals that can be used in the templates?

I'm attempting to make the whole row of each thread with a new post have a different color than those which have no new posts. It's probably possible to do this with the $thread[statusicon] variable, but there are (looks like) 18 possible values of that, so it would get to be a headache. There has to be a variable already set that indicates whether the current thread has new posts...?I guess people dont get what you mean. I do. I asked about this ages ago but I am on ignore at the moment.

I was also curious if there was a way to pull information from a variable in templates.

Example. I want to have information on user 200

insted of $user[fieldx] I want $pull(200)[fieldx] so this phantom 'pull' command works as the user or userinfo string but can be used at anytime anywhere.

would solve a kazillion hacks that need extra information. say gender on a pager or ummm avatar of who sent you admeration the list could go on and on.


Im on 3.0.x but it would be nice to see someone have this for their system.

Gellpak
11-01-2005, 06:27 PM
threadbit... and what's weird is that there are several other places in the template where it shows up also, but doesn't seem to be doing anything either.

akanevsky
11-01-2005, 06:40 PM
I guess people dont get what you mean. I do. I asked about this ages ago but I am on ignore at the moment.

I was also curious if there was a way to pull information from a variable in templates.

Example. I want to have information on user 200

insted of $user[fieldx] I want $pull(200)[fieldx] so this phantom 'pull' command works as the user or userinfo string but can be used at anytime anywhere.

would solve a kazillion hacks that need extra information. say gender on a pager or ummm avatar of who sent you admeration the list could go on and on.


Im on 3.0.x but it would be nice to see someone have this for their system.

However, the conditionals are limited by the PHP syntax.

threadbit... and what's weird is that there are several other places in the template where it shows up also, but doesn't seem to be doing anything either.

That conditional is supposed to show the "go to new post" arrow when the thread is new.