zefiux Posted February 10, 2012 Share Posted February 10, 2012 I'm using ezRPG engine... And well every player has it owns race.. "Fire Clan" or "Ice Clan" Problem is I don't know how to make "Fire Clan" able to see only "Ice Clan" ... here is code of attack screen {include file="header.tpl" TITLE="Attacking"} <p> Click on an opponent to attack them! </p> <table width="90%"> <tr> <th style="text-align: left;">Name</th> <th style="text-align: left;">Level</th> </tr> {foreach from=$weaker item=weaker} <tr> <td><a href="index.php?mod=Attack&act=go&id={$weaker->id}">{$weaker->username}</a></td> <td>{$weaker->level}</td> </tr> {/foreach} </table> {include file="footer.tpl"} I think I've to do something with {foreach from=$weaker item=weaker} <tr> <td><a href="index.php?mod=Attack&act=go&id={$weaker->id}">{$weaker->username}</a></td> <td>{$weaker->level}</td> </tr> {/foreach} I've tryed using {if} function, but failed, might be just me noob :/ {if $player->race == 'Fire Clan'} *Ice Clan list* {else} {if $player->race == 'Ice Clan'} *Fire Clan List* {else} {/if} {/if} Quote Link to comment Share on other sites More sharing options...
zefiux Posted February 11, 2012 Author Share Posted February 11, 2012 Any1 knows? Or atleast know site for good tuts? ,_, Quote Link to comment Share on other sites More sharing options...
Uridium Posted February 11, 2012 Share Posted February 11, 2012 Why are you trying to perform logic in the template? Do your logic in code where it belongs; pass the resulting data onto the template. Octarine some times you sound like a robot lol try using plain english ;) Some members and cant relate to what your telling them :) Quote Link to comment Share on other sites More sharing options...
Dominion Posted February 11, 2012 Share Posted February 11, 2012 Number #1 - http://www.smarty.net/best_practices Quote Link to comment Share on other sites More sharing options...
Spudinski Posted February 11, 2012 Share Posted February 11, 2012 Octarine some times you sound like a robot lol try using plain english ;) Some members and cant relate to what your telling them :) It's plain English. :confused: Though, in translation it sounds very posh. Actually, very proper usage of the language. Quote Link to comment Share on other sites More sharing options...
Nickson Posted February 11, 2012 Share Posted February 11, 2012 You can only congratulate someone for using the language properly, some around here could take an example of it. At least it's understandable and readable. Now back on topic :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.