clr_str($_GET[self::$type[0]]); self::$language = $language; self::$href = $href; self::$section = $section; self::$smarty = $smarty; self::$is_shorts = $is_shorts; self::$userinfo = array("user_id" => '', "user_name" => "", "upload_category" => "", "usr_partner" => "", "usr_affiliate" => "", "affiliate_badge" => "", "user_dname" => "", "ch_title" => "", "user_inc" => "", "user_joindate" => "", "user_issub" => "", "user_subtotal" => "", "user_isfollow" => "", "user_followtotal" => ""); if ($_type == 'live' and self::$file_key != '' and !isset($_GET['s']) and !isset($_GET['do'])) { $fcs = VServer::getFreeServer('chat'); $_SESSION['live_chat_server'] = $fcs; self::set_gcs($_SESSION['USER_ID'], $fcs); self::$smarty->assign('live_chat_server', $fcs); } self::$db_cache = false; //change here to enable caching } /* get embed code from url */ public static function getEmbedCodeFromURL() { require_once 'f_core/f_classes/class_oembed/vendor/autoload.php'; if (isset($_POST['ec']) and $p = secured_decrypt($_POST['ec'])) { try { $embed = new \Embed\Embed(); $url = (html_entity_decode($p, ENT_QUOTES, "UTF-8")); $url = (html_entity_decode($url, ENT_QUOTES, "UTF-8")); $u = parse_url($url); $h = explode('.', $u['host']); $src = $h[(count($h) - 2)]; $src = ($src == 'youtu' ? 'youtube' : $src); switch ($src) { case "facebook": $ec = '
'; break; case "joshwhotv": $ec = ''; break; default: $oe = $embed->get($url); $ec = preg_replace('/(width|height)="[^"]*"/', '$1="100%"', $oe->code->html); break; } return json_encode(["c" => $ec]); } catch (Exception $e) { $er = VGenerate::noticeTpl('', $e->getMessage(), ''); return json_encode(["e" => $er]); } } } /* set current user temp chat servers */ private static function set_gcs($uid, $fcs) { $uid = (int) $uid; $fcs = self::$filter->clr_str($fcs); self::$db->execute(sprintf("UPDATE `db_accountuser` SET `chat_temp`='%s' WHERE `usr_id`='%s' LIMIT 1;", $fcs, $uid)); } /* get current user temp chat servers */ private static function get_gcs($uid) { $uid = (int) $uid; return self::$dbc->singleFieldValue('db_accountuser', 'chat_temp', 'usr_id', $uid); } /* submit like/dislike actions */ public function likeAction($type) { $language = self::$language; $class_filter = self::$filter; $class_database = self::$dbc; $db = self::$db; $cfg = self::$cfg; $_uid = (int) $_SESSION['USER_ID']; $vtype = self::$type; $vkey = self::$file_key; $vrate = (int) $_POST['f_vrate']; $vlike = (int) $_POST['f_like']; $vdislike = (int) $_POST['f_dislike']; $uuid = (int) $_POST['uf_vuid']; $vtxt = $type == 'file-like' ? $language['view.files.like.txt'] : $language['view.files.dislike.txt']; $vtxt = str_replace('##TYPE##', $language["frontend.global." . $vtype[0]], $vtxt); /* get like, dislike numbers */ $vnr = $db->execute(sprintf("SELECT `file_like`, `file_dislike` FROM `db_%sfiles` WHERE `file_key`='%s' LIMIT 1;", $vtype, $vkey)); $likenr = $vnr->fields['file_like']; $dislikenr = $vnr->fields['file_dislike']; /* get file likes */ $vsql = sprintf("SELECT `db_id` FROM `db_%sliked` WHERE `usr_id`='%s' AND `file_key`='%s' LIMIT 1;", $vtype, $_uid, $vkey); $vinfo = $db->execute($vsql); $likes = $vinfo->fields['db_id']; if (!$likes and $type == 'file-like') { $class_database->doInsert('db_' . $vtype . 'liked', ["usr_id" => $_uid, "file_key" => $vkey, "datetime" => date("Y-m-d H:i:s")]); } elseif (($likes and $type == 'file-dislike') or ($likes and $type == 'file-like')) { $db->execute(sprintf("DELETE FROM `db_%sliked` WHERE `db_id`='%s' LIMIT 1;", $vtype, $likes)); } /* get file votes */ $vsql = sprintf("SELECT `file_votes` FROM `db_%srating` WHERE `file_key`='%s' LIMIT 1;", $vtype, $vkey); $vinfo = $db->execute($vsql); $votes = $vinfo->fields['file_votes']; /* start checking */ $js_extra = ''; $q_js = false; $q_str = false; $do_update = false; $db_field = $type == 'file-like' ? 'file_like' : 'file_dislike'; /* if no votes */ if ($votes == '') { $db_arr = array(array("usr_id" => $_uid, "usr_vote" => ($type == 'file-like' ? 1 : 0))); $v_update = sprintf("INSERT INTO `db_%srating` (`db_id` ,`file_key` ,`file_votes`) VALUES ('', '%s', '%s');", $vtype, $vkey, serialize($db_arr)); $db_update = $v_update != '' ? $db->execute($v_update) : null; $do_update = $db->Affected_Rows(); $q_str = sprintf("`%s`=`%s`+1", $db_field, $db_field); $js_extra = '$(".' . $type . '-thumb").addClass("active");'; } else { /* append to votes */ $f = 0; $db_arr = $votes != '' ? unserialize($votes) : null; if (is_array($db_arr)) { /* search if already voted */ foreach ($db_arr as $key => $val) { if ($f == 0 and $val['usr_id'] == $_SESSION['USER_ID']) { $f = 1; $vtxt = $language['view.files.liked.already']; if ($db_arr[$key]['usr_vote'] == 1 and $type != 'file-like') { //already liked, voted dislike $q_str = sprintf("`file_dislike`=`file_dislike`+1, `file_like`=`file_like`-1"); $q_js = '$(".likey .likes_count").text("' . VFiles::numFormat($likenr - 1) . '"); $(".dislikey .dislikes_count").text("' . VFiles::numFormat($dislikenr + 1) . '");'; $q_js .= '$(".file-like-thumb").removeClass("active");$(".file-dislike-thumb").addClass("active");'; $db_arr[$key]['usr_vote'] = ($type == 'file-like' ? 1 : 0); } elseif ($db_arr[$key]['usr_vote'] == 0 and $type == 'file-like') { //already disliked, voted like $q_str = sprintf("`file_dislike`=`file_dislike`-1, `file_like`=`file_like`+1"); $q_js = '$(".likey .likes_count").text("' . VFiles::numFormat($likenr + 1) . '"); $(".dislikey .dislikes_count").text("' . VFiles::numFormat($dislikenr - 1) . '");'; $q_js .= '$(".file-like-thumb").addClass("active");$(".file-dislike-thumb").removeClass("active");'; $db_arr[$key]['usr_vote'] = ($type == 'file-like' ? 1 : 0); } elseif ($db_arr[$key]['usr_vote'] == 1 and $type == 'file-like') { //already liked, voted like (cancel like) $q_str = sprintf("`file_like`=`file_like`-1"); $q_js = '$(".likey .likes_count").text("' . VFiles::numFormat($likenr - 1) . '");'; $q_js .= '$(".file-like-thumb").removeClass("active");$(".file-dislike-thumb").removeClass("active");'; unset($db_arr[$key]); } elseif ($db_arr[$key]['usr_vote'] == 0 and $type != 'file-like') { //already disliked, voted dislike (cancel dislike) $q_str = sprintf("`file_dislike`=`file_dislike`-1"); $q_js = '$(".dislikey .dislikes_count").text("' . VFiles::numFormat($dislikenr - 1) . '");'; $q_js .= '$(".file-like-thumb").removeClass("active");$(".file-dislike-thumb").removeClass("active");'; unset($db_arr[$key]); } $v_update = sprintf("UPDATE `db_%srating` SET `file_votes`='%s' WHERE `file_key`='%s' LIMIT 1;", $vtype, serialize($db_arr), $vkey); $db_update = $v_update != '' ? $db->execute($v_update) : null; $do_update = $db->Affected_Rows(); break; } } /* if did not already vote */ if ($f == 0) { $db_arr[] = array("usr_id" => $_uid, "usr_vote" => ($type == 'file-like' ? 1 : 0)); $v_update = sprintf("UPDATE `db_%srating` SET `file_votes`='%s' WHERE `file_key`='%s' LIMIT 1;", $vtype, serialize($db_arr), $vkey); $db_update = $v_update != '' ? $db->execute($v_update) : null; $do_update = $db->Affected_Rows(); $q_str = sprintf("`%s`=`%s`+1", $db_field, $db_field); if ($type == 'file-like') { $q_js = '$(".likey .likes_count").text("' . VFiles::numFormat($likenr + 1) . '");'; } else { $q_js = '$(".dislikey .dislikes_count").text("' . VFiles::numFormat($dislikenr + 1) . '");'; } $q_js .= '$(".' . $type . '-thumb").addClass("active");'; } } } if ($do_update) { $db->execute(sprintf("UPDATE `db_%sfiles` SET %s WHERE `file_key`='%s' LIMIT 1", $vtype, $q_str, $vkey)); $vlike = $type == 'file-like' ? ($vlike + 1) : $vlike; $vdislike = $type == 'file-dislike' ? ($vdislike + 1) : $vdislike; $js_extra .= '$(".' . ($type == 'file-like' ? 'f_like' : 'f_dislike') . '").val("' . ($type == 'file-like' ? $vlike : $vdislike) . '");'; if ($q_js) { $js_extra .= $q_js; } else { $js_extra .= '$(".' . ($type == 'file-like' ? 'likey .likes_count' : 'dislikey .dislikes_count') . '").text("' . ($type == 'file-like' ? VFiles::numFormat($likenr + 1) : VFiles::numFormat($dislikenr + 1)) . '");'; } $log = ($cfg['activity_logging'] == 1 and $action = new VActivity((int) $_SESSION['USER_ID'], $uuid)) ? $action->addTo('log_rating', (substr($type, 5) . ':' . $vtype . ':' . $vkey)) : null; } echo VGenerate::declareJS($js_extra); return VGenerate::simpleDivWrap('', 'file-like-stats', self::likeStatBars($vrate, $vlike, $vdislike)); } /* like/dislike stat bars */ public function likeStatBars($vrate, $vlike, $vdislike) { $language = self::$language; $like_total = $vlike + $vdislike; $like_perc = $like_total > 0 ? round(100 * $vlike / $like_total) : 0; $dislike_perc = $like_total > 0 ? round(100 * $vdislike / $like_total) : 0; $vlike_txt = $vrate == 1 ? VGenerate::simpleDivWrap('vote-bar', '', ' ') : null; return $vlike_txt; } /* view files layout */ public static function viewLayout() { $sql = self::currentSQL(self::$type, self::$file_key); $vdata = self::$db_cache ? self::$db->CacheExecute(self::$cfg['cache_view_current'], $sql) : self::$db->execute($sql); $vid = self::$file_key; $vuid = $vdata->fields['usr_id']; if (self::$type != 'short' and !$vuid) { echo ''; } else { if (self::$type == 'short' and (int) $vid == 0) { $last_short = self::$dbc->singleFieldValue('db_accountuser', 'usr_last_short', 'usr_id', (int) $_SESSION['USER_ID']); if ($last_short > 0) { $sql = sprintf("SELECT `db_id`, `file_key` FROM `db_shortfiles` WHERE `privacy`='public' AND `approved`='1' AND `deleted`='0' AND `active`='1' AND `db_id` > (SELECT `db_id` FROM `db_shortfiles` WHERE `file_key`='%s' LIMIT 1) ORDER BY `db_id` ASC LIMIT 1", $last_short); $rs = self::$db->execute($sql); if (!$rs->fields['db_id']) { self::$db->execute(sprintf("UPDATE `db_accountuser` SET `usr_last_short`='0' WHERE `usr_id`='%s' LIMIT 1;", (int) $_SESSION['USER_ID'])); $last_short = 0; } } if ($last_short == 0) { $sql = sprintf("SELECT `db_id`, `file_key` FROM `db_shortfiles` WHERE `privacy`='public' AND `approved`='1' AND `deleted`='0' AND `active`='1' ORDER BY `db_id` ASC LIMIT 1"); } $rs = self::$db->execute($sql); if ($rs->fields['db_id']) { header("Location: " . self::$cfg['main_url'] . '/' . VHref::getKey('shorts') . '/' . $rs->fields['file_key']); exit; } } elseif (self::$type == 'short' and (int) $vid > 0) { self::$db->execute(sprintf("UPDATE `db_accountuser` SET `usr_last_short`='%s' WHERE `usr_id`='%s' LIMIT 1;", (int) $vid, (int) $_SESSION['USER_ID'])); } } $vuser = $vdata->fields['usr_user']; $duser = $vdata->fields['usr_dname']; $cuser = $vdata->fields['ch_title']; $ukey = $vdata->fields['usr_key']; $ujoin = $vdata->fields['usr_joindate']; $umail = $vdata->fields['usr_email']; $viewnr = $vdata->fields['file_views']; $vdate = $vdata->fields['upload_date']; $vtitle = $vdata->fields['file_title']; $vdescr = $vdata->fields['file_description']; $vtags = $vdata->fields['file_tags']; $vinc = (int) $_SESSION['USER_PINC']; self::$rel = VGenerate::prepare($vtitle); self::$userinfo['user_id'] = $vuid; self::$userinfo['user_inc'] = $vinc; self::$userinfo['user_name'] = $vuser; self::$userinfo['ch_title'] = $cuser; self::$userinfo['user_dname'] = ($duser != '' ? $duser : ($cuser != '' ? $cuser : $vuser)); self::$userinfo['user_joindate'] = $ujoin; self::$userinfo['usr_affiliate'] = $vdata->fields['usr_affiliate']; self::$userinfo['usr_partner'] = $vdata->fields['usr_partner']; self::$userinfo['affiliate_badge'] = $vdata->fields['affiliate_badge']; $db_id = $vdata->fields['db_id']; $thumb_server = $vdata->fields['thumb_server']; $thumb_cache = $vdata->fields['thumb_cache']; $thumb_cache = $thumb_cache > 1 ? $thumb_cache : null; $vcateg = $vdata->fields['ct_name']; $vcateg_id = $vdata->fields['ct_id']; $vcateg_slug = $vdata->fields['ct_slug']; $ct_lang = unserialize($vdata->fields['ct_lang']); $vcateg = $_SESSION['fe_lang'] != 'en_US' ? ($ct_lang[$_SESSION['fe_lang']] != '' ? $ct_lang[$_SESSION['fe_lang']] : $vdata->fields['ct_name']) : $vdata->fields['ct_name']; $vcategid = $vdata->fields['ct_id']; $vpriv = $vdata->fields['privacy']; $vappr = $vdata->fields['approved']; $vdel = $vdata->fields['deleted']; $vactive = $vdata->fields['active']; $vlike = $vdata->fields['file_like']; $vdislike = $vdata->fields['file_dislike']; $vcomm = $vdata->fields['comments']; $vchat = $vdata->fields['stream_chat']; $vsrc = $vdata->fields['file_type']; $followcount = $vdata->fields['usr_followcount']; $subcount = $vdata->fields['usr_subcount']; $old_key = $vdata->fields['old_file_key']; $has_pv = $vdata->fields['has_preview']; $stream_live = $vdata->fields['stream_live']; $stream_ended = $vdata->fields['stream_ended']; $stream_key = $vdata->fields['stream_key']; $embed_src = $vdata->fields['embed_src'] != '' ? $vdata->fields['embed_src'] : 'local'; $embed_key = (self::$type[0] == 'v' or self::$type[0] == 's') ? $vdata->fields['embed_key'] : null; $embed_url = (self::$type[0] == 'v' or self::$type[0] == 's') ? $vdata->fields['embed_url'] : null; $vrate = self::$cfg['file_rating'] == 1 ? $vdata->fields['rating'] : 0; $vrespond = self::$cfg['file_responses'] == 1 ? $vdata->fields['responding'] : 0; $session_id = (int) $_SESSION['USER_ID']; $session_name = $_SESSION['USER_NAME']; $vembed = self::$cfg['file_embedding'] == 1 ? $vdata->fields['embedding'] : 0; $vsocial = self::$cfg['file_social_sharing'] == 1 ? $vdata->fields['social'] : 0; self::$userinfo['upload_category'] = $vcateg; self::$userinfo['upload_category_id'] = $vcategid; self::$userinfo['user_subtotal'] = $subcount; self::$userinfo['user_followtotal'] = $followcount; /* default error message */ $verr = null; $err1 = self::errorMessage(self::$type, self::$language['notif.error.available.file']); /* running checks */ if ($vdel == 1) { //deleted $verr = self::errorMessage(self::$type, self::$language['notif.error.deleted.file']); } elseif ($vactive == 0) { //suspeded/inactive $verr = $err1; } elseif ($vappr == 0) { //pending approval if ($session_id > 0 and $session_id == $vuid) { $verr = ''; $vmsg = self::errorMessage(self::$type, self::$language['notif.message.pending']); } else { $verr = $err1; } } /* responses */ if (self::$cfg['file_responses'] == 1 and $verr == '') { $sql = sprintf("SELECT * FROM `db_%sresponses` WHERE `file_key`='%s' AND `active`='1';", self::$type, self::$file_key); $vq = self::$db_cache ? self::$db->CacheExecute(self::$cfg['cache_view_responses'], $sql) : self::$db->execute($sql); $vresponses = $vq->getrows(); } /* favorites */ if (self::$cfg['file_favorites'] == 1 and $verr == '') { $sql = sprintf("SELECT `db_id` FROM `db_%sfavorites` WHERE `file_key`='%s' AND `usr_id`='%s' LIMIT 1;", self::$type, self::$file_key, (int) $_SESSION['USER_ID']); $vf = self::$db_cache ? self::$db->CacheExecute(self::$cfg['cache_view_responses'], $sql) : self::$db->execute($sql); $isfavorite = $vf->fields['db_id'] ? 1 : 0; } /* watchlist */ if (self::$cfg['file_watchlist'] == 1 and $verr == '') { $sql = sprintf("SELECT `db_id` FROM `db_%swatchlist` WHERE `file_key`='%s' AND `usr_id`='%s' LIMIT 1;", self::$type, self::$file_key, (int) $_SESSION['USER_ID']); $vf = self::$db_cache ? self::$db->CacheExecute(self::$cfg['cache_view_responses'], $sql) : self::$db->execute($sql); $iswatchlist = $vf->fields['db_id'] ? 1 : 0; } /* member status */ $is_sub = 0; if ($session_id > 0 and $verr == '') { $view_perm_cache = self::$db_cache ? self::$cfg['cache_view_check_perm'] : false; $verr = $verr == '' ? VUseraccount::checkPerm('view', self::$type[0], $view_perm_cache) : $verr; //check view permissions $view_fr_cache = self::$db_cache ? self::$cfg['cache_view_friend_status'] : false; $f_is = VContacts::getFriendStatus($vuid, $view_fr_cache); //am I friend $view_bl_cache = self::$db_cache ? self::$cfg['cache_view_block_status'] : false; $bl_stat = VContacts::getBlockStatus($vuid, $session_name, $view_bl_cache); //am I blocked $view_blc_cache = self::$db_cache ? self::$cfg['cache_view_block_cfg'] : false; $bl_opt = VContacts::getBlockCfg('bl_files', $vuid, $session_name, $view_blc_cache); //is file access blocked $bl_sub = VContacts::getBlockCfg('bl_subscribe', $vuid, $session_name, $view_blc_cache); //is subscribing blocked } /* if viewing playlists, run privacy all the checks */ if (isset($_GET['p']) and $verr == '') { $pl_id = self::$filter->clr_str($_GET['p']); $pli = self::$db->execute(sprintf("SELECT `usr_id`, `pl_privacy` FROM `db_%splaylists` WHERE `pl_key`='%s' LIMIT 1;", self::$type, $pl_id)); $ppriv = $pli->fields['pl_privacy']; $ppuid = $pli->fields['usr_id']; switch ($ppriv) { case "private": case "personal": case "public": $err1 = self::errorMessage('playlist', self::$language['notif.error.available.file']); if ($verr == '' and $vmsg == '') { if ($session_id > 0 and $bl_stat == 1 and $bl_opt == 1) { //check if blocked but access to viewing is allowed $verr = self::$language['notif.error.blocked.request']; $vmsg = ''; } elseif ($session_id > 0 and $session_id == $ppuid and $ppriv != 'public') { //check if own file $verr = ''; $vmsg = self::errorMessage(self::$language['frontend.global.p'], self::$language["notif.message." . $ppriv]); } else { if ($ppriv == 'private' and $session_id > 0) { //check permissions for viewing private files/playlists if ($f_is == 1 and ($bl_stat == 0 or ($bl_stat == 1 and $bl_opt == 0))) { $err1 = null; $vmsg = self::errorMessage(self::$type, self::$language["notif.message." . $vpriv]); } } $verr = $ppriv != 'public' ? $err1 : null; } } break; } } /* if viewing a regular file, same checks are needed */ if ($verr == '') { switch ($vpriv) { case "private": case "personal": case "public": if ($verr == '' and $vmsg == '') { if ($session_id > 0 and $bl_stat == 1 and $bl_opt == 1) { //check if blocked but access to viewing is allowed $verr = self::$language['notif.error.blocked.request']; $vmsg = ''; } elseif ($session_id > 0 and $session_id == $vuid and $vpriv != 'public') { //check if own file $verr = ''; $vmsg = self::errorMessage(self::$type, self::$language["notif.message." . $vpriv]); } else { if ($vpriv == 'private' and $session_id > 0) { //check permissions for viewing private files if ($f_is == 1 and ($bl_stat == 0 or ($bl_stat == 1 and $bl_opt == 0))) { $err1 = null; $vmsg = self::errorMessage(self::$type, self::$language["notif.message." . $vpriv]); } } $verr = $vpriv != 'public' ? $err1 : null; } } break; } } /* error out */ if ($verr != '') { global $smarty; $smarty->assign("blocked", ($bl_stat == 1 and $bl_opt == 1)); echo ''; return false; } /* shorts next/prev */ if (self::$is_shorts) { $sn = self::$db->execute(sprintf("SELECT `file_key` FROM `db_%sfiles` WHERE `db_id` > %s AND `privacy`='public' AND `approved`='1' AND `deleted`='0' AND `active`='1' ORDER BY `db_id` ASC LIMIT 1;", self::$type, $db_id)); $sp = self::$db->execute(sprintf("SELECT `file_key` FROM `db_%sfiles` WHERE `db_id` < %s AND `privacy`='public' AND `approved`='1' AND `deleted`='0' AND `active`='1' ORDER BY `db_id` DESC LIMIT 1;", self::$type, $db_id)); $short_next = $sn->fields['file_key']; $short_prev = $sp->fields['file_key']; } /* get file votes */ $like_active = null; $dislike_active = null; $vsql = sprintf("SELECT `file_votes` FROM `db_%srating` WHERE `file_key`='%s' LIMIT 1;", self::$type, self::$file_key); $vinfo = self::$db->execute($vsql); $votes = unserialize($vinfo->fields['file_votes']); if (isset($votes[0])) { foreach ($votes as $k => $vote) { if ($vote['usr_id'] == $_SESSION['USER_ID']) { if ($vote['usr_vote'] == 1) { $like_active = ' active'; } if ($vote['usr_vote'] == 0) { $dislike_active = ' active'; } break; } } } /* now we can update views and history */ if (!isset($_GET['do'])) { if ($session_id > 0 or ($session_id == 0 and self::$cfg["guest_view_" . self::$type] == 1)) { $update_views = ($session_id == 0 or ($session_id > 0 and $session_id != $vuid)) ? self::updateViewLogs('files') : null; $update_history = self::updateHistory(); $update_pl_views = isset($_GET['p']) ? self::updatePlaylistViews($pl_id, self::$type) : null; } } /* user subscription status */ if (self::$cfg['user_subscriptions'] == 1) { $sql = sprintf("SELECT `db_id` FROM `db_subscribers` WHERE `usr_id`='%s' AND `sub_id`='%s' LIMIT 1;", (int) $vuid, $session_id); $rs = self::$db_cache ? self::$db->CacheExecute(self::$cfg['cache_view_sub_id'], $sql) : self::$db->execute($sql); if ($rs->fields['db_id']) { $is_sub = 1; } if ($is_sub == 0) { $ts = self::$db->execute(sprintf("SELECT `db_id` FROM `db_subtemps` WHERE `usr_id`='%s' AND `usr_id_to`='%s' AND `pk_id`>'0' AND `expire_time`>='%s' AND `active`='1' LIMIT 1;", (int) $_SESSION['USER_ID'], (int) $vuid, date("Y-m-d H:i:s"))); if ($ts->fields['db_id']) { $is_sub = 1; } } self::$userinfo['user_issub'] = $is_sub; } /* user follows status */ if (self::$cfg['user_follows'] == 1) { $is_sub = 0; $sql = sprintf("SELECT `db_id` FROM `db_followers` WHERE `usr_id`='%s' AND `sub_id`='%s' LIMIT 1;", (int) $vuid, $session_id); $rs = self::$db_cache ? self::$db->CacheExecute(self::$cfg['cache_view_sub_id'], $sql) : self::$db->execute($sql); if ($rs->fields['db_id']) { $is_sub = 1; } self::$userinfo['user_isfollow'] = $is_sub; } /* like/dislike percentage bar */ $vlike_txt = $vrate == 1 ? self::likeStatBars($vrate, $vlike, $vdislike) : null; $thumbs = new VBrowse(self::$type); $embed_html = null; $email_html = null; $perma_html = null; $down_html = null; $flag_html = null; $visitor_html = '