{*********************************************************
* Copyright (c) 2009 PHPLDTemplates.com
* Theme Author: http://www.PHPLDTemplates.com
* Theme URL: http://www.phpldtemplates.com/2009/07/free-phpld-template-dbs-3/
* 
* Report bug: Please email contact @ PHPLDTemplates.com
* License: Free, provided user keeps the footer links intake. Not to be resold.
* More free phpld templates are available at http://www.PHPLDTemplates.com
* 
**********************************************************}
{strip}
	<tr>
		<td>
			<img alt="site preview" class="thumb" src="http://open.thumbshots.org/image.pxf?url={$link.URL|escape|trim}" />
	
   			<div class="linkdesc">
				<div class="listheading">
					{if $edit_link}
						<span id="T_{$link.ID}">{$link.TITLE|escape|trim}</span>&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}" /></span>
						{if !empty($link.URL)}
							</a>
						{/if} 
					{else}
						{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} {if $smarty.const.ENABLE_BLANK} target="_blank"{/if}>
						{/if}

						<span  id="edittitle_{$link.ID}" class="link">{$link.TITLE|escape|trim}</span>
		
						{if !empty($link.URL)}
							</a>
						{/if}	
					{/if}
		
					&nbsp;[&nbsp;
					{if $edit_link}
						<span id="U_{$link.ID}" style="color: #999;">{$link.URL|escape|trim}</span>
					{else}
					      {if $link.FEATURED}
							<span class="featurl">{$link.URL|escape|trim}</span>
					      {else}
							<span class="url">{$link.URL|escape|trim}</span>
						{/if}
					{/if}
					&nbsp;]

			      </div>

				{if $smarty.const.SHOW_PAGERANK}
			      	{include file="pagerank.tpl" pr=$link.PAGERANK}
				{/if}

				{if $edit_link}
					<span id="D_{$link.ID}">{if !empty($link.DESCRIPTION)}{$link.DESCRIPTION|trim}{else}[{l}No Description{/l}]{/if}</span>
				{else}
					<span id="editdescrip_{$link.ID}">{if !empty($link.DESCRIPTION)}{$link.DESCRIPTION|trim}{else}[{l}No Description{/l}]{/if}</span>
				{/if} 

				&nbsp;[&nbsp;
				<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}
				&nbsp;]

				{if !empty ($search) or !empty ($uid)}       
					<br />{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>  
				{/if} 
			</div>

			{if $link.rights.editLink eq 1 || $link.rights.delLink eq 1 || (($link.STATUS<2) && $link.rights.editLink eq 1) }
			<div class="frontend_actions">
    				{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" class="float_tiny" />
    					</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" class="float_tiny" />
   					</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}


		</td>
	</tr>
	<tr>
		<td>
			<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}
							<a 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}Rate This Website{/l}: {$link.TITLE|escape|trim}"><img style="float:left;border:0px;" src="{$smarty.const.DOC_ROOT}/templates/{$smarty.const.USE_TEMPLATE}/images/ratethisbutton.gif"></a>   
        					{/if}

    					{/if}
				{/if}
        			<div 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}</div>
   			</div>
		</td> 
	</tr>    

	{if !$smarty.foreach.links.last}<tr><td colspan="2"><hr /></td></tr>{/if}

{/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}'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}
