anybody can help fix this code of php

Discussion in 'PHP' started by Master Directory, Feb 13, 2010.

  1. #1
    Master Directory, Feb 13, 2010 IP
  2. Master Directory

    Master Directory Well-Known Member

    Messages:
    3,351
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    135
    Digital Goods:
    1
    #2
    this is my code on detail.php
    {capture name="title"}{$TITLE|escape}{$CAT_TREE|regex_replace:"/.$/":""}{/capture}
    {capture assign="in_page_title"}{$TITLE|escape} - {l}Details{/l}{/capture}
    {capture assign="description"}{l}Link Details{/l}{/capture}
    
    {include file="header.tpl"}
    {include file="top_bar.tpl"}
    {strip}
    
    {if $error}
    <p class="err">{l}Error{/l}: {$error}</p>
    <br />
    {else}
    
    <div class="caption"><h2></h2><p>Details information</p></div>
    <div class="content">
    <ul>
    <li><strong>{l}Title{/l}:-</strong>
    {if !empty($URL)}<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}>
    {$TITLE|escape|trim}</a>{else}{$TITLE|escape|trim}{/if}
    </li>
    
    <li><strong>{l}Description{/l}:-</strong> {$DESCRIPTION|trim}<br /><br /></li>
    
    <li><strong>{l}Category{/l}:-</strong> <a href="{$CATEGORY_URL|escape|trim}" title="{$CATEGORY_TITLE|escape|trim}">{$CACHE_TITLE|escape|trim}</a><br /><br /></li>
    {if $TITLE1}
    <tr>
    <td class="label">{l}Quick Links:{/l}</td>
    <td class="smallDesc" align="left"><a href="{$URL1|escape|trim}">{$TITLE1|escape|trim}</a>&nbsp;<a href="{$URL2|escape|trim}">{$TITLE2|escape|trim}</a>&nbsp;<a href="{$URL3|escape|trim}">{$TITLE3|escape|trim}</a>&nbsp;<a href="{$URL4|escape|trim}">{$TITLE4|escape|trim}</a>&nbsp;<a href="{$URL5|escape|trim}">{$TITLE5|escape|trim}</a>&nbsp;</td>
    </tr>
    {/if} 
    
    
    {if $smarty.const.SHOW_PAGERANK}
    <li><strong>{l}Pagerank{/l}:-</strong> {if $PAGERANK ge 0}{$PAGERANK}{else}N/A{/if}</li>
    {/if}
    
    <li><strong>{l}ID{/l}:-</strong> {$ID}</li>
    
    
    <li><strong>{l}Link Owner{/l}:-</strong> {$OWNER_NAME|escape|trim}</li>
    <li><strong>{l}Date Added{/l}:-</strong> {$DATE_ADDED|escape|trim}</li>
    <li><strong>{l}Number Hits{/l}:-</strong> {$HITS|escape|trim}</li>
    
    
    {if $smarty.const.GMAP_ENABLE && $ADDRESS }
        <li>{l}Address{/l}: {$ADDRESS|escape|trim}</li>
    	<li>{l}City{/l}: {$CITY|escape|trim}</li>
    	<li>{l}State{/l}: {if $STATE != ""}{$STATE|escape|trim}{/if}</li>
    	<li>{l}Zip Code{/l}: {if $ZIP != ""}{$ZIP|escape|trim}{else}N/A{/if}</li>
    	<li>{l}Phone Number{/l}: {if $PHONE_NUMBER != ""}{$PHONE_NUMBER|escape|trim}{else}N/A{/if}</li>
    {/if}	
    	
    
    </ul>
    </div>
    <br />
    
    
    {if $smarty.const.GMAP_ENABLE && $ADDRESS }
    
    <div class="caption"><h2></h2><p>{l}Map{/l}:</p></div>
    <div class="content">
    {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: 500px; height: 300px; border: 1px solid #6ca901;"></div>
    </div>
    <br />
    {/if}
    
    
    
    
    <div class="caption"><h2></h2><p>Alexa information</p></div>
    <div class="content">
    <img border="0" class="captcha" src="http://traffic.alexa.com/graph?w=379&amp;h=216&amp;r=6m&amp;z=&amp;y=r&amp;u={$URL|escape|trim}&amp;u=" alt="" />
    </div>
    {* Javascript for tracking link clicks *}
    <script language="javascript" 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>
    
    {/if}
    {/strip}
    {include file="footer.tpl"}
    Code (markup):
     
    Master Directory, Feb 13, 2010 IP
  3. felixjet

    felixjet Greenhorn

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    20
    #3
    i think you shouldnt make templates with tables. anyway the quick links table is wrong, use firebug to edit it and change the styles as the others
     
    felixjet, Feb 14, 2010 IP
  4. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #4
    danx10, Feb 14, 2010 IP