{strip}
<div id="container">
{if $edit_link} <div style="clear:both;height:30px"></div><b><span id="T_{$link.ID}">{$link.TITLE|escape|trim}</span></b>&nbsp;
        {if !empty($link.URL)}<a class="link" id="id_{$link.ID}" href="{$link.URL|escape|trim}" title="{$link.TITLE|escape|trim}"
        {* nofollow *}
        {if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
        target="_blank">{/if}<span id="edittitle_{$link.ID}" class="link"><img src="{$smarty.const.DOC_ROOT}/images/external_link.png"       alt="{$link.TITLE|escape|trim}" border="0" /></span>{if !empty($link.URL)}</a>
        {/if} 
     {else}
        {if !empty($link.URL)}{if $link.FEATURED == 1}<div id="titlebar">{else}<div id="titlebar2">{/if}<a id="id_{$link.ID}" href="{$link.URL|escape|trim}" title="{$link.TITLE|escape|trim}"
        {* nofollow *}
        {if $link.NOFOLLOW or ($link.RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $link.RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
        {if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>{/if} <h2>{$link.TITLE|escape|trim|truncate:70}</h2>{if !empty($link.URL)}</a>
        {/if} </div><div id="sidebar-a"><img class="im" src="http://open.thumbshots.org/image.aspx?url={$link.URL}" alt="{$link.TITLE}" title="{$link.TITLE}"></div>
      {/if}


{if $smarty.const.SHOW_PAGERANK}<div id="sidebar-b">{include file="pagerank.tpl" pr=$link.PAGERANK}</div>{/if}

<div id="content">
 {if $edit_link}
   <p id="description{$link.ID}"><span id="D_{$link.ID}">{if !empty($link.DESCRIPTION)}{$link.DESCRIPTION|trim}{else}[{l}No Description{/l}]{/if}</span></p>
      {else}
{if !empty($link.DESCRIPTION)}<p>{$link.DESCRIPTION|trim|truncate:200}</p>{else}[{l}No Description{/l}]{/if}
{/if}
<br />
    {if $edit_link}
        <br /><span class="url" id="U_{$link.ID}">{$link.URL|escape|trim}</span>
        {else}
<span class="url">{$link.URL|escape|trim|truncate:40:'..':true:true}</span>
{/if}
<br /><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}

{if $ratings_on == 1} {if $smarty.const.LINK_RATING_DISPLAY == 'image'}
<span  class="small" style="float: right;">

            {if $link.RATING >0 }
                {section name=foo loop=$link.RATING/$link.VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/stars.png">      
                {/section}
                {if intval($link.RATING/$link.VOTES) < $link.RATING/$link.VOTES}
                    <img src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/stars_m.png">
                {/if} 
            {else}
                Not rated yet            {/if}
    {/if} 
</span>

       [<b>{if $link.COMMENT_COUNT !=''}{$link.COMMENT_COUNT}{else}0{/if}</b>] Reviews. Rating: [<b>{if $link.VOTES}{$link.VOTES}{else}0{/if}</b>] Total Votes: [<b>{if $link.RATING}{$link.RATING/$link.VOTES|truncate:4:""}{else}0{/if}</b>]
{/if}

 {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" 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 link"/>
    </a>
   {/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"  class="thickbox"  onclick="{literal}question = confirm('Are you sure you want to delete this link?');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 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"  class="thickbox"  onclick="{literal}question = confirm('Are you sure you want to make this link 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="category 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}

</div> 

 {if !empty ($search) or !empty ($uid)}
      <p align="right">{l}<strong>Category</strong>{/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 ($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)}
 <div class="float_tiny" style="color: green; font-weight: bold">[<a href="{$smarty.const.DOC_ROOT}/submit.php?linkid={$link.ID}" title="{l}Edit or Remove your link{/l}">{l}Review{/l}</a>]</div>
                                 {/if}
 {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}'D_{$link.ID}', '{$smarty.const.DOC_ROOT}/admin/frontend_edit_link.php?a=D_{$link.ID}',{literal} {savingText:{/literal}'<img src="{$smarty.const.DOC_ROOT}/images/indicator.gif" />',{literal} rows:10, cols:40});
        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}
</div>

{/strip}
