The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm trying to create a conditional plugin, and I've tried this code, but it keeps giving me errors when the template parses. Could someone please read over my newbish attempt at PHP and tell me what's wrong?
if ($date(d) < 8) { $nominate = $true; } else { if ($date(d) > 7) && ($date(d) < 22) { $voting = $true; } else { $winner = $true; } } I get this error: Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/mifbody/public_html/vbulletin/global.php(512) : eval()'d code on line 217 Also, when I try to pass this to my template... <if condition="$nomination == $true"> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="45%" align="center"> <tr> <td class="tcat">Nominate!</td> </tr> <tr> <td class="alt1">Nominate your favorite ride!</td> </tr> </table> <else /> <if condition="$vote == $true"> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="45%" align="center"> <tr> <td class="tcat">Vote for your Ride!</td> </tr> <tr> <td class="alt1">Vote for your favorite ride!</td> </tr> </table> <else /> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="45%" align="center"> <tr> <td class="tcat">And the Winner Is!</td> </tr> <tr> <td class="alt1">A winner has been picked!</td> </tr> </table> </if> </if> it doesn't do the conditional, it just automatically shows the results if nominate == $true, since my plugin wasn't working and giving the boolean error I switched it to just say "$vote == $true;" and it still shows nominate results. |
#2
|
|||
|
|||
![]()
You don't need the $ infront of true. It should just be:
PHP Code:
Alan. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|