This is working and tested with version 2.1, see at
www.azet.co.uk
new file random_featured.tpl in templates dir
Quote:
{if $category.ID eq 0 and not $p and not $qu}
<h2>{l}Random Featured Links{/l}</h2>
<div class="featured">
{foreach from=$random_link item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}</div>
{/if}
|
edit templates/main.tpl - paste the code where you want to display the links
Quote:
|
{include file="random_featured.tpl"}
|
i am using as showed bellow with combination of google adsense
Quote:
{if $smarty.const.FTR_ENABLE == 1 and !empty($feat_links)}
<h2>{l}Featured Links{/l}</h2>
<br />
<div class="featured">
{foreach from=$feat_links item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}</div>
{/if}
{* google *}
{if $category.ID != 0}
{include file="googlead.tpl"}
{else}
{include file="random_featured.tpl"}
{/if}
|
last edit index.php
find
Quote:
|
echo $tpl->fetch('main.tpl', $id);
|
place above
Quote:
$random_link = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE FEATURED = 1 AND STATUS=2 ORDER BY RAND() LIMIT 3");
$tpl->assign('random_link', $random_link);
|
that's it
for more customized design edit in random_featured.tpl line
Quote:
|
{include file="link.tpl" link=$link}
|
to
Quote:
|
{include file="link2.tpl" link=$link}
|
now you need to create new file link2.tpl as new template for the random featured links on front page
have fun