// Start The Session session_start(); // Set Time Limit To Unlimited set_time_limit (0); // Include Necessary Files require_once ('../includes/libs/Smarty.class.php'); require_once ('../includes/class.rapidshare.php'); require_once ('../includes/recaptchalib.php'); require_once ('../includes/class.sql.php'); require_once ('../includes/config.php'); // Instantiate Object $rapidsharelinkgen = new rapidsharelinkgen (); // Open Database Connection $db = new db ($dbhost, $dbname, $dbuser, $dbpassword); // Get All Constants $rapidshares_status = $db->get_var ("SELECT rapidshares_status FROM `globalsetting_details` WHERE id = 1"); $rapidshare_size = $db->get_var ("SELECT rapidshare_size FROM `globalsetting_details` WHERE id = 1"); $rapidshare_counter = $db->get_var ("SELECT rapidshare_counter FROM `globalsetting_details` WHERE id = 1"); $allowed_bandwidth = $db->get_var ("SELECT allowed_bandwidth FROM `globalsetting_details` WHERE id = 1"); $allowed_resume = $db->get_var ("SELECT allowed_resume FROM `globalsetting_details` WHERE id = 1"); $current_sessions = $rapidsharelinkgen->get_sessions (); $allowed_sessions = $db->get_var ("SELECT allowed_sessions FROM `globalsetting_details` WHERE id = 1"); $prem_acc = $db->get_var ("SELECT count(*) FROM `premiumacc_details`"); $total_files = ($db->get_var ("SELECT count(*) FROM `downloadcounter_details`")) ? $db->get_var ("SELECT count(*) FROM `downloadcounter_details`") : 0; if ($rapidshares_status == 1) { $rs_status = 'Active'; } else { $rs_status = 'Unavailable'; } if ($allowed_resume == 1) { $resume = 'Yes'; } else { $resume = 'No'; } // Declare Smarty Class And Its Variables $smarty = new Smarty; $smarty->compile_check = true; $smarty->debugging = false; $smarty->template_dir = '../templates'; $smarty->compile_dir = '../templates_c'; $smarty->assign ('cond', '1'); $smarty->assign ('root_url', $root_url); $smarty->assign ('rapidshares_status', $rs_status); $smarty->assign ('rapidshare_size', $rapidshare_size); $smarty->assign ('rapidshare_counter', $rapidshare_counter); $smarty->assign ('allowed_bandwidth', $allowed_bandwidth); $smarty->assign ('resume', $resume); $smarty->assign ('current_sessions', $current_sessions); $smarty->assign ('allowed_sessions', $allowed_sessions); $smarty->assign ('prem_acc', $prem_acc); $smarty->assign ('total_files', $total_files); $smarty->assign ('current2', 'current'); $smarty->display ('index_top_part.tpl'); // Get The Number Of Sessions Allowed $allowed_sessions = $db->get_var ("SELECT allowed_sessions FROM `globalsetting_details` WHERE id = 1"); // Get The Number Of Sessions Currently Active $number_of_sessions = $rapidsharelinkgen->get_sessions (); // Check If Allowed if ($number_of_sessions >= $allowed_sessions) { $db->conn_close (); $smarty->display ('onlyads.tpl'); echo '

All Download Slots Are Currently In Use ! Please Try After Some Time !

'; echo ''."\n"; $smarty->display ('onlyads2.tpl'); } else { // Get Captcha Status $captcha_setting = $db->get_var ("SELECT captcha_setting FROM `globalsetting_details` WHERE id = 1"); // Close The Connection $db->conn_close (); // Check If Rapidshare Status Is Enabled if ($rapidshares_status == 1) { if (!isset($_POST['submit'])) { /*if (rand (1,20) == 2) { echo ''; }*/ $smarty->display ('form_download.tpl'); if ($captcha_setting == 1) { $smarty->display ('captcha.tpl'); } $smarty->display ('form_download_bottom.tpl'); } else { $smarty->display ('form_submitted.tpl'); if($captcha_setting == 1 and (($_SESSION['security_code'] != $_POST['security_code']) or (empty($_SESSION['security_code'])))) { echo '

Security Code Entered Is Wrong !

'; $smarty->display ('onlyads2.tpl'); } else { // Get The Rapidshare Fake Url $rapidshare_fake_url = addslashes (trim ($_POST['rapidshare_fake_url'])); // Check If Url Format Is Correct if (!preg_match ('/^http:\/\/rapidshare.com\/files\/[0-9]+\/(.*)/', $rapidshare_fake_url)) { echo '

Not A Valid Rapidshare Url !

'; $smarty->display ('onlyads2.tpl'); } else { // Get Real Rapidshare Url $rapidshare_real_url = $rapidsharelinkgen->get_real_rapidshare_url ($rapidshare_fake_url); // Check If Real Url Exists if ($rapidshare_real_url == 'Error') { echo '

This Rapidshare File Does Exists Or The File Has Been Deleted !

'; $smarty->display ('onlyads2.tpl'); } else { // Get The File Size If Allowed $file_size = $rapidsharelinkgen->get_file_size ($rapidshare_real_url); // Check If Filesize Is Allowed if ($file_size == 'Error') { echo '

This File Is Greater Than Allowed Filesize !

'; $smarty->display ('onlyads2.tpl'); } else { // Get The Download Limit $check_download_limit = $rapidsharelinkgen->check_download_limit (); // Check If Download Limit Is Reached if ($check_download_limit == 'Error') { echo '

You Have Reached The Download Limit ! Please Try Again Later !

'; $smarty->display ('onlyads2.tpl'); } else { // Open Database Connection $db = new db ($dbhost, $dbname, $dbuser, $dbpassword); // Check For Banned IP $row = $db->ge