年年我发



返回   年年我发 > 网站建设 > 建站交流 > Web Directory
用户名
密码
 
注册账号 论坛帮助 会员列表 日历事件网赚工具 标记版面已读

回复
 
主题工具 搜索本主题 显示模式
  #1   IP: 222.184.115.77
旧 2007-08-18, 12:28 AM
topvip topvip 当前离线
超级版主
 
注册日期: 2006-01-04
帖子: 591
精华: 11
现金: 4425 元
资产: 6873 元
声望: 10 topvip 正向着好的方向发展
默认 Random Featured Links on front page (phpld)

This is working and tested with version 2.1, see at www.azet.co.uk

new file random_featured.tpl in templates dir
引用:
{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
引用:
{include file="random_featured.tpl"}

i am using as showed bellow with combination of google adsense
引用:
{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
引用:
echo $tpl->fetch('main.tpl', $id);

place above

引用:
$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

引用:
{include file="link.tpl" link=$link}

to

引用:
{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
回复时引用此帖

wellcome to www.0058.net
  #2   IP: 222.184.115.77
旧 2007-08-18, 12:29 AM
topvip topvip 当前离线
超级版主
 
注册日期: 2006-01-04
帖子: 591
精华: 11
现金: 4425 元
资产: 6873 元
声望: 10 topvip 正向着好的方向发展
默认

just an example:
http://www.azet.co.uk/
回复时引用此帖
回复


当前查看此主题的会员: 1 (0 位会员和 1 位游客)
 
主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

论坛启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
论坛跳转

相似的主题
主题 主题作者 版面 回复 最后发表
Front page "Latest Links" and "Top Links" (phpld) topvip Web Directory 2 2007-07-10 03:37 PM
How to list 5 random FEATURED sites on the front page? (phpld) topvip Web Directory 0 2007-07-10 02:41 AM
Secret Out - How Google Ranks Websites smiling 搜索引擎市场营销研究 0 2006-05-14 06:51 PM
Successful Site in 12 Months with Google Alone sunshine 搜索引擎市场营销研究 0 2006-02-27 09:27 PM
Building for the user and the bot. admin 建站交流 0 2006-01-17 03:54 PM


所有时间均为北京时间. 现在的时间是 10:47 AM, Free Patent & Patent Ideas


Powered by vBulletin 3.5.2 Chinese Exhibition Happy New Year
©2000 - 2008,Jelsoft Enterprises Ltd  Desiccant Molecular Sieve Weight Loss Bentonite Trade Manager