{include file="header.tpl"}
<div class="box">
<div class="box_title" id="tba">Links Directory:</div>
<div class="box_body">
<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr bgcolor="#FFFFC2"><td><b><a href="{"?a=directory"|encurl}">Main</a> {foreach from=$path item=p} :: <a href="{"?a=directory&cat=`$p.id`"|encurl}">{$p.name}</a>{/foreach}</b></td>
<td align="right"><a href="{"?a=directory&action=add_form&cat=`$cat.id`"|encurl}" style="color:#A70000">Add Your Link</a>
</td></tr>
</table><br>

{if $frm.say == 'added'}
<div style="color:green" align="center"><b>Thank you. Your link has been accepted and will be alive after admin approve it.</b></div>
{/if}

<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
{section name=c loop=$cats}
<td width="50%" class="arr"><a href="{"?a=directory&cat=`$cats[c].id`"|encurl}"><b>{$cats[c].name|escape:htmlall}</b></a></td>
{if $smarty.section.c.index % 2 == 1}</tr>{if !$smarty.section.c.last}<tr>{/if}{/if}
{if ($smarty.section.c.index) % 2 != 1 && $smarty.section.c.last}</tr>{/if}
{/section}
</table>
<br>

{if $links}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
{section name=l loop=$links}
<tr><td><a href="{"?a=directory&out=`$links[l].id`"|encurl}"><b>{$links[l].title|escape:htmlall}</b></a>
   (Added: {$links[l].fdate|escape:htmlall} - In/Out: {$links[l].t_in}/{$links[l].t_out})<br>
   {$links[l].description|escape:htmlall}<br>
   <small>{$links[l].url|escape:htmlall}</small><br>{if $links[l].button_url}
<a href="{"?a=directory&out=`$links[l].id`"|encurl}"><img src="{$links[l].button_url|escape:htmlall}" width="120" height="60" border="0"></a>{/if}</td></tr>
{/section}
</table>
{elseif $cat}
<br>
<div align="center">No listings in this category.</div>
{/if}

{if $cats && !$frm.cat}
<form method="post" action="">
<input type=hidden name="a" value="directory">
<input type=hidden name="action" value="add">
<table width="100%" cellspacing="1" cellpadding="2" border="0" style="border: 1px dotted #CCCCCC;">
<tr><td colspan="2">To add link into our directory you should place our  <a href="{"?a=partners"|encurl}">link code</a> on your site.<br><br></td></tr>
<tr><td>Category</td><td><select name="cat" class="inpts">
<option value="0">- Your Category -</option>
{section name=ac loop=$cats}
<option value="{$cats[ac].id}">{$cats[ac].name}</option>
{/section}</td></tr>
<tr>
  <td>Site Title</td>
  <td><input type=text name="title" maxlength="255" value="{$frm.title|escape:htmlall}" class="inpts" size="45"></td>
</tr>
<tr>
  <td>Site Description</td>
  <td><input type=text name="description" maxlength="1024" value="{$frm.description|escape:htmlall}" class="inpts" size="45"></td>
</tr>
<tr>
  <td>Site URL</td>
  <td><input type=text name="url" maxlength="255" value="{$frm.url|escape:htmlall}" class="inpts" size="45"></td>
</tr>
<tr>
  <td>Button URL</td>
  <td><input type=text name="button_url" maxlength="255" value="{$frm.button_url|escape:htmlall}" class="inpts" size="45"></td>
</tr>
<tr>
  <td>Back Link</td>
  <td><input type=text name="back_link" maxlength="255" value="{$frm.back_link|escape:htmlall}" class="inpts" size="45"></td>
</tr>
<tr>
  <td>E-mail</td>
  <td><input type=text name="email" maxlength="255" value="{$frm.email|escape:htmlall}" class="inpts" size="45"></td>
</tr>
{if $settings.use_turing}
<tr>
  <th><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}" alt="turing code"></th>
  <td><input type=text name="turing" maxlength=6 size="10" class="inpts"></td>
</tr>
{/if}
<tr>
  <td></td>
  <td><input type=submit value="Add Site" class="sbmt"></td>
</tr>
</table>
</form>
{/if}
</div></div>

{include file="footer.tpl"}