ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/okanime.top/ |
<?php define('ROOT_PATH', dirname(__FILE__) . '/'); require ROOT_PATH."include/configs.php"; require ROOT_PATH."include/const.php"; require ROOT_PATH."lib/class_info.php"; global $INFO; $CORE = new info(); include ROOT_PATH.'lib/class_jsonwebtoken.php'; require ROOT_PATH."lib/class_functions.php"; $func = new FUNC; $CORE->input = $func->get_input(); require ROOT_PATH."lib/class_display.php"; $print = new display(); require ROOT_PATH."lib/class_db.php"; $DB = new db_driver; $DB->connect($INFO); require ROOT_PATH."include/functions/index.php"; if(isset($_COOKIE['cookie_local_token_new']) and $_COOKIE['cookie_local_token_new']!='') { $ob_user = new stdClass(); $ob_user = JWT::decode($_COOKIE['cookie_local_token_new'], 'NHG#789-2017', array('HS256')); $user_id = intval($ob_user->user_id); $row_user = $DB->fetch_row($DB->query("SELECT user_type FROM tb_user WHERE user_id='$user_id'")); if (!$row_user or !in_array($row_user['user_type'], array('cbnv', 'staff'))) { $print->refresh('index.php'); exit(); } }else{ $print->refresh('index.php'); exit(); } $urls = $CORE->input['urls']??''; $truyen_id = $_POST['id'] ?? 0; if(!empty($urls)) { $arr_url = explode('@', $urls); if(!empty($arr_url)){ foreach($arr_url as $val){ $arr_val = explode('|',$val); $chuong_epi = $arr_val[0]; $chap_name = $arr_val[1]; if(!empty($chuong_epi) and !empty($chap_name)) { //insert/update chap $row_chuong = $DB->fetch_row($DB->query("SELECT * FROM tb_chuong WHERE chuong_name='$chap_name' AND truyen_id='$truyen_id' LIMIT 1 ")); $chuong_id = 0; if ($row_chuong) { $chuong_id = $row_chuong['chuong_id']; } $chuong_pos = floatval($chap_name); if ($chuong_id == 0) {//insert $arr_insert = array('truyen_id' => $truyen_id, 'chuong_server' => '', 'chuong_name' => $chap_name, 'chuong_fname' => $func->format_string($chap_name), 'chuong_pos' => $chuong_pos, 'chuong_number_img' => 0, 'chuong_new' => '', 'chuong_hit' => 0, 'chuong_point' => 1, 'time_post' => date('Y-m-d H:i:s'), 'user_post' => 0, 'chuong_epi' => $chuong_epi); $chuong_id = $DB->do_insert('tb_chuong', $arr_insert); } else {//update $arr_update = array('chuong_name' => $chap_name, 'chuong_fname' => $func->format_string($chap_name), 'chuong_pos' => $chuong_pos, 'chuong_number_img' => 0, 'chuong_new' => '', 'chuong_hit' => 0, 'chuong_point' => 1, 'time_post' => date('Y-m-d H:i:s'), 'user_post' => 0, 'chuong_epi' => $chuong_epi); $DB->do_update('tb_chuong', $arr_update, " WHERE chuong_id='$chuong_id' "); } } //show chap uploaded ob_start(); usleep(500000); $arr['status']=1; $arr['message']='<br/>'.$chap_name . " updated!\n<br/>"; doFlush(); } //update follow $DB->query("UPDATE tb_follow SET already_read='' WHERE truyen_id='$truyen_id'"); //update truyen $row_chuong = $DB->fetch_row($DB->query("SELECT count(*) as total FROM tb_chuong WHERE truyen_id='".$truyen_id."' ")); $DB->query("UPDATE tb_truyen SET truyen_sochuong='".$row_chuong['total']."',time_update='".date('Y-m-d H:i:s')."' WHERE truyen_id='$truyen_id'"); $q_chuong = $DB->query("SELECT * FROM tb_chuong WHERE truyen_id='".$truyen_id."' ORDER BY chuong_pos DESC LIMIT 2"); $i=1; while($r_chuong = $DB->fetch_row($q_chuong)){ if($i==1){ $DB->query("UPDATE tb_truyen SET truyen_chuong_moinhat_id='".$r_chuong['chuong_id']."',truyen_chuong_moinhat_name='".$r_chuong['chuong_name']."',truyen_chuong_moinhat_fname='".$r_chuong['chuong_fname']."',truyen_chuong_moinhat_isnew='".$r_chuong['chuong_new']."' ,truyen_chuong_moinhat_time='".$r_chuong['time_post']."' WHERE truyen_id='".$truyen_id."' "); } if($i==2){ if($r_chuong['chuong_id']>0){ $DB->query("UPDATE tb_truyen SET truyen_chuong_moinhi_id='".$r_chuong['chuong_id']."',truyen_chuong_moinhi_name='".$r_chuong['chuong_name']."',truyen_chuong_moinhi_fname='".$r_chuong['chuong_fname']."',truyen_chuong_moinhi_isnew='".$r_chuong['chuong_new']."',truyen_chuong_moinhi_time='".$r_chuong['time_post']."' WHERE truyen_id='".$truyen_id."' "); } } $i++; } } } exit(); ?>