![]() |
Adding a counter for template conditionals
Hi,
I have a simple script that lists the users with the highest reputation. I want to add the avatars of the top three results. I figure the best way was to use a template conditional like <if condition="count > 3">no avatar</else>avatar</if>. So can I accomplish this in this script: PHP Code:
|
up.
|
You probably need to grab more than the avatarvision in order to output the avatar.... unless you have the avatars in the file system - do you? Where are you wanting to put this condition?
Template: HTML Code:
<if condition="$count > 3"> PHP Code:
|
Revisting an old thread here, and I will try and reword it better as my needs have changed slightly.
Basically I have some code outputs a list of users based on the column 'credits' in the 'user' table, ie: PHP Code:
1. exampleuserA 2. exampleuserB 3. exampleuserC So I can add some sort of variable to my template like $user[count]. I want to be able to user conditionals like <if condition="$user[count] == 1 <span class="bigusername">exampleuserA</span></if> I hope it makes more sense now. PHP Code:
|
I'm not sure of exactly what you want, but maybe this is kinda it:
PHP Code:
|
lynne it works perfectly, ty so much once again. if IB isnt paying you they should be and if they are you deserve a raise!
|
Hi lynne,
revisting this thread once again. I have a different script but I ma trying to accomplish the same thing. What am I doing wrong here: Code:
<?php |
Bump. anybody help a brother out here?
|
Another bump.
Someone has to know how I can do this, it seems so simple on the surface. I cant figure out why it works in the first script I posted but in the 2nd very similar script it doesnt. Can someone please have a look for me? |
Well, for one thing the second script is for vB 4.0 (but maybe you know that?).
It might help if you said more about what it's doing and what's going wrong. |
All times are GMT. The time now is 05:08 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|