ÿØÿà 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/vidoe.top/code/ |
<?php class global_site { public function __construct(){ global $CORE, $INFO, $smarty, $lang; $act = ''; if(isset($CORE->input['act'])){ $act = $CORE->input['act']; } switch($act){ case 'phim' : $modules = 'phim2' ; break; case 'search' : $modules = 'search' ; break; case 'video' : $modules = 'video' ; break; case 'videodetail' : $modules = 'videodetail' ; break; case 'mustsee': $modules = 'mustsee' ; break; case 'live' : $modules = 'live'; break; case 'login' : $modules = 'login' ; break; case 'user' : $modules = 'user' ; break; case 'all_movie' : $modules = 'home' ; break; case '18plus' : $modules = '18plus' ; break; case 'upload' : $modules = 'upload' ; break; case '404' : $modules = '404' ; break; default : $modules = 'home_new'; break; } $code = ''; if(isset($CORE->input['code'])){ $code = $CORE->input['code']; } $module = ROOT_PATH."code/".$modules.".php"; include($module); $smarty->assign('module', $modules); $func_view = ''; $show_sub_tpl = 0; $arr_active_menu = array('home'=>'uk-parent','movie'=>'uk-parent','tvdrama'=>'uk-parent','intheaters'=>'uk-parent','all_movie'=>'uk-parent','video'=>'uk-parent','live'=>'uk-parent'); $txt_robot = 'index,follow'; if($modules=='home_new'){ $arr_active_menu['home'] = 'uk-active'; } if($modules=='phim2' or $modules=='home'){ if(isset($CORE->input['formality']) && $CORE->input['formality']=='movie'){ $arr_active_menu['movie'] = 'uk-active'; } if(isset($CORE->input['formality']) && $CORE->input['formality']=='tv-drama'){ $arr_active_menu['tvdrama'] = 'uk-active'; } if(isset($CORE->input['formality']) && $CORE->input['formality']=='in-theaters'){ $arr_active_menu['intheaters'] = 'uk-active'; } $arr_active_menu['all_movie'] = 'uk-active'; } if(isset($CORE->input['act']) and $CORE->input['act']=='all_movie'){ $arr_active_menu['all_movie'] = 'uk-active'; } if($modules=='video'){ $arr_active_menu['video'] = 'uk-active'; } if($modules=='live'){ $arr_active_menu['live'] = 'uk-active'; } if($modules=='18plus'){ $arr_active_menu['plus'] = 'uk-active'; } if($modules=='user'){ $arr_active_menu['myaccount'] = 'uk-active'; } if(!empty($code)){ $func_view = '_'.$code; if(file_exists(ROOT_PATH.'skin/'.$INFO['skin_folder'].'/'.$modules.$func_view.'.tpl')){ $show_sub_tpl = 1; } } $smarty->assign('func_view', $func_view); $smarty->assign('show_sub_tpl', $show_sub_tpl); //$smarty->assign('setting_page',$CORE->vars); //$smarty->assign('langcode',$_SESSION['countryName']); $smarty->assign('lang',$lang); $smarty->assign('active_menu',$arr_active_menu); $smarty->assign('txt_robot',$txt_robot); $this->checkLogin(); $this->goBlockLeft(); $this->goMenu(); } function goMenu(){ global $smarty,$INFO,$DB,$func,$memcache; $txt_keyword = ''; if(isset($_SESSION['keyword']) && $_SESSION['keyword']!=''){ $txt_keyword = $_SESSION['keyword']; } if(isset($_GET['q']) && $_GET['q']!='') { $_SESSION['keyword'] = trim($_GET['q']); $txt_keyword = $_SESSION['keyword']; } $smarty->assign('keyword', $txt_keyword); $txt_phim_le_nam = ''; foreach($INFO['namphathanh_phimle'] as $key=>$val){ $txt_phim_le_nam .= '<a href="movie/' . $key . '/" class="dropdown-item">' . $val[$_SESSION['lang']] . '</a>'; } $smarty->assign('phimlenam',$txt_phim_le_nam); $txt_phim_bo_nam = ''; foreach($INFO['quocgia'] as $key=>$val){ $txt_phim_bo_nam .= '<a href="tv-drama/'.$key.'/" class="dropdown-item">'.$val[$_SESSION['lang']].'</a>'; } $smarty->assign('phimbonam',$txt_phim_bo_nam); $txt_the_loai_video = ''; $txt_the_loai_video_option = ''; foreach($INFO['videocat'] as $key=>$val){ if($key=='mustsee'){ $txt_the_loai_video .= '<a href="'.$key.'/" class="dropdown-item">'.$val[$_SESSION['lang']].'</a>'; }else { $txt_the_loai_video .= '<a href="video/' . $key . '/" class="dropdown-item">' . $val[$_SESSION['lang']] . '</a>'; $txt_the_loai_video_option .= '<option value="'.$key.'">'.$val[$_SESSION['lang']].'</option>'; } } $smarty->assign('theloaivideo',$txt_the_loai_video); $smarty->assign('theloaivideo_option',$txt_the_loai_video_option); $txt_the_loai_tintuc = ''; foreach($INFO['newscat'] as $key=>$val){ $txt_the_loai_tintuc .= '<li><a href="news/'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; } $smarty->assign('theloainews',$txt_the_loai_tintuc); $key_phim_hot = md5('phim-hot-nhat8-'.$_SESSION['lang']); // Unique Words $cache_result_phim_hot = $memcache->get($key_phim_hot); // Memcached object if($cache_result_phim_hot){ $list_phim_hot = $cache_result_phim_hot; }else { $q_phim_hot = $DB->query("SELECT id,theloai,title_vi,title_en,title_other,plot,plot_en,hit,img,chatluong,ngonngu,namphathanh,linkphim,sotap,hinhthuc FROM gtdesign_phim WHERE `hot`='1' AND status=1 ORDER BY time DESC LIMIT 0,9 "); while ($r_phim_hot = $DB->fetch_row($q_phim_hot)) { if ($_SESSION['lang'] != 'vi') { $r_phim_hot['title_vi'] = $r_phim_hot['title_en']; $r_phim_hot['title_en'] = $r_phim_hot['title_other']; $r_phim_hot['plot'] = $r_phim_hot['plot_en']; } $r_phim_hot['plot'] = strip_tags(html_entity_decode($r_phim_hot['plot'])); $r_phim_hot['ftitle'] = $func->format_string($r_phim_hot['title_vi']); $r_phim_hot['chatluong'] = $r_phim_hot['chatluong'] . '-' . $INFO['ngonngu'][$r_phim_hot['ngonngu']][$_SESSION['lang']]; $r_phim_hot['sotap_daup'] = substr_count($r_phim_hot['linkphim'], '@'); $list_phim_hot[] = $r_phim_hot; } $memcache->set($key_phim_hot, $list_phim_hot, MEMCACHE_COMPRESSED, 1200); } $smarty->assign('phim_hot',$list_phim_hot); $key_new_video = md5('video-moi-nhat'); // Unique Words $cache_result_new_video = $memcache->get($key_new_video); // Memcached object if($cache_result_new_video){ $list_related3 = $cache_result_new_video; }else { $q_related2 = $DB->query(" SELECT * FROM gtdesign_video WHERE status='1' ORDER BY time DESC LIMIT 0,5 "); while ($r_related2 = $DB->fetch_row($q_related2)) { $r_related2['title'] = trim(strip_tags(str_replace('"', '"', html_entity_decode($r_related2['title'])))); $r_related2['encode_img'] = bin2hex($func->str_encode($r_related2['img'], 'ngocgiac')); $r_related2['ftitle'] = $func->format_string($r_related2['title']); $row_user3 = $DB->fetch_row($DB->query("SELECT fullname FROM gtdesign_user WHERE id='" . $r_related2['uid'] . "' ")); $r_related2['user_name'] = $row_user3['fullname']; $r_related2['txt_time'] = date('M d Y', $r_related2['time']); $list_related3[] = $r_related2; $memcache->set($key_new_video, $list_related3, MEMCACHE_COMPRESSED, 1200); } } $smarty->assign('list_new_video',$list_related3); //show channel $key_video_local = md5("SELECT uid, count(id) AS so_upload FROM gtdesign_video GROUP BY uid ORDER BY so_upload DESC LIMIT 5 "); $cache_video_local = $memcache->get($key_video_local); if($cache_video_local){ $list_uid = $cache_video_local; }else { $q_video_local = $DB->query("SELECT uid, count(id) AS so_upload FROM gtdesign_video GROUP BY uid ORDER BY so_upload DESC LIMIT 5 "); while ($r_video_local = $DB->fetch_row($q_video_local)) { $list_uid[] = $r_video_local['uid']; } $memcache->set($key_video_local, $list_uid, MEMCACHE_COMPRESSED, 1200); } $txt_uid=implode(',',$list_uid); $key_user_local = md5("SELECT id,name,fullname,avatar FROM gtdesign_user WHERE id IN (".$txt_uid.") ORDER BY id DESC LIMIT 5"); $cache_user_local = $memcache->get($key_user_local); if($cache_user_local){ $list_users = $cache_user_local; }else { $q_user_local = $DB->query("SELECT id,name,fullname,avatar FROM gtdesign_user WHERE id IN (" . $txt_uid . ") ORDER BY id DESC LIMIT 5"); while ($r_user_local = $DB->fetch_row($q_user_local)) { if (!empty($r_user_local['name'])) { $list_user_local['url'] = 'user/' . $r_user_local['name'] . '/'; } else { $list_user_local['url'] = 'video/post/' . $r_user_local['id'] . '/'; } $list_user_local['avatar'] = $r_user_local['avatar']; $list_user_local['fullname'] = $r_user_local['fullname']; $list_users[] = $list_user_local; } $memcache->set($key_user_local, $list_users, MEMCACHE_COMPRESSED, 1200); } $smarty->assign('list_users',$list_users); } // Menu builder function, parentId 0 is the root function checkLogin(){ global $DB,$smarty,$func; $smarty->assign('user_id', ''); if(isset($_SESSION['openid_type']) and $_SESSION['openid_type']!='') { switch ($_SESSION['openid_type']) { case 'facebook': if (isset($_SESSION['openid']) and $_SESSION['openid'] != '') { $avatar = 'https://graph.facebook.com/' . $_SESSION['openid'] . '/picture'; $row_check_user = $DB->fetch_row($DB->query("SELECT * FROM gtdesign_user WHERE openid='" . $_SESSION['openid'] . "' and openid_type='" . $_SESSION['openid_type'] . "' LIMIT 1 ")); if (!$row_check_user) { $joined = time(); $DB->query("INSERT INTO gtdesign_user (`openid`,`email`,`joined`,`fullname`,`avatar`,`openid_type`) VALUES ('" . $_SESSION['openid'] . "','" . $_SESSION['email'] . "','" . $joined . "','" . $_SESSION['fullname'] . "','" . $avatar . "','" . $_SESSION['openid_type'] . "') "); $_SESSION['user_id'] = mysql_insert_id(); } else { $_SESSION['user_id'] = $row_check_user['id']; $joined = $row_check_user['joined']; $_SESSION['fullname'] = $row_check_user['fullname']; $_SESSION['email'] = $row_check_user['email']; } $_SESSION['redirect_url'] = $func->current_url(); $smarty->assign('user_id', $_SESSION['user_id']); $smarty->assign('openid', $_SESSION['openid']); $smarty->assign('avatar', $avatar); $smarty->assign('email', $_SESSION['email']); $smarty->assign('fullname', $_SESSION['fullname']); $smarty->assign('joined', date('F d Y', $joined)); } else { $smarty->assign('openid', ''); } break; case 'google': if (isset($_SESSION['openid']) and $_SESSION['openid'] != '') { $avatar = $_SESSION['avatar']; $row_check_user = $DB->fetch_row($DB->query("SELECT * FROM gtdesign_user WHERE openid='" . $_SESSION['openid'] . "' and openid_type='" . $_SESSION['openid_type'] . "' LIMIT 1 ")); if (!$row_check_user) { $joined = time(); $DB->query("INSERT INTO gtdesign_user (`openid`,`email`,`joined`,`fullname`,`avatar`,`openid_type`) VALUES ('" . $_SESSION['openid'] . "','" . $_SESSION['email'] . "','" . $joined . "','" . $_SESSION['fullname'] . "','" . $avatar . "','" . $_SESSION['openid_type'] . "') "); $_SESSION['user_id'] = mysql_insert_id(); } else { if(!file_exists($row_check_user['avatar'])) { $DB->query("UPDATE gtdesign_user SET avatar='$avatar' WHERE id='" . $row_check_user['id'] . "' "); } $_SESSION['user_id'] = $row_check_user['id']; $joined = $row_check_user['joined']; $_SESSION['fullname'] = $row_check_user['fullname']; $_SESSION['email'] = $row_check_user['email']; } $_SESSION['redirect_url'] = $func->current_url(); $smarty->assign('user_id', $_SESSION['user_id']); $smarty->assign('openid', $_SESSION['openid']); $smarty->assign('avatar', $avatar); $smarty->assign('email', $_SESSION['email']); $smarty->assign('fullname', $_SESSION['fullname']); $smarty->assign('joined', date('F d Y', $joined)); } else { $smarty->assign('openid', ''); } break; case 'discord': if (isset($_SESSION['openid']) and $_SESSION['openid'] != '') { $avatar = $_SESSION['avatar']; $row_check_user = $DB->fetch_row($DB->query("SELECT * FROM gtdesign_user WHERE openid='" . $_SESSION['openid'] . "' and openid_type='" . $_SESSION['openid_type'] . "' LIMIT 1 ")); if (!$row_check_user) { $joined = time(); $DB->query("INSERT INTO gtdesign_user (`openid`,`email`,`joined`,`fullname`,`avatar`,`openid_type`) VALUES ('" . $_SESSION['openid'] . "','" . $_SESSION['email'] . "','" . $joined . "','" . $_SESSION['fullname'] . "','" . $avatar . "','" . $_SESSION['openid_type'] . "') "); $_SESSION['user_id'] = mysql_insert_id(); } else { $DB->query("UPDATE gtdesign_user SET avatar='$avatar' WHERE id='".$row_check_user['id']."' "); $_SESSION['user_id'] = $row_check_user['id']; $joined = $row_check_user['joined']; $_SESSION['fullname'] = $row_check_user['fullname']; $_SESSION['email'] = $row_check_user['email']; } $_SESSION['redirect_url'] = $func->current_url(); $smarty->assign('user_id', $_SESSION['user_id']); $smarty->assign('openid', $_SESSION['openid']); $smarty->assign('avatar', $avatar); $smarty->assign('email', $_SESSION['email']); $smarty->assign('fullname', $_SESSION['fullname']); $smarty->assign('joined', date('F d Y', $joined)); } else { $smarty->assign('openid', ''); } break; } } } function goBlockLeft(){ global $INFO,$smarty,$CORE,$DB; $txt_theloai = ''; $txt_theloai_option = ''; $q_genres = $DB->query("SELECT * FROM gtdesign_genres"); while($r_genres = $DB->fetch_row($q_genres)){ if($_SESSION['lang']=='en'){ $r_genres['name'] = $r_genres['ename']; } $key = $r_genres['slug']; if(isset($CORE->input['genre']) and $CORE->input['genre']==$key) { $txt_theloai .= '<li class="active"><a href="genre/'.$key.'/">'.$r_genres['name'].'</a></li>'; $txt_theloai_option .= '<option value="' . $key . '" selected>'.$r_genres['name'].'</option>'; }else { $txt_theloai .= '<li><a href="genre/' . $key . '/">'.$r_genres['name'].'</a></li>'; $txt_theloai_option .= '<option value="' . $key . '">'.$r_genres['name'].'</option>'; } } $smarty -> assign('theloai',$txt_theloai); $smarty -> assign('theloai_option',$txt_theloai_option); $txt_ngonngu = ''; $txt_ngonngu_option = ''; foreach($INFO['ngonngu'] as $key=>$val){ if(isset($CORE->input['language']) and $CORE->input['language']==$key) { $txt_ngonngu_option .= '<option value="' . $key . '" selected>' . $val[$_SESSION['lang']] . '</option>'; $txt_ngonngu .= '<li class="active"><a href="language/'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; }else{ $txt_ngonngu_option .= '<option value="' . $key . '">' . $val[$_SESSION['lang']] . '</option>'; $txt_ngonngu .= '<li><a href="language/'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; } } $smarty -> assign('ngonngu',$txt_ngonngu); $smarty -> assign('ngonngu_option',$txt_ngonngu_option); $txt_quocgia = ''; $txt_quocgia_option = ''; $q_country = $DB->query("SELECT * FROM gtdesign_country"); while($r_country = $DB->fetch_row($q_country)){ if($_SESSION['lang']=='en'){ $r_country['name'] = $r_country['ename']; } $key = $r_country['slug']; if(isset($CORE->input['country']) and $CORE->input['country']==$key) { $txt_quocgia .= '<li class="active"><a href="country/'.$key.'/">'.$r_country['name'].'</a></li>'; $txt_quocgia_option .= '<option value="' . $key . '" selected>' . $r_country['name'] . '</option>'; }else { $txt_quocgia .= '<li><a href="country/' . $key . '/">' . $r_country['name'] . '</a></li>'; $txt_quocgia_option .= '<option value="' . $key . '">' . $r_country['name'] . '</option>'; } } $smarty -> assign('quocgia',$txt_quocgia); $smarty -> assign('quocgia_option',$txt_quocgia_option); $txt_namphathanh = ''; $txt_namphathanh_option = ''; foreach($INFO['namphathanh'] as $key=>$val){ if(isset($CORE->input['year']) and $CORE->input['year']==$key) { $txt_namphathanh_option .= '<option value="' . $key . '" selected>' . $val[$_SESSION['lang']] . '</option>'; $txt_namphathanh .= '<li class="active"><a href="year/'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; }else{ $txt_namphathanh_option .= '<option value="' . $key . '">' . $val[$_SESSION['lang']] . '</option>'; $txt_namphathanh .= '<li><a href="year/'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; } } $smarty -> assign('namphathanh',$txt_namphathanh); $smarty -> assign('namphathanh_option',$txt_namphathanh_option); $txt_hinhthuc = ''; $txt_hinhthuc_option = ''; foreach($INFO['hinhthuc'] as $key=>$val){ if(isset($CORE->input['formality']) and $CORE->input['formality']==$key) { $txt_hinhthuc .= '<li class="active"><a href="'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; $txt_hinhthuc_option .= '<option value="' . $key . '" selected>' . $val[$_SESSION['lang']] . '</option>'; }else{ $txt_hinhthuc .= '<li><a href="'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; $txt_hinhthuc_option .= '<option value="' . $key . '">' . $val[$_SESSION['lang']] . '</option>'; } } $smarty -> assign('hinhthuc',$txt_hinhthuc); $smarty -> assign('hinhthuc_option',$txt_hinhthuc_option); $txt_videocat = ''; foreach($INFO['videocat'] as $key=>$val){ if($key=='mustsee'){ $txt_videocat .= '<li><a href="'.$key.'/">'.$val[$_SESSION['lang']].'</a></li>'; }else { $txt_videocat .= '<li><a href="video/' . $key . '/">' . $val[$_SESSION['lang']] . '</a></li>'; } } $smarty -> assign('videocat',$txt_videocat); } } ?>