加入收藏 | 设为首页 | 会员中心 | 我要投稿 湖南网 (https://www.hunanwang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

PHPWind门户模式中不同栏目定义不同头部的方法

发布时间:2021-03-31 10:11:09 所属栏目:教程 来源:网络整理
导读:PHPWind派别模式中差异栏目界说差异头部的要领 先看pw common.php的代码 function getAreaSrcTpl($template,$EXT='htm'){ global $db_tplstyle,$area_indextpl; if ($template=='header' || $template=='footer') { $srcTpl = M_P.themes/$area_indextpl/$te

PHPWind派别模式中差异栏目界说差异头部的要领

先看pw common.php的代码

function getAreaSrcTpl($template,$EXT='htm'){
global $db_tplstyle,$area_indextpl;
if ($template=='header' || $template=='footer') {
$srcTpl = M_P."themes/$area_indextpl/$template.$EXT";
} else {
$srcTpl = M_P."themes/$db_tplstyle/$template.$EXT";
}
if (!file_exists($srcTpl)) { //liehuo.net
global $area_indextpl;
if ($area_indextpl!='default' && file_exists(M_P."themes/$area_indextpl/$template.$EXT")) {
$srcTpl = M_P."themes/$area_indextpl/$template.$EXT";
} else {
$srcTpl = M_P."themes/default/$template.$EXT";
}
}
return $srcTpl;
}

因为行使了

知道你要收罗,www.liehuo。net

if ($template=='header' || $template=='footer') {
$srcTpl = M_P."themes/$area_indextpl/$template.$EXT";
} else {

以是同一了头部和底部,可是许多环境但愿每个频道头部纷歧样,变动要领为:

将cate.php中

require_once(M_P.'require/header.php');

改成

require_once(M_P.'require/header_cate.php');

然后复制一个header.php更名为header_cate.php;

变动require_once PrintEot('header');

为require_once PrintEot('header_cate');

然后在每个气魄威风凛凛目次中加上header_cate.htm,这样就可觉得每个频道拟定差异头部了。在气魄威风凛凛模板中

(编辑:湖南网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读