帝国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]?> | <?=$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>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。