熊猫办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 lines
1.8 KiB

<?php
require('e/class/connect.php');
require('e/data/dbcache/class.php');
require('e/class/db_sql.php');
$link=db_connect('master');
$empire=new mysqlquery();
$page=(int)$_GET[page];
$classid=(int)$_GET[classid];
$orderby=(int)$_GET['orderby'];
$key=RepPostVar($_GET['title']);
$callback=$_GET['callback'];
$line=40;//每页显示链接数
$offset=$page*$line;//总偏移量
$trueclassid=intval($classid);
if($class_r[$trueclassid][islast])//终极栏目
{
$add.="classid='$trueclassid'";
$have_class=0;
}
else
{
$add.=ReturnClass($class_r[$trueclassid][sonclass]);
}
if ($orderby==1){$orderby='totaldown';}
if ($orderby==2){$orderby='newstime';}
if (!$orderby){$orderby='onclick';}
if ($key){
$add.=" and title like '%".$key."%'";
}
$sql="select * from {$dbtbpre}ecms_ppt where $add order by $orderby desc limit $offset,$line";
$i=0;
$newbook=$empire->query($sql);
while($bqr=$empire->fetch($newbook)) {
$i=$i+1;
$classname=$class_r[$classid]['classname'];
$list.='{"id":'.$bqr['id'].',"mid":'.$bqr['id'].',"title":"'.$bqr['title'].'","keywords":"","cate":"'.$classname.'","img":"http://'.$public_r['add_www'].$bqr['titlepic'].'","thumb":"http://'.$public_r['add_www'].$bqr['titlepic'].'","cateid":'.$classid.',"subcateid":20,"thrcateid":31,"downcount":'.$bqr['totaldown'].',"favcount":"'.$bqr['fav'].'","hasppt":1,"online":1,"pages":6,"uploadtime":1543991976,"ordernum":0,"style":0,"uid":6103,"isshell":0,"isweili":0,"catepath":"pptmoban","@expr":1933.7999267578125,"hasfav":0,"url":"'.$bqr['titleurl'].'","preview_path":"http://'.$public_r['add_www'].$bqr['titlepic'].'"},';
}
$list=substr($list,0,strlen($list)-1);
echo $callback.'({"data":['.$list.'],"more":1,"nextpageurl":"/more.php?classid='.$classid.'&orderby='.$orderby.'&key='.$key.'&page='.($page+1).'"})';
@db_close();
$link=NULL;
$empire=NULL;
?>