本帖最后由 psdshow 于 2009-7-16 22:34 编辑
看到不少人在寻找各人模板与个人子页模板统一的方法
我的前一段时间调整了一下 实现了统一
演示查看http://home.ningyuan.me/2 (链接就不加了,复制到地址栏去查看吧)
方法是修改了2个程序文件 仅加了小段代码 不影响原先程序使用
修改了大量原来的模板文件,因为原来的文件css导致统一时严重错位
修改前请先备份。
找到space.php文件
- //获取空间
- if($uid) {
- $space = getspace($uid, 'uid', 0);
- } elseif ($username) {
- $space = getspace($username, 'username', 0);
- } elseif ($domain) {
- $space = getspace($domain, 'domain', 0);
- } else {
- if(empty($_SGLOBAL['supe_uid'])) {
- if ($do != 'mtag') {
- ssetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));
- showmessage('to_login', 'do.php?ac='.$_SCONFIG['login_action']);
- }
- } else {
- $space = getspace($_SGLOBAL['supe_uid'], 'uid', 0);
- }
- }
复制代码
换行后加入
- //风格
- $_SGLOBAL['space_theme'] = $space['theme'];
- $_SGLOBAL['space_css'] = $space['css'];
复制代码
在uchome根目录下的cp.php找到下面的代码
- //获取空间信息
- $space = getspace($_SGLOBAL['supe_uid']);
- if(empty($space)) {
- showmessage('space_does_not_exist');
- }
复制代码 换行后在后面加入- //风格
- $_SGLOBAL['space_theme'] = $space['theme'];
- $_SGLOBAL['space_css'] = $space['css'];
复制代码 文件userapp.php文件找到 约16行- //空间信息
- $space = getspace($_SGLOBAL['supe_uid']);
复制代码 换行后在后面加入- //风格
- $_SGLOBAL['space_theme'] = $space['theme'];
- $_SGLOBAL['space_css'] = $space['css'];
复制代码 在network.php中找到 约35行- $space = $_SGLOBAL['supe_uid']?getspace($_SGLOBAL['supe_uid']):array();
复制代码 换行后在后面加入- //风格
- $_SGLOBAL['space_theme'] = $space['theme'];
- $_SGLOBAL['space_css'] = $space['css'];
复制代码 后面大部分是调整模板template\default\下的模板文件的工作了,太多的模板需要调整了,不调整的话严重变形,
主要是页面模板中包含<div class="tabs_header">的,将前面一个区块的内容调整到这个区块后面去就可以了 |