PDA

View Full Version : [SOLVED] help : if conditional - Syntax error when saveing template [SOLVED]


Vaupell
01-18-2010, 12:20 PM
Got a registered var, i get and want to check with if statment
to weither to show report link or not..

Howewer when trying to save this, i get unexspected , or unclosed tag..
so if the statment is 3 then no link is shown, how ewer any other value will show the link.


<vb:if condition="({vb:raw moderated}, 3)">
<vb:else />
<a class="botton" href="EIG.php?do=reportgallery&galid={vb:raw userid}"> Report offensive gallery(NEED PHRASE) </a>
</vb:if>



condition=({vb:raw moderated}, 3)> didnt save at all. ;)


EDIT + UPDATE :

after re-reading this article -> https://vborg.vbsupport.ru/showthread.php?t=231525&highlight=conditional

I then tryed another cconditional


<vb:if condition="{vb:raw moderated} == 3">
<vb:else />
<a class="botton" href="EIG.php?do=reportgallery&galid={vb:raw userid}"> Report offensive gallery </a>
</vb:if>


Which didnt work either.

luki
01-18-2010, 01:11 PM
<vb:if condition="{vb:raw moderated} != 3">
<a class="botton" href="EIG.php?do=reportgallery&galid={vb:raw userid}"> Report offensive gallery </a>
</vb:if>

Try this, if it won't work paste any error if you get one, and check if the variable is correctly registered by trying to display it (just put {vb:raw moderated} somewhere in the template and check the output).

Vaupell
01-18-2010, 01:15 PM
<vb:if condition="{vb:raw moderated} != 3">
<a class="botton" href="EIG.php?do=reportgallery&galid={vb:raw userid}"> Report offensive gallery </a>
</vb:if>

Try this, if it won't work paste any error if you get one, and check if the variable is correctly registered by trying to display it (just put {vb:raw moderated} somewhere in the template and check the output).

yes, but the condition is correct, aparently the syntax is bugged..

The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected '{' in C:\xampp\xampp\htdocs\emod\includes\adminfunctions _template.php(4667) : eval()'d code on line 26

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

using { inside the "" gives this error, howewer also tryed using ' ' instead of ""

the problem is not getting the data to the template, the problem is saveing the template.

Lynne
01-18-2010, 01:37 PM
You do not use the new syntax in conditions.
<vb:if condition="$moderated == 3">

Vaupell
01-18-2010, 01:44 PM
You do not use the new syntax in conditions.
<vb:if condition="$moderated == 3">


ohhh.. well :D tx it worked. :p