functionjhc_get_keyid($tbname,$limit=10){
global$empire,$dbtbpre;
$maxid=$empire->gettotal("selectmax(id)astotalfrom{$dbtbpre}ecms_{$tbname}");
$ids=array();
$i=0;
while($i<$limit){
$key=rand(1,$maxid);
$key=$empire->gettotal("selectidastotalfrom{$dbtbpre}ecms_{$tbname}whereid<=$keyorderbyiddesclimit1");
if(in_array($key,$ids))continue;
$ids[]=$key;
$i++;
}
$rand=implode(',',$ids);
return$rand;
}
上一篇:帝国cms list.var列表调用文章内容的[!-newstext-]
下一篇:帝国CMS获取当前栏目下子栏目的方法
自定义函数









