|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Pycck Smarty n00b
Joined: 24 Mar 2014 Posts: 4
|
Posted: Mon Mar 24, 2014 9:15 am Post subject: LOL?... |
|
|
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> {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> {if strlen($arr2.motto) > 0}{$arr2.motto}{else}No mission exists{/if}<br />
<strong>Rank:</strong> {if $arr2.rank == 5}Moderator{/if}{if arr2.rank == 6}Community Manager{/if}{if $arr2.rank == 7}Manager{/if}<br />
<strong>Story:</strong> {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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Mar 24, 2014 10:46 am Post subject: |
|
|
Code: | {if arr2.rank == 6} |
should be
Code: | {if $arr2.rank == 6} |
|
|
Back to top |
|
Pycck Smarty n00b
Joined: 24 Mar 2014 Posts: 4
|
Posted: Mon Mar 24, 2014 12:19 pm Post subject: |
|
|
U.Tews wrote: | Code: | {if arr2.rank == 6} |
should be
Code: | {if $arr2.rank == 6} |
|
Oh, lol!
Thanks, hehe. |
|
Back to top |
|
|
|
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
|