// 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 '