{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"}
{include file="validation.tpl" form_id="submit_form" validators=$validators}
{strip}
{if $smarty.const.DISABLE_ARTICLE_SUBMIT == 1 && $is_admin neq 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}      </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" width="100%" 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" class="cmxform">
<table border="0" class="formPage">
{if $error}
       <tr><td colspan="2" class="err">
          {l}An error has occured {foreach name=errorList from=$error_list key=errorKey item=errorItem}
					{if $errorKey == 'DO_MATH'}
						{if is_array($errorItem)}
							{$errorItem.remote}
						{else}
							{$errorItem}
						{/if}
					{/if}
				{/foreach}.{/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">
   <div class="fields">
	<div class="fields_c">
	<h3>{l}Pricing{/l}</h3>
   <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}
           </div>
           <div class="fields_b"></div>
         </div>
    </td></tr>
{/if}
{/if}
 
<tr>
    <td class="label underlined" align='left' colspan="2">{l}Fields marked with a {/l}<span class='req'>*</span>{l} are required.{/l}</td>
</tr>

  <tr>
   <td class="label" width="25%"><span class='req'>*</span>{l}Title{/l}:</td>
   <td class="field">
      <input class="text" 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}
   </td>
  </tr>
  <tr>
   <td class="label" width="25%"><span class='req'>*</span>{l}Short Description{/l}:</td>
   <td class="field">
      <textarea name="DESCRIPTION" rows="4" cols="36" class="text" {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 class="label" width="25%">{l}Article{/l}:</td>
   <td class="field">
      {include file="rte.tpl" NAME="ARTICLE" VALUE=$ARTICLE}
      
   </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 eq 2}
<tr>
		<td class="label"<span class='req'>*</span>{l}DO THE MATH{/l}:</td>
		<td class="field">
			<span style="color: red;">
				{foreach name=errorList from=$error_list key=errorKey item=errorItem}
					{if $errorKey == 'DO_MATH'}
						{if is_array($errorItem)}
							{$errorItem.remote}<br/>
						{else}
							{$errorItem}<br/>
						{/if}
					{/if}
				{/foreach}
			</span>
			<font style="font-weight: bold; font-size: 14pt; color: red; margin-right: 10px;">{$DO_MATH_N1} + {$DO_MATH_N2} = </font><input type="text" id="DO_MATH" name="DO_MATH" value='{$DO_MATH}' class="text" style="width: 60px;"/>
		<br/>
		<br/>
		</td>
	</tr>
	{/if}
   {if $smarty.const.VISUAL_CONFIRM eq 1}
   {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 class="text" id="CAPTCHA" name="CAPTCHA" type="text" value="" size="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" maxlength="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" />
      {*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="continue" value="{l}Continue{/l}" class="btn" />
			<input type="hidden" name="formSubmitted" value="1" />
         {else}
            <input type="submit" name="edit" value="{l}Continue{/l}" class="btn" />
			<input type="hidden" name="edit" value="1" />
         {/if}
      </td>
  </tr>
</table>
<input type="hidden" name="id" value="{$article_id}" />
</form>
{/if}
{/if}
{include file="footer.tpl"}
{/strip}