ERROR: FILE NOT FOUND!";
include("footer.php");
}
else {
// get file details
$get_file = mysql_query("SELECT dateadded, originalfilename, filename, filesize, password, description, originalext, totalviews, status FROM files WHERE id = ".$file." LIMIT 1");
$dateadded = mysql_result($get_file, 0, dateadded);
$dateadded = substr($dateadded, 8, 2)."/".substr($dateadded, 5, 2)."/".substr($dateadded, 0, 4);
$originalfilename = mysql_result($get_file, 0, originalfilename);
$filename = mysql_result($get_file, 0, filename);
$filesize = mysql_result($get_file, 0, filesize);
$password = mysql_result($get_file, 0, password);
$description = mysql_result($get_file, 0, description);
$extension = mysql_result($get_file, 0, originalext);
$totalviews = mysql_result($get_file, 0, totalviews);
$status = mysql_result($get_file, 0, status);
if(strlen($password) > 0) {
if($_POST['p'] != $password) {
header("Location: http://".$site_url."/enter-password.html?file=".$file."&f=".urlencode($originalfilename));
die();
exit;
}
}
if($status == "removed") {
$ptitle = "Free Image Hosting";
$pkeys = "image hosting, free image host, image host, img host, upload picture";
$pdesc = "Fast & Free Image Hosting";
$selected = "VIEWPIC";
include_once("header.php");
echo '
';
echo "
ERROR:
File Removed
";
echo ' |
';
include("footer.php");
exit;
die();
}
if(($_SESSION[sess_memtype] == "premium") || ($_SESSION[sess_isadmin] == 'yes')) {
// push the download straight out
// check user hasn't downloaded maximum for today
$ip = GetHostByName($REMOTE_ADDR);
if($_SESSION[sess_memtype] == "premium") $max = $pre_max_download_size;
else $max = $noa_max_download_size;
if($max != 0) {
// check for max
$lookupdate = date("Y-M-d");
$check_max = mysql_query("SELECT SUM(filesize) AS total FROM downloads WHERE ip = '".$ip."' datedl LIKE '".$lookupdate."%' AND LIMIT 1");
$total = mysql_result($check_max, 0, total);
if($total > $max) die("Error: Maximum download limit reached, please signup for a premium account or try again later.");
}
// log download
$insert_dl = mysql_query("INSERT INTO downloads (fileid, ip, datedl, filesize) VALUES (".$file.", '".$ip."', NOW(), ".$filesize.")");
// update views/downloads
$newviews = $totalviews+1;
$update_views = mysql_query("UPDATE files SET totalviews = ".$newviews.", lastaccessed = NOW() WHERE id = ".mysql_real_escape_string($file)." LIMIT 1");
$full_path = "http://".$site_url."/storage/".$filename;
$done = file_get_contents($full_path);
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-type: ".$mimetype);
header("Pragma: public");
header("Content-Disposition: attachment; filename=\"".$originalfilename."\"");
header("Content-Description: File Transfer");
echo $done;
exit();
}
else {
$ptitle = "Free Image Hosting";
$pkeys = "image hosting, free image host, image host, img host, upload picture";
$pdesc = "Fast & Free Image Hosting";
$selected = "VIEWPIC";
include_once("header.php");
echo '';
if(strlen($adsense_id) > 0) {
// display ads here to display at the top of the page
?>
".$originalfilename."
";
if(file_exists("images/icons/gifs/".$extension.".gif")) $icon_path = "../images/icons/gifs/".$extension.".gif";
else $icon_path = "../images/icons/gifs/txt.gif";
if(($_SESSION[sess_memtype] != "premium") && ($noa_dl_delay_link > 0)) {
// display js count down
?>
|
| DOWNLOAD FILE |
';
}
echo "
Date Added: ".$dateadded." | Filesize: ".display_size($filesize)." | Downloads: ".$newviews;
if(strlen($description) > 0) echo "
Comments: ".$description;
echo "
";
if(strlen($adsense_id) > 0) {
// display ads here to display at the bottom of the page
?>
';
include("footer.php");
}
}
?>