""){
$rs=query("select classname from zzcms_zixunclass where classid='".$smallclassid."'");
$row=fetch_array($rs);
$smallclassname=$row["classname"];
}
$station=getstation($bigclassid,$bigclassname,$smallclassid,$smallclassname,"","","zixun");
$pagetitle=$title.zxshowtitle;
$pagekeywords=$keywords.zxshowkeyword;
$pagedescription=$description.zxshowdescription;
$zxsm="来源:".$laiyuan." 发布日期:".date('Y-m-d',strtotime($sendtime))." 发布者:".$editor." 共阅".$hit."次";
function Payjf(){
global $content,$zxid,$jifen,$editor;
$looked=0;
$str="";
$sql="select groupid,totleRMB from zzcms_user where username='".$_COOKIE["UserName"]."'";
$rs=query($sql);
$row=fetch_array($rs);
$totleRMB=$row["totleRMB"];
if (!isset($_POST["action"]) && $looked==0){
$str="
";
$str=$str."";
$str=$str."
";
}elseif ($_POST["action"]=="kan" && $looked==0) {
if( $totleRMB>=$jifen) {
query("update zzcms_user set totleRMB=totleRMB-".$jifen." where username='".$_COOKIE["UserName"]."'");//查看时扣除积分
query("update zzcms_user set totleRMB=totleRMB+".$jifen." where username='".$editor."'");//给发布者加积分
query("insert into zzcms_pay (username,dowhat,RMB,mark,sendtime) values('".$_COOKIE['UserName']."','查看资讯信息','-".$jifen."','$zxid','".date('Y-m-d H:i:s')."')");//写入冲值记录
query("insert into zzcms_pay (username,dowhat,RMB,mark,sendtime) values('".$editor."','资讯信息售出','+".$jifen."','$zxid','".date('Y-m-d H:i:s')."')");//写入冲值记录
$str=$str.showcontent($content,$zxid);
}else{
$str=$str."您的帐户中已不足 ".$jifen." 金币,暂不能查看!
";
$str=$str."
";
}
}
return $str;
}
function showcontent(){ //分页显示资讯
global $content,$zxid ;
$sql="Select * From zzcms_tagzx";
$rs=query($sql);
$row=num_rows($rs);
if (!$row){
$str=$content;
}else{
$str=str_replace($row["keyword"],"".$row["keyword"]."",$content);
while($row=fetch_array($rs)){
$str=str_replace($row["keyword"],"".$row["keyword"]."",$str);
}
}
//$str=replace($str,"count($allpage) ){//当大于最大下标值时,使等于它
$page=count($allpage)+1;
}
$str=$allpage[$page-1];//分页显示正文
$str=$str. "";
for ($i=1;$i
第".$i."页 ";
}else{
$str=$str. "第".$i."页 ";
}
}
$str=$str. " ";
}
return $str;
}
//end
$msg="[".$groupname."]才能查看
";
$msg1="需要办理[".$groupname."] 请联系本站客服";
$msg2="如果您是[".$groupname."]请 登录;";
$msg2=$msg2."尚未注册的[".$groupname."]请先 注册 成为本站会员。然后联系客服为您办理为[".$groupname."]。方可查看本页内容。";
if ($groupid==0){
$zxcontent=showcontent();
}else{
if (!isset($_COOKIE["UserName"]) || $_COOKIE["UserName"]=="") {
$zxcontent="";
$zxcontent=$zxcontent.$msg.$msg2;
$zxcontent=$zxcontent."
";
}else{
$sqln="select groupid from zzcms_user where username='".$_COOKIE["UserName"]."'";
$rsn=query($sqln);
$rown=fetch_array($rsn);
$groupid_user=$rown["groupid"];
if ($groupid_user>=$groupid){
$zxcontent=showcontent();
}elseif($groupid_user<$groupid){
if (jifen=="Yes"){
if($jifen==0){//当用户设定为不让用积分查看时
$zxcontent="".$msg.$msg1."
";
}else{
$zxcontent=Payjf();
}
}elseif (jifen=="No"){
$zxcontent="".$msg.$msg1."
";
}
}
}
}
$sql="select * from zzcms_zixun where id < ".$zxid." and passed=1 and bigclassid in (select classid from zzcms_zixunclass where isshow=1 and parentid=0) order by id desc limit 0,1";
$rs=query($sql);
$row=fetch_array($rs);
if ($row){
$nextid="上一篇文章:".$row["title"]."
";
}else{
$nextid="上一篇文章:没有了
";
}
$sql="select * from zzcms_zixun where id > ".$zxid." and passed=1 and bigclassid in (select classid from zzcms_zixunclass where isshow=1 and parentid=0) order by id asc limit 0,1";
$rs=query($sql);
$row=fetch_array($rs);
if ($row){
$nextid=$nextid . "下一篇文章:".$row["title"]." ";
}else{
$nextid=$nextid . "下一篇文章:没有了";
}
$sql="select * from zzcms_pinglun where about=".$zxid." and passed=1 order by id desc";
$rs=query($sql);
$row=num_rows($rs);
if ($row){
$pinglun="";
}else{
$pinglun=" 暂无评论";
}
$fp="../template/".$siteskin."/zixun_show.htm";
if (file_exists($fp)==false){WriteErrMsg($fp.'模板文件不存在');exit;}
$f = fopen($fp,'r');
$strout = fread($f,filesize($fp));
fclose($f);
$strout=str_replace("{#siteskin}",$siteskin,$strout) ;
$strout=str_replace("{#sitename}",sitename,$strout) ;
$strout=str_replace("{#pagetitle}",$pagetitle,$strout);
$strout=str_replace("{#pagekeywords}",$pagekeywords,$strout);
$strout=str_replace("{#pagedescription}",$pagedescription,$strout);
$strout=str_replace("{#station}",$station,$strout);
$strout=str_replace("{#zxtitle}",$title,$strout);
$strout=str_replace("{#zxsm}",$zxsm,$strout);
$strout=str_replace("{#zxcontent}",$zxcontent,$strout);
$strout=str_replace("{#id}",$zxid,$strout);
$strout=str_replace("{#nextid}",$nextid,$strout);
$strout=str_replace("{#pinglun}",$pinglun,$strout);
$strout=str_replace("{#getuserip}",getip(),$strout);
$strout=str_replace("{#pinglunren}","",$strout);
$strout=str_replace("{#pageurl}","http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],$strout);
$strout=str_replace("{#sitebottom}",sitebottom(),$strout);
$strout=str_replace("{#sitetop}",sitetop(),$strout);
$strout=showlabel($strout);
echo $strout;
}
?>