{capture name="title"} - {l}Submit Article{/l}{/capture}
{capture assign="in_page_title"}{l}Submit Article{/l}{/capture}
{capture assign="description"}{l}Submit a new article to the directory{/l}{/capture}
{capture name="non_rules_agree"}<span class="errForm">You have to agree to the rules before submitting an article.</span>{/capture}

{include file="header.tpl"}
{include file="top_bar.tpl"}

{strip}
{if $smarty.const.DISABLE_ARTICLE_SUBMIT == 1 } <table width="96%" border="0" align="center" cellpadding="4" cellspacing="4" class="sp_area">   <tr>      <td>         <h2>{l}Closed{/l}</h2>      </td>   </tr>   <tr>      <td>         {l}We are sorry but articles submissions are closed.{/l}<br />         {$disablearticlereason}</a>      </td>   </tr> </table> <br /> {else}
{if ($confirmed)}
   <table border="0" class="formPage">
   <tr><td colspan="2" class="msg">
   {l}The article's email address has been confirmed.{/l}<br />
   {l}The article will be listed as soon as it is approved by a site administrator.{/l}
   </td></tr>
   </table>
{/if}
{if $smarty.const.REQUIRE_REGISTERED_USER_ARTICLE == 1 and empty($regular_user_details.ID)}

<table border="0" class="formPage" align="center" style="clear:both; margin-top:3em;">
   <tr>
      <td>
         <h3>{l}Information{/l}</h3>
      </td>
   </tr>
   <tr>
      <td>
         {l}You must be logged in to submit a new article.{/l}
         <br />
         {l}No account yet?{/l} <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register" title="{l}Become an Author{/l}">{l}Become an Author{/l}</a>
      </td>
   </tr>
</table>

{else}

<form method="post" action="" id="submit_form">
<table border="0" class="formPage">
{if $error}
   <tr><td colspan="2" class="err">
      {l}An error occured while saving the link.{/l}
   </td></tr>
{/if}

{if $double_review and !$posted}
<tr><td colspan="2" class="err">
   {$double_review}
</td></tr>
{/if}

{if $posted}
   <tr><td colspan="2" class="msg">
   {l}Article submitted {/l}{if $waiting_approval eq 1}{l}and awaiting approval{/l}{/if}.<br />
   {l}Submit another article.{/l}
   </td></tr>
{/if}
{if $needs_confirmation}
    <tr><td colspan="2" class="msg">
   {l}The email address you provided needs to be confirmed before the article is listed.{/l}<br />
   {l}Please check your email for the confirmation link.{/l}
   </td></tr>
{/if}

{if $smarty.const.ARTICLE_PAY_ENABLE}
{if $dont_show_pay neq 1}
   <tr><td colspan="2" class="price">
   <b>{l}Pricing{/l}:</b><br />
   <table border="0" cellspacing="0" cellpadding="0">
   {if $smarty.const.ARTICLE_PAY_FEATURED}
      <tr><td><input type="radio" id="featured" name="ARTICLE_TYPE" value="featured" {if $ARTICLE_TYPE eq 'featured'}checked="true"{/if}><label for="featured">{l}Featured articles{/l}</label></td><td>{$smarty.const.HTML_CURRENCY_CODE}{$smarty.const.ARTICLE_PAY_FEATURED} </td></tr>
   {/if}
   {if $smarty.const.ARTICLE_PAY_NORMAL gt 0}
      <tr><td><input type="radio" id="normal" name="ARTICLE_TYPE" value="normal" {if $ARTICLE_TYPE eq 'normal'}checked="true"{/if}><label for="normal">{l}Regular articles{/l}</label></td><td>{$smarty.const.HTML_CURRENCY_CODE}{$smarty.const.ARTICLE_PAY_NORMAL} </td></tr>
   {elseif $smarty.const.ARTICLE_PAY_NORMAL eq 0}
      <tr><td><input type="radio" id="normal" name="ARTICLE_TYPE" value="normal" {if $ARTICLE_TYPE eq 'normal'}checked="true"{/if}><label for="normal">{l}Regular articles{/l}</label></td><td>{l}free{/l}</td></tr>
   {/if}
   {if $smarty.const.ARTICLE_PAY_ENABLE_FREE}
      <tr><td><input type="radio" id="free" name="ARTICLE_TYPE" value="free" {if $ARTICLE_TYPE eq 'free'}checked="true"{/if}><label for="free">{l}Articles with nofollow attribute{/l}</label></td><td>free</td></tr>
   {/if}
   </table>
   {validate form="submit_article" id="v_ARTICLE_TYPE" message=$smarty.capture.field_link_type}
   {if isset($AllowedFeat) and $AllowedFeat ne 1}
      <br /><span class="errForm">{l}No more featured articles allowed for this category.{/l}</span>
   {/if}
   </td></tr>
{/if}
{/if}

  <tr>
   <td class="label" width="25%"><span class='req'>*</span>{l}Title{/l}:</td>
   <td class="field">
      <input type="text" name="TITLE" value="{$TITLE|escape|trim}" size="40" maxlength="{$smarty.const.ARTICLE_TITLE_MAX_LENGTH}" class="text" />
      {validate form="submit_article" id="v_TITLE" message=$smarty.capture.field_char_required}
      {if $review_articlee == 0 || $remove_article == 0}
         {validate form="submit_article" id="v_TITLE_U" message=$smarty.capture.title_not_unique}
      {/if}
      {validate form="submit_article" id="v_TITLE_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.ARTICLE_TITLE_MIN_LENGTH|replace:'#MAX#':$smarty.const.ARTICLE_TITLE_MAX_LENGTH} </div></td>
   </td>
  </tr>
  <tr>
   <td class="label"><span class='req'>*</span>{l}Short Description{/l}:</td>
   <td class="field">
      <textarea name="DESCRIPTION" rows="4" cols="36" class="textarea" {formtool_count_chars name="DESCRIPTION" limit=$smarty.const.ARTICLE_DESCRIPTION_MAX_LENGTH alert=true}>{$DESCRIPTION|escape|trim}</textarea>
       {validate form="submit_article" id="v_DESCRIPTION_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.ARTICLE_DESCRIPTION_MIN_LENGTH|replace:'#MAX#':$smarty.const.ARTICLE_DESCRIPTION_MAX_LENGTH} <br />
       {l}Limit{/l}: <input type="text" name="DESCRIPTION_limit" size="4" class="limit_field" readonly="readonly" value="{$DescriptionLimit|trim}" />
   </td>
  </tr>
  <tr>
   <td colspan="2" class="label" width="25%">{l}Article{/l}:</td>
  </tr>
  <tr>
   <td colspan="2" class="field">
      {if isset ($useRTE) and $useRTE eq 1}
      {literal}
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "exact",
		elements: "ARTICLE",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect",
		theme_advanced_buttons2 : ",fontselect,fontsizeselect,|,cut,copy,paste,pastetext,pasteword,|,outdent,indent,|,undo,redo",
		//theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid",
		//theme_advanced_buttons4 : "insertdate,inserttime,preview,|,forecolor,backcolor,|,charmap,emotions,iespell,media,advhr,|,print,|,fullscreen",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css"
		
		});
</script>
{/literal}
<textarea id="ARTICLE" name="ARTICLE" rows="10" cols="80" style="width: 100%">{$ARTICLE}
</textarea>
      {else}
         <textarea name="ARTICLE" id="ARTICLE" rows="6" cols="50" class="textarea" {formtool_count_chars name="ARTICLE" limit=$smarty.const.ARTICLE_MAX_LENGTH alert=true}>{$ARTICLE|escape|trim}</textarea>
         {validate form="submit_article" id="v_ARTICLE_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.ARTICLE_MIN_LENGTH|replace:'#MAX#':$smarty.const.ARTICLE_MAX_LENGTH} <br />
         {l}Limit{/l}: <input type="text" name="ARTICLE_limit" size="4" class="limit_field" readonly="readonly" value="{$ArticleLimit|trim}" />{if isset ($allowedTags)} <small>Allowed html tags: {$allowedTags|wordwrap:30:"<br />\n"}</small>{/if} <br />{if isset ($allowedAttr)}<small>Allowed html attribute tags: {$allowedAttr|wordwrap:30:"<br />\n"}</small>{/if}
      {/if}
   </td>
  </tr>
{if $smarty.const.ENABLE_META_TAGS eq 1 and $smarty.const.ENABLE_USER_META_TAGS_ARTICLE eq 1}
			   <tr>
			      <td class="label" width="25%" width="10%">{l}META Keywords{/l}:</td>
			      <td class="field">
			        <input type="text" name="META_KEYWORDS" value="{$META_KEYWORDS|escape|trim}" size="40" maxlength="2000" class="text" />
			        <p class="small">{l}Separate keywords by comma.{/l}</p>
			        {validate form="submit_article" id="v_META_KEYWORDS_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.META_KEYWORDS_MIN_LENGTH|replace:'#MAX#':$smarty.const.META_KEYWORDS_MAX_LENGTH}
			      </td>
			   </tr>
			   <tr>
			      <td class="label" width="25%">{l}META Description{/l}:</td>
			      <td class="field">
			         <textarea name="META_DESCRIPTION" rows="3" cols="30" class="text" {formtool_count_chars name="META_DESCRIPTION" limit=$smarty.const.META_DESCRIPTION_MAX_LENGTH alert=true}>{$META_DESCRIPTION|escape|trim}</textarea>
			         {validate form="submit_article" id="v_META_DESCRIPTION_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.META_DESCRIPTION_MIN_LENGTH|replace:'#MAX#':$smarty.const.META_DESCRIPTION_MAX_LENGTH}
			         <br />
			         {l}Limit{/l}: <input type="text" name="META_DESCRIPTION_limit" size="4" class="limit_field" readonly="readonly" value="{$MetaDescriptionLimit|trim}" />
			      </td>
			   </tr>
			   {/if}
   {if $smarty.const.REQUIRE_REGISTERED_USER_ARTICLE == 0 || empty($regular_user_details.ID)}
   <tr>
      <td class="label" width="25%"><span class='req'>*</span>{l}Your Name{/l}:</td>
      <td class="field">
         <input type="text" name="OWNER_NAME" value="{$OWNER_NAME|escape|trim}" size="40" maxlength="{$smarty.const.USER_NAME_MAX_LENGTH}" class="text" />
         {validate form="submit_article" id="v_OWNER_NAME" message=$smarty.capture.field_char_required}
         {validate form="submit_article" id="v_OWNER_NAME_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.USER_NAME_MIN_LENGTH|replace:'#MAX#':$smarty.const.USER_NAME_MAX_LENGTH}
      </td>
   </tr>
   <tr>
      <td class="label" width="25%"><span class='req'>*</span>{l}Your Email{/l}:</td>
      <td class="field">
         <input type="text" name="OWNER_EMAIL" value="{$OWNER_EMAIL|escape|trim}" size="40" maxlength="255" class="text" />
         {validate form="submit_article" id="v_OWNER_EMAIL" message=$smarty.capture.invalid_email}
         {validate form="submit_article" id="v_OWNER_EMAIL_BANNED" message=$smarty.capture.email_banned}
      </td>
   </tr>
   {/if}

   <tr>
   <td class="label" width="25%"><span class='req'>*</span>{l}Category{/l}:</td>
   <td class="field">
      {* Load category selection *}
      {include file="category_select_article.tpl"}
   </td>
   </tr>

   {if $remove_article}
   <tr>
   <td class="label" width="25%">{l}Mark for removal{/l}:</td>
   <td class="field">
      <input type="checkbox" id="MARK_REMOVE" name="MARK_REMOVE" /><span class="small">{l}Use with caution{/l}</span>
   </td>
   </tr>
   {/if}

	{if $is_admin eq 1 }
	<tr>
         <td class="label">{l}Release Date{/l}:</td>
         <td class="field">
           <input id="RELEASE_DATE" type="text" name="RELEASE_DATE" value="{$RELEASE_DATE}" class="text"/>
            <a href=""
             style="display: block; float: left; margin-left: 5px; margin-top: 1px;"  
             onclick="window.open(
             'date_cal.html',
             'calendar',
             'toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=0,dependent=no,width=220,height=220');
             return false;">
             <img src="images/date_btn.gif" border="0"></a>
         </td>
      </tr>
	{/if}

   {if $smarty.const.VISUAL_CONFIRM}
   {if $dont_show_captch neq 1}
   <tr>
   <td class="label" width="25%"><span class='req'>*</span>{l}Enter the code shown{/l}:</td>
   <td class="field">
      <input id="IMAGEHASH" name="IMAGEHASH" type="hidden" value="{$imagehash}" />
      <input id="CAPTCHA" name="CAPTCHA" type="text" value="" size="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" maxlength="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" class="text" />
      {validate form="submit_article" id="v_CAPTCHA" message=$smarty.capture.invalid_code}
      <br />
      <p class="small">{l}This helps prevent automated registrations.{/l}</p>
      <img src="{$smarty.const.DOC_ROOT}/captcha.php?imagehash={$imagehash}" class="captcha" alt="{l}Visual Confirmation Security Code{/l}" title="{l}Visual Confirmation Security Code{/l}" />
   </td>
   </tr>
   {/if}
   {/if}
   <tr>
   <td class="label" width="25%"><span class='req'>*</span><a href="{$smarty.const.DOC_ROOT}/rules.php" title="Submission Rules" target='_blank'>Submission Rules</a> Agreement:</td>
   <td class="field">
    <input type="checkbox" id="AGREERULES" name="AGREERULES"{if $AGREERULES eq 'on'} checked="checked"{/if} /> {l}I AGREE with the {/l}<a href="{$smarty.const.DOC_ROOT}/rules.php" title="Submission Rules" target='_blank'>{l}submission rules{/l}</a>
    {validate form="submit_article" id="v_AGREERULES" message=$smarty.capture.non_rules_agree}</td>
   </tr>
   <tr>
      <td colspan="2" class="buttons">
         {if !$review_article and !$remove_article}
            <input type="submit" name="submit" value="{l}Continue{/l}" class="btn" />
         {else}
            <input type="submit" name="edit" value="{l}Continue{/l}" class="btn" />
         {/if}
      </td>
  </tr>
</table>
</form>
{/if}
{/if}
{include file="footer.tpl"}
{/strip}