<?php
require_once('./global.php');
include_once(R_P.'data/bbscache/level.php');
require_once(R_P.'require/forum.php');
require_once(R_P.'require/bbscode.php');
if(!is_numeric($tid))Showmsg('illegal_tid');
if ($page>1){
$S_sql=$J_sql='';
}else{
!$page && $page = 1;
$start_limit = 0;
$S_sql=',tm.*,p.voteopts,p.pollid,m.uid,m.username,m.gender,m.oicq, m.groupid,m.memberid,m.icon AS micon ,m.onlinetime,m.hack,m.honor,m.signature,m.regdate,m.postnum,m.rvrc,m.money,m.credit,m.thisvisit,m.signchange';
$J_sql='LEFT JOIN pw_tmsgs tm ON t.tid=tm.tid LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_polls p ON p.pollid=t.pollid';
}
$read = $db->get_one("SELECT t.* $S_sql FROM pw_threads t $J_sql WHERE t.tid='$tid'");
if(!$read){
Showmsg('illegal_tid');
}$fid=$read['fid'];$foruminfo=$db->get_one("SELECT * FROM pw_forums WHERE fid='$fid'");
if(!$foruminfo){
require_once(R_P.'require/url_error.php');
}
wind_forumcheck($foruminfo);$subject=$read['subject'];
require_once('./header.php');
if(!$foruminfo['allowvisit'] && $gp_allowread==0){
Showmsg('read_group_right');
}if($windid==$manager){
$admincheck=1;
} elseif($foruminfo['forumadmin'] && strpos($foruminfo['forumadmin'],','.$windid.',')!==false){
$admincheck=1;
} else{
$admincheck=0;
}
!$windid && $admincheck=0;
$winddb['p_num'] && $db_readperpage=$winddb['p_num'];
$count= $read['replies']+1;
if ($count%$db_readperpage==0){
$numofpage=$count/$db_readperpage;
} else{
$numofpage=floor($count/$db_readperpage)+1;
}
if ($page=='e' || $page>$numofpage){
$page=$numofpage;
}Update_ol();
$readdb=array();
if($read && $page==1){
$foruminfo['allowhtm']==1 && $htmurl='htm_data/'.$fid.'/'.date('ym',$read['postdate']).'/'.$read['tid'].'.html';
if($foruminfo['allowhtm']==1 && !$toread && file_exists($htmurl)){
header("Location: $htmurl");exit;
}
$read['pid']='tpc';
$readdb[]=viewread($read,0);
}$fengye=numofpage($count,$page,$numofpage,"read.php?tid=$tid&fpage=$fpage&toread=$toread&");//文章数,页码,共几页,路径
$pollid=$read['pollid'];if(!$admincheck && !$SYSTEM['viewcheck'] && $foruminfo['f_check'] && $winduid!=$read['authorid'] && $read['ifcheck']==0){
Showmsg('read_check');
}if ($read['locked']==2 && !$admincheck && !$SYSTEM['viewclose']){
Showmsg('read_locked');
}if(!$db_hithour){
$db->update("UPDATE pw_threads SET hits=hits+1 WHERE tid='$tid'");
$read['hits']++;
} else{
writeover(R_P."data/bbscache/hits.txt",$tid."\t",'ab');
}$favortitle=str_replace("&#39","‘",$subject);
include_once(R_P.'data/bbscache/forum_cache.php');
$guidename=forumindex($foruminfo['fup']);
unset($fourm);
$guidename[$subject]="read.php?tid=$tid";
$msg_guide=headguide($guidename);
$db_bbsname=addslashes($db_bbsname);//模版内用到
if ($page==1 || $numofpage==1){
if($pollid && $read['voteopts']){
require_once(R_P.'require/readvote.php');
$tpc_date=get_date($read['postdate']);
vote($read['voteopts']);
}
}
if($read['replies']>0){
$start_limit=($page-1)*$db_readperpage;
if($page==1){
$readnum=$db_readperpage-1;
} else{
$readnum=$db_readperpage;
$start_limit-=1;
}

$query = $db->query("SELECT p.*,m.uid,m.username,m.gender, m.oicq, m.groupid,m.memberid,m.icon AS micon,m.onlinetime,m.hack,m.honor,m.signature,m.regdate,m.postnum,m.rvrc,m.money,m.credit,m.thisvisit,m.signchange FROM pw_posts p LEFT JOIN pw_members m ON m.uid=p.authorid WHERE p.tid='$tid'  ORDER BY postdate $asc LIMIT $start_limit, $readnum");

$start_limit++;
while($read=$db->fetch_array($query)){
$readdb[]=viewread($read,$start_limit);
$start_limit++;
}

解决方案 »

  1.   

    $db->free_result($query);
    unset($sign,$read);
    }include_once(R_P.'data/bbscache/forumcache.php');
    if($groupid!='guest'){
    if($db_signwindcode==1){
    $windcode='<br><a href=\'faq.php?faqjob=1#5\'> Wind Code Open</a>';
    if ($db_windpic['pic']==1){
    $windcode.='<br> [img] - Open';
    } else{
    $windcode.='<br> [img] - Close';
    }
    if ($db_windpic['flash']==1){
    $windcode.='<br> [flash] - Open';
    } else{
    $windcode.='<br> [flash] - Close';
    }
    } else{
    $windcode='<br><a href=\'faq.php?faqjob=1#5\'>Wind Code</a>Close';
    }
    $htmlpost=($foruminfo['allowhide'] && $gp_allowhidden ? '':"disabled");
    $htmlhide=($foruminfo['allowencode'] && $gp_allowencode ? '':"disabled");
    $htmlsell=($foruminfo['allowsell'] && $gp_allowsell ? '':"disabled");
    $psot_sta='reply';//control the faster reply
    $titletop1='Re:'.$subject;
    $fastpost='fastpost';
    } else{
    $fastpost='';
    }
    require_once(PrintEot('read'));footer();
    function viewread($read,$start_limit){
    global $SYSTEM,$groupid,$admincheck,$attach_url,$attachper,$winduid,$tablecolor,$tpc_author,$tpc_buy,$count,$timestamp,$db_onlinetime,$attachpath,$gp_allowloadrvrc,$readcolorone,$readcolortwo,$lpic,$ltitle,$imgpath,$db_ipfrom,$db_showonline,$stylepath,$db_windpost,$db_windpic,$db_signwindcode,$fid,$tid,$pid,$pic_a;
    $read['lou']=$start_limit;
    $start_limit==$count-1 && $read['jupend']='<a name=a></a>';
    $tpc_buy=$read['buy'];
    if ($start_limit%2==0){
    $read['colour']=$readcolorone;
    } else{
    $read['colour']=$readcolortwo;
    }
    $read['ifsign']<2 && $read['content']=str_replace("\n","<br>",$read['content']);
    if($read['groupid']!=''){
    $read['groupid']=='-1' && $read['groupid']=$read['memberid'];
    !$lpic[$read['groupid']] && $read['groupid']=8;
    $read['lpic']=$lpic[$read['groupid']];
    $read['level']=$ltitle[$read['groupid']];
    $read['regdate']=get_date($read['regdate'],"Y-m-d");
    $read['lastlogin']=get_date($read['thisvisit'],"Y-m-d");
    $read['aurvrc']=floor($read['rvrc']/10);
    $read['author']=$read['username'];
    $tpc_author=$read['author']; /*
    if($read['hack']==1){
    $read['face']=getwindxiu($read['author'],$i,140,226);
    } else{*/
    $read['face']=showfacedesign($read['micon']);
    //} $db_ipfrom==1 ? $read['ipfrom']=' From:'.$read['ipfrom'] : $read['ipfrom']=''; if($SYSTEM['viewip']==1 || ($admincheck && $SYSTEM['viewip']==2)){
    $read['ip']="IP:$read[userip] |";
    } $read['ontime']=(int)($read['onlinetime']/3600); global $sign;
    if(!$sign[$read['author']]){
    if ($read['ifsign']==1 || $read['ifsign']==3){
    if($db_signwindcode && $read['signchange']==2) $read['signature']=convert($read['signature'],$db_windpic,2);
    $read['signature']=str_replace("\n","<br>",$read['signature']);
    }else{
    $read['signature']='';
    }
    }else{
    $read['signature']=$sign[$read['author']];
    }
    $sign[$read['author']]=$read['signature'];
    }else{
    $read['face']="<br>";$read['lpic']='8';
    $read['level']=$read['postnum']=$read['money']=$read['regdate']=$read['lastlogin']=$read['aurvrc']='*';
    }
    $read['postdate']=get_date($read['postdate']);
    if($read['if']){
    $db=explode("\t",$read['if']);
    $info="<tr>";
    foreach($db as $key=>$value){
    $info.='<td>'.$value.'</td>';
    $key++;
    if($key%3==0)$info.='</tr><tr>';
    }
    $info.='</tr>';
    $read['']=$info;
    } else{
    $read['']='';
    }
    if($read['icon']){
    $read['icon']="<img src='$imgpath/post/emotion/$read[icon].gif' align=left border=0>";
    } else{
    $read['icon']='';
    }
    /*
    *  control the attachs hide
    */
    $attachper=1;
    if($read['ifconvert']==2){
    $read['content']=convert($read['content'],$db_windpost);
    }
    if($attachper){
    $downattach=$downpic='';
    if($read['aid']!=''){
    $attachs= unserialize(stripslashes($read['aid'])); if(is_array($attachs)){
    if ($winduid==$read['authorid'] || $admincheck || ($groupid!=5 && $SYSTEM['delattach'])){
    $dfadmin=1;
    } else{
    $dfadmin=0;
    }
    foreach($attachs as $rt){
    if(file_exists($attachpath.'/'.$rt['attachurl'])){
    $a_url=$attachpath.'/'.$rt['attachurl'];
    } elseif($attach_url){
    $a_url=$attach_url.$attachpath.'/'.$rt['attachurl'];
    } else{
    continue;
    }
    if($rt['type']=='img' && $rt['needrvrc']==0){
    $dfurl='<br>'.cvpic($a_url,1);
    $read['pic'][$rt['aid']]=array($rt['aid'],$dfurl,$dfadmin);
    //$pic_a[$aid]=array($aid,$dfurl,$dfadmin);
    } else{
    $read['downattach'][]=array($rt['aid'],$rt['name'],$rt['size'],$rt['hits'],$rt['needrvrc'],$rt['type'],$dfadmin);
    }
    }
    }
    }
    }
    /**
    * convert the post content
    */ $read['alterinfo'] && $read['content'].="<br><br><br><font color=gray>[ $read[alterinfo] ]</font>";
    return $read;
    }
    ?>
      

  2.   

    应该查看网页源文件(客户端)的代码。而不是 php 文件的代码。
    最好把你的BBS出错页面贴出来才好分析。
      

  3.   

    getsex()函数不存在,检查这个require/birth.js文件
      

  4.   

    没有require/birth.js这个文件.
    只有require/birth.php这个文件啊!
    急~~~~
    require/birth.php代码如下:<?php
    !function_exists('readover') && exit('Forbidden');if($birthcontrol<$tdtime|| ($birth=='tongji' && $windid==$manager)){
    $birthman='';
    $birthcontrol=$tdtime;
    $get_today=date("Y-m-d",$timestamp);
    $todayyear=substr($get_today,0,strpos($get_today,'-'));
    $gettoday=substr($get_today,strpos($get_today,'-')+1);
    $query = $db->query("SELECT username,bday,gender FROM pw_members WHERE bday LIKE '%$gettoday'");
    while(@extract($db->fetch_array($query))){
    $birthday=substr($bday,strpos($bday,'-')+1);
    if($gettoday==$birthday)
    {
    $birthyear=substr($bday,0,strpos($bday,'-'));
    $age=$todayyear-$birthyear;
    $birthman.="$username~$gender~$age".",";
    }
    }
    $db->update("UPDATE pw_bbsinfo SET birthcontrol='$tdtime',birthman='$birthman' WHERE id=1");
    }
    $birthmen=explode(',',$birthman);
    $birthnum=count($birthmen)-1;
    $index_birth='';
    if($birthnum==0){
    include PrintEot('birth');
    //$index_birth.='-->';
    } else{
    for($i=0;$i<$birthnum;$i++)
    {
    $userarray=explode("~",$birthmen[$i]);
    $rawname=rawurlencode($userarray[0]);
    include PrintEot('birth');
    //$index_birth.='-->';
    }
    }
    ?>
      

  5.   

    你的问题是JS错误
    和PHP代码没有关系调试起来不麻烦,只不过你应该把输出的代码贴出来