Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

■ NoNameMag Style■ By Sai [Last update 11-28 12:40]

 关闭 [复制链接]
FujiwaraSai 发表于 2006-11-27 22:53:56 | 显示全部楼层 |阅读模式
══════════════════════════════════════
■ 感谢您使用Sai制作的模版!
══════════════════════════════════════
    模版制作: Sai
    个人网站: http://saicn.com
    电子邮件: sai#live.com
    原作者V2EX.com Livd授权Sai转换至Discuz
══════════════════════════════════════
■ 演示地址
══════════════════════════════════════
首页 http://saicn.com/bbs
帖子列表 http://saicn.com/bbs/forum/27/1
主题页面 http://www.saicn.com/bbs/thread/4904/1/1
══════════════════════════════════════
■ 在您使用此模版前请仔细阅读此说明
══════════════════════════════════════
[box=wheat]本风格安装过程较为复杂,涉及较多的程序修改,推荐有一定基础的朋友安装使用[/box]
安装方法
1.请确认您的主机支持.htaccess文件的使用,若无法使用,则不能安装本风格

2.按照目录结构上传压缩包内的images以及templates内的文件夹以及.htaccess文件

3.在后台模板编辑添加一个新的模版套系,设置如下:
模板名称所在目录版权信息
v2ex./templates/v2exCreated By SAi
4.在界面风格中添加一个新的风格方案,名称随意。之后点击详情,按压缩包中的配色.mht进行设置。

══════════════════════════════════════
5.程序修改部分
5.1 打开config.inc.php,在最后加上如下内容:

  1. $bbsdir = '/bbs'; //请设置您的论坛所在目录,若为根目录请留空
复制代码


5.2 打开include/common.inc.php,在
  1. ?>
复制代码

加上

  1. //计算百分比 By Sai
  2. $query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts");
  3. @$percentmine = round($posts * 100 / $db->result($query, 0), 2);
  4. //显示个人头像 By Sai
  5. if($allowavatar || $avatarshowstatus || $allownickname) {
  6.                  $query = $db->query("SELECT mf.avatar
  7.                          FROM {$tablepre}memberfields mf, {$tablepre}members m WHERE m.uid='$discuz_uid' AND mf.uid=m.uid");
  8.                  $member = $db->fetch_array($query);
  9.          } else {
  10.                  $member = array('nickname' => '', 'avatar' => '', 'avatarshowid' => 0);
  11.          }
  12.          $avatarmine = $avatarshowstatus != 2 && $member['avatar'] ? "<img src="$thread[avatarx]" height="16" width="16" class="portrait" align="absmiddle">" : "<img src="/images/common/nohead_n.gif" height="16" width="16" class="portrait" align="absmiddle">";
复制代码


注意修改默认头像nohead_n.gif的路径(最前面一定要带/ )

5.3 打开include/cache.func.php,找到
  1.   'bbcodes' => array('bbcodes', 'smilies'),
复制代码

下面添加
  1.   'toplist'   => array('newthread'),//TOPLIST by Sai
  2.   'lastmembers' => array('lastmembers'),//LastMember
复制代码


找到
  1.   case 'medals':
复制代码

上面添加

  1.     //S:TOPLIST by Sai
  2.                 case 'newthread':
  3.                         $table = 'threads t';
  4.                         $cols = 't.tid, t.fid, t.author,t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name, mf.avatar';
  5.                         $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid LEFT JOIN {$tablepre}memberfields mf ON mf.uid=t.authorid WHERE t.displayorder!='-1' and f.fid!='72'and f.fid!='73'and f.fid!='76'and f.fid!='49'and f.fid!='67'and f.fid!='74'and f.fid!='77'and f.fid!='46' and f.fid!='6'and f.fid!='25'and f.fid!='51'and f.fid!='26'and f.fid!='64' ORDER BY t.dateline DESC LIMIT 0, 10";
  6.                         break;
  7. //E:TOPLIST by Sai
复制代码


找到
  1. switch($cachename) {
复制代码

下面添加

  1.   //S:TOPLIST by Sai
  2.                 case 'newthread':
  3.                         $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
  4.                         while($topthread = $db->fetch_array($query)) {
  5.                                 $threadcolor = sprintf('%02d', $topthread['highlight']);
  6.                                 $topthread['uid'] = $topthread['uid'];
  7.                                 $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
  8.                                 $topthread['subjectc'] = cutstr($topthread['subject'], 50);
  9.         if (preg_match("/^(customavatars\/.+?)$/i",$topthread['avatar'])) {
  10.          $topthread['avatar']=str_replace("customavatars/","/bbs/customavatars/s/",$topthread['avatar']);
  11.         }elseif (preg_match("/^(images\/avatars\/.+?)$/i",$topthread['avatar'])) {
  12.          $topthread['avatar']=str_replace("images/avatars/","/bbs/images/avatars/s/",$topthread['avatar']);
  13.         }else{
  14.          $topthread['avatar']="/bbs/images/common/nohead_n.gif";
  15.         }
  16.         $topthread['threadcolor'] = $threadcolor[1] ? " style="color: ".$colorarray[$threadcolor[1]].""" : NULL;
  17.                                 $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
  18.                                 $data[] = $topthread;
  19.                         }
  20.                         break;
  21.                 //E:TOPLIST by Sai
复制代码

注意修改默认头像nohead_n.gif的路径(最前面一定要带/ )

5.4 打开index.php
找到
  1. $forumlist = $catforumlist = $forums = $catforums = $categories = $collapse = array();
复制代码

在下面添加
  1.         require_once DISCUZ_ROOT.'./forumdata/cache/cache_toplist.php';
  2.         $toplistloop = $_DCACHE['newthread'];
复制代码


5.5 打开viewthread.php,找到

  1. $post['avatarshow'] = $avatarshowstatus && ($post['avatarshowid'] || $avatarshowdefault) ? avatarshow($post['avatarshowid'], $post['gender']) : '';
  2.                         if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
  3.                                 $post['avatar'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0" style="margin-bottom: 5px;" class="portrait">';
  4.                         } elseif($avatarshowstatus != 2 && $_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
  5.                                 $post['avatar'] = '<img src="'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0" style="margin-bottom: 5px;" class="portrait" />';
  6.                         } else {
  7.                                 $post['avatar'] = '';
  8.                         }
复制代码

替换为

  1. $post['avatarshow'] = $avatarshowstatus && ($post['avatarshowid'] || $avatarshowdefault) ? avatarshow($post['avatarshowid'], $post['gender']) : '';
  2.                         if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
  3.                                 $post['stars'] = '';
  4.                                 $post['avatarcnhky'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0">';
  5.                         
  6.                         } else {
  7.                                 $post['avatarcnhky'] = '';
  8.                                 $post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars'];
  9.                         }
  10.                         $post['avatarmini'] = '<img src="'.$bbsdir.'/'.$post['avatar'].'" width="32" height="32" border="0" align="absmiddle" style="border-left: 2px solid '.$topic_color.'; padding: 0px 5px 0px 5px;" />';
  11.                         if($avatarshowstatus != 2 && $_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
  12.                         $post['avatar'] = '<img src="'.$bbsdir.'/'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0" style="margin-bottom: 5px;" class="portrait" />';
  13.                                 
  14.                         } else {
  15.                                 $post['avatar'] = '';
  16.                         }
复制代码


5.6 请安装Tea制作的首页横排插件
程序修改部分结束?(修改太多,我也忘记了
══════════════════════════════════════
6.模版修改
进入templates\v2ex目录
修改::NoName Magazine.::无名杂志为您的网站名称
修改header.htm <div id="nav">下的内容

安装到此结束,过程复杂,难免有缺漏,请确认有本安装方法中没有提到的错误后交错误报告

[ 本帖最后由 FujiwaraSai 于 2006-11-28 12:41 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| FujiwaraSai 发表于 2006-11-27 22:55:31 | 显示全部楼层
程序修改更新 2006-11-28 11:40

隔帖换色的修改
打开viewthread.php
找到

  1. $post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
复制代码


上面添加

  1.   $post['v2bg'] = $v2bg = isset($v2bg) && $v2bg == 'light_odd' ? 'light_even' : 'light_odd';
复制代码


增加搜索引擎收录的修改
将global.func.php中的
function rewrite_thread,function rewrite_forum替换为

  1. function rewrite_thread($tid, $page = 0, $prevpage = 0, $extra = '') {
  2. return '<a href="/bbs/thread/'.$tid.'/'.($page ? $page : 1).'/'.($prevpage ? $prevpage : 1).'"'.stripslashes($extra).'>';
  3. }
  4. function rewrite_forum($fid, $page = 0, $extra = '') {
  5. return '<a href="/bbs/forum/'.$fid.'/'.($page ? $page : 1).'"'.stripslashes($extra).'>';
  6. }
复制代码

[ 本帖最后由 FujiwaraSai 于 2006-11-28 12:44 编辑 ]
回复

使用道具 举报

AgFx 发表于 2006-11-27 22:55:43 | 显示全部楼层
沙发支持~~
回复

使用道具 举报

渴望无限 发表于 2006-11-27 22:57:14 | 显示全部楼层
支持啊,呵呵
.........
回复

使用道具 举报

ComsenzInc 发表于 2006-11-27 23:00:11 | 显示全部楼层
;P ;P
看来我不用做下去了..支持!

[ 本帖最后由 ComsenzInc 于 2006-11-27 23:03 编辑 ]
回复

使用道具 举报

ComsenzInc 发表于 2006-11-27 23:00:55 | 显示全部楼层
占一楼....

[ 本帖最后由 ComsenzInc 于 2006-11-27 23:03 编辑 ]
回复

使用道具 举报

ComsenzInc 发表于 2006-11-27 23:04:17 | 显示全部楼层
没有人要..再占一楼..如果不是.5.0我可以提供升级,呵呵.
回复

使用道具 举报

houstun 发表于 2006-11-27 23:04:32 | 显示全部楼层
HOHO~抢个页.支持啊
回复

使用道具 举报

NNXK.CN 发表于 2006-11-28 00:01:23 | 显示全部楼层
还真是复杂……
回复

使用道具 举报

ComsenzInc 发表于 2006-11-28 00:13:06 | 显示全部楼层
images/common/q_edit.gif
请提供这个图像..
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-25 23:01 , Processed in 1.073347 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表