首先调用20条默认的信息,代码如下
[e:loop={"select * from www_11px_cn_ecms_news where classid in (2,3,4,5,6) order by newstime desc limit 20",6,24,0}] [/e:loop]
然后再就是下拉加载的JS代码,
最后就是getAJAX.php的读取代码
<?php $ye=strFilter($_GET["next"]); $clasid=strFilter($_GET["classid"]); if($clasid==1){$clasid="2,3,4,5,6";} if($clasid==7){$clasid="8,9,10,11,12,13";} if($clasid==14){$clasid="15,16,17";} if($clasid==18){$clasid="19,20,21,22";} if($clasid==23){$clasid="24,25,26,27,38";} if($clasid==28){$clasid="29,30,31,32";} if($clasid==33){$clasid="34,35,36,37";} if($clasid==0){ $aabbccdd = base64_encode("select * from www_11px_cn_ecms_news order by newstime desc limit"); }else{ $aabbccdd = base64_encode("select * from www_11px_cn_ecms_news where classid in ($clasid) order by newstime desc limit"); } function strFilter($str){ $str = str_replace('`', '', $str); $str = str_replace('·', '', $str); $str = str_replace('~', '', $str); $str = str_replace('!', '', $str); $str = str_replace('!', '', $str); $str = str_replace('@', '', $str); $str = str_replace('#', '', $str); $str = str_replace('$', '', $str); $str = str_replace('¥', '', $str); $str = str_replace('%', '', $str); $str = str_replace('^', '', $str); $str = str_replace('……', '', $str); $str = str_replace('&', '', $str); $str = str_replace('*', '', $str); $str = str_replace('(', '', $str); $str = str_replace(')', '', $str); $str = str_replace('(', '', $str); $str = str_replace(')', '', $str); $str = str_replace('-', '', $str); $str = str_replace('_', '', $str); $str = str_replace('——', '', $str); $str = str_replace('+', '', $str); $str = str_replace('=', '', $str); $str = str_replace('|', '', $str); $str = str_replace('', '', $str); $str = str_replace('[', '', $str); $str = str_replace(']', '', $str); $str = str_replace('【', '', $str); $str = str_replace('】', '', $str); $str = str_replace('{', '', $str); $str = str_replace('}', '', $str); $str = str_replace(';', '', $str); $str = str_replace(';', '', $str); $str = str_replace(':', '', $str); $str = str_replace(':', '', $str); $str = str_replace(''', '', $str); $str = str_replace('"', '', $str); $str = str_replace('“', '', $str); $str = str_replace('”', '', $str); $str = str_replace(',', '', $str); $str = str_replace(',', '', $str); $str = str_replace('<', '', $str); $str = str_replace('>', '', $str); $str = str_replace('《', '', $str); $str = str_replace('》', '', $str); $str = str_replace('.', '', $str); $str = str_replace('。', '', $str); $str = str_replace('/', '', $str); $str = str_replace('、', '', $str); $str = str_replace('?', '', $str); $str = str_replace('?', '', $str); return trim($str); } require("../e/class/connect.php"); if(!defined('InEmpireCMS')) { exit(); } require("../e/class/db_sql.php"); require("../e/class/q_functions.php"); $link=db_connect(); $empire=new mysqlquery(); $yema= $ye*20; $query = @mysql_query(base64_decode($aabbccdd)." $yema,20") //执行SQL语句 or die("SQL语句继续执行失利2"); while($rs = mysql_fetch_assoc($query)){ $src = $rs[id]; $xwclassid=$rs['classid']; $xwtitle=$rs['title']; $xwtitleurl=$rs['titleurl']; $xwtitlepic=$rs['titlepic']; $smalltext=$rs['smalltext']; $newstime=$rs['newstime']; $onclick=$rs['onclick']; $tuurl=$public_r[add_www_11px_cn_url]; $queryss = @mysql_query("select * from www_11px_cn_enewsclass where classid='$xwclassid'") //执行SQL语句 or die("SQL语句继续执行失利3"); while($rstt = mysql_fetch_assoc($queryss)){$xwclassname=$rstt[classname];$xwclasspath=$rstt[classpath];} ?>
- "><?=$xwtitlepic?>" width="100%">
- " class="FConWza"> <?=$xwclassname?> <?=date('Y-m-d',$newstime)?> " class="FConWzDesc"><?=$xwtitle?>
这段代码提了写推论栏目的功能,大家按格式自行修改吧。