| Server IP : 208.122.213.31 / Your IP : 216.73.216.183 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 : |
<?php
function showtemplate($tplfile) {
global $conn, $config, $set, $basedir, $basepath, $extras, $ext_variables, $ext_tplfile;
$tplarray=file("templates/".$tplfile);
$template=join("", $tplarray);
$xml=0;
$all_categories=0;
if (ereg("\.xml$", $tplfile)):
$xml=1;
endif;
if (ereg("#VIDEO_LOOP([0-9]*)#(.+)#END_VIDEO_LOOP#", $template, $videoregs)):
$template = ereg_replace("#VIDEO_LOOP([0-9]*)#(.+)#END_VIDEO_LOOP#", "#REPEATVIDEOBLOCK#", $template);
$config["vids_perpage"]=$videoregs[1];
if (ereg("#CATEGORY_ALL#", $videoregs[2])):
$all_categories=1;
endif;
if ($xml==1):
$videoblock=showVideosXML($videoregs[2], $config["vids_perpage"]);
else:
$videoblock=showVideos($videoregs[2], $config["vids_perpage"]);
endif;
$template = preg_replace("/#REPEATVIDEOBLOCK#/", $videoblock, $template);
endif;
if (ereg("^[0-9]+\-", $_GET["get1"])):
if (ereg("^[0-9]+\-thumbs", $_GET["get1"])):
$tplarray=file($basepath."/templates/thumbs.html");
else:
$tplarray=file($basepath."/templates/video.html");
endif;
$template=join("", $tplarray);
$template = showVideos($template, 1);
endif;
if ((isset($_GET["get1"])) AND (!ereg("^[0-9]+", $_GET["get1"]))):
$template = showCatDetails($template);
endif;
$template = showSiteDetails($template);
$variables=array();
$variables["#VIDEOCOUNT#"]="countVideos();";
$variables["#CATEGORIES[_]{0,1}([^#]*)#"]="showCats(0,0,\$matched[1]);";
$variables["#CATLINKS[_]{0,1}([^#]*)#"]="showCats(1,0,\$matched[1]);";
$variables["#PAGES#"]="showPages(".$all_categories.");";
$variables["#SITEROOT#"]="\$basedir.\"/\";";
$variables["#TEMPLATE#"]="\$basedir.\"/templates/\";";
$variables["#TPLPATH#"]="\$basepath.\"/templates/\";";
$variables["#DATERFC#"]="date(\"r\");";
if (count($extras)>0):
foreach ($extras AS $value) {
if ((isset($ext_variables["main"][$value])) AND (is_array($ext_variables["main"][$value]))):
foreach ($ext_variables["main"][$value] AS $key => $extvar) {
$variables[$key]=$extvar;
}
endif;
}
endif;
foreach($variables as $variable => $replacement) {
while (preg_match("/".$variable."/",$template, $matched)):
$replace=eval("return ".$replacement);
$template = preg_replace("/".$variable."/", $replace, $template, 1);
endwhile;
}
if (ereg("\.xml$", $tplfile)):
return $template;
else:
return eval("?".">" . $template . "<"."?php ");
endif;
}
function getExtras(){
global $config, $basedir, $basepath;
$extras=array();
if (is_dir($config["ext_path"])):
$extdir = opendir($config["ext_path"]);
while (false !== ($files = readdir($extdir))) {
if ((is_file(rtrim($config["ext_path"], "/")."/".$files)) AND (ereg("functions\.([^\.]+)\.php", $files, $regs))):
$extras[] = $regs[1];
endif;
}
closedir($extdir);
sort ($extras);
reset($extras);
endif;
return $extras;
}
function showSiteDetails($template)
{
global $config, $conn, $basedir;
$output="";
$variables=array();
$select=LDB_Exec($conn,"SELECT sites.* FROM sites WHERE sites.id='".$config["site_id"]."' LIMIT 1");
if ((LDB_NumRows($select))>0):
$result=LDB_Fetch_Array($select,0);
$variables["#KEYWORDS#"]=$result["keywords"];
$variables["#DESCRIPTION#"]=$result["description"];
$variables["#TITLE#"]=$result["name"];
endif;
foreach($variables as $variable => $replacement) {
$template = preg_replace("/".$variable."/", $replacement, $template);
}
$output=$template;
if ($output!=""):
if ($config["charset"]!="utf-8"):
return @iconv("utf-8", $config["charset"], $output);
else:
return $output;
endif;
else:
return false;
endif;
}
function showCatDetails($template)
{
global $config, $conn, $basedir;
$output="";
$variables=array();
$select=LDB_Exec($conn,"SELECT category.* FROM category WHERE category.catlink='".$_GET["get1"]."' LIMIT 1");
if ((LDB_NumRows($select))>0):
$result=LDB_Fetch_Array($select,0);
if ($result["category"]!=""):
$variables["#TITLE#"]=$result["category"];
endif;
if ($result["keywords"]!=""):
$variables["#KEYWORDS#"]=$result["keywords"];
endif;
if ($result["description"]!=""):
$variables["#DESCRIPTION#"]=$result["description"];
endif;
endif;
foreach($variables as $variable => $replacement) {
$template = preg_replace("/".$variable."/", $replacement, $template);
}
$output=$template;
if ($output!=""):
if ($config["charset"]!="utf-8"):
return @iconv("utf-8", $config["charset"], $output);
else:
return $output;
endif;
else:
return false;
endif;
}
function showCats($links=0, $video_id=0, $separator=", ")
{
global $config, $conn, $basedir;
$output=array();
$where[]="sites.id='".$config["site_id"]."'";
if ($video_id!=0):
$where[]="video2cat.video_id='".$video_id."'";
endif;
$wherestr=" WHERE ".implode(" AND ", $where);
$select_cat=LDB_Exec($conn,"SELECT category.* FROM category INNER JOIN video2cat ON video2cat.cat_id=category.id INNER JOIN site2cat ON category.id = site2cat.cat_id INNER JOIN sites ON site2cat.site_id = sites.id".$wherestr." GROUP BY category.id ORDER BY category.category");
if ((LDB_NumRows($select_cat))>0):
for ($u=0; $u<LDB_NumRows($select_cat); $u++) {
$result_cat=LDB_Fetch_Array($select_cat,$u);
$current="";
if ($_GET["get1"]==$result_cat["catlink"]) $current=" class=\"current\"";
if ($links!=0):
$output[]="<a href=\"".$basedir."/".$result_cat["catlink"]."/\"".$current.">".$result_cat["category"]."</a>\n";
else:
$output[]=$result["name"];
endif;
}
endif;
if ($separator=="") $separator=", ";
if (count($output)>0):
if ($config["charset"]!="utf-8"):
return @iconv("utf-8", $config["charset"], implode($separator, $output));
else:
return implode($separator, $output);
endif;
else:
return false;
endif;
}
function showVideos($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;
if (ereg("#ORDER_([A-Z]{1})#", $templateblock, $regs)):
$config["vids_order"]=$regs[1];
elseif ((isset($_COOKIE["order"])) AND ($_COOKIE["order"]!="")):
$config["vids_order"]=$_COOKIE["order"];
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";
}
$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\";";
if (!ereg("#CATEGORY_ALL#", $templateblock)):
$ext_tplfile["ereg"]["category"]="^[^0-9]+\-?";
$ext_tplfile["eval"]["category"]="\$where[]=\"category.catlink='\".\$_GET[\"get1\"].\"'\";";
endif;
foreach($ext_tplfile["ereg"] as $key => $value) {
if (!isset($_GET["get1"])) $_GET["get1"]="";
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;
}
$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("&","&",$result["title"]);
$variables["#VIDEOKEYWORDS#"]=str_replace("&","&",$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})#"]="";
$variables["#CATEGORY_ALL#"]="";
$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) {
$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 showPages($all_cats=0)
{
global $conn, $config, $set, $basedir, $basepath;
$perpage=$config["vids_perpage"];
$links=$config["pages"];
$output="";
$where=array();
$wherestr="";
$join="";
$groupstr=" GROUP BY video.id";
$where[]="site2cat.site_id='".$config["site_id"]."'";
if ($all_cats==0):
$ext_tplfile["ereg"]["category"]="^[^0-9]+\-?";
$ext_tplfile["eval"]["category"]="\$where[]=\"category.catlink='\".\$_GET[\"get1\"].\"'\";";
endif;
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]);
break;
endif;
}
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);
$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";
$select=LDB_Exec($conn,"SELECT video.* FROM video ".$join.$wherestr.$groupstr);
$link=$basedir."/";
if ((isset($_GET["get1"])) AND ($_GET["get1"]!="") AND (!ereg("^[0-9]+$", $_GET["get1"])) AND (!ereg("^[0-9]+\-", $_GET["get1"]))):
$link.=$_GET["get1"]."/";
endif;
if ((isset($_GET["get2"])) AND ($_GET["get2"]!="") AND (!ereg("^[0-9]+$", $_GET["get2"]))):
$link.=$_GET["get2"]."/";
endif;
if (LDB_NumRows($select)>0):
if ($perpage=="") $perpage=LDB_NumRows($select);
$pages=(ceil(LDB_NumRows($select)/$perpage))-1;
if ($pages>0):
if (($set>0) AND (isset($config["var_first"])) AND ($config["var_first"]!="")) $output.= "<li><a href=\"".$link."\" target=\"_self\">".$config["var_first"]."</a></li>\n";
$slinks=$links-1;
if ($set<=$slinks/2):
$start=0;
$end=$slinks;
if ($end>$pages):
$end=$pages;
endif;
elseif ($set>($pages-$slinks/2)):
$start=$pages-$slinks;
if ($start<0) $start=0;
$end=$pages;
else:
$start=$set-(floor($slinks/2));
if ($start<0) $start=0;
$end=$set+(ceil($slinks/2));
if ($end>$pages):
$end=$pages;
endif;
endif;
if (($set==1) AND (isset($config["var_prev"])) AND ($config["var_prev"]!="")):
$output.= "<li><a href=\"".$link."\" target=\"_self\">".$config["var_prev"]."</a></li>\n";
elseif (($set>1) AND (isset($config["var_prev"])) AND ($config["var_prev"]!="")):
$output.= "<li><a href=\"".$link.($set-1)."/\" target=\"_self\">".$config["var_prev"]."</a></li>\n";
endif;
for ($j=$start; $j<=$end; $j++) {
$current="";
if ($j==$set) $current=" class=\"current\"";
if ($j==0):
$output.= "<li><a href=\"".$link."\"".$current." target=\"_self\">".($j+1)."</a></li>\n";
else:
$output.= "<li><a href=\"".$link.$j."/\"".$current." target=\"_self\">".($j+1)."</a></li>\n";
endif;
}
if (($set<$pages) AND (isset($config["var_next"])) AND ($config["var_next"]!="")):
$output.= "<li><a href=\"".$link.($set+1)."/\" target=\"_self\">".$config["var_next"]."</a></li>\n";
endif;
if (($set<$pages) AND (isset($config["var_next"])) AND ($config["var_next"]!="")):
$output.= "<li><a href=\"".$link.$pages."/\" target=\"_self\">".$config["var_last"]."</a></li>\n";
endif;
endif;
endif;
if ($output!=""):
if ($config["charset"]!="utf-8"):
return @iconv("utf-8", $config["charset"], $output);
else:
return $output;
endif;
else:
return "<li><a href=\"".$link."\" class=\"current\" target=\"_self\">1</a></li>\n";
endif;
}
function mainPage()
{
if ((!isset($_GET["get1"])) OR ($_GET["get1"]=="")):
return true;
else:
return false;
endif;
}
function countVideos()
{
global $conn, $config;
$output="";
$select=LDB_Exec($conn,"SELECT video.id FROM video INNER JOIN video2cat ON video.id = video2cat.video_id INNER JOIN site2cat ON video2cat.cat_id = site2cat.cat_id WHERE site2cat.site_id='".$config["site_id"]."' GROUP BY video.id");
$output=LDB_NumRows($select);
if ($output!=""):
if ($config["charset"]!="utf-8"):
return @iconv("utf-8", $config["charset"], $output);
else:
return $output;
endif;
else:
return false;
endif;
}
function mklink($translink,$separator) {
$trans = array("á"=>"a", "ä"=> "a", "č"=>"c", "ď"=>"d", "é"=>"e", "ě"=>"e", "ë"=>"e", "í"=>"i", "ï"=>"i", "ň"=>"n", "ó"=>"o", "ö"=>"o", "ř"=>"r", "š"=>"s", "ť"=>"t", "ú"=>"u", "ů"=>"u", "ü"=>"u", "ý"=>"y", "ÿ"=>"y", "ž"=>"z", "ĺ"=>"l", "Á"=>"A", "Ä"=>"A", "Č"=>"C", "Ď"=>"D", "É"=>"E", "Ě"=>"E", "Ë"=>"E", "Í"=>"I", "Ï"=>"I", "Ň"=>"N", "Ó"=>"O", "Ö"=>"O", "Ř"=>"R", "Š"=>"S","Ť"=>"T", "Ú"=>"U", "Ů"=>"U", "Ü"=>"U", "Ý"=>"Y", "Ÿ"=>"Y", "Ž"=>"Z", "Ĺ"=>"L", " "=>"-");
$newlink=strtr(trim($translink), $trans);
$newlink=StrToLower(ereg_replace("[^a-zA-Z0-9\-]",$separator,$newlink));
$newlink=ereg_replace("[".$separator."]{2,}",$separator,$newlink);
$newlink=trim($newlink, $separator);
return $newlink;
}
function bytestostring($size, $precision = 0) {
$sizes = array('YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'kB', 'B');
$total = count($sizes);
while($total-- && $size > 1024) $size /= 1024;
return round($size, $precision).$sizes[$total];
}
function tns($tnsstr)
{
$tns_tmp1=array();
$tn=array();
$tnnr=1;
if ($tnsstr!=""):
$tns_tmp1=explode(";", trim($tnsstr));
foreach ($tns_tmp1 AS $value)
{
$tns_tmp2=array();
$tns_tmp2=explode("x", trim($value));
if ((isset($tns_tmp2[0])) AND (isset($tns_tmp2[1])) AND (isset($tns_tmp2[2]))):
for ($i=0; $i<$tns_tmp2[0]; $i++) {
$tn[$tnnr]["count"]=$tns_tmp2[0];
$tn[$tnnr]["width"]=$tns_tmp2[1];
$tn[$tnnr]["height"]=$tns_tmp2[2];
$tnnr++;
}
endif;
}
endif;
return $tn;
}
?>