67 Star 170 Fork 77

aming / ebookapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
category.php 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
aming 提交于 2014-07-23 09:40 . 重新修改适应原抓取网站的变化
<?php
include_once "init.php";
include_once "util/mysql_class.php";
include_once "smarty_inc.php";
include_once WEB_ROOT."admin/funcs/app_util_func.php";
include_once WEB_ROOT."util/util.php";
include_once WEB_ROOT."util/Model_class.php";
include_once 'util/mobile_redirect.php';
$db = new mysql();
if(@$_GET["id"]){
$category_id = verify_id($_GET["id"]);
$category_sql = " and c.id=".$category_id;
$pageNo=verify_id($_GET["page"]);
}else{
$category_sql ="";
$pageNo=1;
}
$sql_total="select count(1) from t_article a,t_seeds b,t_category c where a.seed_id = b.id and b.category_id=c.id ".$category_sql ;
$total = get_total_count($sql_total);
$category_name=get_category_name($category_id);
$smarty->assign("total",$total);
$smarty->assign("pageNo",$pageNo);
$maxPg = (int)($total/15);
if($maxPg*15<$total){
$maxPg = $maxPg+1;
}
$pagination="";
/*if($pageNo==1&$pageNo<$maxPg){
$pagination = "<li><a href=\"/category/".$category_id."/".($pageNo+1).".html\">Next</a></li>";
} else if($pageNo==$maxPg&$pageNo>=$maxPg&$pageNo>1){
$pagination = "<li><a href=\"/category/".$category_id."/".($pageNo-1).".html\">Prev</a></li>";
} else if($pageNo<$maxPg){
$pagination = "<li><a href=\"/category/".$category_id."/".($pageNo-1).".html\">Prev</a></li><li><a href=\"/category/".$category_id."/".($pageNo+1).".html\">Next</a></li>";
}*/
$pagination = getPageInfo($category_id,$pageNo,$maxPg);
$links = getLinks();
$advert = getadvert();
$smarty->assign("links",$links);
$smarty->assign("advert",$advert);
$recent = getCRecent($category_sql,$pageNo,"a.id");
$arr = getCRecent($category_sql,"1","a.click_times");
$smarty->assign("click_artile",$arr);
$smarty->assign("maxPg",$maxPg);
$smarty->assign("total",$total);
$smarty->assign("pagination",$pagination);
$smarty->assign("category_name",$category_name);
$smarty->assign("activeIdx",$category_id);
$smarty->assign("artile",$recent);
$smarty->display("category_bootstrap.htm");
$smarty->display("right-nav.htm");
$smarty->display("common_footer.htm");
?>
PHP
1
https://gitee.com/aming0502/ebookapp.git
git@gitee.com:aming0502/ebookapp.git
aming0502
ebookapp
ebookapp
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891