帝国cms首页增加PHP文件点击加载更多按钮

<?php
require('../class/connect.php');
require('../class/db_sql.php');
require('../data/dbcache/class.php');
if($_POST[action] == 'getmorenews'){
$table=htmlspecialchars($_POST[table]);
if(empty($_POST[orderby])){$orderby='newstime';}else{ $orderby=htmlspecialchars($_POST[orderby]);}
if(empty($_POST[myorder])){$myorder='desc';}else{ $myorder='asc';}
if(empty($_POST[limit])){$limit=20;}else{ $limit=(int)$_POST[limit];}
if(empty($_POST[classid])){$where=null;}else{ $where='where classid in('.$_POST[classid].')';}
if(empty($_POST[length])){$length=50;}else{ $length=(int)$_POST[length];}
if(empty($_POST[small_length])){$small_length=500;}else{ $small_length=(int)$_POST[small_length];}
 
$link=db_connect();
$empire=new mysqlquery();
$num =(int)$_POST['next'] *$limit;

  if($table){
        $sql=$empire->query("SELECT * FROM `".$dbtbpre."ecms_".$table."` $where order by $orderby $myorder limit $num,$limit");
 
    while($r=$empire->fetch($sql)){
 
        if($r[mtitlepic]==''){ 
            $r[mtitlepic]=$public_r[news.url]."../../skin/m/images/notimg.png";
        }
    $oldtitle=stripSlashes($r[title]);
    $title=sub($oldtitle,'',$length);
    $smalltext=stripSlashes($r[smalltext]);
    $smalltext=sub($smalltext,'',$small_length);
    $classname=$class_r[$r[classid]][classname];
    $newsurl=$public_r[newsurl];
    $classurl=$newsurl.$class_r[$r[classid]][classpath];
    $urls = sys_ReturnBqTitleLink($r);
 
?>
<div class="m-app-item-3 indexlist_apk" style="display:block;"> <a href="<?=$urls?>"> <img src="<?=$r[titlepic]?>">
  <div class="m-center"> <span class="u-name"><?=$r[title]?></span> <span class="u-type"><?=$class_r[$r[classid]][classname]?>&nbsp;|&nbsp;<?=$r['onclick']?>℃</span>
    <div class="m-star-chain-box">
      <div class="m-star-chain" style="width:94.73999977111816%;"> <span class="icon icon-star-chain"></span> </div>
    </div>
    <span class="u-desc"><?php echo date('Y-m-d',strtotime('-5 day')) ?></span> </div>
  <div class="m-right"> 
  <i class="icon icon-download" data-gameid="160444" data-cplink="Y" data-isbp="0" data-href="<?=$r['ios']?>" data-filepath="<?=$r['apk']?>">下载</i> 
  </div>
  </a> 
</div>               
<?php
    }
   }
}
db_close();
$empire=null;
?>

模板代码:

<div class="u-btn-load-more" id="loadmore">点击加载更多</div>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注