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

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

概述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 { $src…

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,这样就可以为每个频道制定不同头部了。在风格模板中

总结

以上是内存溢出为你收集整理的PHPWind门户模式中不同栏目定义不同头部的方法全部内容,希望文章能够帮你解决PHPWind门户模式中不同栏目定义不同头部的方法所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/1000358.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存