sql_query("UPDATE `{$tablepre}news` SET hits=hits +1 WHERE isstate=1 AND id=".$id); $pid=$bd['pid']; $ty=$bd['ty']; $tty=$bd['tty']; $ttty=$bd['ttty']; $img1=$bd['img1']; $Title=$bd['title']; $Ftitle=$bd['ftitle']; $istop=$bd['istop']; $Sendtime=date('Y-m-d',$bd['sendtime']); $Hits=$bd['hits']; $Content=$bd['content']; $Content2=$bd['content2']; $Content3=$bd['content3']; $Content4=$bd['content4']; //上一个 $sql1="select id,title from `{$tablepre}news` where pid={$pid} and ty={$ty} and id<{$id} and isstate=1 order by id desc limit 1"; $result1=$db->sql_query($sql1); $rs1=$db->sql_fetchrow($result1); $total1=$db->sql_numrows($result1); if($total1>0){ $url1="view.php?id={$rs1['id']}"; $str1="上一篇:{$rs1['title']}"; }else{ $str1="上一篇:已经是第一篇了"; } //下一个 $sql2="select id,title from `{$tablepre}news` where pid={$pid} and ty={$ty} and id>{$id} and isstate=1 order by id asc limit 1"; $result2=$db->sql_query($sql2); $rs2=$db->sql_fetchrow($result2); $total2=$db->sql_numrows($result2); if($total2>0){ $url2="view.php?id={$rs2['id']}"; $str2="下一篇:{$rs2['title']}"; }else{ $str2="下一篇:已经是最后一篇了"; } }else{ ErrorHtml('Sorry,No Result.'); exit(); } } } else{ if($id){ $bd=get_detail_view($id,$_GET['action'],"news"); if($bd){ $db->sql_query("UPDATE `{$tablepre}news` SET hits=hits WHERE isstate=1 AND id=".$id); $pid=$bd['pid']; $ty=$bd['ty']; $tty=$bd['tty']; $ttty=$bd['ttty']; $img1=$bd['img1']; $Title=$bd['title']; $Sendtime=date('Y-m-d',$bd['sendtime']); $Hits=$bd['hits']; $Content=$bd['content']; $Content2=$bd['content2']; $Content3=$bd['content3']; $Content4=$bd['content4']; //上一个 $sql1="select id,title from `{$tablepre}news` where pid={$pid} and ty={$ty} and id<{$id} and isstate=1 order by id desc limit 1"; $result1=$db->sql_query($sql1); $rs1=$db->sql_fetchrow($result1); $total1=$db->sql_numrows($result1); if($total1>0){ $url1="view.php?id={$rs1['id']}"; $str1="上一篇:{$rs1['title']}"; }else{ $str1="上一篇:已经是第一篇了"; } //下一个 $sql2="select id,title from `{$tablepre}news` where pid={$pid} and ty={$ty} and id>{$id} and isstate=1 order by id asc limit 1"; $result2=$db->sql_query($sql2); $rs2=$db->sql_fetchrow($result2); $total2=$db->sql_numrows($result2); if($total2>0){ $url2="view.php?id={$rs2['id']}"; $str2="下一篇:{$rs2['title']}"; }else{ $str2="下一篇:已经是最后一篇了"; } }else{ ErrorHtml('Sorry,No Result.'); exit(); } } } if($pid&&$id==0){ if($ty) $ty=$ty; else $ty=get_nextid($pid); $sql="select catname,showtype from `{$tablepre}news_cats` where pid={$pid} and id=".$ty." order by id desc"; //echo $sql; $result=$db->sql_query($sql); if($bd=$db->sql_fetchrow($result)){ $System_Seotitle=$bd['catname']; $showtype=$bd['showtype']; } }elseif($id==0){ $System_Seotitle=$System_Seotitle; $Keywords=$System_Keywords; $Info=$System_Info; } $sql_uid="select * from `{$tablepre}users` where id={$uid}"; //echo $sql; $result_uid=$db->sql_query($sql_uid); while($bd_uid=$db->sql_fetchrow($result_uid)){ $uid_name=$bd_uid['name']; $uid_email=$bd_uid['email']; } if($uid) { $sql_gwc = "select * from `{$tablepre}cart` where uid={$uid}"; $result_gwc=$db->sql_query($sql_gwc); $nums=0; while($bd_gwc=$db->sql_fetchrow($result_gwc)){ $nums=(int)$bd_gwc['num']+$nums; } }elseif($_SESSION['gwc']){ $nums=0; foreach($_SESSION['gwc'] as $ccx){ $nums=$ccx['num']+$nums; } }else{ $nums=0; } $ccv=$nums; if($Title) $System_Seotitle=$Title; else $System_Seotitle=$System_Seotitle; if($Keywords) $System_Keywords=$Keywords; else $System_Keywords=$System_Keywords; if($Info) $System_Info=$Info; else $System_Info=$System_Description; if($System_Seotitle) $System_Seotitle="{$System_Seotitle}_";else $System_Seotitle=""; ?>