本帖最后由 teakiagy 于 2009-12-24 21:09 编辑
本模板不再修复,过些天发布新版
呵呵,看见有仿我以前的风格的了,这个是在官方自带的fervor基础上修改的,绝大部分的CSS都已经重写,所以后台风格里的一些选项也基本无效了。
这个模板也许会有一些细节错误,因为7.1出来不久7.2就跟着出来了,对于这个过渡时期的产物反正我也懒得改了,修改了一些代码能适用于7.2,很多人找我要,干脆就发了出来……
附件图标已修改为16x16像素,帖子内容页里面的打印,字体大小等功能在下认为没什么用,所以删除了,需要的请自行到默认风格中复制相应代码
用户信息菜单
上图的CSS3圆角效果需要在非IE浏览器才能看见
====================================================================================================
安装方法:
上传所有文件到templates文件夹,
如果你的index.php,viewthread.php,include/global.func.php是未经修改过的(Discuz7.2)
请直接下载压缩包中的文件覆盖
否则按下面的方法手动修改:
【第一步】添加首页头像调用,和非横排板块右侧新帖调用
打开index.php,在- require_once './include/common.inc.php';
复制代码 下面添加:
- $avatar = discuz_uc_avatar($GLOBALS['discuz_uid'], 'small');
- $hack_cut_str =60; //teread_text_count
- $fids = array();
- if (file_exists("./forumdata/cache/cache_forums.php")){
- require_once "./forumdata/cache/cache_forums.php";
- if (is_array($_DCACHE['forums'])){
- foreach ($_DCACHE['forums'] as $k => $v){
- if (!strstr(',sub,forum,',','.$v['type'].',')) continue;
- $fids[$k] = 4; //area_1
- }
- }
- }
- if (count($fids) < 1){
- $query = $db->query("SELECT fid FROM {$tablepre}forums WHERE type='forum' OR type='sub'");
- while ($row = $db->fetch_array($query)){
- $fids[$row['fid']] = 4; //area_2 same to front
- }
- }
- $limit_counts = 0;
- foreach ($fids as $k => $v){
- $sql .= "(SELECT t.*, f.name FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f.fid = t.fid WHERE t.fid='$k' ORDER BY t.dateline DESC LIMIT $v) UNION ";
- }
- if ($sql){
- $sql = substr($sql,0,strlen($sql)-6);
- }
- $query = $db->query($sql);
- while ($row = $db->fetch_array($query)){
- $row['view_subject'] = cutstr($row['subject'],$hack_cut_str);
- $row['date']= gmdate("$dateformat", $row['dateline'] + $timeoffset * 3600);
- if($row['highlight']) {
- $string = sprintf('%02d', $row['highlight']);
- $stylestr = sprintf('%03b', $string[0]);
- $row['highlight'] = 'style="';
- $row['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
- $row['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
- $row['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
- $row['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
- $row['highlight'] .= '"';
- } else {
- $row['highlight'] = '';
- }
- ${'new_no'.$row['fid'].'_threadlist'}[] = $row;
- }
复制代码 【第二步】修改帖子内容页头像区样式:
打开viewthread.php, 搜索:
- $post['avatar'] .= '<br /><img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0" alt="" />';
复制代码 替换为:
- $post['avatar'] .= '<div class="avatar_area_group"><img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" alt="" /></div>';
复制代码 打开include/global.func.php,搜索
- if(empty($GLOBALS['avatarmethod'])) {
- return $returnsrc ? UC_API.'/avatar.php?uid='.$uid.'&size='.$size : '<img src="'.UC_API.'/avatar.php?uid='.$uid.'&size='.$size.'" />';
- }
复制代码 替换为:
- if(empty($GLOBALS['avatarmethod'])) {
- return $returnsrc ? UC_API.'/avatar.php?uid='.$uid.'&size='.$size : '<div class="avatar_area_main"><img src="'.UC_API.'/avatar.php?uid='.$uid.'&size='.$size.'" /></div>';
- }
复制代码 【第三步】修改帖子底部附件显示区样式:
打开templates/default/discuzcode.htm,搜索下面一大段代码:
- <!--{block return}-->
- <!--{if $attach['attachimg']}-->
- <!--{if !IS_ROBOT}-->
- <dl class="t_attachlist attachimg">
- ............................
- <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->
- </dd>
- <!--{/if}-->
- </dl>
- <!--{/block}-->
- <!--{eval return $return;}-->
复制代码 将他们替换为:- <!--{block return}-->
- <!--{if $attach['attachimg']}-->
- <!--{if !IS_ROBOT}-->
- <dl class="newstyle_attachlist nattachimg">
- <dt>
- </dt>
- <dd>
- <p class="newstyle_imgtitle">
- <a href="attachment.php?aid=$aidencode&nothumb=yes" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" id="aid$attach[aid]" class="bold" target="_blank">$attach[filename]</a>
- <em>($attach[attachsize])</em>
- </p>
- <div class="newstyle_attach_popup" id="aid$attach[aid]_menu" style="display: none">
- <div class="cornerlayger">
- <p>$attach[dateline]</p>
- </div>
- <div class="minicorner"></div>
- </div>
- <p>
- <!--阅读权限判断--><!--{if $attach['readperm']}-->{lang readperm}: <strong>$attach[readperm]</strong><!--{/if}-->
- <!--售价判断--><!--{if $attach['price']}-->{lang price}: <strong>{$extcredits[$creditstransextra[1]][title]} $attach[price] {$extcredits[$creditstransextra[1]][unit]}</strong> [<a href="misc.php?action=viewattachpayments&aid=$attach[aid]" onclick="showWindow('attachpay', this.href);return false;" target="_blank">{lang pay_view}</a>]
- <!--已购买判断--><!--{if !$attach['payed']}-->
- [<a href="misc.php?action=attachpay&aid=$attach[aid]" onclick="showWindow('attachpay', this.href);return false;" target="_blank">{lang attachment_buy}</a>]
- <!--{/if}-->
- <!--{/if}-->
- </p>
- <!--附件描述--><!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->
- <!--{if !$attach['price'] || $attach['payed']}-->
- <p>
- <!--{if $thumbstatus && $attach['thumb']}-->
- <a href="javascript:;"><img onclick="zoom(this, '{if $attach[refcheck]}attachment.php?aid=$aidencode&noupdate=yes&nothumb=yes{else}$attach[url]/$attach[attachment]{/if}')" src="{if $attach[refcheck]}attachment.php?aid=$aidencode{else}$attach[url]/$attach[attachment].thumb.jpg{/if}" alt="$attach[filename]" /></a>
- <!--{else}-->
- {eval $GLOBALS[aimgs][$attach[pid]][] = $attach[aid];}{eval $widthcode = attachwidth($attach['width']);}
- <img src="images/common/none.gif" file="{if $attach[refcheck]}attachment.php?aid=$aidencode&noupdate=yes{else}$attach[url]/$attach[attachment]{/if}" $widthcode id="aimg_$attach[aid]" alt="$attach[filename]" />
- <!--{/if}-->
- </p>
- <!--{/if}-->
- </dd>
- <!--{else}-->
- <dl class="newstyle_attachlist nattachimg">
- <!--{if !$attach['price'] || $attach['payed']}-->
- <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->
- <img src="{if $attach[refcheck]}attachment.php?aid=$aidencode&noupdate=yes{else}$attach[url]/$attach[attachment]{/if}" alt="$attach[filename]" />
- <!--{/if}-->
- <!--{/if}-->
- <!--{else}-->
- <dl class="newstyle_attachlist"><!--未插入的附件列表-->
- <dt>
- $attach[attachicon]
- </dt>
- <dd>
- <p class="newstyle_attachname">
- <em class="attachlist_sublv1">
- <!--{if !$attach['price'] || $attach['payed']}-->
- <a <!--{if $attach[readperm] >= 100}-->class="attach_vipicon" <!--{/if}-->href="attachment.php?aid=$aidencode" id="aid$attach[aid]" target="_blank"{if $GLOBALS[attachcredits]} onclick="return creditconfirm('{$GLOBALS[attachcredits]}');"{/if}>$attach[filename]</a>
- <!--{else}-->
- <a <!--{if $attach[readperm] >= 100}-->class="attach_vipicon" <!--{/if}-->href="misc.php?action=attachpay&aid=$attach[aid]" onclick="showWindow('attachpay', this.href);return false;">$attach[filename]</a>
- <!--{/if}-->
- <em class="attach_info_filesiza">($attach[attachsize])</em>
- <span class="attach_info_filedate">$attach[dateline]</span>
- <span class="attach_info_downcount">下载次数:<em>$attach[downloads]</em></span>
- </em>
- <em class="attachlist_sublv2">
- <!--{if $attach['price']}--><!--购买记录-->
- [<a href="misc.php?action=viewattachpayments&aid=$attach[aid]" onclick="floatwin('open_attachpay', this.href, 600, 410);return false;">购买记录</a>]
- <!--{/if}-->
- </em>
- <p>
- <!--{if $attach['price']}--><!--售价-->
- {lang price}: <strong>{$extcredits[$creditstransextra[1]][title]} $attach[price] {$extcredits[$creditstransextra[1]][unit]}</strong>
- <!--{if !$attach['payed']}--><!--购买后-->
- [<a href="misc.php?action=attachpay&aid=$attach[aid]" onclick="showWindow('attachpay', this.href);return false;">{lang attachment_buy}</a>]
- <!--{/if}-->
- <!--{/if}-->
- <!--{if $attach['readperm']}--><!--附件权限-->
- {lang readperm}: <strong>$attach[readperm]</strong>
- <!--{/if}-->
- </p>
- <!--悬停菜单-->
- <div class="newstyle_attach_popup" id="aid$attach[aid]_menu" style="display: none">
- <div class="cornerlayger">
- <!--{if $GLOBALS[attachcredits]}--><p>{lang attachcredits} $GLOBALS[attachcredits]</p><!--{/if}-->
- </div>
- <div class="minicorner"></div>
- </div>
- </p>
- <!--{if $attach['description']}--><p>{$attach[description]}</p><!--{/if}-->
- </dd>
- <!--{/if}-->
- </dl>
- <!--{/block}-->
- <!--{eval return $return;}-->
复制代码 继续查找:- <dl class="t_attachlist attachimg">
复制代码 替换为:- <dl class="newstyle_attachlist nattachimg">
复制代码 查找:- $attach[attachicon] <span style="white-space: nowrap" id="attach_$attach[aid]" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"><a href="attachment.php?aid=$aidencode" target="_blank"{if !$attach['attachimg'] && $GLOBALS[attachcredits]} onclick="return creditconfirm('{$GLOBALS[attachcredits]}');"{/if}><strong>$attach[filename]</strong></a></span> ($attach[attachsize])
复制代码 替换为:- $attach[attachicon] <span style="white-space: nowrap" id="attach_$attach[aid]" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"><a href="attachment.php?aid=$aidencode" target="_blank"{if !$attach['attachimg'] && $GLOBALS[attachcredits]} onclick="return creditconfirm('{$GLOBALS[attachcredits]}');"{/if}><strong>$attach[filename]</strong></a></span> ($attach[attachsize]) <span class="attach_info_downcount">下载次数:<em>$attach[downloads]</em></span>
复制代码 查找:- {lang downloads}: $attach[downloads]<br />
复制代码 删除……
查找:- {lang price}: {$extcredits[$creditstransextra[1]][title]} $attach[price] {$extcredits[$creditstransextra[1]][unit]}<br />
复制代码 替换为:- <strong>{lang price}: {$extcredits[$creditstransextra[1]][title]} $attach[price] {$extcredits[$creditstransextra[1]][unit]}</strong>
复制代码 查找:- <div class="t_smallfont">$attach[dateline]</div>
复制代码 替换为:- <span class="attach_info_filedate">$attach[dateline]</span>
复制代码 【关于附件前面的vip小图标】
修改后的discuzcode.htm,找到- <!--{if $attach[readperm] >= 100}-->class="attach_vipicon" <!--{/if}-->
复制代码 共有相邻的两处,意思就是附件的阅读权限大于100时,显示这个vip样式可根据需要自行修改,或者删除该判断。
风格下载:
附送一套16x16附件图标,解压到images/attachicon目录下
091215修正了22楼提出的错误
091216修正了精华图章看不见的问题 |