Are you looking to give those that purchase featured spots on your directory a little more bang for their buck? I have modified the Mod that shows the latest links on your home page that has been published in many places around the web to shop the latest featured listings instead. Not much involved in modifying this Mod but if your interested here’s the code required.
First off you need to add the following to your index.php file and place it just below the “//Make output line” at the bottom of the file:
$last5 = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS = 2 AND FEATURED = 1
ORDER BY DATE_ADDED DESC LIMIT 0,3");
$tpl->assign('last5', $last5);
echo $tpl->fetch('main.tpl', $id);
The above code pulls the last 3 sites approved as featured listings from your database so that they can be called using smarty on your templates. Once that is completed you will need to edit your template file which for most templates is the “main.tpl” file and place any variation of the following code where you want the links to appear. The code below will display the link title only for the 3 latest links separated by a line break “<br/>” :
{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} </strong></a><br/>{/foreach}
This is where you can get creative with how you want this to appear on your page. In my case I used the same code that is used to display featured links on the category/subcategory pages for my particular template to display the link title, description, plus the link to the site detail page. I made a separate template called “frontfeatured.tpl” and than used an include call to place it where I wanted it on the front page. Of course this is just a basic idea on what to do which is only limited by your imagination and your template but it should give you a good idea on how to get started on your directory.