iKxin

记录一下有玩社区的优化过程
早上改了一下有玩社区的标题字数限制,还专门写了篇文章来做笔记,现在想了想,以后要改的东西还有很多,如果每改一次就写...
扫描右侧二维码阅读全文
30
2019/07

记录一下有玩社区的优化过程

早上改了一下有玩社区的标题字数限制,还专门写了篇文章来做笔记,现在想了想,以后要改的东西还有很多,如果每改一次就写一篇,很明显效率不高,也不方便以后查阅,所以决定用这篇文章来持续记录改过的文件,也方便给有需要的人进行参考。下面所有的修改都是基于discuz3.4版本,如果是以前的版本,可能代码位置不一样,只能以本文作为参考。

因为仅仅是做个记录,所以不会写的很详细,如果小伙伴看不懂的,欢迎下方留言,我会认真回复你的。

4、在线用户页面样式微调

文件路径/template/default/home/space_friend.htm

205行

<div class="xg1">

改成

<div class="xg1" style="white-space: nowrap;">

2019.07.31

3、取消图片弹出下载附件

文件路径/template/default/forum/discuzcode.htm

258行

<img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} style="cursor:pointer" id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G[setting][showexif]}')" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode{else}{$attach[url]}$attachthumb{/if}" inpost="1"{if $_GET['from'] != 'preview'} onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if} />

改成

<img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} style="cursor:pointer" id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" onclick="zoom(this, this.getAttribute('zoomfile'), 0, 0, '{$_G[setting][showexif]}')" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode{else}{$attach[url]}$attachthumb{/if}" inpost="1"{if $_GET['from'] != 'preview'} {if $firstpost && $_G['fid'] && $_G['forum']['picstyle'] && ($_G['forum']['ismoderator'] || $_G['uid'] == $attach['uid'])}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if}{/if} />

260行

<img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes{else}{$attach[url]}$attach[attachment]{/if}" $widthcode id="aimg_$attach[aid]" inpost="1"{if $_GET['from'] != 'preview'} onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if} />

改成

<img{if $attach['price'] && $_G['forum_attachmentdown'] && $_G['uid'] != $attach['uid']} class="attprice"{/if} id="aimg_$attach[aid]" aid="$attach[aid]" src="{STATICURL}image/common/none.gif" zoomfile="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes&#172;humb=yes{else}{$attach[url]}$attach[attachment]{/if}" file="{if $attach[refcheck]}forum.php?mod=attachment{$is_archive}&aid=$aidencode&noupdate=yes{else}{$attach[url]}$attach[attachment]{/if}" $widthcode id="aimg_$attach[aid]" inpost="1"{if $_GET['from'] != 'preview'} {if $firstpost && $_G['fid'] && $_G['forum']['picstyle'] && ($_G['forum']['ismoderator'] || $_G['uid'] == $attach['uid'])}onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"{/if}{/if} />

注释掉267行

<a href="forum.php?mod=attachment{$is_archive}&aid=$aidencode&#172;humb=yes" target="_blank">{lang download}</a>

2019.07.31

2、限制发帖标题字数

文件路径/static/js/forum_post.js

if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") {
    showError('抱歉,您尚未输入标题或内容');
    return false;
} else if(mb_strlen(theform.subject.value) > 80) {
    showError('您的标题超过 80 个字符的限制');
    return false;
}

下面插入

else if(mb_strlen(theform.subject.value) < 20 && mb_strlen(theform.subject.value) > 0) {
    showError('您的标题不足 20 个字符的限制');
    return false;
}

2019.07.30

1、去除标题Powered by Discuz!

文件路径/template/default/common/header_common.htm]

<title><!--{if !empty($navtitle)}-->$navtitle - <!--{/if}--><!--{if empty($nobbname)}--> $_G['setting']['bbname'] - <!--{/if}--> Powered by Discuz!</title>

改为

<title><!--{if !empty($navtitle)}-->$navtitle - <!--{/if}--><!--{if empty($nobbname)}--> $_G['setting']['bbname']<!--{/if}--></title>

2019.07.16

最后修改:2019 年 07 月 31 日 05 : 47 PM
如果觉得我的文章写得不错,请赏我一杯咖啡

发表评论