Discuz   发布时间:2022-05-06  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了PHPWind门户模式中不同栏目定义不同头部的方法大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

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门户模式中不同栏目定义不同头部的方法所遇到的程序开发问题。

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: