<?php
require("../../class/connect.php");
include("../../class/config.php");
include("../../class/db_sql.php");
$link=db_connect();
$empire=new mysqlquery();
$id=(int)$_GET['id'];
$classid=(int)$_GET['classid'];
$down=(int)$_GET['down'];
$cr=$empire->fetch1("select tbname from {$dbtbpre}enewsclass where classid='$classid'");
if(empty($cr['tbname']))
{
	exit();
}
$r=$empire->fetch1("select onclick,totaldown,plnum from {$dbtbpre}ecms_".$cr['tbname']." where id='$id'");
db_close();
$empire=null;
//浏览数
if($down==0)
{
	$shownum=$r['onclick']+1;
	if($_GET['addclick']==1)
	{
		$usql=$empire->query("update {$dbtbpre}ecms_".$cr['tbname']." set onclick=onclick+1 where id='$id'");
	}
}
//下载数
elseif($down==1)
{
	$shownum=$r['totaldown'];
}
//评论数
else
{
	$shownum=$r['plnum'];
}
echo"document.write('".$shownum."');";
?>