PDA

View Full Version : Conditionals for even and odd postcount numbers !!!


valdet
11-22-2007, 03:59 PM
Hello everyone,

While I am not sure that something like this exists for vBulletin conditionals, I thought of asking if someone knows a way how to implement odd and even numbers within a <if> conditional for postcounts.

Please look at this post for more info.
https://vborg.vbsupport.ru/showpost.php?p=1387499&postcount=19

I know from maths :), that odd numbers in general are represented by (2x+1) while even numbers are presented with (2x), with x being a full number greater or equal to zero.

Thanks you for your time.

Regards,
Val.

Analogpoint
11-22-2007, 04:59 PM
<if condition="$post['postcount'] % 2">
odd
<else />
even
</if>