══════════════════════════════════════
■ 感谢您使用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/v2ex | Created By SAi | 4.在界面风格中添加一个新的风格方案,名称随意。之后点击详情,按压缩包中的配色.mht进行设置。
══════════════════════════════════════
5.程序修改部分
5.1 打开config.inc.php,在最后加上如下内容:
-
- $bbsdir = '/bbs'; //请设置您的论坛所在目录,若为根目录请留空
复制代码
5.2 打开include/common.inc.php,在
前加上-
- //计算百分比 By Sai
- $query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts");
- @$percentmine = round($posts * 100 / $db->result($query, 0), 2);
- //显示个人头像 By Sai
- if($allowavatar || $avatarshowstatus || $allownickname) {
- $query = $db->query("SELECT mf.avatar
- FROM {$tablepre}memberfields mf, {$tablepre}members m WHERE m.uid='$discuz_uid' AND mf.uid=m.uid");
- $member = $db->fetch_array($query);
- } else {
- $member = array('nickname' => '', 'avatar' => '', 'avatarshowid' => 0);
- }
- $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,找到
- 'bbcodes' => array('bbcodes', 'smilies'),
复制代码
在下面添加
- 'toplist' => array('newthread'),//TOPLIST by Sai
- 'lastmembers' => array('lastmembers'),//LastMember
复制代码
找到
在上面添加
-
- //S:TOPLIST by Sai
- case 'newthread':
- $table = 'threads t';
- $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';
- $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";
- break;
- //E:TOPLIST by Sai
复制代码
找到
在下面添加
-
- //S:TOPLIST by Sai
- case 'newthread':
- $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
- while($topthread = $db->fetch_array($query)) {
- $threadcolor = sprintf('%02d', $topthread['highlight']);
- $topthread['uid'] = $topthread['uid'];
- $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
- $topthread['subjectc'] = cutstr($topthread['subject'], 50);
- if (preg_match("/^(customavatars\/.+?)$/i",$topthread['avatar'])) {
- $topthread['avatar']=str_replace("customavatars/","/bbs/customavatars/s/",$topthread['avatar']);
- }elseif (preg_match("/^(images\/avatars\/.+?)$/i",$topthread['avatar'])) {
- $topthread['avatar']=str_replace("images/avatars/","/bbs/images/avatars/s/",$topthread['avatar']);
- }else{
- $topthread['avatar']="/bbs/images/common/nohead_n.gif";
- }
- $topthread['threadcolor'] = $threadcolor[1] ? " style="color: ".$colorarray[$threadcolor[1]].""" : NULL;
- $topthread['name'] = AddSlashes(strip_tags(trim($topthread['name'])));
- $data[] = $topthread;
- }
- break;
- //E:TOPLIST by Sai
复制代码
注意修改默认头像nohead_n.gif的路径(最前面一定要带/ )
5.4 打开index.php
找到
- $forumlist = $catforumlist = $forums = $catforums = $categories = $collapse = array();
复制代码
在下面添加
- require_once DISCUZ_ROOT.'./forumdata/cache/cache_toplist.php';
- $toplistloop = $_DCACHE['newthread'];
复制代码
5.5 打开viewthread.php,找到
-
- $post['avatarshow'] = $avatarshowstatus && ($post['avatarshowid'] || $avatarshowdefault) ? avatarshow($post['avatarshowid'], $post['gender']) : '';
- if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
- $post['avatar'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0" style="margin-bottom: 5px;" class="portrait">';
- } elseif($avatarshowstatus != 2 && $_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
- $post['avatar'] = '<img src="'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0" style="margin-bottom: 5px;" class="portrait" />';
- } else {
- $post['avatar'] = '';
- }
复制代码
替换为
-
- $post['avatarshow'] = $avatarshowstatus && ($post['avatarshowid'] || $avatarshowdefault) ? avatarshow($post['avatarshowid'], $post['gender']) : '';
- if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
- $post['stars'] = '';
- $post['avatarcnhky'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0">';
-
- } else {
- $post['avatarcnhky'] = '';
- $post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars'];
- }
- $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;" />';
- if($avatarshowstatus != 2 && $_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
- $post['avatar'] = '<img src="'.$bbsdir.'/'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0" style="margin-bottom: 5px;" class="portrait" />';
-
- } else {
- $post['avatar'] = '';
- }
复制代码
5.6 请安装Tea制作的首页横排插件
程序修改部分结束?(修改太多,我也忘记了 )
══════════════════════════════════════
6.模版修改
进入templates\v2ex目录
修改::NoName Magazine.::无名杂志为您的网站名称
修改header.htm <div id="nav">下的内容
安装到此结束,过程复杂,难免有缺漏,请确认有本安装方法中没有提到的错误后交错误报告
[ 本帖最后由 FujiwaraSai 于 2006-11-28 12:41 编辑 ] |