帝国cms首页增加PHP文件点击加载更多按钮
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>
参考网址:http://m.119yx.cncobo.com/
http://ecms300.cncobo.com/

#免责声明#
ZHANN.CN帝国之家工作室内所有作品,均为ZHANN手写代码。部分样式或模板代码移植或仿造自互联网(如有侵权,出示著作权证书联系我删除),所有代码不能用于非法站点(色情,暴力,政治类站点)。ZHANN只提供源代码服务,不提供任何建站服务。不承担任何建站后的法律问题!ZHANN所得费用均为制作模板劳动报酬。使用开源免费的帝国CMS作为核心,请保留帝国CMS的版权。如商用请购买帝国商业版,ZHANN只做帝国CMS模板服务,不做任何建站、不制作采集任何网站内容、不出售任何非开源有版权源代码更不卖任何域名和空间服务器,我出卖的只是我的技术劳动力!如在本站发生交易任何资源或者下载任何资源,则代表默认同意以上文字内容。感谢小伙本的支持,做一个知法守法的好公民!