{include file="header.tpl"}
<h3>Add Directory Link</h3>

<div class="directory">
<div class="list">
 <div class="header clearfix">
 <h1><a href="{"?a=directory"|encurl}">Main</a> {foreach from=$path item=p} :: <a href="{"?a=directory&cat=`$p.id`"|encurl}">{$p.name}</a>{/foreach}</h1>
 </div>
</div>
<div class="message">
To add link into our directory you should place our  <a href="{"?a=codes"|encurl}">link code</a> on your site.
</div>
<br>
{if $errors}
<ul class="error">
{if $errors.turing}<li> Invalid turing image provided.</li>{/if}
{if $errors.category}<li> Please, select links category</li>{/if}
{if $errors.title}<li> Please, enter your site title</li>{/if}
{if $errors.url}<li> Please, enter your site URL, it should starts from http:// or https://</li>{/if}
{if $errors.back_link}<li> Please, enter your Back Link, it should starts from http:// or https://</li>{/if}
{if $errors.email}<li> Please, enter your valid email</li>{/if}
</ul>
{/if}

<form method="post" action="">
<input type=hidden name=a value=directory>
<input type=hidden name=action value=add>
<input type=hidden name=cat value="{$cat.id}">
<table class="form">
<tr>
  <th>Category</th>
  <td><b>{$cat.name|escape:html|default:"Main"}</b></td>
</tr>
<tr>
  <th>Site Title</th>
  <td><input type=text name="title" maxlength=255 value="{$frm.title|escape:htmlall}"></td>
</tr>
<tr>
  <th>Site Description</th>
  <td><input type=text name="description" maxlength=1024 value="{$frm.description|escape:htmlall}"></td>
</tr>
<tr>
  <th>Site URL</th>
  <td><input type=text name="url" maxlength=255 value="{$frm.url|escape:htmlall}"></td>
</tr>
<tr>
  <th>Button URL</th>
  <td><input type=text name="button_url" maxlength=255 value="{$frm.button_url|escape:htmlall}"></td>
</tr>
<tr>
  <th>Back Link</th>
  <td><input type=text name="back_link" maxlength=255 value="{$frm.back_link|escape:htmlall}"></td>
</tr>
<tr>
  <th>E-mail</th>
  <td><input type=text name="email" maxlength=255 value="{$frm.email|escape:htmlall}"></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=6></td>
</tr>
{/if}
<tr>
  <th></th>
  <td><input type=submit value="Add Site"></td>
</tr>
</table>
</form>
</div>
{include file="footer.tpl"}