try this

function isEven($x){if($x%2==0){return true;}else{return false;}}
$oddeven=1;

print "<tr class=\"";
if(isEven($oddeven){
print "even";}else{print "odd";})$oddeven++
print "\"><td>";





R.A.Smith
Manager/Technical Lead
Exterbox - "Thinking outside of the box"
http://www.exterbox.com
rohan@exterbox.com
1-876-449-7506



On Sat, Jun 12, 2010 at 10:06 AM, Neil Coghlan <neil@esl-lounge.com> wrote:
I have a custom block showing the users whose content has attracted most pageviews.
 
part of my code is this:
 
print "<tr class=\"";
print $zebra;
print "\"><td>";
 
this is a drupal 6 installation and I don't seem to be able to get the odd/even classes I'm looking for. If I put print "odd", they all come out grey, "even" and they all come out white, so I know the syntax of the code is fine...I just can't get the zebra variable working.
 
any tips what I'm failing to do??
 
Neil

--
[ Drupal support list | http://lists.drupal.org/ ]