当前样式
function meun_on_con($url) {
$self = explode('/', $_SERVER['SCRIPT_NAME']);
if ($self[1] == $url) {
return "class='on'";
} else {
return "";
}
}
<li <{"news.php"|meun_on_con}>>
<li <{if $smarty.server.SCRIPT_NAME == "/club.php"}>class="on"<{/if}>>
推荐、限制
Trs("newstwo_i", "news_page", "del!=1 and tid=93 and bdid=12 and recommended<>0 order by recommended desc , time desc limit 8");
Trs("newsthree_i", "news_page", "del!=1 and tid=93 and bdid=13 and recommended<>0 order by recommended desc , time desc limit 8");
调用公共内容
调取公共内容
<{include file = "`$app_tpl_w`public/head.tpl"}>
//通过获取id
if ($_GET['id'])
{
$sql = " and id={$_GET['id']}";
}
//抛到页面的名称:pic //获取的数据库:index_pic
Trs("pic","index_pic","del!=1 and tid=67");
//给获取的数据指定一个名称
$index_pic = Dgs("index_pic","del!=1 and tid=67");
$type = Dgs("classify","del!=1 and tid=75 and bdid={$_GET['city']} and bdtid=68");
$champion = Dgs("details","del!=1 and tid=69 and region={$_GET['city']} and title={$type[0]['id']}");
Tr($champion,'details');
foreach ($champion as $key => $value){
$spic = Dgs('spic',"del!=1 and tid=76 and bdid={$value['id']} and bdtid={$value['tid']}");
$hpic = Dgs('hpic',"del!=1 and tid=77 and bdid={$value['id']} and bdtid={$value['tid']} limit 2");
$champion[$key]['spic'] =$spic;
$champion[$key]['hpic'] =$hpic;
}
//通过推荐字段推荐到首页,通过时间排序
Trs("i_dynamic","dynamic","del!=1 and tid=77 and recommend<>0 order by recommend desc , time desc limit 6");
//在页面上限制文档显示的字数
<{$details.advantage|clearhtml|cutstr:'160'}>
Dgs
$financial = Dgs("financial","del!=1 and tid=79");
title={$financial[0]['id']}
$share = Dgs("dynamic","del!=1 and tid=93");
$f_share = Dgs("share","del!=1 and tid=94 and classify={$share[0]['id']}");
Tr($champion,'details');
Tr($today,"today");
修改翻页样式
<{if $typeone}>
<{$pages}>
<{/if}>
fy($param = array(
'result' => 'typeone', //命名
'table' => 'pic', //数据库
'condition' => "del!=1 and tid=75", //判断条件
'perpage' => 4, //显示多少个项目
'type' => 4, //翻页的样式
'nav' => 'pages', //样式命名
//'debug' => 1 //查看属性
));
修改翻页路径:includes/classes/lm_pape.php