{strip}

<table>
<tr>
    {* show page rank *}
    {if $smarty.const.SHOW_PAGERANK}
         <td width="124" valign="top"> <img class="thumb" src="http://open.thumbshots.org/image.pxf?url={$link.URL|escape|trim}"><br />
            {include file="pagerank.tpl" pr=$link.PAGERANK}
        </td>
    {/if}

    <td>{if $edit_link}
        <span id="T_{$link.ID}">{$link.TITLE|escape|trim}</span>
    {if !empty($link.URL)}
      &nbsp;&nbsp;
       <a class="link" id="id_{$link.ID}" href="{$link.URL|escape|trim}" title="{$link.TITLE|escape|trim}"
          {if $link.NOFOLLOW} rel="nofollow"{/if}
          target="_blank">
          <span class="link"><img src="{$smarty.const.DOC_ROOT}/images/external_link.png" alt="{$link.TITLE|escape|trim}" border="0"/></span>
       </a>
       {/if}
      {else}
      <a class="link" id="id_{$link.ID}" href="{$link.URL|escape|trim}" title="{$link.TITLE|escape|trim}"
          {if $link.NOFOLLOW} rel="nofollow"{/if}
          target="_blank">{$link.TITLE|escape|trim}</a>    {/if}
 <br/>
  
{if !empty ($search) or !empty ($uid)}
	<p>{l}Category{/l}: <a href="{$smarty.const.DOC_ROOT}/{$link.CATEGORY_URL|escape|trim}" title="{$link.CATEGORY_TITLE|escape|trim}">{$link.CATEGORY_TITLE|escape|trim}</a></p>
{/if}
   
{if $link.URL}
       {if $edit_link}
     
       <span class="link" id="U_{$link.ID}" style="color: #3E81B4;">{$link.URL|escape|trim}</span>
  
       {else}
         <span class="link">{$link.URL|escape|trim}</span>
       {/if}
  {/if}
  {if $link.DESCRIPTION}
  <p id="description{$link.ID}">
       <span id="editdescrip_{$link.ID}">{if !empty($link.DESCRIPTION)}{$link.DESCRIPTION|trim}{else}[{l}No Description{/l}]{/if}</span>
  </p>
  {/if}
  <p>
 <a class="readMore" href="{if !$smarty.const.ENABLE_REWRITE}
                                                {$smarty.const.DOC_ROOT}/detail.php?id={$link.ID}
                                             {else}
                                                {$smarty.const.DOC_ROOT}/{$link.SEO_URL}{/if}" title="{l}Read more about{/l}: {$link.TITLE|escape|trim}">{l}Read&nbsp;more{/l}</a>



                                 {if ($smarty.const.REQUIRE_REGISTERED_USER == 1 || $smarty.const.REQUIRE_REGISTERED_USER_ARTICLE == 1) and !empty ($regular_user_details) and ($regular_user_details.ID == $link.OWNER_ID)}

                                    ,&nbsp;<a class="readMore" href="{$smarty.const.DOC_ROOT}/submit.php?linkid={$link.ID}" title="{l}Edit or Remove your link{/l}">{l}Review{/l}</a>

                                 {/if}

   </p>

         
    <!-- reviews, ratings -->
    <div class="link_rating">
     {if $ratings_on == 1} {if $smarty.const.LINK_RATING_DISPLAY == 'image'}
            {if $link.RATING >0 }
                {section name=foo loop=$link.RATING/$link.VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/tiny_star.gif">      
                {/section}
                {if intval($link.RATING/$link.VOTES) < $link.RATING/$link.VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/tiny_star_half.gif">
                {/if} 
            {else}
                <span class="review" style="float: left; padding-bottom: 3px;padding-left: 3px;">not rated yet</span>
            {/if}
    {/if} {/if}
    <span class="review">{if $comments_on == 1}{if $link.COMMENT_COUNT !=''}{$link.COMMENT_COUNT}{else}0{/if} Reviews.{/if}{if $ratings_on == 1} Rating: {$link.RATING/$link.VOTES|truncate:4:""} Total Votes: {if !$link.VOTES}0{else}{$link.VOTES}{/if}{/if}</span>
        
    <div style="clear: both;"></div>
    </div>
    <!-- /reviews, ratings -->
    </td>

<tr>
    <td colspan="2">
    {if $link.rights.editLink eq 1}
    <a href="{$smarty.const.DOC_ROOT}/inplace_editlink.php?ID={$link.ID}&TB_iframe=true&height=400&width=600" target="blank" class="thickbox"  onclick="{literal}return showThickbox(this);{/literal}">
      <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/edit.gif" width="14" height="14" style="border: none;" alt="edit link"/>
    </a>
	&nbsp;
   {/if}
   {if $link.rights.delLink eq 1}
   <a href="{$smarty.const.DOC_ROOT}/inplace_editlink.php?ID={$link.ID}&mode=del&TB_iframe=true&height=100&width=250" onclick="{literal}question = confirm('Are you sure you want to delete this link?');if (question !='0'){return showThickbox(this);} else return false;{/literal}" class="thickbox">
        <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/delete.gif" width="14" height="14" style="border: none;" alt="delete link"/>
   </a>
    {/if}
    {if ($link.STATUS<2) && $link.rights.editLink eq 1}
    <a href="{$smarty.const.DOC_ROOT}/inplace_editlink.php?ID={$link.ID}&mode=active&TB_iframe=true&height=100&width=250" onclick="{literal}question = confirm('Are you sure you want to make this link active?');if (question !='0'){return showThickbox(this);} else return false;{/literal}" class="thickbox">
        <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/active.gif" width="14" height="14" style="border: none;" alt="link is inactive" class="float_tiny"/>
    </a>
    {/if}
    {if $link.rights.editLink eq 1 || $link.rights.delLink eq 1}
    {if $link.has_payment > 0}
    <div class="float_tiny" style="color: green; font-weight: bold">$</div>
    {/if}
    {/if}
    </td>
</tr>

</table>

<p style="margin: 0; padding: 0; line-height: 0; height: 15px;"></p>

{/strip}
 {if $edit_link}
{literal}
      <script type="text/javascript">
        new Ajax.InPlaceEditor({/literal}'T_{$link.ID}', '{$smarty.const.DOC_ROOT}/admin/frontend_edit_link.php?a=T_{$link.ID}',{literal} {savingText:{/literal}'<img src="{$smarty.const.DOC_ROOT}/images/indicator.gif" />',{literal} size:30});
        new Ajax.InPlaceEditor({/literal}'U_{$link.ID}', '{$smarty.const.DOC_ROOT}/admin/frontend_edit_link.php?a=U_{$link.ID}',{literal} {savingText:{/literal}'<img src="{$smarty.const.DOC_ROOT}/images/indicator.gif" />',{literal} size:30});
      </script>
      {/literal}
      {/if}