晚风之家's Archiver

晚风 发表于 2007-3-24 22:57

站内插件安装顺序

便于以后升级方便,整理一下所有修改的文件,便于下次升级

晚风 发表于 2007-3-24 22:58

1.统一联盟论坛LOGO大小 [color=Red]for6.1[/color]

打开include/cache.func.php 找:[code]$tightlink_logo .= "<a href=\"$flink[url]\" target=\"_blank\"><img src=\"$flink[logo]\" border=\"0\" alt=\"$flink[name]\" /></a> ";[/code]替换为:[code]$tightlink_logo .= "<a href=\"$flink[url]\" target=\"_blank\"><img src=\"$flink[logo]\" border=\"0\" alt=\"$flink[name]\" / width=\"88\" height=\"31\"></a> ";[/code]

晚风 发表于 2007-3-26 09:05

军衔替代星星图for6.1

第1步:include/global.func.php

找到代码:[code]function showstars($num) {

        global $starthreshold;



        $alt = 'alt="Rank: '.$num.'"';

        if(empty($starthreshold)) {

                for($i = 0; $i < $num; $i++) {

                        echo '<img src="'.IMGDIR.'/star_level1.gif" '.$alt.' />';

                }

        } else {

                for($i = 3; $i > 0; $i--) {

                        $numlevel = intval($num / pow($starthreshold, ($i - 1)));

                        $num = ($num % pow($starthreshold, ($i - 1)));

                        for($j = 0; $j < $numlevel; $j++) {

                                echo '<img src="'.IMGDIR.'/star_level'.$i.'.gif" '.$alt.' />';

                        }

                }

        }

}
[/code]下面加上[code]function showrankstars($num) {
echo "<img src=images/rank/$num.gif title='Rank: ".$num."'>";
}
[/code]第2步:、templates\default\viewthread.htm
找到[code]showstars[/code]替换成[code]showrankstars[/code]第3步:  templates\default\viewpro_classic.htm

找到:[code]{eval showstars($member['groupstars']);}[/code]替换成:[code]{eval showrankstars($member['groupstars']);}[/code]4.templates\default\viewpro_inajax.htm
找到:[code]showstars[/code]替换成:[code]showrankstars[/code]5.templates\default\my_grouppermission.htm
找到:[code]showstars[/code]替换成:[code]showrankstars[/code]文件修改部分完成!

晚风 发表于 2007-3-26 09:08

6.1静态化问题

Rewrite规则

[quote]RewriteEngine On
RewriteEngine On
RewriteBase /

# Rewrite 系统规则请勿修改
RewriteRule ^archiver/([a-z0-9\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
        
RewriteCond %{HTTP_REFERER} !^http://9232.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://9232.org$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.9232.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.9232.org$ [NC]
[/quote]

晚风 发表于 2007-3-26 09:12

加大行间距FOR6.1.0

css_viewthread.htm
找[code]
        .t_msgfont, .t_msgfont td { font-size: {MSGFONTSIZE}; line-height: 1.6em; }
[/code]改为[code]
  .t_msgfont, .t_msgfont td { font-size: {MSGFONTSIZE}; line-height: 2.6em; }[/code]

晚风 发表于 2007-3-26 09:19

首页四格FOR DZ6.0正式版

1、index.php
查找[code]require_once DISCUZ_ROOT.'./include/forum.func.php';[/code]下面加[code]require_once DISCUZ_ROOT.'./include/toplist.php';[/code]2、templates/default/discuz.htm
查找[code]<!--{if !empty($advlist['text'])}-->
        
        
        <table cellspacing="1" border="0" cellpadding="{TABLESPACE}" width="100%"
style="background: {BGBORDER}">$advlist[text]
        

<!--{/if}-->[/code]在下面加[code]<!--{if empty($gid)}-->

{template toplist}



<!--{/if}-->[/code]3.上传压缩包中的内容
toplist.php上传至include目录下
toplist.htm模板目录下

晚风 发表于 2007-3-26 09:29

宠物系统

1.上传Web目录所有文件到论坛目录下
2.运行pet_install.php文件,安装宠物数据库
3.导入插件数据
4.修改pet.php文件,找到以下地方,修改成你论坛对应的字段[code]$moneycredit ='extcredits2';//论坛币字段[/code]5.修改petshop/pet_gm.php文件,填上你自己的宠物后台管理帐号
6.修改一个文件 include/db_mysql.class.php
   找到:[code]function version() {[/code]在上面添加:[code]        function query_first($query_string) {
                $query_id = $this->query($query_string);
                $returnarray=$this->fetch_array($query_id);
                $this->free_result($query_id);
                return $returnarray;
        }[/code]函数说明:把原有的query和fetch_array函数结合在一起,方便对只有一条数据的查询
7.修改一个文件templates\default\actions.lang.php
  找到:[code]211 => '修改系统设置',[/code]在下面添加:[code]
222 => '宠物中心',[/code]说明:此处的222必须与pet.php文件中的discuz_action设置对应
8.在1.2版本以上增加了宠物系统图片本地化,请把下载的petimages.rar放于论坛images目录下供会员下载
9.如果安装过其他宠物系统,是否能安装本宠物系统,将似以下几个条件决定
  a.web目录里的文件是否和以前的宠物系统有重复
  b.数据库表是否有重复,本宠物系统的数据库表全部以 论坛数据表前缀+wx 开头
  c.插件标识符是否重复,本宠物系统的插件标识符为wxpet
10.在插件的编写和升级过程中,已尽量避免了bug的产生,但水平有限,难免出现疏忽,如果发现到我们的论坛反映,谢谢!

晚风 发表于 2007-3-26 09:35

宠物信息贴内显示

需要更改的文件:
   viewthread.php
   templates/default/viewthread.htm
   (请务必先备份,以便出错后可以覆盖恢复)

一、viewthread.php 文件
1、查找[code]mf.customstatus[/code]在其后面紧跟着插入[code]
, pd.petname, pd.mypetpic, pd.pettype, pd.mypetjob, pd.mypetlevel, pd.mypetexp, pd.mypethp, pd.mypetmaxhp, pd.mypetsp, pd.mypetmp, pd.mypetmaxmp,  pd.mypetgood, pd.mypetdead[/code]2、查找[code]
LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
[/code]在其下面插入[code]
LEFT JOIN {$tablepre}wxpetdata pd ON pd.username=m.username
[/code]3、查找[code]
$forum['allowbbcode'] = $forum['allowbbcode'] ? ($_DCACHE['usergroups'][$post['groupid']]['allowcusbbcode'] ? 2 : 1) : 0;[/code]在其上面插入[code]
//宠物数据>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if($post['petname']!=''){
        $petjob = $post['mypetjob'];
        $petlevel= $post['mypetlevel'];
        $levelpic = ($petlevel/10)>11?11:intval($petlevel/10);
        if ($petjob == 0 or ($petjob <=3 && $petlevel < 200) or $post['mypetpic']=='') {
                $post['petpic'] = "<img src=images/pet/pet/$post[pettype]/$post[pettype]$levelpic.gif border=0>";
        } else {
                $post['petpic'] = "<img src=$post[mypetpic] border=0>";
        }
                        
        $petlevelfloor = pow (log10 (ceil($post['mypetexp']/ ($petjob * 0.2 + 1))), 3);
        $epf=intval (100 * ($petlevelfloor - intval ($petlevelfloor)));
        $hpf = floor (100 * ($post['mypethp'] / $post['mypetmaxhp']));
        $mpf = $post['mypetmaxmp']?(floor (100 * ($post['mypetmp'] / $post['mypetmaxmp']))):0;
        $spf = floor (100 * ($post['mypetsp'] / 5000)) - 1;
        $post['epf']=$epf>97?97:$epf;
        $post['hpf']=$hpf>97?97:$hpf;
        $post['mpf']=$mpf>97?97:$mpf;
        $post['spf']=$spf>97?97:$spf;
                        
        $post['petdead']= $post['mypetdead']?'死亡':'生存';
        $petgood = $post['mypetgood'];   
        if ($petgood >= 100) {
                $post['shit'] = "死忠";
        }elseif($petgood >=50) {
                $post['shit']="忠诚";
        }elseif($petgood >= -50) {
                $post['shit'] = "猜疑";
        }elseif($petgood > -100) {
                $post['shit'] = "厌恶";
        }else{
                $post[shit] = "<font color=red>不鸟!</font>";
        }
}
//宠物数据<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

[/code]二、修改 template/default/viewthread.htm
查找:[code]
<!--{if $post['number'] == 1 && $relatedkeywords}--><br><br><span class="bold">{lang thread_keywords}</span> $relatedkeywords<br><br><!--{/if}-->[/code]在其上面插入[code]
<!--{if $post[petname]}-->
<br><br>
<div align="right">
<table width='120' border="1" cellpadding="1">
<tr rowspan="2"><td><div align="center">$post[petpic]</div>
</td></tr>
<td>
<span class="smalltxt">
<div align="left">宠物名: <a href="pet.php?index=viewpet&username=$post[author]">$post[petname]</a><br>
宠物状态: $post[petdead] $post[shit]<br>
级别:  $post[mypetjob] 转/ $post[mypetlevel] 级<br>
HP: $post[mypethp] /  $post[petmaxhp]<br>
    <table width='120' border='0' cellspacing='0' cellpadding='0' bordercolor='#000000'>
                      <tr>
                       <TD width=114 height=13><img src=' images/pet/rpg/orange.gif' width=' $post[hpf]%' height='9'><img src=' images/pet/rpg/hp.gif' height='9'></td>
                        </tr>
                    </table>
MP: $post[mypetmp] /  $post[petmaxmp]<br>
                    <table width='120' border='0' cellspacing='0' cellpadding='0' bordercolor='#000000'>
                      <tr>
                        <TD width=114 height=13><img src=' images/pet/rpg/blue.gif' width=' $post[mpf]%' height='9'><img src=' images/pet/rpg/exp.gif' height='9'></td>
                        
                      </tr>
                    </table>
SP: $post[mypetsp] /  5000<br>
                    <table width='120' border='0' cellspacing='0' cellpadding='0' bordercolor='#000000'>
                      <tr>
                        
                        <TD width=114 height=13><img src=' images/pet/rpg/green.gif' width=' $post[spf]%' height='9'><img src=' images/pet/rpg/mp.gif' height='9'></td>
                        
                      </tr>
                    </table>
EXP: $post[epf]%<br>
                    <table width='120' border='0' cellspacing='0' cellpadding='0' bordercolor='#000000'>
                      <tr>
                        <TD width=114 height=13><img src=' images/pet/rpg/blue.gif' width=' $post[epf]%' alt= $post[mypetexp] height='9'><img src=' images/pet/rpg/exp.gif' alt= $post[mypetexp] height='9'></td>
                     
                      </tr>
                  </table>
</div>
<div align="left">
</span></td></table></div>
<!--{/if}-->
[/code]

晚风 发表于 2007-3-26 10:27

管理员可见隐身会员

打开./index.php
找到
[code]
        if($online['invisible']) {
        $invisiblecount++;
        continue;
        } else {

[/code]
替换成:
[code]
        if($online['invisible']) {
        $invisiblecount++;
                       if ($adminid == 1 ){
                             $online['icon'] = 'online_invisible.gif';
                       }else{
        continue;
                    }
        } else {
[/code]

晚风 发表于 2007-3-26 10:56

DZ5.5帖内广告去掉“广告”两个字

编辑模板 - viewthread.htm

查找:[code]<!--{if !empty($advlist['thread2'][$post['count']])}-->[{lang advertisement}] $advlist[thread2][$post[count]]<br><!--{/if}-->
[/code]

把代码中的
[code][{lang advertisement}]
[/code]

删除即可

晚风 发表于 2007-7-29 00:00

论坛安装CC插件使用教程


1.修改post_editor.htm文件

查找如下代码:[code]<td><a id="{$editorid}_cmd_custom{$bbcode[params]}_$tag"><img src="images/common/$bbcode[icon]" title="$bbcode[explanation]" alt="$tag" /></a></td><!--{if in_array($cusnum++, array(5, 25))}--></tr></table><table summary="Editor ToolBar" cellpadding="0" cellspacing="0" id="{$editorid}_morebuttons{if $cusnum == 6}1{else}2{/if}" {if !$advanceeditor}style="display: none"{/if}><tr><!--{/if}-->
      <!--{/loop}-->
     <!--{/if}-->[/code]在后面添加[code]<!-- cc视频插件代码 --><td><object width='72' height='24'><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always' /><param name='movie' value='http://union.bokecc.com/flash/plugin/plugin_7.swf?userID=23052&type=Discuz' /><embed src='http://union.bokecc.com/flash/plugin/plugin_7.swf?userID=23052&type=Discuz' type='application/x-shockwave-flash' width='72' height='24' allowScriptAccess='always'></embed></object></td><!-- cc视频插件代码 -->[/code]

晚风 发表于 2007-7-29 00:02

《社区监狱》经典败絮整合版

程序:社区监狱
版本: Version 1.0.0
适用: Discuz! 5.0X/4.X
修改文件:include/global.func.php
     include/newthread.inc.php
     include/newreply.inc.php
     include/editpost.inc.php
数据升级:有
[color=#0000ff][b]全新安装
[/b]=========================================================[/color]
1、上传附件中upload里所有文件至论坛根目录覆盖添加。
2、运行jail_install.php安装数据库,注意选择好字符集安装方式,以免发生1267错误
3、修改include/global.func.php
在 global.func.php 文件的最后 PHP结束符(?>)之前,插入以下代码:

[code]function postban_check($fid, $theuser){
    global $isadmin, $issupermod, $db, $postban;
    if (!$fid || !$theuser) return 1;
    if ($isadmin || $issupermod) return 1;
    else {
        $timestamp = time();
        $fid=intval($fid);
        if ($fid < 1) return 0;
        $post_bancount=$db->result($db->query("select count(*) FROM cdb_postban where (fid='$fid' or fid='65535')  AND username='$theuser' AND timelimit > $timestamp"), 0);
        if ($post_bancount) return 0;
        else return 1;
    }
} [/code]

4、修改include/newthread.inc.php
查找:[code]if($subject == '' || $message == '') {
                showmessage('post_sm_isnull');
        }[/code]
在上面插入:
[code]if (!$ismoderator) {
    if (!postban_check($forum[fid], $discuz_user)) showmessage('你已被捕,在监狱里好好改造,不能发贴和编辑');
}[/code]
5、修改include/newreply.inc.php
查找:[code]if($subject == '' && $message == '') {[/code]
在上面插入:[code]if (!$ismoderator) {
    if (!postban_check($forum[fid], $discuz_user)) showmessage('你已被捕,在监狱里好好改造,不能发贴和编辑');
}[/code]

6、修改include/editpost.inc.php
查找:
[code]if(empty($delete)) {[/code]
在上面插入:
[code]if (!$ismoderator) {
    if (!postban_check($forum[fid], $discuz_user)) showmessage('你已被捕,在监狱里好好改造,不能发贴和编辑');
}[/code]

7、导入插件数据
8、更新缓存

晚风 发表于 2007-7-29 00:03

在线列表显示IP详细地址插件 for D6.0
1首先让D6可以使用wry.dat IP数据
编辑 /include/misc.func.php 文件,
找[code]                        if(@file_exists($tinyipfile)) {
                                $return = convertip_tiny($ip, $tinyipfile);
                        } elseif(@file_exists($fullipfile)) {
                                $return = convertip_full($ip, $fullipfile);
                        }[/code]替换为[code]                        if(@file_exists($fullipfile)) {
                                $return = convertip_full($ip, $fullipfile);
                        } elseif(@file_exists($tinyipfile)) {
                                $return = convertip_tiny($ip, $tinyipfile);
                        }[/code]找[code]        if(!$fd = @fopen($ipdatafile)) {
                return '- Invalid IP data file';
        }[/code]替换为[code]        if(!$fd = @fopen($ipdatafile, 'rb')) {
                return '- Invalid IP data file';
        }[/code]2、编辑 /member.php 文件,
查找[code]$onlinelist[] = $online;[/code],在其上面一行加入如下代码:[code]        if($discuz_uid && in_array($adminid, array(1))){
                require_once './include/misc.func.php';
                $online['where']=convertip($online['ip']);
        }[/code]3、编辑 \templates\default\whosonline.htm 文件,
查找[code]<td>$online[ip] </td>[/code],将其替换成如下代码:[code]<td>
                  <!--{if $discuz_uid && in_array($adminid, array(1))}-->
                      $online[where]-<font color=#cccccc>[{$online[ip]}]</font>
                  <!--{else}-->
                      $online[ip]
                  <!--{/if}-->
        </td>[/code]4、上传wry.dat 到 \ipdata目录下
到此操作完成,看看效果吧。

晚风 发表于 2007-9-30 20:54

首页在线列表显示所有[IP][来自][操作系统][浏览器] for D6.0正式版
一、添加首页显示[IP]等

1、修改index.php

①查找[code]$query = $db->query("SELECT uid, username,[/code]替换成[code]$query = $db->query("SELECT uid, ip1, ip2, ip3, ip4, username,[/code]②查找[code]$online['lastactivity'] = gmdate($timeformat, $online['lastactivity'] + ($timeoffset * 3600));[/code]在下面添加[code]////////////////////////////////显示ip
          $online['ip'] = $online['ip1'].'.'.$online['ip2'].'.'.$online['ip3'].'.'.$online['ip4'];
          if($allowviewip && !($adminid == 2 && $member['adminid'] == 1) && !($adminid == 3 && ($member['adminid'] == 1 || $member['adminid'] == 2))) {
             require_once DISCUZ_ROOT.'./include/misc.func.php';
             $online['iplocation'] = convertip($online['ip']);
          } else {
          $allowviewip = 0;
          }
////////////////////////////////显示ip[/code]2、修改模板文件 default/discuz.htm
  查找:[code]<!--{if $online['fid']}-->{LF}{lang forum}: $online[fid]<!--{/if}-->[/code]在下面添加:[code]<!--{if $allowviewip}-->{LF}{lang stats_os}:$visitor_os {LF}{lang stats_browser}:$visitor_browser{LF}来自:$online[iplocation]<!--{/if}-->[/code]

晚风 发表于 2007-10-9 13:58

修改宠物禁止游客和待认证会员进入
在pet.php中加入[code]if(!$discuz_uid) {
         showmessage('not_loggedin', NULL, 'HALTED');
}
if($credits<1) {
        showmessage('不好意思,您的发贴数小于1,请至论坛发贴后再来吧!!!');
}[/code]

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.