⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 read.php

📁 一个可以实时查看股票行情的小程序,真是一个好程序哦,直得大家
💻 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 ($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.hack,m.honor,m.signature,m.regdate,m.signchange,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.thisvisit,md.onlinetime';
	$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_memberdata md ON md.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 && $_COOKIE){
	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($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&");//文章数,页码,共几页,路径

if($read['ifcheck']==0 && $foruminfo['f_check'] && !$admincheck && !$SYSTEM['viewcheck']){
	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'");
} 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,$fastpost);
$guidename[$subject]="read.php?tid=$tid";
$msg_guide=headguide($guidename);
$db_bbsname=addslashes($db_bbsname);//模版内用到

$pollid=$read['pollid'];
if($pollid && ($page==1 || $numofpage==1) && $read['voteopts']){
	require_once(R_P.'require/readvote.php');
	$tpc_date=get_date($read['postdate']);
	vote($read['voteopts']);
}

if($read['replies']>0){
	unset($asc);
	$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.hack,m.honor,m.signature,m.regdate,m.signchange,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.thisvisit,md.onlinetime FROM pw_posts p LEFT JOIN pw_members m ON m.uid=p.authorid LEFT JOIN pw_memberdata md ON md.uid=p.authorid WHERE p.tid='$tid' AND p.ifcheck='1' 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';
}
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'];
		$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['digests']=$read['credit']=$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){
		//print_r($pic_a);exit;
		$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.'/'.$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);
					} 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;
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -