代码拉取完成,页面将自动刷新
同步操作将从 aming/ebookapp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
include_once "init.php";
include_once WEB_ROOT."util/mysql_class.php";
include_once WEB_ROOT."smarty_inc.php";
include_once WEB_ROOT."admin/funcs/make_article_func.php";
include_once WEB_ROOT."admin/funcs/app_util_func.php";
include_once WEB_ROOT."admin/funcs/make_single_chapter_func.php";
include_once WEB_ROOT."util/util.php";
include_once WEB_ROOT."util/Model_class.php";
include_once WEB_ROOT.'admin/Parser_class.php';
include_once 'third_part/simple_html_dom.php';
include_once 'util/mobile_redirect.php';
//$db = new mysql();
if(@$_GET["chapter_id"]){
$chapter_id = str_check($_GET["chapter_id"]);
$article_id = str_check($_GET["article_id"]);
$flag = $_GET["flag"];
if(strcmp($flag,"next")==0){
//echo "1";
$next_id = next_chapter_func($chapter_id,$article_id);
}else{
//echo "2";
$next_id = last_chapter_func($chapter_id,$article_id);
}
//echo $next_id;
navToChapter($next_id);
}else{
echo "artileid missing";
}
function next_chapter_func($chapter_id,$article_id){
$db = new mysql();
$sql_select="select * from t_chapter where id > ".$chapter_id." and artile_id=".$article_id." order by id limit 0,1";
$query = $db->query($sql_select);
$count = 0;
$row=$db->fetch_row_array($query);
if($row){
return $row["id"];
}else{
return -1;
}
}
function last_chapter_func($chapter_id,$article_id){
$db = new mysql();
$sql_select="select * from t_chapter where id < ".$chapter_id." and artile_id=".$article_id." order by id desc limit 0,1";
$query = $db->query($sql_select);
$count = 0;
$row=$db->fetch_row_array($query);
if($row){
return $row["id"];
}else{
return -1;
}
}
function navToChapter($chapter_id){
if($chapter_id<0){
echo "<head><meta charset=\"gb2312\"></head>ѵҳ ";
return;
}
$local_url="/data/chapters/".$chapter_id.".htm";
$act_file = WEB_ROOT.$local_url;
if(!file_exists($act_file)){
try{
make_chapter_func($chapter_id,false);
}catch(Exception $e){
}
}
if(file_exists($act_file)){
echo read_file_content($act_file);
}else{
showErrorPage($chapter_id);
}
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。