<?PHP 

    # Пишу скрипты, модули с 0 
    # PHP <> 7.4, MySQL,MySQL(i),PDO
    # author penny wise
    # telegram @the_penny_wise

    # ядро

    require_once (__DIR__."/_sys/_core.php");

    $id = isset( $_GET['id'] ) ? abs(intval($_GET['id'])) : 0;

    $url = URL.'films/'.$id;

    $get = curl($url);

    preg_match('#<title>(.*)</title>#sU', $get, $meta_title);
	preg_match('#<meta name="description" content="(.*)"#sU', $get, $meta_description);
	preg_match('#<meta name="keywords" content="(.*)"#sU', $get, $meta_keywords);
	preg_match('#<meta property="og:title" content="(.*)"#sU', $get, $meta_og_title);
    preg_match('#<meta property="og:desc" content="(.*)"#sU', $get, $meta_og_desc);	

    preg_match('#<img src="'.URL.'films/screen/(.*)"(.*)title="(.*)"#sU', $get, $screen);
    preg_match('#<div class="filmopis screen2">(.*)</div>#sU', $get, $screen2);
    preg_match('#<div class="filmopis screen3"><p>(.*)</p>#sU', $get, $screen3);
    preg_match('#Playerjs(.*);#sU', $get, $video);
    preg_match('#<div class="blms"><ul class="tl2">(.*)</ul></div>#sU', $get, $load);
    
    $title = ($meta_title[1] != null ? $meta_title[1] : 'Фильмы на телефон');
    $keywords = ($meta_keywords[1] != null ? $meta_keywords[1] : 'Фильмы на телефон');
    $description = ($meta_description[1] != null ? $meta_description[1] : 'Фильмы на телефон');
    $og_title = ($meta_og_title[1] != null ? $meta_og_title[1] : 'Фильмы на телефон');
    $og_desc = ($meta_og_desc[1] != null ? $meta_og_desc[1] : 'Фильмы на телефон');
    $t =  ($meta_og_title[1] != null ? $meta_og_title[1] : 'Фильмы на телефон');


    $screen2[1] = str_replace('/style/',URL.'style/',$screen2[1]);
    $screen2[1] = stripslashes(trim($screen2[1]));

    $load[1] = str_replace('/films/',URL.'films/',$load[1]);
    $load[1] = stripslashes(trim($load[1]));

    # head

    require_once (__DIR__."/_sys/_head.php");

    if ($meta_title[1] != null):
   
    echo '
    <div class="filmopis screen">
    <img src="'.URL.'films/screen/'.$screen[1].'" alt="'.$screen[3].'" title="'.$screen[3].'" class="filmscreen">
    <br></div>
    <div class="filmopis screen2">'.$screen2[1].'</div>
    <div class="clear"></div>
    <div class="filmopis screen3"><p>'.$screen3[1].'</p></div>
    <div class="clear"></div>
    </div>
    <h1 class="blc2"><span class="acat2"><img src="https://'.DOMAIN.'/style/img/online.png" alt="">Смотреть онлайн:</span></h1>
    <script src="'.URL.'films/player/anwap_asd.js?v10.2"></script>
    <div class="onlinefilm" style="    margin: 4px;">
    <div class="player" id="videoplayer" style="max-width:1024px;"></div>
    <script>var player = new Playerjs'.$video[1].';</script>
    </div><div class="clear"></div>
    <h1 class="blc2"><span class="acat2"><img src="https://'.DOMAIN.'/style/img/raz.png" alt="">Поделится в соц. сетях:</span></h1>
<center><div class="ya-share2" data-services="vkontakte,facebook,odnoklassniki,twitter,whatsapp,telegram"></div></center>
    <h1 class="blc2"><span class="acat2"><img src="https://'.DOMAIN.'/style/img/raz.png" alt="">Скачать фильм:</span></h1>
    <div class="blms"><ul class="tl2">'.$load[1].'</ul></div>
    ';

    
    else: echo '</div><div class="us_msg" style="margin: 0px 4px;color: red;"><strong>Ошибка зайдите позже!</strong></div>'; endif;

    echo '
    <div class="menuniz">
    <a href="http://'.DOMAIN.'/films/search"><img src="'.URL.'style/img/newpoisk.png" alt="">Поиск</a>
    <a href="http://'.DOMAIN.'"><img src="'.URL.'style/img/back.png" alt="">На главную</a></div>
    ';

    # foot

    require_once (__DIR__."/_sys/_foot.php");