| 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/theavaaddams.com/public_html/free2/fnc/ |
Upload File : |
<?php
function cdn_code($vid_link, $asset_id, $vars, $flash, $bg_dir) // will sometimes be a dir and file, other times just a filename
{ if($vars =='')
{ $path = "/sites/".$bg_dir."/trailers/".$vid_link; }
else { $path = "/sites/".$bg_dir."/trailers/".$vars; }
$secret = 'crambroulet'; // Expiration in seconds (e.g. 90 seconds)
$expire = time() + 900000; // Generate token
$md5 = md5($path.$secret.$expire, true);
$md5 = base64_encode($md5);
$md5 = strtr($md5, '+/', '-_');
$md5 = str_replace('=', '', $md5); // Use this URL
return $bg_code = "http://003abb-dfd.kxcdn.com{$path}?token={$md5}&expire={$expire}";
}
function edgecast_code($vid_link, $asset_id, $vars, $flash, $bg_dir) // will sometimes be a dir and file, other times just a filename
{
if($vars ==''){$vars = $vid_link;}
$expiry_time = time() + 40;
$key = "zhFrFuPpdU72KEx";
$params = "ec_expire=$expiry_time";
// Generate the token
// Check to see if the extension properly loaded before using it.
if (extension_loaded('ectoken')){
$token = ectoken_generate($key, $params);
} else {
trigger_error('The EdgeCast Token module could not be loaded.', E_USER_ERROR);
}
$url = "http://wpc.3ABB.systemcdn.net/003ABB/sites/".$bg_dir."/trailers/".$vars."";
return $url."?".$token;
}
function bitgrav_code($vid_link, $asset_id, $vars, $flash, $bg_dir) // will sometimes be a dir and file, other times just a filename
{
if($vars ==''){$vars = $vid_link;}
// here is the list of country codes: http://www.maxmind.com/app/iso3166
$expiry_time = time() + 30; // 3600 is in seconds. Adjust as desired.
$disallowed_countries = ""; //PL = poland, DE = Germany, FI = Finland, IT = italy, CZ = Czech Republic
$fart = "http://alt-b.bitg.net/branddanger/".$bg_dir."/members/trailers/".$vars."?e=".$expiry_time.
"&d=".$disallowed_countries.
"&h=".MD5("zhFrFuPpdU72KEx/branddanger/".$bg_dir."/members/trailers/".$vars."?e=".$expiry_time."&d=".$disallowed_countries).
"";
if($flash =='y') {$bg_code = str_replace("&", "%26", $fart);}
else {$bg_code = $fart;}
return $bg_code;
}
function random_image($dir,$w,$h, $url) {
if(file_exists($dir) ) {
$d = dir("$dir");
$i = 0;
while (false !== ($entry = $d->read())) {
if(preg_match("/.jpg|.jpeg|.gif|.png/i", $entry)) {
$array[$i] = $entry;
$i++;
}
}
$d->close();
$i = $i -1;
$i = rand(0,$i);
if($array[$i] != "") {
echo "<img src=\"$url$array[$i]\"";
if(isset($w) AND is_numeric($w)) {
echo " width=\"$w\"";
}
if(isset($h) AND is_numeric($h)) {
echo " height=\"$h\"";
}
echo " border=\"0\">";
} else {
echo "Error: Failed to select a random image (does the dir contain any .jpg/.png/gif's?).";
}
} else {
echo "Error: Directory $dir doesn't seem to exist.";
}
}
function random_image_n($tour, $model_id, $niche_id )
{
if($model_id <> '')
{
$query = "select m2a.asset_id , t.free_link
from mod2vid m2a
left join assets a on m2a.asset_id = a.asset_id
join tour t on a.asset_id = t.asset_id
WHERE t.asset_id = a.asset_id and a.hide_photo = 'n' and m2a.model_id = '".$model_id."' ";
$query .= " and a.tour_date <= '".date('Y-m-d')."' and a.hide = 'n' order by rand() limit 1 ";
}
elseif($niche_id <> '')
{
$query = "select n2a.asset_id , t.free_link
from niche2asset n2a
left join assets a on n2a.asset_id = a.asset_id
join tour t on a.asset_id = t.asset_id
WHERE t.asset_id = a.asset_id and a.media ='V' and n2a.niche_id = '".$niche_id."' ";
$query .= " and a.p_date <= '".date('Y-m-d')."' and a.hide_photo = 'n' order by rand() limit 1 ";
}
elseif($tour == 'mt')
{
$query = "select t.asset_id, t.free_link
from tour t , assets a ";
$query .= " where t.asset_id = a.asset_id and a.media ='V' and a.hide_photo = 'n' order by rand() limit 1 ";
}
$rand = mysql_query($query);
$row = mysql_fetch_assoc($rand);
return array($row['asset_id'], $row['free_link']);
}
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
function mkdir_recursive($pathname, $mode)
{
is_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname), $mode);
return is_dir($pathname) || @mkdir($pathname, $mode);
}
function get_niche_puldown($nats, $niche_id)
{
$query = "SELECT distinct(n2a.niche_id), n.niche_name ";
$query .= "FROM niche2asset n2a, niche n , assets a, tour t ";
$query .= "WHERE n2a.niche_id = n.niche_id and t.asset_id = n2a.asset_id
and n2a.asset_id = a.asset_id and t.site_id = '".CURR_SITE_ID."' and a.hide_photo <> 'y' and t.tour_title <> ''
order by n.niche_name ";
$result = mysql_query($query) or die("ERROR: <br>$query<br /> <strong>" . mysql_error()."</strong>");
echo "<option selected=\"selected\" disabled=\"disabled\">--Select Category--</option>";
while($row = mysql_fetch_assoc($result))
{
if($niche_id == $row["niche_id"])
{$checked = "selected=\"selected\"";}
else{$checked = "";}
echo " <option value=\"".TOUR_URL."/niche/".str_replace(' ', '', $row["niche_name"])."/".str_replace(' ', '', $row["niche_name"]).".php?nats=$nats\" $checked >".$row["niche_name"]."</option> ";
}
}
function get_niche($connection, $asset_id)
{
$niche_str = '';
$query = "SELECT n2a.niche_id, n.niche_name ";
$query .= "FROM tour_niche2asset n2a, tour_niche n ";
$query .= " where n2a.niche_id = n.niche_id and n2a.asset_id = '".$asset_id."' ";
$result = mysql_query($query) or die("ERROR: <br>$query<br /> <strong>" . mysql_error()."</strong>");
while($row_niche = mysql_fetch_assoc($result))
{
//echo "<br />".$row_niche["niche_id"]."-".$row_niche["niche_name"]."<br />";
$niche_str .= $row_niche["niche_name"].", ";
}
return $niche_str;
}
function get_models_pulldown($nats, $niche_id)
{
$query = "SELECT distinct(m.model_id), m.name as model_name ";
$query .= "FROM models m, mod2vid m2a, tour t ";
$query .= "WHERE m.model_id = m2a.model_id and t.asset_id = m2a.asset_id
and t.tour_date <= '".date('Y-m-d')."' and t.tour_title <> '' and m.sex <> 'm'
group by m.model_id order by m.name ";
$result = mysql_query($query) or die("ERROR: <br>$query<br /> <strong>" . mysql_error()."</strong>");
echo "<option selected=\"selected\" disabled=\"disabled\">--Select Model--</option>";
while($row = mysql_fetch_assoc($result))
{
if($model_id == $row["model_id"])
{$checked = "selected=\"selected\"";}
else{$checked = "";}
echo " <option value=\"".TOUR_URL."/model/".str_replace(' ', '', $row["model_name"])."/".str_replace(' ', '', $row["model_name"]).".php?nats=$nats\" $checked >".$row["model_name"]."</option> ";
}
}
function models_starring($asset_id)
{
$query = "select m.model_name, m.sex, t2m.asset_id, m.model_id ";
$query .= "from tour_models m ";
$query .= "left join tour_mod2asset t2m on m.model_id = t2m.model_id ";
$query .= "where t2m.asset_id = '".$asset_id."'";
$result = mysql_query($query) or die('Bummer: ' . mysql_error());
$starring_string = '';
$num_rows = mysql_num_rows($result);
$count = '1';
while ($row = mysql_fetch_assoc($result))
{
$starring = "";
if ($count == '1')
{$starring .= "";}
elseif ($count == $num_rows)
{$starring .= " & ";}
else
{$starring .= ", ";}
$starring .= $row["model_name"];
$starring_string .= "".$starring."";
$count ++;
}
return $starring_string;
$count ='';
}
function tour_models_starring($asset_id, $nats)
{
$query = "select m.name, m.sex, t2m.asset_id, m.model_id ";
$query .= "from models m ";
$query .= "left join mod2vid t2m on m.model_id = t2m.model_id ";
$query .= "where t2m.asset_id = '".$asset_id."'";
$result = mysql_query($query) or die('Bummer: ' . mysql_error());
$starring_string = '';
$num_rows = mysql_num_rows($result);
$count = '1';
while ($row = mysql_fetch_assoc($result))
{
$starring = "";
if ($count == '1')
{$starring .= "";}
elseif ($count == $num_rows)
{$starring .= " & ";}
else
{$starring .= ", ";}
$name_nospace = str_replace(' ', '', $row['name']);
$static_page = TOUR_URL."/model/$name_nospace/$name_nospace.php";
$starring .= "<a href=\"$static_page?nats={$nats}\" target=\"_parent\">{$row["name"]}</a>";
$starring_string .= "".$starring."";
$count ++;
}
return $starring_string;
$count ='';
}
function nolink_models_starring($asset_id)
{
$query = "select m.name, m.sex, t2m.asset_id, m.model_id ";
$query .= "from models m ";
$query .= "left join mod2vid t2m on m.model_id = t2m.model_id ";
$query .= "where t2m.asset_id = '".$asset_id."'";
$result = mysql_query($query) or die('Bummer: ' . mysql_error());
$starring_string = '';
$num_rows = mysql_num_rows($result);
$count = '1';
while ($row = mysql_fetch_assoc($result))
{
$starring = "";
if ($count == '1')
{$starring .= "";}
elseif ($count == $num_rows)
{$starring .= " & ";}
else
{$starring .= ", ";}
$starring .= "{$row["name"]}";
$starring_string .= "".$starring."";
$count ++;
}
return $starring_string;
$count ='';
}
function get_mod_names_tour($connection, $asset_id)
{
$query = "SELECT m.model_name, t2m.model_id, t2m.asset_id ";
$query .= "FROM tour_mod2asset t2m, tour_models m ";
$query .= "where t2m.model_id = m.model_id and t2m.asset_id = '".$asset_id."' ";
$res = mysql_query($query) or die('Query failed: ' . mysql_error());
$cnt = '1';
while($line = mysql_fetch_array($res))
{
//$line["model_id"];
if($cnt =='1')
{$tmod1 = $line["model_id"];}
if($cnt =='2')
{$tmod2 = $line["model_id"];}
if($cnt =='3')
{$tmod3 = $line["model_id"];}
if($cnt =='4')
{$tmod4 = $line["model_id"];}
//print_r($line);
$cnt++;
}
?>
<input name="torig_model1" type="hidden" value="<?php if(isset($tmod1)){echo $tmod1;} ?>" />
<input name="torig_model2" type="hidden" value="<?php if(isset($tmod2)){echo $tmod2;} ?>" />
<input name="torig_model3" type="hidden" value="<?php if(isset($tmod3)){echo $tmod3;} ?>" />
<input name="torig_model4" type="hidden" value="<?php if(isset($tmod4)){echo $tmod4;} ?>" />
<?php
/* ------------------------------------------------------------------------------------------------------ */
$query2 = "SELECT model_name, model_id from tour_models order by model_name";
$res2 = mysql_query($query2) or die('Query failed: ' . mysql_error());
$dataset = array(); // Will hold all our data returned from DB
$i = 0; // Just a counter
while($row = mysql_fetch_assoc($res2))
{
$dataset[$i++] = $row;
$i++;
}
$i=1;
while($i<=4)
{
@ $menu_ctr++;
echo '<select name="modeltour'.$i.'" class="select01">';
echo "<option value=\"0\">None</option>";
foreach($dataset as $row)
{
if($i == '1')
{
if($tmod1 == $row["model_id"])
{$sel = "SELECTED";}
else{$sel = "";}
echo "<option value=".$row["model_id"]." $sel>".$row["model_name"]."</option>";
}
if($i == '2')
{
if($tmod2 == $row["model_id"])
{$sel = "SELECTED";}
else{$sel = "";}
echo "<option value=".$row["model_id"]." $sel>".$row["model_name"]."</option>";
}
if($i == '3')
{
if($tmod3 == $row["model_id"])
{$sel = "SELECTED";}
else{$sel = "";}
echo "<option value=".$row["model_id"]." $sel>".$row["model_name"]."</option>";
}
if($i == '4')
{
if($tmod4 == $row["model_id"])
{$sel = "SELECTED";}
else{$sel = "";}
echo "<option value=".$row["model_id"]." $sel>".$row["model_name"]."</option>";
}
}
$i++;
echo "</select>\n";
if($i==3){echo "<br />";}
}
mysql_free_result($res2);
}
function recursive_remove_directory($directory, $empty=FALSE)
{
// if the path has a slash at the end we remove it here
if(substr($directory,-1) == '/')
{
$directory = substr($directory,0,-1);
}
// if the path is not valid or is not a directory ...
if(!file_exists($directory) || !is_dir($directory))
{
// ... we return false and exit the function
return FALSE;
// ... if the path is not readable
}elseif(!is_readable($directory))
{
// ... we return false and exit the function
return FALSE;
// ... else if the path is readable
}else{
// we open the directory
$handle = opendir($directory);
// and scan through the items inside
while (FALSE !== ($item = readdir($handle)))
{
// if the filepointer is not the current directory
// or the parent directory
if($item != '.' && $item != '..')
{
// we build the new path to delete
$path = $directory.'/'.$item;
// if the new path is a directory
if(is_dir($path))
{
// we call this function with the new path
recursive_remove_directory($path);
// if the new path is a file
}else{
// we remove the file
unlink($path);
}
}
}
// close the directory
closedir($handle);
// if the option to empty is not set to true
if($empty == FALSE)
{
// try to delete the now empty directory
if(!rmdir($directory))
{
// return false if not possible
return FALSE;
}
}
// return success
return TRUE;
}
}
?>