向php高手求救!!
来源:互联网 发布:淘宝网口罩价格 编辑:程序博客网 时间:2024/06/10 01:20
小站的论坛是php的.但是最近不知道为什么一打开文章就会出现页面错误!
例:
行: 130
字符:1
错误:缺少对象
代码:0
URL: http://www.20030.net/bbs/read.php?tid=21&fpage=1
我用Macromedia Dreamweaver MX 2004打开了这个文件.
很容易就找到了第130行!
但是我完全不了解php.
我用记事本打开了read.php 代码如下:
<?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("'","‘",$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++;
}
$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['ifmark']){
$markdb=explode("/t",$read['ifmark']);
$markinfo="<tr>";
foreach($markdb as $key=>$value){
$markinfo.='<td>'.$value.'</td>';
$key++;
if($key%3==0)$markinfo.='</tr><tr>';
}
$markinfo.='</tr>';
$read['mark']=$markinfo;
} else{
$read['mark']='';
}
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;
}
?>
第130行的是:
if ($db_windpic['pic']==1){
希望高手可以帮我搞掂这个问题.万分感谢!!!
- 向php高手求救!!
- 求救各位高手
- 高手求救:access violation!
- 求救!!!请个位高手帮忙????????????
- 求救!!!!linux高手请帮忙!!!
- 向一个陌生老师求救!
- 求救,智能客户端问题.请高手指点!!!
- sql server2005值比较求救各位高手
- 求救
- 求救!!!!
- 求救
- 求救!~~~
- 求救!
- 求救
- 求救
- 求救
- 求救
- 求救!
- .net中Web自定义控件编写的几个注意事项(转)
- Beautiful Smile and Love
- 工作所感
- 你O/R Mapping了吗? [转载]
- 关于Ping命令及ICMP
- 向php高手求救!!
- 如何才能享受到实现目标的充实感呢?
- 给大家拜年了
- 喷墨打印机使用技巧揭秘:将省墨进行到底
- 美梦,有一天会成真吗?
- c# .net 操作word
- 打印技术术语简介:多种技术繁荣照片打印
- Saying Good-bye to Cambridge Again
- vlc学习计划(5)--VLC程序宏及线程分析