Search
  
Categories
 Last Articles
 Design
 Coding: PHP and Smarty
 Miscellaneous
 Admin Area
 Installation
[add new article]
Add the Latest Links to the Homepage

Author: David
Added: February 11, 2007

In the .tpl file where you want the links to be output add this:

<h3>Latest Links</h3>
{foreach from=$last5 item=link name=links}
<a href="{if $smarty.const.ENABLE_REWRITE}{$link.URL|escape}/{else}index.php?c={$link.ID}{/if}"><strong>{$link.TITLE|escape}</a>
<br /><br />{/foreach}



In index.php file add this right after //Make output

$last5 = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS = 2 ORDER BY ID DESC LIMIT 0,5");
$tpl->assign('last5', $last5);
echo $tpl->fetch('main.tpl', $id);