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

<div class="directory">
<div class="list">
 <div class="header clearfix">
 <h1><a href="{"?a=directory"|encurl}">{t}Main{/t}</a> {foreach from=$path item=p} :: <a href="{"?a=directory&cat=`$p.id`"|encurl}">{$p.name}</a>{/foreach}</h1>
 </div>
</div>
<div class="message">
{t link="?a=codes"|encurl}To add link into our directory you should place our <a href="%link">link code</a> on your site.{/t}
</div>
<br>
{if $errors}
<ul class="error">
{if $errors.turing}<li> {t}Invalid turing image provided{/t}</li>{/if}
{if $errors.category}<li> {t}Please, select links category{/t}</li>{/if}
{if $errors.title}<li> {t}Please, enter your site title{/t}</li>{/if}
{if $errors.url}<li> {t}Please, enter your site URL, it should starts from http:// or https://{/t}</li>{/if}
{if $errors.back_link}<li> {t}Please, enter your Back Link, it should starts from http:// or https://{/t}</li>{/if}
{if $errors.email}<li> {t}Please, enter a valid E-mail address{/t}</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>{t}Category{/t}</th>
  <td><b>{$cat.name|escape:html|default:"Main"}</b></td>
</tr>
<tr>
  <th>{t}Site Title{/t}</th>
  <td><input type=text name="title" maxlength=255 value="{$frm.title|escape:htmlall}"></td>
</tr>
<tr>
  <th>{t}Site Description{/t}</th>
  <td><input type=text name="description" maxlength=1024 value="{$frm.description|escape:htmlall}"></td>
</tr>
<tr>
  <th>{t}Site URL{/t}</th>
  <td><input type=text name="url" maxlength=255 value="{$frm.url|escape:htmlall}"></td>
</tr>
<tr>
  <th>{t}Button URL{/t}</th>
  <td><input type=text name="button_url" maxlength=255 value="{$frm.button_url|escape:htmlall}"></td>
</tr>
<tr>
  <th>{t}Back Link{/t}</th>
  <td><input type=text name="back_link" maxlength=255 value="{$frm.back_link|escape:htmlall}"></td>
</tr>
<tr>
  <th>{t}E-mail{/t}</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="{t}Add Link{/t}"></td>
</tr>
</table>
</form>
</div>
{include file="footer.tpl"}