{capture name="title"}{$TITLE|escape|trim}{/capture}
{capture assign="in_page_title"}{$TITLE|escape|trim}{/capture}
{capture assign="description"}{l}Article Details{/l}{/capture}

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

<!--strip-->
{if $error}
   <div class="err">
      <img src="admin/images/no_22.gif" align="baseline" alt="Error" title="Error" />
      <p>{l}Error{/l}: {$error}</p>
   </div>
{else}
   <table align="center" border="0" width="80%">
   <tbody>
   <tr>
      <td class="smallDesc"><h3>{$TITLE|escape|trim}</h3></td>
   </tr>
   <tr>
      <td class="smallDesc">{l}Date Added{/l}: {$DATE_ADDED|escape|trim}</td>
   </tr>
   <tr>
      <td class="smallDesc">{l}Author{/l}: {$NAME|trim}</td>
   </tr>
    <tr>
 <td class="smallDesc">{l}Category{/l}: <a href="{$CATEGORY_URL|escape|trim}" title="{$CATEGORY_TITLE|escape|trim}">{$CACHE_TITLE|escape|trim}</a></td>
 </tr>
   <tr>
      <td class="smallDesc" style="text-align:justify;" id="article_content_{$ID}">{$ARTICLE|trim}</td>
   </tr>
<tr>
    <td>
        <div style="float: right;">
        {if $rights.editArt eq 1}
        <a href="{$smarty.const.DOC_ROOT}/inplace_editart.php?ID={$ID}&detail=1&TB_iframe=true&height=400&width=600" onclick="return showThickbox(this);" class="thickbox">
        <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/edit.gif" width="14" height="14" style="border: none;" alt="edit article"/>
        </a> 
        {/if}
        {if $rights.delArt eq 1}  
        <a href="{$smarty.const.DOC_ROOT}/inplace_editart.php?ID={$ID}&detail=1&mode=del&TB_iframe=true&height=100&width=250"  class="thickbox" onclick="{literal}question = confirm('Are you sure you want to delete this article?');if (question !='0'){return showThickbox(this);} else return false;{/literal}">
        <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/delete.gif" width="14" height="14" style="border: none;" alt="delete article"/>
        </a>
        {/if}
        {if $STATUS<2 && $rights.editArt eq 1}
        <a href="{$smarty.const.DOC_ROOT}/inplace_editart.php?ID={$ID}&detail=1&mode=active&TB_iframe=true&height=100&width=250"  class="thickbox" onclick="{literal}question = confirm('Are you sure you want to make this article active?');if (question !='0'){return showThickbox(this);} else return false;{/literal}">
            <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/active.gif" width="14" height="14" style="border: none;" alt="article is inactive" class="float_tiny"/>
        </a>
        {/if}
        {if $rights.editArt eq 1 || $rights.delArt eq 1}
        {if $has_payment > 0}
            <div class="float_tiny" style="color: green; font-weight: bold;">$</div>
        {/if}
        {/if}
        </div>
    </td>
</tr>

{if $uLevel eq 1}
<tr>
	<td align="center" colspan="2">
		<a href="{$smarty.const.DOC_ROOT}/admin/article_edit.php?action=E:{$ID}" target="blank" title="Edit as Admin">Edit as Admin</a>
	</td>
</tr>
{/if}
{if $ratings_on == 1}
<tr>
   <td>
<fieldset>
<legend>{l}Ratings{/l}</legend>
   {if $logged_rating eq 1}
      {if $ratingError}<div class="errForm">{l}Please choose your rating, and after this click Rate{/l}.</div>{/if}
      <label for="RATING">{l}Rate the article{/l}: &nbsp;</a>
      <form name="rating" action="{$smarty.const.DOC_ROOT}/article.php?action=R:{$ID}" method="post">
         <select id="RATING" name="RATING" class="text" {$rating_disabled}>
           <option value=""></option>
           <option value="1">1</option>
           <option value="2">2</option>
           <option value="3">3</option>
           <option value="4">4</option>
           <option value="5">5</option>
           <option value="6">6</option>
           <option value="7">7</option>
           <option value="8">8</option>
           <option value="9">9</option>
           <option value="10">10</option>
         </select>
         &nbsp;<input type="submit" value="{l}Rate{/l}" class="btn" {$rating_disabled}>
      </form>
      &nbsp;&nbsp;
   {else}
      <center><a href="{$smarty.const.DOC_ROOT}/login.php" class="error">{l}You must be logged in to leave a rating{/l}.</a><br> {/if}
      	       {if $smarty.const.ARTICLE_RATING_DISPLAY == 'image'}
            {if $RATING >0 }
                {section name=foo loop=$RATING/$VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/tiny_star.gif">      
                {/section}
                {if intval($article.RATING/$article.VOTES) < $article.RATING/$article.VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/tiny_star_half.gif">
                {/if}
        
    {/if}{elseif $smarty.const.ARTICLE_RATING_DISPLAY == 'bar'}
            {if $RATING >0 }
                {section name=foo loop=$RATING/$VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/bar_full.png">      
                {/section}
                {if intval($article.RATING/$article.VOTES) < $article.RATING/$article.VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/bar_full_half.png">
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/bar_empty_half.png">
                {/if}
        		{section name=foo loop=$LEFT_RATING}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/bar_empty.png">      
                {/section}
        
    {/if}{else}{$RATING}{/if} ({if !$VOTES}0{else}{$VOTES}{/if} {l}votes{/l})
   {/if}
</fieldset>
</td>
</tr>
{/if}



{if $comments_on == 1}
<tr>
   <td>
      <fieldset>
         <legend>{l}Comments{/l}</legend>
         <!-- Printing Comments -->
         {foreach from=$comments item=comment name=items}
            <table class="comment" cellspacing="0" cellpadding="0" width="100%">
               <tr class="comment">
                  <td>{$comment.USER_NAME}:</td>
                  <td align="right">{$comment.DATE_ADDED}</td>
               </tr>
               <tr height="50" valign="top">
                  <td class="descr" colspan="2">{$comment.COMMENT|nl2br}</td>
               </tr>
            </table>
         {foreachelse}
            <h3>{l}No Comments Yet{/l}.</h3>
         {/foreach}

		{if $comm_posted eq 1 && $needs_approval_msg eq 1}
		<p style="color: green">{l}Comment posted and awaiting admin approval{/l}.</p>

		{/if}

         {if $logged_comment eq 1}
            <br>
            <form id="commentForm" action="{$smarty.const.DOC_ROOT}/article.php?action=C:{$ID}" method="post">
            <table width="100%" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <label for="comment"><b>{l}Leave your comment{/l}:</b><br>
                    <textarea id="comment" name="comment" rows="4" cols="60" class="text">{$COMMENT}</textarea>
                    {if $commentError}<div class="errForm">{l}You need to enter comment before Submit{/l}.</div>{/if}

                </td>
            </tr>
            <tr>
                <td>
                 {if $smarty.const.VISUAL_CONFIRM_COMMENTS eq 1 && $smarty.const.VISUAL_CONFIRM eq 1}
                   {if $rights.editLink neq 1 && $rights.addLink neq 1 && $rights.delLink neq 1}
                   {if $img_verification_error}
                      <span class="error"><font color=red>{l}Verification error, please enter the code again{/l}</font></span><br>
                   {/if}
                   <input id="IMAGEHASH" name="IMAGEHASH" type="hidden" value="{$imagehash}" />
                   <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}" />
                   <br><br><span class='req'>*</span>{l}Enter the code shown{/l}:
                   &nbsp;<input id="CAPTCHA" name="CAPTCHA" type="text" value="" size="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" maxlength="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" class="text" /><br><br>
                   {/if}
                {/if}
   {if $smarty.const.VISUAL_CONFIRM_COMMENTS eq 1 && $smarty.const.VISUAL_CONFIRM eq 2}
		<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>
		<span class='req'>*</span>{l}Do the Math{/l}:
                   &nbsp;	<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/>

{/if}
                <input type="hidden" name="formSubmitted" value="1" />
                <input type="submit" value="{l}Submit{/l}" class="btn">
                </td>
            </tr>
            </table>
            </form>
         {else}
             <br><a href="{$smarty.const.DOC_ROOT}/login.php" class="error">{l}You must be logged in to leave a Comment{/l}.</a><br>
         {/if}
      </fieldset>
   </td>
</tr>
{/if}
</tbody>
</table>

{foreach from=$widgets.ARTICLE_DETAIL.BOT item=v}
	{if $v.SETTINGS.DISPLAY_IN_BOX eq 'Yes'}
	{include file="widget_central_top.tpl"}
	{/if}
	{$v.CONTENT}
	{if $v.SETTINGS.DISPLAY_IN_BOX eq 'Yes'}
	{include file="widget_central_bot.tpl"}
	{/if}
{/foreach}

{*/strip*}

{include file="footer.tpl"}
