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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

DISCUZ2.2升级到DISCUZ5.0后,原先的贴附件都不显示了?有代码,烦版主进来看看!

[复制链接]
 楼主| matiz 发表于 2006-11-24 19:12:36 | 显示全部楼层
DISCUZ2.2 之前的备份 viewthread.php:
<?php

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

        Version: 2.2.0
        Author: Crossday (info@discuz.net)
        Copyright: Crossday Studio (www.crossday.com)
        Last Modified: 2002/12/6 17:00
*/

require './include/common.php';
require $discuz_root.'./include/forum.php';
require $discuz_root.'./include/discuzcode.php';
require_once './advcenter/bank_config.php';
require_once $discuz_root.'./include/attachment.php';


$discuz_action = 3;
$ismoderator = modcheck($discuz_user);

$query = $db->query("SELECT * FROM $table_threads WHERE tid='$tid'");
if(!$thread = $db->fetch_array($query)) {
        showmessage('thread_nonexistence');
}

$codecount = 0;
$oldtopics = $HTTP_COOKIE_VARS['oldtopics'];
if(!strstr($oldtopics, "\t$tid\t")) {
        $oldtopics .= $oldtopics ? "$tid\t" : "\t$tid\t";
        setcookie('oldtopics', $oldtopics, $timestamp + 3600, $cookiepath, $cookiedomain);
}

if($forum['type'] == 'forum') {
        $navigation .= "&raquo; <a href=\"forumdisplay.php?fid=$fid\"> $forum[name]</a> &raquo; $thread[subject]";
        $navtitle .= " - $forum[name] - $thread[subject]";
} else {
        $query = $db->query("SELECT fid, name FROM $table_forums WHERE fid='$forum[fup]'");
        $fup = $db->fetch_array($query);
        $navigation .= "&raquo; <a href=\"forumdisplay.php?fid=$fup[fid]\">$fup[name]</a> &raquo; <a href=\"forumdisplay.php?fid=$fid\"> $forum[name]</a> &raquo; $thread[subject]";
        $navtitle .= " - $fup[name] - $forum[name] - $thread[subject]";
}

if(!$forum['viewperm'] && !$allowview) {
        showmessage('group_nopermission');
} elseif($forum['viewperm'] && !strstr($forum['viewperm'], "\t$groupid\t")) {
        showmessage('forum_nopermission');
//fix: 解决如果贴子设定积分过高,作者自身可能无法观看和修改贴子
} elseif($thread['creditsrequire'] && $thread['creditsrequire'] > $credit && !$ismoderator && $thread['author']<>$discuz_user) {
        showmessage('thread_nopermission');
}

if($forum['password'] != $HTTP_COOKIE_VARS["fidpw$fid"] && $forum['password']) {
        header("Location: {$boardurl}forumdisplay.php?fid=$fid&sid=$sid");
        discuz_exit();
}

if(!$action && $tid) {

        if($discuz_user && $newpm) {
                require $discuz_root.'./include/pmprompt.php';
        }

        $highlightstatus = str_replace("+", "", $highlight) ? 1 : 0;
        $karmaoptions = '';
        if($allowkarma && $maxkarmarate) {
                $offset = ceil($maxkarmarate / 6);
                for($vote = - $maxkarmarate + $offset; $vote <= $maxkarmarate; $vote += $offset) {
                        $votenum = $vote > 0 ? "+$vote" : $vote;
                        $karmaoptions .= $vote ? "<option value=\"$vote\">$votenum</option>\n" : NULL;
                }
        }
        unset($vote, $votenum, $offset);
       
        $page = empty($page) ? 1 : $page;
        $start_limit = $numpost = ($page - 1) * $ppp;

        $db->unbuffered_query("UPDATE $table_threads SET views=views+1 WHERE tid='$tid'");

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

        if($thread['pollopts']) {
                $pollopts = unserialize($thread['pollopts']);
                $polloptions = array();
                foreach($pollopts['options'] as $option) {
                        $polloptions[] = array(        'option'        => dhtmlspecialchars(stripslashes($option[0])),
                                                'votes'                => $option[1],
                                                'width'                => @round($option[1] * 300 / $pollopts['max']) + 2,
                                                'percent'        => @sprintf ("%01.2f", $option[1] * 100 / $pollopts['total'])
                                                );
                }

                $allowvote = $allowvote && $discuz_user && (empty($thread['closed']) || $issupermod) && !in_array($discuz_user, $pollopts['voters']);
                $optiontype = $pollopts['multiple'] ? 'checkbox' : 'radio';
        }

        $altbg1 = ALTBG1;
        $altbg2 = ALTBG2;
        $postcount = 0;
        $postlist = array();
        $attachments = $comma = '';
//-----------------------------虚拟形象参数查询
        require_once('./virtualimage/images_config.php');
        $imagesset = $setting;
        unset($setting);
        if($imagesset[openalpha]){
                $alpha = "FILTER: alpha(opacity=\"+WearArray+\")";
        }
        $imagesdatas = '';
        //-----------------------------

$querypost = $db->query("SELECT p.*,m.uid, m.username, m.gender, m.status, m.regdate, m.lastvisit, m.postnum, m.credit, m.email, m.site, m.icq, m.oicq, m.yahoo, m.msn, m.location, m.avatar, m.signature, m.customstatus, m.showemail, m.bank, m.money
          FROM $table_posts p LEFT JOIN $table_members m ON m.username=p.author  WHERE p.tid='$tid' ORDER BY dateline LIMIT $start_limit, $ppp");

/*        $querypost = $db->query("SELECT p.*, a.aid AS aaid, a.creditsrequire, a.filetype, a.filename, a.attachment, a.filesize, a.downloads, m.uid, m.username, m.gender, m.status, m.regdate, m.lastvisit, m.postnum, m.credit, m.email, m.site, m.icq, m.oicq, m.yahoo, m.msn, m.location, m.avatar, m.signature, m.customstatus, m.showemail, m.medals, m.useimages,m.bank,m.money
                                        FROM $table_posts p LEFT JOIN $table_members m ON m.username=p.author LEFT JOIN $table_attachments a ON p.aid<>'0' AND p.aid=a.aid WHERE p.tid='$tid' ORDER BY dateline LIMIT $start_limit, $ppp");
*/
        while($post = $db->fetch_array($querypost)) {
                $bgno = $postcount++ % 2 + 1;
                $post['thisbg'] = ${'altbg'.$bgno};
                $post['number'] = ++$numpost;

                $post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
                if(isset($post['username']) && $post['author'] != 'Guest') {
                        $post['authorenc'] = rawurlencode($post['author']);
                        unset($groupinfo, $groupstars, $stars);
                        foreach($_DCACHE['usergroups'] as $usergroup) {
                                if((stristr($usergroup['specifiedusers'], "\t".addslashes($post['author'])."\t") || ($post['status'] == $usergroup['status'] && $usergroup['status'] != "Member")) && !$usergroup['creditshigher'] && !$usergroup['creditslower']) {
                                        if($groupstars < $usergroup['stars']) {
                                                $groupstars = $usergroup['stars'];
                                        }
                                        $groupinfo = $usergroup;
                                } elseif($post['credit'] >= $usergroup['creditshigher'] && $post['credit'] < $usergroup['creditslower']) {
                                        if($post['status'] == $usergroup['status'] && !$groupinfo) {
                                                $groupstars = $usergroup['stars'];
                                                $groupinfo = $usergroup;
                                        } elseif($groupstars < $usergroup['stars']) {
                                                $groupstars = $usergroup['stars'];
                                        }
                                        if($groupinfo) {
                                                break;
                                        }
                                }
                        }
//                        $post['authortitle'] = $post['customstatus'] ? $post['customstatus'] : $groupinfo['grouptitle'];
                        $post['authortitle'] = $groupinfo['grouptitle'];
                        $post['regdate'] = gmdate($dateformat, $post['regdate'] + $timeoffset * 3600);

                        for($i = 0; $i < $groupstars; $i++) {
                                $post['stars'] .= "<img src=\"".IMGDIR."/star.gif\">";
                        }

$post['moneygroup'] = getmoneygroup($post['money']+$post['bank']);

                        if($groupinfo['groupavatar']) {
                                $post['avatar'] = image($groupinfo['groupavatar']);
                        } elseif($groupinfo['allowavatar'] && $post['avatar']) {
                                $post['avatar'] = '<img src="'.$post['avatar'].'" border="0">';
                        } else {
                                $post['avatar'] = '';
                        }
//------------------------------------------------------------虚拟形象
                        if ($imagesset['orderuse']!='1' && $post['useimages']!=1){
                              $post['avatar'] = $post['avatar'];
                        }elseif($post['gender']=='0'){
                              if($imagesset['orderuse']=='1'){
                                    $post['avatar'] = "<img src='{$imagesset[imageurl]}noface.gif'  border='0'>";
                              }else{
                                    $post['avatar'] = $post['avatar'];
                              }
                        }else{
                            if ($post[gender]==1){
                                     $imagesdata[tempequip] = '0-0-0-0-0-0-0-0-init-init-0-init-0-init-init-0-0-0-init-0-0-0-0-0-0-0';  //男性的初始值
                                     $imagesdata[sex] = "m";
                                     $imagesdata[upid] = "init";
                            }else if ($post[gender]==2){
                                     $imagesdata[tempequip] = '0-0-0-0-0-0-0-0-initf-initf-0-initf-0-initf-initf-0-0-0-initf-0-0-0-0-0-0-0'; //女性的初始值
                                     $imagesdata[sex] = "f";
                                     $imagesdata[upid] = "initf";
                            }

                            $imagesdata[pid] = $post[pid];
                            $imagesdata[uid] = $post[uid];
                            $imagesdatas[] = $imagesdata;

                            $post['avatar'] = "
                            <!-- 虚拟形象开始-->
                            <DIV id=Show{$post['pid']}
                                style=\"PADDING-RIGHT: 0px; PADDING-LEFT: 0px; LEFT: 0px; PADDING-BOTTOM: 0px; WIDTH: 140px; PADDING-TOP: 0px; POSITION: relative; TOP: 0px; HEIGHT: 226px\"></DIV>
                            <!-- 虚拟形象结束-->";

                       }
                       //--------------------------------------------------------------
                } else {
                        $post['postnum'] = $post['credit'] = $post['regdate'] = 'N/A';
                }

                $post['karma'] = '';
                if($post['rate'] && $post['ratetimes']) {
                        $rateimg = $post['rate'] > 0 ? 'agree.gif' : 'disagree.gif';
                        for($i = 0; $i < round(abs($post['rate']) / $post['ratetimes']); $i++) {
                                $post['karma'] .= '<img src="'.IMGDIR.'/'.$rateimg.'" align="right">';
                        }
                }

                $post['subject'] = $post['subject'] ? $post['subject'].'<br><br>' : NULL;
                $post['message'] = postify($post['message'], $post['smileyoff'], $post['bbcodeoff'], $forum['allowsmilies'], $forum['allowhtml'], $forum['allowbbcode'], $forum['allowimgcode']);
                $post['signature'] = $post['usesig'] && $post['signature'] ? postify($post['signature'], 0, 0, 0, 0, $groupinfo['allowsigbbcode'], $groupinfo['allowsigimgcode']) : NULL;

/*                if($post['aaid']) {
                        require_once $discuz_root.'./include/attachment.php';
                        $extension = strtolower(substr(strrchr($post['filename'], "."), 1));
                        $post['attachicon'] = attachicon($extension."\t".$postattach['filetype']);
                        if($attachimgpost && ($extension == 'jpg' || $extension == 'jpeg' || $extension == 'jpe' || $extension == 'gif' || $extension == 'png' || $extension == 'bmp')) {                                 $post['attachimg'] = 1;
                        } elseif($attachimgpost && $extension == 'swf') {
                                $post['attachimg'] = 2;
                        } else {
                                $post['attachimg'] = 0;
                                $post['attachsize'] = sizecount($post['filesize']);
                        }
                }*/
                if($post['aid']) {
       $aids= unserialize(stripslashes($post['aid']));
       if(is_array($aids)){
          foreach($aids as $postatt){
          $extension = strtolower(substr(strrchr($postatt['filename'], "."), 1));
          $postatt['attachicon'] = attachicon($extension."\t".$postatt['filetype']);
          //贴子买卖funciton ========start
          $postatt['attachtype'] = attachtype($extension."\t".$postatt['filetype']);
          $postatt['attachext'] = $extension;
          $postatt['attachsize'] = sizecount($postatt['filesize']);
          //贴子买卖funciton ========end
          if($attachimgpost && ($extension == 'jpg' || $extension == 'jpeg' || $extension == 'jpe' || $extension == 'gif' || $extension == 'png' || $extension == 'bmp')) {
             $postatt['attachimg'] = 1;
             } elseif($attachimgpost && $extension == 'swf') {
                $postatt['attachimg'] = 2;
                } else {
                 $postatt['attachimg'] = 0;
                 /*$post['attachsize'] = sizecount($post['filesize']);买卖帖hack使原码这行删除*/
                 }
                 $post['postatts'][]=$postatt;                                       
          }
          $post['attnumber']=count($aids);
        }
     }

               
                 //------------------ member medals
     if($post['medals']){
        require_once("./forumdata/cache/tom_medal.php");
        $medalid = strtok($post['medals'],",");
     while($medalid){
        $tempmedal .= "<img src={$medalurls[$medalid]} alt={$medals[$medalid]}> ";
        $medalid = strtok(",");}
        $post['medals'] = $tempmedal.'<br>';
        unset($tempmedal);
     }
     //------------------
               
                $postlist[] = $post;

        }
//--------------------------------------------虚拟形象
        if($imagesdatas!=''){
                $showimages = '';
                require_once('./virtualimage/global.php');
                $showimages = images_showimages($imagesdatas,$alhpa,$imagesset[imageurl]);
                unset($imagesdatas,$imagesdata,$alpha);
        }
        //--------------------------------------
        $forumselect = forumselect();

        if($fastpost && (!$thread['closed'] || $ismoderator) && ((!$forum['postperm'] && $allowpost) || ($forum['postperm'] && strstr($forum['postperm'], "\t$groupid\t")))) {
                $fastpost = 1;
                $usesigcheck = $signature ? "checked" : NULL;
        } else {
                $fastpost = 0;
        }

        include template('viewthread');

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

        require $discuz_root.'./include/printable.php';

}

?>

[ 本帖最后由 matiz 于 2006-11-24 19:14 编辑 ]
回复

使用道具 举报

 楼主| matiz 发表于 2006-11-24 19:13:36 | 显示全部楼层
修改后的viewthread.php,文件

  1. <?php

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

  5.         Version: 2.2.0
  6.         Author: Crossday (info@discuz.net)
  7.         Copyright: Crossday Studio (www.crossday.com)
  8.         Last Modified: 2002/12/6 17:00
  9. */

  10. require './include/common.php';
  11. require $discuz_root.'./include/forum.php';
  12. require $discuz_root.'./include/discuzcode.php';
  13. require_once './advcenter/bank_config.php';
  14. require_once $discuz_root.'./include/attachment.php';

  15. $tmp = explode(",",$forum[karmabyf]);
  16. $maxkarmabyf = $tmp[0];              
  17. $offsetbyf = $tmp[1];               
  18. $discuz_action = 3;

  19. $ismoderator = modcheck($discuz_user);

  20. $query = $db->query("SELECT * FROM $table_threads WHERE tid='$tid'");
  21. if(!$thread = $db->fetch_array($query)) {
  22.         showmessage('thread_nonexistence');
  23. }

  24. $codecount = 0;
  25. $oldtopics = $HTTP_COOKIE_VARS['oldtopics'];
  26. if(!strstr($oldtopics, "\t$tid\t")) {
  27.         $oldtopics .= $oldtopics ? "$tid\t" : "\t$tid\t";
  28.         setcookie('oldtopics', $oldtopics, $timestamp + 3600, $cookiepath, $cookiedomain);
  29. }

  30. if($forum['type'] == 'forum') {
  31.         $navigation .= "&raquo; <a href="forumdisplay.php?fid=$fid"> $forum[name]</a> &raquo; $thread[subject]";
  32.         $navtitle .= " - $forum[name] - $thread[subject]";
  33. } else {
  34.         $query = $db->query("SELECT fid, name FROM $table_forums WHERE fid='$forum[fup]'");
  35.         $fup = $db->fetch_array($query);
  36.         $navigation .= "&raquo; <a href="forumdisplay.php?fid=$fup[fid]">$fup[name]</a> &raquo; <a href="forumdisplay.php?fid=$fid"> $forum[name]</a> &raquo; $thread[subject]";
  37.         $navtitle .= " - $fup[name] - $forum[name] - $thread[subject]";
  38. }

  39. if(!$forum['viewperm'] && !$allowview) {
  40.         showmessage('group_nopermission');
  41. } elseif($forum['viewperm'] && !strstr($forum['viewperm'], "\t$groupid\t")) {
  42.         showmessage('forum_nopermission');
  43. //fix: 解决如果贴子设定积分过高,作者自身可能无法观看和修改贴子
  44. } elseif($thread['creditsrequire'] && $thread['creditsrequire'] > $credit && !$ismoderator && $thread['author']<>$discuz_user) {
  45.         showmessage('thread_nopermission');
  46. }

  47. if($forum['password'] != $HTTP_COOKIE_VARS["fidpw$fid"] && $forum['password']) {
  48.         header("Location: {$boardurl}forumdisplay.php?fid=$fid&sid=$sid");
  49.         discuz_exit();
  50. }

  51. if(!$action && $tid) {

  52.         if($discuz_user && $newpm) {
  53.                 require $discuz_root.'./include/pmprompt.php';
  54.         }

  55.         $highlightstatus = str_replace("+", "", $highlight) ? 1 : 0;
  56.         $karmaoptions = '';
  57.        
  58.         $query = $db->query("SELECT karmamode FROM $table_settings");
  59.         $settings = $db->fetch_array($query);
  60.     if($isadmin || $issupermod) {
  61.         if($allowkarma && $maxkarmarate) {
  62.             $offset = ceil($maxkarmarate / $karmasep);
  63.             for($vote = - $maxkarmarate + $offset; $vote <= $maxkarmarate; $vote += $offset) {
  64.                 $votenum = $vote > 0 ? "+$vote" : $vote;
  65.                 $karmaoptions .= $vote ? "<option value="$vote">$votenum</option>\n" : NULL;
  66.             }
  67.         }
  68.     } else {
  69.         if($settings[karmamode]) {
  70.             if($allowkarma && $maxkarmabyf) {
  71.                 $offset = ceil($maxkarmabyf / $offsetbyf);
  72.                 for($vote = - $maxkarmabyf + $offset; $vote <= $maxkarmabyf; $vote += $offset) {
  73.                     $votenum = $vote > 0 ? "+$vote" : $vote;
  74.                     $karmaoptions .= $vote ? "<option value="$vote">$votenum</option>\n" : NULL;
  75.                 }
  76.             }
  77.         } else {
  78.             if($allowkarma && $maxkarmarate) {
  79.                 $offset = ceil($maxkarmarate / $karmasep);
  80.                 for($vote = - $maxkarmarate + $offset; $vote <= $maxkarmarate; $vote += $offset) {
  81.                     $votenum = $vote > 0 ? "+$vote" : $vote;
  82.                     $karmaoptions .= $vote ? "<option value="$vote">$votenum</option>\n" : NULL;
  83.                 }
  84.             }
  85.         }
  86.     }

  87.         unset($vote, $votenum, $offset);
  88.        
  89.         $page = empty($page) ? 1 : $page;
  90.         $start_limit = $numpost = ($page - 1) * $ppp;

  91.         $db->unbuffered_query("UPDATE $table_threads SET views=views+1 WHERE tid='$tid'");

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

  93.         if($thread['pollopts']) {
  94.                 $pollopts = unserialize($thread['pollopts']);
  95.                 $polloptions = array();
  96.                 foreach($pollopts['options'] as $option) {
  97.                         $polloptions[] = array(        'option'        => dhtmlspecialchars(stripslashes($option[0])),
  98.                                                 'votes'                => $option[1],
  99.                                                 'width'                => @round($option[1] * 300 / $pollopts['max']) + 2,
  100.                                                 'percent'        => @sprintf ("%01.2f", $option[1] * 100 / $pollopts['total'])
  101.                                                 );
  102.                 }

  103.                 $allowvote = $allowvote && $discuz_user && (empty($thread['closed']) || $issupermod) && !in_array($discuz_user, $pollopts['voters']);
  104.                 $optiontype = $pollopts['multiple'] ? 'checkbox' : 'radio';
  105.         }

  106.         $altbg1 = ALTBG1;
  107.         $altbg2 = ALTBG2;
  108.         $postcount = 0;
  109.         $postlist = array();
  110.         $attachments = $comma = '';
  111.         //隐身插件
  112.         $querypost = $db->query("select username from $table_sessions where invisible='1'");
  113.     $pk_invisible = ',';
  114.     while($pk_tmp_invisible = $db->fetch_array($querypost)) {
  115.         $pk_invisible .= $pk_tmp_invisible['username'] . ',';
  116.     }
  117.     unset($pk_tmp_invisible);
  118.   //隐身插件
  119. //-----------------------------虚拟形象参数查询
  120.         require_once('./virtualimage/images_config.php');
  121.         $imagesset = $setting;
  122.         unset($setting);
  123.         if($imagesset[openalpha]){
  124.                 $alpha = "FILTER: alpha(opacity="+WearArray[i]+")";
  125.         }
  126.         $imagesdatas = '';
  127.         //-----------------------------

  128. $querypost = $db->query("SELECT p.*,m.uid, m.username, m.gender, m.status, m.regdate, m.lastvisit, m.postnum, m.credit, m.email, m.site, m.icq, m.oicq, m.yahoo, m.msn, m.location, m.avatar, m.signature, m.customstatus, m.showemail, m.bank, m.money
  129.           FROM $table_posts p LEFT JOIN $table_members m ON m.username=p.author  WHERE p.tid='$tid' ORDER BY dateline LIMIT $start_limit, $ppp");
  130. //-----------------------------Tom medal
  131.         $querypost = $db->query("SELECT p.*, a.aid AS aaid, a.creditsrequire, a.filetype, a.filename, a.attachment, a.filesize, a.downloads, m.uid, m.username, m.gender, m.status, m.regdate, m.lastvisit, m.postnum, m.credit, m.email, m.site, m.icq, m.oicq, m.yahoo, m.msn, m.location, m.avatar, m.signature, m.customstatus, m.showemail, m.medals, m.useimages,m.bank,m.money
  132.                                         FROM $table_posts p LEFT JOIN $table_members m ON m.username=p.author LEFT JOIN $table_attachments a ON p.aid<>'0' AND p.aid=a.aid WHERE p.tid='$tid' ORDER BY dateline LIMIT $start_limit, $ppp");

  133.         while($post = $db->fetch_array($querypost)) {
  134.                 //隐身插件
  135.                 if (strstr($pk_invisible,','.$post['author'].',') && $post['author']!=$discuz_user && !$isadmin) $post['invisible']=1;
  136.                 else $post['invisible']=0;
  137.                 //隐身插件
  138.                 $bgno = $postcount++ % 2 + 1;
  139.                 $post['thisbg'] = ${'altbg'.$bgno};
  140.                 $post['number'] = ++$numpost;

  141.                 $post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
  142.                 if(isset($post['username']) && $post['author'] != 'Guest') {
  143.                         $post['authorenc'] = rawurlencode($post['author']);
  144.                         unset($groupinfo, $groupstars, $stars);
  145.                         foreach($_DCACHE['usergroups'] as $usergroup) {
  146.                                 if((stristr($usergroup['specifiedusers'], "\t".addslashes($post['author'])."\t") || ($post['status'] == $usergroup['status'] && $usergroup['status'] != "Member")) && !$usergroup['creditshigher'] && !$usergroup['creditslower']) {
  147.                                         if($groupstars < $usergroup['stars']) {
  148.                                                 $groupstars = $usergroup['stars'];
  149.                                         }
  150.                                         $groupinfo = $usergroup;
  151.                                 } elseif($post['credit'] >= $usergroup['creditshigher'] && $post['credit'] < $usergroup['creditslower']) {
  152.                                         if($post['status'] == $usergroup['status'] && !$groupinfo) {
  153.                                                 $groupstars = $usergroup['stars'];
  154.                                                 $groupinfo = $usergroup;
  155.                                         } elseif($groupstars < $usergroup['stars']) {
  156.                                                 $groupstars = $usergroup['stars'];
  157.                                         }
  158.                                         if($groupinfo) {
  159.                                                 break;
  160.                                         }
  161.                                 }
  162.                         }
  163. //                        $post['authortitle'] = $post['customstatus'] ? $post['customstatus'] : $groupinfo['grouptitle'];
  164.                         $post['authortitle'] = $groupinfo['grouptitle'];
  165.                         $post['regdate'] = gmdate($dateformat, $post['regdate'] + $timeoffset * 3600);

  166.                         for($i = 0; $i < $groupstars; $i++) {
  167.                                 $post['stars'] .= "<img src="".IMGDIR."/star.gif">";
  168.                         }

  169. $post['moneygroup'] = getmoneygroup($post['money']+$post['bank']);

  170.                         if($groupinfo['groupavatar']) {
  171.                                 $post['avatar'] = image($groupinfo['groupavatar']);
  172.                         } elseif($groupinfo['allowavatar'] && $post['avatar']) {
  173.                                 $post['avatar'] = '<img src="'.$post['avatar'].'" border="0">';
  174.                         } else {
  175.                                 $post['avatar'] = '';
  176.                         }
  177. //------------------------------------------------------------虚拟形象
  178. if ($imagesset['orderuse']!='1' && $post['useimages']!=1){
  179.        $post['avatar'] = $post['avatar'];
  180. }elseif($post['gender']=='0'){
  181.        if($imagesset['orderuse']=='1'){
  182.              $post['avatar'] = "<img src='{$imagesset[imageurl]}noface.gif'  border='0'>";
  183.        }else{
  184.              $post['avatar'] = $post['avatar'];
  185.        }
  186. }else{
  187.      if ($post[gender]==1){
  188.               $imagesdata[tempequip] = '0-0-0-0-0-0-0-0-init-init-0-init-0-init-init-0-0-0-init-0-0-0-0-0-0-0';  //男性的初始值
  189.               $imagesdata[sex] = "m";
  190.               $imagesdata[upid] = "init";
  191.      }else if ($post[gender]==2){
  192.               $imagesdata[tempequip] = '0-0-0-0-0-0-0-0-initf-initf-0-initf-0-initf-initf-0-0-0-initf-0-0-0-0-0-0-0'; //女性的初始值
  193.               $imagesdata[sex] = "f";
  194.               $imagesdata[upid] = "initf";
  195.      }

  196.      $imagesdata[pid] = $post[pid];
  197.      $imagesdata[uid] = $post[uid];
  198.      $imagesdatas[] = $imagesdata;

  199.      $post['avatar'] = "
  200.      <!-- 虚拟形象开始-->
  201.      <DIV id=Show{$post['pid']}
  202.          style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; LEFT: 0px; PADDING-BOTTOM: 0px; WIDTH: 140px; PADDING-TOP: 0px; POSITION: relative; TOP: 0px; HEIGHT: 226px"></DIV>
  203.      <!-- 虚拟形象结束-->";

  204. }
  205. //--------------------------------------------------------------
  206.                 } else {
  207.                         $post['postnum'] = $post['credit'] = $post['regdate'] = 'N/A';
  208.                 }

  209.                 $post['karma'] = '';
  210.                 if($post['rate'] && $post['ratetimes']) {
  211.                         $rateimg = $post['rate'] > 0 ? 'agree.gif' : 'disagree.gif';
  212.                         for($i = 0; $i < round(abs($post['rate']) / $post['ratetimes']); $i++) {
  213.                                 $post['karma'] .= '<img src="'.IMGDIR.'/'.$rateimg.'" align="right">';
  214.                         }
  215.                 }

  216.                 $post['subject'] = $post['subject'] ? $post['subject'].'<br><br>' : NULL;
  217.                 $post['message'] = postify($post['message'], $post['smileyoff'], $post['bbcodeoff'], $forum['allowsmilies'], $forum['allowhtml'], $forum['allowbbcode'], $forum['allowimgcode']);
  218.                   
  219.                 //--------巧嘴娃娃v2.0.0 BY smallwl(www.xooo.net)
  220.                 if ($qiaozhui){
  221.                         require_once $discuz_root.'./qiaozhui.php';
  222.                         $qiaozhui_bgcolor = $altbg1;
  223.                                 if ($post[number]%2==0){$qiaozhui_bgcolor = $altbg2;}
  224.                         $post['message'] = qiaozhui($post[message],$qiaozhui_act,$qiaozhui_num,$qiaozhui_bgcolor);
  225.                                         
  226.                 }
  227.                 //--------巧嘴娃娃v2.0.0 BY smallwl(www.xooo.net)

  228.                 $post['signature'] = $post['usesig'] && $post['signature'] ? postify($post['signature'], 0, 0, 0, 0, $groupinfo['allowsigbbcode'], $groupinfo['allowsigimgcode']) : NULL;
  229.                
  230.                
  231.                
  232. /*                if($post['aaid']) {
  233.                         require_once $discuz_root.'./include/attachment.php';
  234.                         $extension = strtolower(substr(strrchr($post['filename'], "."), 1));
  235.                         $post['attachicon'] = attachicon($extension."\t".$postattach['filetype']);
  236.                         if($attachimgpost && ($extension == 'jpg' || $extension == 'jpeg' || $extension == 'jpe' || $extension == 'gif' || $extension == 'png' || $extension == 'bmp')) {
  237.                                 $post['attachimg'] = 1;
  238.                         } elseif($attachimgpost && $extension == 'swf') {
  239.                                 $post['attachimg'] = 2;
  240.                         } else {
  241.                                 $post['attachimg'] = 0;
  242.                                 $post['attachsize'] = sizecount($post['filesize']);
  243.                         }
  244.                 }*/
  245. if($post['aid']) {
  246.    $aids= unserialize(stripslashes($post['aid']));
  247.    if(is_array($aids)){
  248.       foreach($aids as $postatt){
  249.               $extension = strtolower(substr(strrchr($postatt['filename'], "."), 1));
  250.               $postatt['attachicon'] = attachicon($extension."\t".$postatt['filetype']);
  251.               //贴子买卖funciton ========start
  252.               $postatt['attachtype'] = attachtype($extension."\t".$postatt['filetype']);
  253.               $postatt['attachext'] = $extension;
  254.               $postatt['attachsize'] = sizecount($postatt['filesize']);
  255.               //贴子买卖funciton ========end
  256.               if($attachimgpost && ($extension == 'jpg' || $extension == 'jpeg' || $extension == 'jpe' || $extension == 'gif' || $extension == 'png' || $extension == 'bmp')) {
  257.                  $postatt['attachimg'] = 1;
  258.               }elseif($attachimgpost && $extension == 'swf') {
  259.                  $postatt['attachimg'] = 2;
  260.               }else {
  261.                  $postatt['attachimg'] = 0;
  262.                                 /*$post['attachsize'] = sizecount($post['filesize']);买卖帖hack使原码这行删除*/
  263.               }
  264.                  $post['postatts'][]=$postatt;
  265.       }
  266.       $post['attnumber']=count($aids);
  267.     }
  268. }

  269. //------------------ member medals
  270.      if($post['medals']){
  271.         require_once("./forumdata/cache/tom_medal.php");
  272.         $medalid = strtok($post['medals'],",");
  273.      while($medalid){
  274.         $tempmedal .= "<img src={$medalurls[$medalid]} alt={$medals[$medalid]}> ";
  275.         $medalid = strtok(",");}
  276.         $post['medals'] = $tempmedal.'<br>';
  277.         unset($tempmedal);
  278.      }
  279.      //------------------
  280.                
  281.                 $postlist[] = $post;
  282.        
  283.         //------------------ member medals
  284.   if($post['medals']){
  285.           require_once("./forumdata/cache/tom_medal.php");
  286.           $medalid = strtok($post['medals'],",");
  287.           while($medalid){
  288.                   $tempmedal .= "<img src={$medalurls[$medalid]} alt={$medals[$medalid]}> ";
  289.                   $medalid = strtok(",");}
  290.           $post['medals'] = $tempmedal.'<br>';
  291.           unset($tempmedal);
  292.   }
  293.   //------------------
  294.        
  295.         }
  296. //--------------------------------------------虚拟形象
  297.         if($imagesdatas!=''){
  298.                 $showimages = '';
  299.                 require_once('./virtualimage/global.php');
  300.                 $showimages = images_showimages($imagesdatas,$alhpa,$imagesset[imageurl]);
  301.                 unset($imagesdatas,$imagesdata,$alpha);
  302.         }
  303.         //--------------------------------------
  304.         $forumselect = forumselect();

  305.         if($fastpost && (!$thread['closed'] || $ismoderator) && ((!$forum['postperm'] && $allowpost) || ($forum['postperm'] && strstr($forum['postperm'], "\t$groupid\t")))) {
  306.                 $fastpost = 1;
  307.                 $usesigcheck = $signature ? "checked" : NULL;
  308.         } else {
  309.                 $fastpost = 0;
  310.         }

  311.         include template('viewthread');

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

  313.         require $discuz_root.'./include/printable.php';

  314. }

  315. ?>
复制代码

[ 本帖最后由 matiz 于 2006-11-24 20:22 编辑 ]
回复

使用道具 举报

倔犟的牛 发表于 2006-11-24 19:36:56 | 显示全部楼层
看不清
回复

使用道具 举报

 楼主| matiz 发表于 2006-11-24 19:48:29 | 显示全部楼层
不好意思,我应该找出来给你看, 感谢!.

下面内容为添加的部分:


  1. ……
  2. $tmp = explode(",",$forum[karmabyf]);
  3. $maxkarmabyf = $tmp[0];              
  4. $offsetbyf = $tmp[1];               
  5. ……
  6. $query = $db->query("SELECT karmamode FROM $table_settings");
  7. $settings = $db->fetch_array($query);
  8.     if($isadmin || $issupermod) {
  9.         ……
  10.             $offset = ceil($maxkarmarate / $karmasep);       ( 说明:这个值改动过。)
  11.             ……
  12.     } else {
  13.         if($settings[karmamode]) {
  14.             if($allowkarma && $maxkarmabyf) {
  15.                 $offset = ceil($maxkarmabyf / $offsetbyf);
  16.                 for($vote = - $maxkarmabyf + $offset; $vote <= $maxkarmabyf; $vote += $offset) {
  17.                     $votenum = $vote > 0 ? "+$vote" : $vote;
  18.                     $karmaoptions .= $vote ? "<option value="$vote">$votenum</option>\n" : NULL;
  19.                 }
  20.             }
  21.         } else {
  22.             if($allowkarma && $maxkarmarate) {
  23.                 $offset = ceil($maxkarmarate / $karmasep);
  24.                 for($vote = - $maxkarmarate + $offset; $vote <= $maxkarmarate; $vote += $offset) {
  25.                     $votenum = $vote > 0 ? "+$vote" : $vote;
  26.                     $karmaoptions .= $vote ? "<option value="$vote">$votenum</option>\n" : NULL;
  27.                 }
  28.             }
  29.         }
  30.     }
  31. ……
  32. //隐身插件
  33. $querypost = $db->query("select username from $table_sessions where invisible='1'");
  34.     $pk_invisible = ',';
  35.     while($pk_tmp_invisible = $db->fetch_array($querypost)) {
  36.         $pk_invisible .= $pk_tmp_invisible['username'] . ',';
  37.     }
  38.     unset($pk_tmp_invisible);
  39.   //隐身插件
  40. ……
  41. //-----------------------------Tom medal
  42. ……
  43.   //隐身插件
  44.   if (strstr($pk_invisible,','.$post['author'].',') && $post['author']!=$discuz_user && !$isadmin) $post['invisible']=1;
  45.   else $post['invisible']=0;
  46.   //隐身插件
  47. ……   
  48.   //--------巧嘴娃娃v2.0.0 BY smallwl(www.xooo.net)
  49.   if ($qiaozhui){
  50.           require_once $discuz_root.'./qiaozhui.php';
  51.           $qiaozhui_bgcolor = $altbg1;
  52.                   if ($post[number]%2==0){$qiaozhui_bgcolor = $altbg2;}
  53.           $post['message'] = qiaozhui($post[message],$qiaozhui_act,$qiaozhui_num,$qiaozhui_bgcolor);
  54.                   
  55.   }
  56.   //--------巧嘴娃娃v2.0.0 BY smallwl(www.xooo.net)
  57. ……

  58. //------------------ member medals
  59.   if($post['medals']){
  60.           require_once("./forumdata/cache/tom_medal.php");
  61.           $medalid = strtok($post['medals'],",");
  62.           while($medalid){
  63.                   $tempmedal .= "<img src={$medalurls[$medalid]} alt={$medals[$medalid]}> ";
  64.                   $medalid = strtok(",");}
  65.           $post['medals'] = $tempmedal.'<br>';
  66.           unset($tempmedal);
  67.   }
  68.   //------------------

  69. ……
复制代码

[ 本帖最后由 matiz 于 2006-11-24 19:50 编辑 ]
回复

使用道具 举报

倔犟的牛 发表于 2006-11-24 20:09:43 | 显示全部楼层
你用dbcheck查看一下现在还有什么非标准表存在.下载地址https://discuz.dismall.com/attachment.php?aid=55047

把结果放出来看一下.使用方法见https://discuz.dismall.com/viewth ... 26amp%3Btypeid%3D16

主要是存储附件信息的表里面的数据在不在.
回复

使用道具 举报

 楼主| matiz 发表于 2006-11-24 20:20:33 | 显示全部楼层
在升级前,我试过,这个工具,好象要环境不支持.

环境要求:支持zend

有没有不用Zend的工具?
回复

使用道具 举报

倔犟的牛 发表于 2006-11-24 20:23:56 | 显示全部楼层
你按照这里的对照一下.68个表那一部份https://discuz.dismall.com/viewth ... 26amp%3Btypeid%3D16
回复

使用道具 举报

 楼主| matiz 发表于 2006-11-24 20:48:04 | 显示全部楼层
我对照了一下,我的数据库里共80个表,多了下面12个表.

cdb_banklog        1
cdb_bankstatus        2
cdb_clubhorse        3  
cdb_images_album           4
cdb_images_data           5
cdb_images_order         6  
cdb_images_sort          7
cdb_images_user         8
cdb_lottery         9
cdb_memo         10
cdb_postpay         11
cdb_xn_song         12
回复

使用道具 举报

倔犟的牛 发表于 2006-11-24 21:11:52 | 显示全部楼层
你看一下这几个表是什么内容

cdb_images_album           4
cdb_images_data           5
cdb_images_order         6  
cdb_images_sort          7
cdb_images_user          8
回复

使用道具 举报

 楼主| matiz 发表于 2006-11-24 21:39:18 | 显示全部楼层
表中的数据如下:

cdb_images_album         4  无数据
cdb_images_data          5  虚拟形象(表情)
cdb_images_order         6  无数据
cdb_images_sort          7  虚拟形象(道具和服装等)
cdb_images_user          8  虚拟形象(用户数据)
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-3-1 08:03 , Processed in 0.034372 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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