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.
30 lines
773 B
30 lines
773 B
<?php
|
|
|
|
defined("api_m") or exit;
|
|
|
|
|
|
|
|
$classid=$api->param('t' , 0 , 'intval');
|
|
|
|
$q=$api->get('q','','trim');
|
|
|
|
if ($q){
|
|
|
|
$addkey=user_scws($q);
|
|
|
|
if (!$addkey){$addkey=$q;}
|
|
|
|
$sql=$empire->query("select * from {$dbtbpre}enewstags where tagname REGEXP '$addkey' order by num desc limit 10");
|
|
|
|
while($r=$empire->fetch($sql))
|
|
|
|
{
|
|
|
|
$list.='"'.$r[tagname].'",';
|
|
|
|
}
|
|
|
|
$rank='false';
|
|
|
|
}else{
|
|
$add=ReturnClassAddField($classid,'xiala');
$pd_record=explode(",",$add);
for($i=0;$i<count($pd_record);$i++)
{
$list.='"'.$pd_record[$i].'",';
}
$rank='true';
}
$list=substr($list,0,strlen($list)-1);
if ($list=='""'){
echo '{"code":1}';
}else{
echo '{"code":0,"data":{"expire":'.time().',"rank":'.$rank.',"list":['.$list.']}}';
}
|