{*********************************************************
* 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
* 
**********************************************************}
{capture name="title"}{$TITLE|escape|trim} - {l}Details{/l} -{$CAT_TREE|regex_replace:"/.$/":""}{/capture}
{capture assign="in_page_title"}{$TITLE|escape|trim} - {l}Details{/l}{/capture}
{capture assign="description"}{l}Link 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}
{foreach from=$widgets.LINK_DETAIL.TOP 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}

<table class="formPage" align="center">
   <tr>
      <td class="label">{l}ID{/l}:</td>
      <td class="field"><b>{$ID}</b></td>
   </tr>
   <tr>
      <td class="label">{l}Title{/l}:</td>
      <td class="field" align="left">
     <span class="link" id="edittitle">{$TITLE|escape|trim}</span>
     
     {if !empty($URL)}
     	 &nbsp;&nbsp; - &nbsp;&nbsp;
        
     	 <a id="id_{$ID}" href="{$URL|escape|trim}" title="{$TITLE|escape|trim}"
         {* nofollow *}
         {if $NOFOLLOW or ($RECPR_VALID eq 0 and ($smarty.const.RECPR_NOFOLLOW eq 2 or ($smarty.const.RECPR_NOFOLLOW eq 1 and $RECPR_REQUIRED eq 1)))} rel="nofollow"{/if}
         {if $smarty.const.ENABLE_BLANK} target="_blank"{/if} >
         {$URL|escape|trim}</a> 
	{/if}

      </td>
   </tr>

   {if $smarty.const.SHOW_PAGERANK}
   <tr>
      <td class="label">{l}Pagerank{/l}:</td>
      <td class="field">{if $PAGERANK ge 0}{$PAGERANK}{else}N/A{/if}</td>
   </tr>
   {/if}
   <tr>
      <td class="label">{l}Description{/l}:</td>
      <td class="field" align="left" id="editdescrip_{$ID}">{$DESCRIPTION|trim}</td>      
   </tr>
   <tr>
      <td class="label">{l}Category{/l}:</td>
      <td class="field"><a href="{$CATEGORY_URL|escape|trim}" title="{$CATEGORY_TITLE|escape|trim}">{$CACHE_TITLE|escape|trim}</a></td>
   </tr>
   <tr>
      <td class="label">{l}Link Owner{/l}:</td>
      <td class="field"><b>{$OWNER_NAME|trim}</b></td>
   </tr>
   <tr>
      <td class="label">{l}Date Added{/l}:</td>
      <td class="field">{$DATE_ADDED|escape|trim}</td>
   </tr>
   <tr>
      <td class="label">{l}Number Hits{/l}:</td>
      <td class="field"><b>{$HITS|escape|trim}</b></td>
   </tr>
   {if $smarty.const.GMAP_ENABLE && $ADDRESS }
   <tr>
      <td class="label">{l}Address{/l}:</td>
      <td class="field">{$ADDRESS|escape|trim}</td>
   </tr>
  <tr>
   <td class="label">{l}City{/l}:</td>
   <td class="field">{$CITY|escape|trim}</td>
  </tr>
  <tr>
   <td class="label">{l}State{/l}:</td>
   <td class="field">{if $STATE != ""}{$STATE|escape|trim}{/if}</td>
  </tr>
  <tr>
   <td class="label">{l}Zip Code{/l}:</td>
   <td class="field">{if $ZIP != ""}{$ZIP|escape|trim}{else}N/A{/if}</td>
  </tr>
   <td class="label">{l}Phone Number{/l}:</td>
   <td class="field">{if $PHONE_NUMBER != ""}{$PHONE_NUMBER|escape|trim}{else}N/A{/if}</td>
  </tr>
  <tr><td class="label">{l}Map{/l}:</td>
  <td class="field">
  {literal} 
 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={/literal}{$GMAPKEY}{literal}"
type="text/javascript"></script> 
<script type="text/javascript"> 
//<![CDATA[ 
function load() { 
if (GBrowserIsCompatible()) { 
var map = new GMap2(document.getElementById("map")); 
} 
geocoder = new GClientGeocoder(); 
var latitude = ''; 
var longitude = ''; 
if (geocoder) { 
{/literal} 
var address = '{$ADDRESS|replace:"'":"\\'"},{$CITY},{$STATE}'; 
{literal} 
geocoder.getLatLng(address, 
function(point) { 
if (point) { 
map.addControl(new GSmallMapControl()); 
map.addControl(new GMapTypeControl()); 
map.setCenter(point, 15); 
map.addOverlay(new GMarker(point)); 
function createMarker(point) { 
var marker = new GMarker(point); 
GEvent.addListener(marker, "click", function() { 

{/literal} 
marker.openInfoWindowHtml("<b>{$TITLE} <br />{$ADDRESS}{if $CITY != ""}<br /> {$CITY}{/if}{if $STATE != ""}<br /> {$STATE}{/if}{if $ZIP != ""}<br /> {$ZIP}{/if}{if $PHONE_NUMBER != ""}<br /> {$PHONE_NUMBER}{/if}</b>"); }); 
{literal} 

return marker; 
} 
map.addOverlay(createMarker(point)); 
} 
} 
); 
} 
} 
//]]> 
</script> 
{/literal} 

<div id="map" style="margin-left:0px; width: 400px; height: 300px;"></div><br/><br/> 
</div> 
</td>
</tr>
  {/if}

<tr>
	<td colspan="2">
			<div class="frontend_actions">
        		{if $rights.editLink eq 1}
        			<a href="{$smarty.const.DOC_ROOT}/inplace_editlink.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 link"/>
        			</a>        
        		{/if}

        		{if $rights.delLink eq 1}  
        			<a href="{$smarty.const.DOC_ROOT}/inplace_editlink.php?ID={$ID}&mode=del&detail=1&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 $STATUS<2 && $rights.editLink eq 1}
        			<a href="{$smarty.const.DOC_ROOT}/inplace_editlink.php?ID={$ID}&mode=active&detail=1&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="link is inactive" class="float_tiny"/>
        		{/if}

        		{if $rights.editLink eq 1 || $rights.delLink eq 1}
        			{if $has_payment > 0}
        				<div class="float_tiny" style="color: green; font-weight: bold">$</div>
        			{/if}
        		{/if}
        	</div>
    	</td>
</tr> 
<tr><td colspan="2">&nbsp;</td></tr>

</table>
 
{if $ratings_on == 1}
	<h3>{l}Ratings{/l}</h3>

	<table class="details">
	<tr>
		<td>
		<div class="ratings-area">
	    	{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 this site{/l}: &nbsp;</a>
	       	<form name="rating" action="{$smarty.const.DOC_ROOT}/detail.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}
	       	<a href="{$smarty.const.DOC_ROOT}/login.php" class="error">{l}You must be logged in to leave a rating{/l}.</a><br /> 
		{/if}

		<b>{l}Average rating{/l}:</b> {$RATING} ({if !$VOTES}0{else}{$VOTES}{/if} {l}votes{/l})

		</div>
		</td>
	</tr>
	</table>

{/if}
  
{if $comments_on == 1}
	<h3>{l}Reviews{/l}</h3>

	<table class="details">
	<tr>
		<td>
		<div class="reviews-area">

         	{* 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}
            	<p>{l}No Reviews Yet{/l}.</p>
         	{/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}/detail.php?action=C:{$ID}" method="post">
            		<table width="100%" cellspacing="0" cellpadding="0">
            		<tr>
                			<td colspan="2">
                    			<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 $subscribe}          
                   				You are subscribed to this article for receiving future comments. <a href="{$smarty.const.DOC_ROOT}/detail.php?id={$ID}&action=U:{$ID}">Unsubscribe</a>
                   				<br />
                				{else}
                   				<label for="subscribe">Subscribe for comments</label> <input type="checkbox" id="subscribe" name="subscribe" value="1"><br />
                				{/if}
        				</td>
            		</tr> *}

            		<tr>
                			<td colspan="2">
                				{if $smarty.const.VISUAL_CONFIRM_LINK_COMMENTS}
                   				{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}

                				<input id="submit" name="submit" type="hidden" value="submit" />
                				<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}

		</div>
		</td>
	</tr>
	</table>
{/if}


{* Javascript for tracking link clicks *}
<script type="text/javascript">
/* <![CDATA[ */
   var root = '{$smarty.const.DOC_ROOT}';
   {literal}
   var a = document.getElementsByTagName("a");
   for(i = 0; i< a.length; i++)
      if(a[i].id != '')
         a[i].onclick = count_link;
   function count_link() {
      i = new Image();
      i.src= root+'/cl.php?id='+this.id;
      return true;
   }
   {/literal}
/* ]]> */
</script>


{foreach from=$widgets.LINK_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}

{/if}
{/strip}
{include file="footer.tpl"}
