Log in

View Full Version : Determining if $post[postid] is ODD template conditional help please...


ThePimp
02-19-2006, 06:19 PM
Ok, so here's what I'm trying to do...
I want to display a banner ad on every "Odd" numbered post via a plugin. Here's what I have so far:
PLUGIN:
Product: vBulletin
Hook Location: showthread_complete
Title: OddSig
Plugin PHP Code:
$number=$post[postid];
if( is_odd($number) )
{
$oddSig=1;
}
else
{
$oddSig=0;
}

function is_odd( $int )
{
return( $int & 1 );
}

Then I call the function in the postbit_legacy like so:
<if condition="$oddSig == '1'">
FOO
</if>

It doesn't seem to work however.
Can someone please help with this?

Thanks in advance.