Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

LOL?...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Pycck
Smarty n00b


Joined: 24 Mar 2014
Posts: 4

PostPosted: Mon Mar 24, 2014 9:15 am    Post subject: LOL?... Reply with quote

Hello dear community,
I am currently working on my content management system, and suddenly get a strange error:

[/code]
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "templates/default/staff.tpl" on line 105 "<strong>Rank:</strong>&nbsp;{if $arr2.rank == 5}Moderator{/if}{elseif arr2.rank == 6}Community Manager{/if}{elseif $arr2.rank == 7}Manager{/if}<br />" - Unexpected ".", expected one of: "}" <-- thrown in /Applications/XAMPP/xamppfiles/htdocs/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 105[code]

[code]{foreach from=$array2 item=arr2}
{if $arr2.rank > 3}
<div class="employee-user">
<div class="half-avatar"><img style="margin-top:-20px;" src="{$arr2.look}" /></div>
<div class="employee-details">
<span class="employee-online"><img src="{if $user_online == 1}data/img/online.gif{else}data/img/offline.gif{/if}" /></span>
<span class="username">{$arr2.username}</span><br />
<strong>Motto:</strong>&nbsp;{if strlen($arr2.motto) > 0}{$arr2.motto}{else}No mission exists{/if}<br />
<strong>Rank:</strong>&nbsp;{if $arr2.rank == 5}Moderator{/if}{if arr2.rank == 6}Community Manager{/if}{if $arr2.rank == 7}Manager{/if}<br />
<strong>Story:</strong>&nbsp;{if strlen($arr2.story) > 0}{$arr2.story}{else}No story exists{/if}</div>
</div>
{/if} {/foreach}
[/code]

Here is the code for Array2:
[code] $result2 = mysql_query("SELECT * FROM users WHERE rank > 3") OR die(mysql_error());
$array2 = array();
while($row2 = mysql_fetch_assoc($result2))
{
$array2[] = $row2;
}
$Smarty->assign("array2", $array2);[/code]
Back to top
View user's profile Send private message Send e-mail
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon Mar 24, 2014 10:46 am    Post subject: Reply with quote

Code:
{if arr2.rank == 6}


should be

Code:
{if $arr2.rank == 6}
Back to top
View user's profile Send private message
Pycck
Smarty n00b


Joined: 24 Mar 2014
Posts: 4

PostPosted: Mon Mar 24, 2014 12:19 pm    Post subject: Reply with quote

U.Tews wrote:
Code:
{if arr2.rank == 6}


should be

Code:
{if $arr2.rank == 6}

Oh, lol!
Thanks, hehe.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP