Forum template, all-in-one
Forum template, all-in-one Posted by Alexander Shatalov Smarty {strip} {if $data.type=='categories'} <h1>{'Forum categories'|lang}</h1> <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="head"> <td class="a">{'Category'|lang}</td> <td width="5%">{'Threads'|lang}</td> <td width="5%" class="b">{'Posts'|lang}</td> </tr> {foreach from=$data.list key=i item=d} <tr class="row{if $i%2} odd{/if}"> <td class="a"> <a href="?forum&category={$d.id}" class="ajax_link">{$d.title}</a> {$d.descr} </td> <td{if !$d.threads} style="color:#777"{/if}> {$d.threads} </td> <td class="b"{if !$d.posts} style="color:#777"{/if}> {$d.posts} </td> </tr> {/foreach} </tbody> </table> {elseif $data.type=='threads'} {if $reply} <h1>{'Add new thread to %1'|lang:$cat.title}</h1> <a href="?forum" class="ajax_link">Home</a> :: {$cat.title} {if $User.UserID} <table cellspacing="0" cellpadding="0" class="form"> <tbody> <tr><td> <form method="post" action="?{$URL}" class="ajax_form center-area"> {include file='includes/form_errors.tpl'} <h3 class="x">{'New thread:'|lang}<span class="x">{'New thread:'|lang}</span></h3> <input class="textbox" name="title" onfocus="if(this.value=='{'_Thread title'|lang}'){ this.value='';this.style.color='#000'}" onblur="if (this.value=='') { this.value='{'_Thread title'|lang}';this.style.color='#888' }" style="{if !$smarty.post.title}color:#888;{/if}width:96%;margin:10px 1% 4px 1%;padding:5px 1%;-family:'Lucida Console'" value="{if $smarty.post.title}{$smarty.post.title|strform}{else}{'_Thread title'|lang}{/if}" /> <textarea class="textbox" name="message" onfocus="if(this.value=='{'_Thread message'|lang}'){ this.value='';this.style.color='#000'}" onblur="if (this.value=='') { this.value='{'_Thread message'|lang}';this.style.color='#888' }" style="{if !$smarty.post.message}color:#888;{/if}width:96%;margin:4px 1% 10px 1%;height:280px;padding:5px 1%;-family:'Lucida Console'">{if $smarty.post.message}{$smarty.post.message|strform}{else}{'_Thread message'|lang}{/if}</textarea> <button type="submit" class="x">{'Submit'|lang}<span class="x">{'Submit'|lang}</span></button> </form> </td></tr> </tbody> </table> {else} <a href="?user&login&jump=forum/category-{$cat.id}/reply" class="ajax_link">{'You need to login in order to start new thread in our forum'|lang}</a> {/if} <a href="?forum&category={$cat.id}" class="ajax_link"><< Cancel</a> {else} <h1>{$cat.title}</h1> <a href="?forum" class="ajax_link">Home</a> :: {$cat.title} <a href="?forum&category={$cat.id}&reply" style="float:right" class="ajax_link">{'Add new thread'|lang}</a> <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="head"> <td class="a">Threads</td> <td width="10%">Date</td> <td width="5%">Posts</td> </tr> {foreach from=$data.list key=i item=d} <tr class="row{if $i%2} odd{/if}"> <td class="a"> <a href="?forum&thread={$d.id}" class="ajax_link">{$d.title}</a> {($d.descr|strip_tags)|trunc:300:1:1} {if $smarty.const.IS_ADMIN} <a href="javascript:;" onclick="if(confirm('Are you sure to delete this thread?')) S.G.get('?forum&category={$cat.id}&thread={$d.id}&delete',0,1);">{'Delete this thread'|lang}</a> {/if} </td> <td>{'Date'|Call:'dayCountDown':$d.dated}</td> <td{if !$d.posts} style="color:#777"{/if}> {$d.posts} </td> </tr> {/foreach} </tbody> </table> <a href="?forum" class="ajax_link"><< {'Back to forum home'|lang}</a> <a href="?forum&category={$cat.id}&reply" style="float:right" class="ajax_link">{'Add new thread'|lang}</a> {/if} {elseif $data.type=='posts'} {if $reply} <h1>{'Reply to %1'|lang:$thread.title}</h1> <a href="?forum" class="ajax_link">Home</a> :: <a href="?forum&category={$cat.id}" class="ajax_link">{$cat.title}</a> :: <a href="?forum&category={$cat.id}&thread={$thread.id}" class="ajax_link">{$thread.title}</a> :: Reply <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="thread"> <td class="a" colspan="2"> {$thread.title} Posted {'Date'|Call:'dayCountDown':$thread.dated} by <b>{$thread.user}</b> {$thread.descr} </td> </tr> </tbody> </table> {if $User.UserID} <form method="post" action="?{$URL}" class="ajax_form center-area"> {include file='includes/form_errors.tpl'} <h3 class="x" style="text-align:left;margin-top:10px">{'Your reply:'|lang}<span class="x">{'Your reply:'|lang}</span></h3> <textarea class="textbox" name="message" onfocus="if(this.value=='{'_Message'|lang}'){ this.value='';this.style.color='#000'}" onblur="if (this.value=='') { this.value='{'_Message'|lang}';this.style.color='#888' }" style="{if !$smarty.post.message}color:#888;{/if}width:96%;margin:4px 1% 10px 1%;height:280px;padding:5px 1%;-family:'Lucida Console'">{if $smarty.post.message}{$smarty.post.message|strform}{else}{'_Message'|lang}{/if}</textarea> <button type="submit" class="x">{'Submit'|lang}<span class="x">{'Submit'|lang}</span></button> </form> {else} <a href="?user&login&jump=forum/category-{$cat.id}/thread-{$thread.id}/reply" class="ajax_link">{'You need to login in order to write on our forum'|lang}</a> {/if} <a href="?forum&category={$cat.id}&thread={$thread.id}" class="ajax_link"><< Cancel</a> {else} <h1>{$thread.title}</h1> {if $smarty.const.IS_ADMIN} <a href="javascript:;" onclick="if(confirm('Are you sure to delete this thread?')) S.G.get('?forum&category={$cat.id}&thread={$thread.id}&delete',0,1);">{'Delete this thread'|lang}</a> {/if} <a href="?forum" class="ajax_link">Home</a> :: <a href="?forum&category={$cat.id}" class="ajax_link">{$cat.title}</a> :: {$thread.title} <a href="?forum&category={$cat.id}&thread={$thread.id}&reply" style="float:right" class="ajax_link">Reply</a> <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="thread"> <td class="a" colspan="2"> {$thread.title} Posted {'Date'|Call:'dayCountDown':$thread.dated} by <b>{$thread.user}</b> {$thread.descr} </td> </tr> {foreach from=$data.list key=i item=d} <tr class="row{if $i%2} odd{/if}"> <td style="text-align:left;width:15%" class="post_author"> <b style="-size:13px">{$d.user}</b> <span style="-size:13px">{'Date'|Call:'dayCountDown':$d.added}</span> {if $smarty.const.IS_ADMIN} <a href="javascript:;" onclick="if(confirm('Are you sure to delete this post?')) S.G.get('?forum&category={$cat.id}&thread={$thread.id}&del={$d.id}',0,1);">{'Delete this post'|lang}</a> {/if} </td> <td style="text-align:left" class="post_descr"> {$d.descr} </td> </tr> {/foreach} </tbody> </table> <a href="?forum&category={$cat.id}" class="ajax_link"><< Back to {$cat.title}</a> <a href="?forum&category={$cat.id}&thread={$thread.id}&reply" style="float:right" class="ajax_link">Reply</a> {/if} {/if} {include file='content/pager.tpl' pager=$data.pager} {/strip} | |
Alexander Shatalov 15 november 2013 in 19:34 | HTML (4.0.1) {strip} {if $data.type=='categories'} <h1>{'Forum categories'|lang}</h1> <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="head"> <td class="a">{'Category'|lang}</td> <td width="5%">{'Threads'|lang}</td> <td width="5%" class="b">{'Posts'|lang}</td> </tr> {foreach from=$data.list key=i item=d} <tr class="row{if $i%2} odd{/if}"> <td class="a"> <a href="?forum&category={$d.id}" class="ajax_link">{$d.title}</a> {$d.descr} </td> <td{if !$d.threads} style="color:#777"{/if}> {$d.threads} </td> <td class="b"{if !$d.posts} style="color:#777"{/if}> {$d.posts} </td> </tr> {/foreach} </tbody> </table> {elseif $data.type=='threads'} {if $reply} <h1>{'Add new thread to %1'|lang:$cat.title}</h1> <a href="?forum" class="ajax_link">Home</a> :: {$cat.title} {if $User.UserID} <table cellspacing="0" cellpadding="0" class="form"> <tbody> <tr><td> <form method="post" action="?{$URL}" class="ajax_form center-area"> {include file='includes/form_errors.tpl'} <h3 class="x">{'New thread:'|lang}<span class="x">{'New thread:'|lang}</span></h3> <input class="textbox" name="title" onfocus="if(this.value=='{'_Thread title'|lang}'){ this.value='';this.style.color='#000'}" onblur="if (this.value=='') { this.value='{'_Thread title'|lang}';this.style.color='#888' }" style="{if !$smarty.post.title}color:#888;{/if}width:96%;margin:10px 1% 4px 1%;padding:5px 1%;-family:'Lucida Console'" value="{if $smarty.post.title}{$smarty.post.title|strform}{else}{'_Thread title'|lang}{/if}" /> <textarea class="textbox" name="message" onfocus="if(this.value=='{'_Thread message'|lang}'){ this.value='';this.style.color='#000'}" onblur="if (this.value=='') { this.value='{'_Thread message'|lang}';this.style.color='#888' }" style="{if !$smarty.post.message}color:#888;{/if}width:96%;margin:4px 1% 10px 1%;height:280px;padding:5px 1%;-family:'Lucida Console'">{if $smarty.post.message}{$smarty.post.message|strform}{else}{'_Thread message'|lang}{/if}</textarea> <button type="submit" class="x">{'Submit'|lang}<span class="x">{'Submit'|lang}</span></button> </form> </td></tr> </tbody> </table> {else} <a href="?user&login&jump=forum/category-{$cat.id}/reply" class="ajax_link">{'You need to login in order to start new thread in our forum'|lang}</a> {/if} <a href="?forum&category={$cat.id}" class="ajax_link"><< Cancel</a> {else} <h1>{$cat.title}</h1> <a href="?forum" class="ajax_link">Home</a> :: {$cat.title} <a href="?forum&category={$cat.id}&reply" style="float:right" class="ajax_link">{'Add new thread'|lang}</a> <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="head"> <td class="a">Threads</td> <td width="10%">Date</td> <td width="5%">Posts</td> </tr> {foreach from=$data.list key=i item=d} <tr class="row{if $i%2} odd{/if}"> <td class="a"> <a href="?forum&thread={$d.id}" class="ajax_link">{$d.title}</a> {($d.descr|strip_tags)|trunc:300:1:1} {if $smarty.const.IS_ADMIN} <a href="javascript:;" onclick="if(confirm('Are you sure to delete this thread?')) S.G.get('?forum&category={$cat.id}&thread={$d.id}&delete',0,1);">{'Delete this thread'|lang}</a> {/if} </td> <td>{'Date'|Call:'dayCountDown':$d.dated}</td> <td{if !$d.posts} style="color:#777"{/if}> {$d.posts} </td> </tr> {/foreach} </tbody> </table> <a href="?forum" class="ajax_link"><< {'Back to forum home'|lang}</a> <a href="?forum&category={$cat.id}&reply" style="float:right" class="ajax_link">{'Add new thread'|lang}</a> {/if} {elseif $data.type=='posts'} {if $reply} <h1>{'Reply to %1'|lang:$thread.title}</h1> <a href="?forum" class="ajax_link">Home</a> :: <a href="?forum&category={$cat.id}" class="ajax_link">{$cat.title}</a> :: <a href="?forum&category={$cat.id}&thread={$thread.id}" class="ajax_link">{$thread.title}</a> :: Reply <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="thread"> <td class="a" colspan="2"> {$thread.title} Posted {'Date'|Call:'dayCountDown':$thread.dated} by <b>{$thread.user}</b> {$thread.descr} </td> </tr> </tbody> </table> {if $User.UserID} <form method="post" action="?{$URL}" class="ajax_form center-area"> {include file='includes/form_errors.tpl'} <h3 class="x" style="text-align:left;margin-top:10px">{'Your reply:'|lang}<span class="x">{'Your reply:'|lang}</span></h3> <textarea class="textbox" name="message" onfocus="if(this.value=='{'_Message'|lang}'){ this.value='';this.style.color='#000'}" onblur="if (this.value=='') { this.value='{'_Message'|lang}';this.style.color='#888' }" style="{if !$smarty.post.message}color:#888;{/if}width:96%;margin:4px 1% 10px 1%;height:280px;padding:5px 1%;-family:'Lucida Console'">{if $smarty.post.message}{$smarty.post.message|strform}{else}{'_Message'|lang}{/if}</textarea> <button type="submit" class="x">{'Submit'|lang}<span class="x">{'Submit'|lang}</span></button> </form> {else} <a href="?user&login&jump=forum/category-{$cat.id}/thread-{$thread.id}/reply" class="ajax_link">{'You need to login in order to write on our forum'|lang}</a> {/if} <a href="?forum&category={$cat.id}&thread={$thread.id}" class="ajax_link"><< Cancel</a> {else} <h1>{$thread.title}</h1> {if $smarty.const.IS_ADMIN} <a href="javascript:;" onclick="if(confirm('Are you sure to delete this thread?')) S.G.get('?forum&category={$cat.id}&thread={$thread.id}&delete',0,1);">{'Delete this thread'|lang}</a> {/if} <a href="?forum" class="ajax_link">Home</a> :: <a href="?forum&category={$cat.id}" class="ajax_link">{$cat.title}</a> :: {$thread.title} <a href="?forum&category={$cat.id}&thread={$thread.id}&reply" style="float:right" class="ajax_link">Reply</a> <table cellspacing="0" cellpadding="0" class="table"> <tbody> <tr class="thread"> <td class="a" colspan="2"> {$thread.title} Posted {'Date'|Call:'dayCountDown':$thread.dated} by <b>{$thread.user}</b> {$thread.descr} </td> </tr> {foreach from=$data.list key=i item=d} <tr class="row{if $i%2} odd{/if}"> <td style="text-align:left;width:15%" class="post_author"> <b style="-size:13px">{$d.user}</b> <span style="-size:13px">{'Date'|Call:'dayCountDown':$d.added}</span> {if $smarty.const.IS_ADMIN} <a href="javascript:;" onclick="if(confirm('Are you sure to delete this post?')) S.G.get('?forum&category={$cat.id}&thread={$thread.id}&del={$d.id}',0,1);">{'Delete this post'|lang}</a> {/if} </td> <td style="text-align:left" class="post_descr"> {$d.descr} </td> </tr> {/foreach} </tbody> </table> <a href="?forum&category={$cat.id}" class="ajax_link"><< Back to {$cat.title}</a> <a href="?forum&category={$cat.id}&thread={$thread.id}&reply" style="float:right" class="ajax_link">Reply</a> {/if} {/if} {include file='content/pager.tpl' pager=$data.pager} {/strip} |