首先,随便在后台管理栏目,找到设计欣赏,选择更改标题 还有 绑定域名,然后在“模板设置”处查看引用的“栏目首页模板”是category_heng.php.
然后通过以下三点更改,即可取出只有第三方连接的导航栏目
1.contengTagLib.class.php页面
public function category1($data) {
//缓存时间
$cache = (int) $data['cache'];
$cacheID = to_guid_string($data);
if ($cache && $array = S($cacheID)) {
return $array;
}
$data['catid'] = intval($data['catid']);
$where = $array = array();
//设置SQL where 部分
if (isset($data['where']) && $data['where']) {
$where['_string'] = $data['where'];
}
$db = M("Category");
$num = (int) $data['num'];
if (isset($data['catid'])) {
$where['ismenu'] = array("EQ", 1);
$where['parentid'] = array("EQ", $data['catid']);
$where['url'] = array("like", "http://%");//like http://,这样就获取到不是外站的第三方连接
}
//如果条件不为空,进行查库
if (!empty($where)) {
if ($num) {
$categorys = $db->where($where)->limit($num)->order($data['order'])->select();
} else {
$categorys = $db->where($where)->order($data['order'])->select();
}
}
//结果进行缓存
if ($cache) {
S($cacheID, $categorys, $cache);
}
return $categorys;
}
2.<template file="Contents/header1.php"/>
3.<content action="category1" catid="0" order="listorder ASC" >