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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 水客版宠物forD4正式版

[复制链接]
dikiy 发表于 2006-1-16 23:38:41 | 显示全部楼层
原帖由 阿狗狗 于 2006-1-16 02:01 发表

2、不在线就会死掉,建议不在线宠物不接受PK,也不消耗能量

3、在练级的时候还是会被PK,练级中已经有怪物杀我了,还要再被人PK,不死才怪

4、等级没到,还是可以买高等级的装备,但买了却装不上,浪费钱 ...




我重新很认真的又去查了一遍,还是没发现这些在后台可以编辑的,可否告知在哪编辑??

复制物品肯定存在,有好几个物品都可以复制~~在商店里面有两个一样的道具,买回来一个,然后按整理,就会一直复制出来好多,无数……阁下可以试试“左手巨剑”~~~

这个肯定是BUG,不然为什么在柜台里会显示两个同样的武器??反正只要显示两个一样武器的买回来都可以无限量复制!
回复

使用道具 举报

浙江MPA 发表于 2006-1-16 23:47:30 | 显示全部楼层
期待发一个补丁,可以批量或者全部出售或丢弃的功能
回复

使用道具 举报

离恨天 发表于 2006-1-17 00:48:24 | 显示全部楼层
现在装了阿狗狗的一点小修改已经差不多比较BT了.

有宠物币,兑换比率为1:100,后台打怪得经验钱的比率为0.6

太少了怕他们喊不赚钱。。
回复

使用道具 举报

阿狗狗 发表于 2006-1-17 03:28:54 | 显示全部楼层
原帖由 dikiy 于 2006-1-16 23:38 发表




我重新很认真的又去查了一遍,还是没发现这些在后台可以编辑的,可否告知在哪编辑??

复制物品肯定存在,有好几个物品都可以复制~~在商店里面有两个一样的道具,买回来一个,然后按整理,就会一直复制 ...

複製寶物的問題 我始終沒有發現有多複製的東西
圖一中 我買了二把左手巨劍  無論如何重新整理 還是二把
唯一有問題的就是 之前反應的 道具不能合併顯示的問題


圖二 編輯道具的使用等級


圖三 管理中心編輯物品列表


圖四 後台管理中心 插件設置 設定pk時間限制

我的論壇程式有修改為全部不能取消pk 一率要接受pk
但是 pk時間限制為3600秒
這樣子 pk 就會受到限制了

不接受pk 的 只要把寵物存在寵物銀行就行了
正在打怪的  一率得接受pk
這樣哪個傢伙在賺大錢 我就k他二下  哈哈

[ 本帖最后由 阿狗狗 于 2006-1-17 03:39 编辑 ]

本帖子中包含更多资源

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

x
回复

使用道具 举报

阿狗狗 发表于 2006-1-17 03:34:06 | 显示全部楼层
原帖由 离恨天 于 2006-1-17 00:48 发表
现在装了阿狗狗的一点小修改已经差不多比较BT了.

有宠物币,兑换比率为1:100,后台打怪得经验钱的比率为0.6

太少了怕他们喊不赚钱。。

我的會員現在都是窮光蛋  
有大賺 也有賠大錢的時候
回复

使用道具 举报

阿狗狗 发表于 2006-1-17 10:38:27 | 显示全部楼层
修正一下35樓

禁止售價大於原價總合 小於原價總合1/3
請自行查看
回复

使用道具 举报

离恨天 发表于 2006-1-17 11:22:42 | 显示全部楼层
原帖由 阿狗狗 于 2006-1-17 03:34 发表

我的會員現在都是窮光蛋  
有大賺 也有賠大錢的時候

1:100不能搞定啊

现在兑换比率是1:0.85
回复

使用道具 举报

阿狗狗 发表于 2006-1-17 11:45:18 | 显示全部楼层
1/17 更新
再提供大家修正一個bug
購買數量2時 雙倍被扣款

修改weaponshop.php


  1. $totalmoney=$totalmoney + $buyitemcount[$i] * $itemobject[$j]['itembuycost'];
复制代码


替換成
  1. $totalmoney=$buyitemcount[$i] * $itemobject[$j]['itembuycost'];  //修正 by 貓仔(阿狗狗)
复制代码





  1. showmessage("購買成功 ".join(",",$buyitemmsg)."折扣為".$discount,'pet.php?index=mypet');
复制代码

建議改為
  1. showmessage("購買成功 ".join(",",$buyitemmsg)."折扣為".$discount."共花費".$totalmoney,'pet.php?index=mypet'); //修正by 貓仔
复制代码





itemshop.php

  1. $totalmoney=$totalmoney + $buyitemcount[$i] * $itemobject[$j]['itembuycost'];
复制代码

改為
  1. $totalmoney=$buyitemcount[$i] * $itemobject[$j]['itembuycost']; //修正by 貓仔
复制代码





  1. showmessage("購買成功 ".join(",",$buyitemmsg)."折扣為".$discount,'pet.php?index=mypet');
复制代码

建議改為
  1. showmessage("購買成功 ".join(",",$buyitemmsg)."折扣為".$discount."共花費".$totalmoney,'pet.php?index=mypet'); //修正by 貓仔
复制代码




[ 本帖最后由 阿狗狗 于 2006-1-17 12:41 编辑 ]
回复

使用道具 举报

阿狗狗 发表于 2006-1-17 12:03:47 | 显示全部楼层
原帖由 离恨天 于 2006-1-17 11:22 发表

1:100不能搞定啊

现在兑换比率是1:0.85



相關道具價格設置的問題
倒店價 一定要低
掉寶率 要調低
金錢兌換代幣比率我是1:1
代幣兌換金錢比率我是1000:1  (未滿1000 千萬不能兌換 不然兌換後是零)
道具使用等級 不能太低
因為沒使用道具時 必須消耗非常多的復活藥水 及麵包
有使用道具時 會相當容易賺到獎金
所以 道具價格一定不能低

再搞不定  直接修改

petpk.php

  1. $ngetmoney=floor($getmoney*0.033*($abslevel-5));
复制代码


以及
  1. $nexp=floor($exp*0.033*($abslevel-5));
复制代码


把寵物及怪物等級每差5級時扣的獎金及經驗值調高

其中的0.033 改成較高的扣除比率
例如
0.08

[ 本帖最后由 阿狗狗 于 2006-1-17 13:46 编辑 ]
回复

使用道具 举报

Eor 发表于 2006-1-17 12:23:39 | 显示全部楼层
在帖子中显示宠物数据总是出错!

在帖子中显示宠物数据总是出错!我已经照着改了很多遍了!麻烦大家帮忙看看!

图片附件: 1.GIF (2006-1-17 11:42, 9.59 K)

 

  1. <?php

  2. /*
  3.         [DISCUZ!] viewthread.php - view thread posts
  4.         This is NOT a freeware, use is subject to license terms

  5.         Version: 4.0.0
  6.         Web: http://www.comsenz.com
  7.         Copyright: 2001-2005 Comsenz Technology Ltd.
  8.         Last Modified: 2005-3-6 15:38
  9. */

  10. define('CURSCRIPT', 'viewthread');

  11. require_once './include/common.inc.php';
  12. require_once DISCUZ_ROOT.'./include/forum.func.php';
  13. require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
  14. //悬赏提问帖 start
  15. @require_once DISCUZ_ROOT.'./forumdata/cache/cache_forumdisplay.php';
  16. //悬赏提问帖 end


  17. $discuz_action = 3;

  18. $query = $db->query("SELECT t.*, tm.uid AS moduid, tm.username AS modusername, tm.dateline AS moddateline, tm.action AS modaction
  19.         FROM {$tablepre}threads t LEFT JOIN {$tablepre}threadsmod tm ON t.moderated=1 AND tm.tid=t.tid
  20.         WHERE t.tid='$tid' AND t.displayorder>='0'");

  21. if(!$thread = $db->fetch_array($query)) {
  22.         showmessage('thread_nonexistence');
  23. } elseif($thread['moderated']) {
  24.         if($thread['modaction']) {
  25.                 include language('modactions');
  26.                 $thread['moddateline'] = gmdate("$dateformat $timeformat", $thread['moddateline'] + $timeoffset * 3600);
  27.                 $thread['modaction'] = $modactioncode[$thread['modaction']];
  28.         } else {
  29.                 $db->query("UPDATE {$tablepre}threads SET moderated='0' WHERE tid='$tid'", 'UNBUFFERED');
  30.         }
  31. }

  32. $codecount = 0;
  33. $oldtopics = isset($_DCOOKIE['oldtopics']) ? $_DCOOKIE['oldtopics'] : 'D';
  34. if(strpos($oldtopics, 'D'.$tid.'D') === FALSE) {
  35.         $oldtopics = 'D'.$tid.$oldtopics;
  36.         if(strlen($oldtopics) > 3072) {
  37.                 $oldtopics = preg_replace("((D\d+)+D).*$", "\\1", substr($oldtopics, 0, 3072));
  38.         }
  39.         dsetcookie('oldtopics', $oldtopics, 3600);
  40. }

  41. if($lastvisit < $thread['lastpost'] && (!isset($_DCOOKIE['f'.$fid]) || $thread['lastpost'] > $_DCOOKIE['f'.$fid])) {
  42.         dsetcookie('fid'.$fid, $thread['lastpost'], 3600);
  43. }

  44. $navigation = "&raquo; <a href="forumdisplay.php?fid=$fid".($extra ? '&'.preg_replace("/^(&)*/", '', $extra) : '')."">$forum[name]</a> &raquo; $thread[subject]";
  45. $navtitle = $thread['subject'].' - '.strip_tags($forum['name']).' - ';
  46. if($forum['type'] == 'sub') {
  47.         $query = $db->query("SELECT fid, name FROM {$tablepre}forums WHERE fid='$forum[fup]'");
  48.         $fup = $db->fetch_array($query);
  49.         $navigation = "&raquo; <a href="forumdisplay.php?fid=$fup[fid]">$fup[name]</a> $navigation";
  50.         $navtitle = $navtitle.' - '.strip_tags($fup['name']);
  51. }

  52. if($thread['typeid'] && isset($forum['threadtypes']['types'][$thread['typeid']])) {
  53.         $thread['subject'] = ($forum['threadtypes']['listable'] ? '<a href="forumdisplay.php?fid='.$fid.'&filter=type&typeid='.$thread['typeid'].'">['.$forum['threadtypes']['types'][$thread['typeid']].']</a>' : '['.$forum['threadtypes']['types'][$thread['typeid']].']').' '.$thread['subject'];
  54. }

  55. if(empty($forum['allowview'])) {
  56.         if(!$forum['viewperm'] && !$readaccess) {
  57.                 showmessage('group_nopermission', NULL, 'NOPERM');
  58.         } elseif($forum['viewperm'] && !forumperm($forum['viewperm'])) {
  59.                 showmessage('forum_nopermission', NULL, 'NOPERM');
  60.         }
  61. }

  62. if($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
  63.         showmessage('thread_nopermission', NULL, 'NOPERM');
  64. }

  65. if($thread['price'] > 0) {
  66.         if($maxchargespan && $timestamp - $thread['dateline'] >= $maxchargespan * 3600) {
  67.                 $db->query("UPDATE {$tablepre}threads SET price='0' WHERE tid='$tid'");
  68.                 $thread['price'] = 0;
  69.         } else {
  70.                 if(!$discuz_uid) {
  71.                         showmessage('group_nopermission', NULL, 'NOPERM');
  72.                 } elseif(!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
  73.                         $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
  74.                         if(!$db->num_rows($query)) {
  75.                                 require_once DISCUZ_ROOT.'./include/threadpay.inc.php';
  76.                                 exit();
  77.                         }
  78.                 }               
  79.         }
  80. }

  81. if($forum['password'] && $forum['password'] != $_DCOOKIE['fidpw'.$fid]) {
  82.         header("Location: {$boardurl}forumdisplay.php?fid=$fid&sid=$sid");
  83.         exit();
  84. }

  85. $raterange = $modratelimit && $adminid == 3 && !$forum['ismoderator'] ? array() : $raterange;

  86. $extra = rawurlencode($extra);
  87. $allowgetattach = !empty($forum['allowgetattach']) || ($allowgetattach && !$forum['getattachperm']) || forumperm($forum['getattachperm']);

  88. //get trade thread status (pos. -1)
  89. $allowposttrade = substr(sprintf('%02b', $forum['allowtrade']), -1, 1);

  90. //get pay to author status (pos. -2)
  91. $allowpaytoauthor = substr(sprintf('%02b', $forum['allowtrade']), -2, 1);

  92. if(empty($action) && $tid) {

  93.         if($discuz_uid && $newpm) {
  94.                 require_once DISCUZ_ROOT.'./include/pmprompt.inc.php';
  95.         }

  96.         $highlightstatus = isset($highlight) && str_replace('+', '', $highlight) ? 1 : 0;
  97.         $maxsigrows = $maxsigrows ? 'style="height: '.$maxsigrows.'em"' : '';

  98.         $page = empty($page) || !ispage($page) ? 1 : $page;
  99.         $start_limit = $numpost = ($page - 1) * $ppp;
  100.         if($start_limit > $thread['replies']) {
  101.                 $start_limit = $numpost = 0;
  102.                 $page = 1;
  103.         }

  104.         $multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&extra=$extra".(isset($highlight) ? "&highlight=".rawurlencode($highlight) : ''));

  105.         $polloptions = array();
  106.         if($thread['poll']) {
  107.                 $query = $db->query("SELECT pollopts FROM {$tablepre}polls WHERE tid='$tid'");
  108.                 if(is_array($pollopts = unserialize($db->result($query, 0)))) {
  109.                         foreach($pollopts['options'] as $option) {
  110.                                 $polloptions[] = array
  111.                                         (
  112.                                         'option'        => dhtmlspecialchars(stripslashes($option[0])),
  113.                                         'votes'                => $option[1],
  114.                                         'width'                => @round($option[1] * 300 / $pollopts['max']) + 2,
  115.                                         'percent'        => @sprintf ("%01.2f", $option[1] * 100 / $pollopts['total'])
  116.                                         );
  117.                         }

  118.                         $allowvote = $allowvote && (empty($thread['closed']) || $alloweditpoll) && !in_array(($discuz_uid ? $discuz_user : $onlineip), $pollopts['voters']);
  119.                         $optiontype = $pollopts['multiple'] ? 'checkbox' : 'radio';
  120.                 } else {
  121.                         $db->query("UPDATE {$tablepre}threads SET poll='0' WHERE tid='$tid'", 'UNBUFFERED');
  122.                 }
  123.         }

  124.         $extcredits_thread = array();
  125.         foreach($extcredits as $key => $value) {
  126.                 if($value['showinthread']) {
  127.                         $extcredits_thread['extcredits'.$key] = array('title' => $value['title'], 'unit' => $value['unit']);
  128.                 }
  129.         }

  130.         $fieldsadd = '';
  131.         if(is_array($_DCACHE['fields_thread'])) {
  132.                 foreach($_DCACHE['fields_thread'] as $field) {
  133.                         $fieldsadd .= ', mf.field_'.$field['fieldid'];
  134.                 }
  135.         }

  136.         $postlist = $attachtags = array();
  137.         $newpostanchor = $postcount = $attachpids = 0;

  138.         $query = $db->query("SELECT p.*, m.uid, m.username, m.groupid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,
  139.                 m.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6, m.extcredits7, m.extcredits8, m.email, b.mypetname, b.mypet, b.mypetname, b.mypetlevel, b.mypetdead, b.openpk, b.mypethp, b.mypetsp, b.mypetexp, b.mypetsex, b.mypetsx, m.gender, m.showemail, m.invisible, m.avatarshowid, mf.nickname, mf.site, mf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals, mf.avatar, mf.avatarwidth,
  140.                 mf.avatarheight, mf.sightml AS signature, mf.customstatus $fieldsadd
  141.                 FROM {$tablepre}posts p
  142.                 LEFT JOIN {$tablepre}members m ON m.uid=p.authorid
  143.                 LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid                               
  144.                 LEFT JOIN $tablepre"."mypetdata b ON b.username=p.author
  145.                 WHERE p.tid='$tid' AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");
  146.                        while($post = $db->fetch_array($query)) {
  147. //任务精灵 2005-12-14
  148.                 if($post['missionid']<>'') {
  149.                         $post['hack_mission']=explode('|', $post['missionid']);
  150.                         if($post['hack_mission'][0]<>$discuz_uid) $post['missionid']='';
  151.                 }
  152. //任务精灵 end

  153.                 if(!$newpostanchor && $post['dateline'] > $lastvisit) {
  154.                         $post['newpostanchor'] = '<a name="newpost"></a>';
  155.                         $newpostanchor = 1;
  156.                 } else {
  157.                         $post['newpostanchor'] = '';
  158.                 }
  159.                 $post['lastpostanchor'] = $numpost == $thread['replies'] ? '<a name="lastpost"></a>' : '';
  160.                 $post['number'] = ++$numpost;
  161.                 $post['count'] = $postcount++;

  162.                 $post['thisbg'] = $thisbg = isset($thisbg) && $thisbg == 'altbg1' ? 'altbg2' : 'altbg1';
  163.                 $post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
  164. $post[petpic]=$post[mypetname];
  165. $petnowexp=$post[mypetexp];
  166. $post[mypetlevel] = floor(sqrt(sqrt($petnowexp)));
  167. $petlevel = $post[mypetlevel] ;
  168. $post[picdisplay] = intval($post[mypetlevel]/10);
  169. if ($post[picdisplay]>10){$post[picdisplay]=11;}
  170. $petnextlvexp = pow($petlevel+1,4);

  171.                 if($post['username']) {

  172.                         $post['groupid'] = getgroupid($post['authorid'], $_DCACHE['usergroups'][$post['groupid']], $post);
  173.                         $post['readaccess'] = $_DCACHE['usergroups'][$post['groupid']]['readaccess'];
  174.                         if($userstatusby == 1 || $_DCACHE['usergroups'][$post['groupid']]['byrank'] === 0) {
  175.                                 $post['authortitle'] = $_DCACHE['usergroups'][$post['groupid']]['grouptitle'];
  176.                                 $post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars'];
  177.                         } elseif($userstatusby == 2) {
  178.                                 foreach($_DCACHE['ranks'] as $rank) {
  179.                                         if($post['posts'] > $rank['postshigher']) {
  180.                                                 $post['authortitle'] = $rank['ranktitle'];
  181.                                                 $post['stars'] = $rank['stars'];
  182.                                                 break;
  183.                                         }
  184.                                 }
  185.                         }

  186.                         if($allowpaytoauthor) {
  187.                                 if(!$post['alipay'] && $post['email'] && $post['showemail']) {
  188.                                         $post['alipay'] = $post['email'];
  189.                                 }
  190.                         } else {
  191.                                 $post['alipay'] = '';
  192.                         }

  193.                         $post['authoras'] = addslashes($post['author']);
  194.                         $post['regdate'] = gmdate($dateformat, $post['regdate'] + $timeoffset * 3600);
  195. //--------------背单词语音版--------->
  196.                 require_once "./wordlib/libconfig.php";
  197.                 require_once "./wordcfg.php";
  198.                 $n=count($listkind);
  199.                 $opwo="<select onchange=Fword(this.options[this.selectedIndex].value)>";
  200.                 $opwo.="<option value=''>选择词库级别</option>";
  201.                 foreach($listkind as $key=>$value)
  202.                 {
  203.                         $opwo.="<option value=$key>$value</option>";
  204.                 }
  205.                 $opwo.="</select>";
  206.                 $woselect=$opwo;
  207.                 $post['words']=getword($wordkind,$wordcuttype,$words);
  208. //--------------背单词语音版--------->

  209.                         $post['allowuseblog'] = $_DCACHE['usergroups'][$post['groupid']]['allowuseblog'];

  210.                         if($post['medals']) {
  211.                                 require_once DISCUZ_ROOT.'./forumdata/cache/cache_medals.php';
  212.                                 foreach($post['medals'] = explode("\t", $post['medals']) as $key => $medalid) {
  213.                                         if(isset($_DCACHE['medals'][$medalid])) {
  214.                                                 $post['medals'][$key] = $_DCACHE['medals'][$medalid];
  215.                                         } else {
  216.                                                 unset($post['medals'][$key]);
  217.                                         }
  218.                                 }
  219.                                
  220.                         }

  221.                         $post['avatarshow'] = $avatarshowstatus && ($post['avatarshowid'] || $avatarshowdefault) ? avatarshow($post['avatarshowid'], $post['gender']) : '';
  222.                         if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
  223.                                 $post['avatar'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0">';
  224.                         } elseif($avatarshowstatus != 2 && $_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
  225.                                 $post['avatar'] = '<img src="'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0">';
  226.                         } else {
  227.                                 $post['avatar'] = '<a href="memcp.php?action=profile"><img
  228. src="images/common/nopic.gif" alt="默认头像" border="0"></a>';
  229.                         }

  230.                 } else {

  231.                         if(!$post['authorid']) {
  232.                                 $post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')).'.x';
  233.                         }

  234.                 }

  235.                 $post['attachments'] = array();
  236.                 if($post['attachment'] && $allowgetattach) {
  237.                         $attachpids .= ",$post[pid]";
  238.                         $post['attachment'] = 0;
  239.                         if(preg_match("/\[attach\](\d+)\[\/attach\]/i", $post['message'])) {
  240.                                 $attachtags[] = $post['pid'];
  241.                         }
  242.                 }

  243.                 $forum['allowbbcode'] = $forum['allowbbcode'] ? ($_DCACHE['usergroups'][$post['groupid']]['allowcusbbcode'] ? 2 : 1) : 0;

  244.                 $post['ratings'] = karmaimg($post['rate'], $post['ratetimes']);
  245.                 $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'], $forum['allowsmilies'], $forum['allowbbcode'], $forum['allowimgcode'], $forum['allowhtml'], ($forum['jammer'] && $post['authorid'] != $discuz_uid ? 1 : 0));
  246.                 $post['signature'] = $post['usesig'] ? $post['signature'] : '';
  247.                 //帖子显示评分记录开始
  248.                 if($post['rate']) {
  249.                         $queryr = $db->query("SELECT * FROM {$tablepre}ratelog WHERE pid='$post[pid]' ORDER BY dateline");
  250.                         if($db->num_rows($queryr)) {
  251.                                 if($post['tid'] == $thread['tid']) {
  252.                                         $post['pft'] = array();
  253.                                         while($log = $db->fetch_array($queryr)) {
  254.                                                 $log['dateline'] = gmdate("$dateformat $timeformat", $log['dateline'] + $timeoffset * 3600);
  255.                                                 $log['score'] = $log['score'] > 0 ? '+'.$log['score'] : $log['score'];
  256.                                                 $log['reason'] = dhtmlspecialchars($log['reason']);
  257.                                                 $post['pft'][] = $log;
  258.                                         }
  259.                                 }
  260.                         }
  261.                 }
  262.                 //帖子显示评分记录结束
  263.                 $postlist[$post['pid']] = $post;

  264.         }

  265.         if($attachpids) {

  266.                                 //图文混排,删除了段内容,替换为下面内容
  267.                 $query = $db->query("SELECT aid, pid, displayorder, dateline, readperm, filename, description, filetype, attachment, filesize, downloads
  268.                                         FROM {$tablepre}attachments WHERE pid IN ($attachpids) ORDER BY displayorder");
  269.                 //图文混排结束

  270.                 if($db->num_rows($query)) {
  271.                         require_once DISCUZ_ROOT.'./include/attachment.func.php';

  272.                         while($attach = $db->fetch_array($query)) {
  273.                                 $extension = strtolower(fileext($attach['filename']));
  274.                                 $extension == 'torrent' ? $attach['bt'] = 1 : $attach['bt'] = 0;
  275.                                 $attach['dateline'] = gmdate("$dateformat $timeformat", $attach['dateline'] + $timeoffset * 3600);
  276.                                 $attach['attachicon'] = attachtype($extension."\t".$attach['filetype']);
  277.                                 $attach['attachsize'] = sizecount($attach['filesize']);
  278.                                 //图文混排删除上面内容,加入下面
  279.                                 $isimage = in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp'));
  280.                                 require_once DISCUZ_ROOT.'./include/att_typeid.func.php';
  281.                                 $attach['$type'] = attachtypeid($attach['filetype']);
  282.                                 $attach['$idname'] = random(2);
  283.                                 if ( $isimage && $attachimgpost && !$attach['permid'] ){
  284.                                         $postlist[$attach['pid']]['attachimg'][$attach[aid]] = $attach;
  285.                                 }else{
  286.                                         $postlist[$attach['pid']]['attachments'][$attach[aid]] = $attach;
  287.                                 }
  288.                                 
  289.                                 if ( $attach['permid'] && $isimage && $attachimgpost && !isset($postlist[$attach['pid']]['attachimg'][$attach[aid]]) && ($disablepermscheck || checkperms( $attach['permid'],$attach['readperm'],'attach')==1)){
  290.                                         $postlist[$attach['pid']]['attachimg'][$attach[aid]] = $attach;

  291.                                 }

  292.                
  293.                 if (isset($postlist[$attach['pid']]['attachimg'][$attach[aid]]) && $forum['allowbbcode'] && $forum['allowimgcode'] && !$post['bbcodeoff']){
  294.                 $posmessage = str_replace( "images/common/attachnoperm.gif?{$attach[displayorder]}","$attachurl/$attach[attachment]",$postlist[$attach['pid']]['message']);
  295.                                 
  296.                 if($postlist[$attach['pid']]['message']!=$posmessage){
  297.                 $postlist[$attach['pid']]['message']=$posmessage;
  298.                 unset($posmessage,$postlist[$attach['pid']]['attachimg'][$attach[aid]]);
  299.                 }else{
  300.                     unset($posmessage,$postlist[$attach['pid']]['attachments'][$attach[aid]]);
  301.                 }
  302.                 }//结束
  303.                         }

  304.                         foreach($attachtags as $pid) {
  305.                                 $postlist[$pid]['message'] = preg_replace("/\[attach\](\d+)\[\/attach\]/ie", "attachtag($pid, \\1)", $postlist[$pid]['message']);
  306.                         }
  307.                 } else {
  308.                         $db->query("UPDATE {$tablepre}posts SET attachment='0' WHERE pid IN ($attachpids)", 'UNBUFFERED');
  309.                 }

  310.         }

  311.         if(empty($postlist)) {
  312.                 showmessage('undefined_action', NULL, 'HALTED');
  313.         }

  314.         $visitedforums = $visitedforums ? visitedforums() : '';
  315.         $forumselect = $forumjump ? forumselect() : '';

  316.         $usesigcheck = $discuz_uid && $sigstatus ? 'checked' : '';
  317.         $allowpostreply = ((!$thread['closed'] && !checkautoclose()) || $forum['ismoderator']) && ((!$forum['replyperm'] && $allowreply) || ($forum['replyperm'] && forumperm($forum['replyperm'])) || $forum['allowreply']);
  318.         $allowpost = (!$forum['postperm'] && $allowpost) || ($forum['postperm'] && forumperm($forum['postperm'])) || $forum['allowpost'];

  319.         if($delayviewcount) {
  320.                 $logfile = DISCUZ_ROOT.'./forumdata/viewcount.log';
  321.                 if(substr($timestamp, -2) == '00') {
  322.                         require_once DISCUZ_ROOT.'./include/misc.func.php';
  323.                         updateviews();
  324.                 }

  325.                 if(@$fp = fopen($logfile, 'a')) {
  326.                         fwrite($fp, "$tid\n");
  327.                         fclose($fp);
  328.                 } elseif($adminid == 1) {
  329.                         showmessage('view_log_invalid');
  330.                 }
  331.         } else {
  332.                 $db->query("UPDATE {$tablepre}threads SET views=views+1 WHERE tid='$tid'", 'UNBUFFERED');
  333.         }

  334.         include template('viewthread');

  335. } elseif($action == 'printable' && $tid) {

  336.         require_once DISCUZ_ROOT.'./include/printable.inc.php';

  337. }

  338. ?>
复制代码

[ 本帖最后由 Eor 于 2006-1-17 18:00 编辑 ]
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-1 10:43 , Processed in 0.105468 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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