header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); header("Content-Type: {$ctype}"); header("Content-Disposition: attachment; filename=\"" . $filename . "\";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . @filesize($file)); if (function_exists('set_time_limit')) { set_time_limit(0); } //@readfile($file) or die("File not found."); ob_end_clean(); @readfileChunked($file); // or die("File not found."); } } else { $tmpFilename = create_unique2() . ".jpg"; $tmpFilenamePath = BASE_PATH . "/assets/tmp/{$tmpFilename}"; // Check availability if ($download['externalLink']) { if ($filecheck['status']) { if (downloadcURL($download['externalLink'], $tempPath . $tempFileName)) { // Worked $imgPath = $tempPath . $tempFileName; } else { die('File download failed!'); } } else { die("File cannot be found at link provided."); } } else { // Do resizing and downloading
if ($_COOKIE['cart']['uniqueOrderID']) { $_SESSION['uniqueOrderID'] = $_COOKIE['cart']['uniqueOrderID']; } else { $newUniqueOrderID = create_unique2(); $_SESSION['uniqueOrderID'] = $newUniqueOrderID; // Set Cookie if ($config['useCookies']) { setcookie("cart[uniqueOrderID]", $newUniqueOrderID, time() + 60 * 60 * 24 * 30, "/", $host[0]); } // Set a cart id cookie } } // Check if this unique order id is already in the db with a status other than incomplete $orderCheckResult = mysqli_query($db, "SELECT SQL_CALC_FOUND_ROWS uorder_id FROM {$dbinfo[pre]}orders WHERE uorder_id = '{$_SESSION[uniqueOrderID]}' AND order_status != '2'"); if (getRows()) { $_SESSION['uniqueOrderID'] = create_unique2(); } // The unique order id is already in the db - create a new one if (!$_SESSION['uniqueOrderID']) { // Make sure an order ID was created and if not die die("No order ID was ever created"); } if (!$miniCart) { unset($_SESSION['currentMode']); } // Unset the gallery mode //print_k($_SESSION['cartTotalsSession']); exit; // Testing try { if ($config['EncryptIDs']) { $id = k_decrypt($id); if ($mediaID) {
if ($signupGroups) { foreach ($signupGroups as $key => $value) { mysqli_query($db, "INSERT INTO {$dbinfo[pre]}groupids (mgrarea,item_id,group_id) VALUES ('members','{$saveID}','{$value}')"); } } //$_SESSION['testing']['step3'] = '3'; try { $memberObj = new memberTools($saveID); $member = $memberObj->getMemberInfoFromDB($umem_id); // Get all the member info from the database $member['primaryAddress'] = $memberObj->getPrimaryAddress(); if ($paidMembership) { // Do paid membership stuff // $saveID // $membershipDB $ubill_id = create_unique2(); $invoice_number = $config['settings']['invoice_prefix'] . $config['settings']['invoice_next'] . $config['settings']['invoice_suffix']; // Get new invoice number $cur_inv = $config['settings']['invoice_next']; $next_inv = $cur_inv + 1; $billDate = $nowGMT; $dueDate = $nowGMT; $invoiceTotal = $membershipDB['price']; $membershipPeriodName = $lang[$membershipDB['period']]; $invoiceMembershipName = "{$lang[membership]}: {$membershipDB[name]} ({$membershipPeriodName})"; // Create bill record mysqli_query($db, "\r\n\t\t\t\t\t\t\t\tINSERT INTO {$dbinfo[pre]}billings \r\n\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\tubill_id,\r\n\t\t\t\t\t\t\t\t\tmember_id,\r\n\t\t\t\t\t\t\t\t\tbill_type,\r\n\t\t\t\t\t\t\t\t\tmembership\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\tVALUES\r\n\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'{$ubill_id}',\r\n\t\t\t\t\t\t\t\t\t'{$saveID}',\r\n\t\t\t\t\t\t\t\t\t'1',\r\n\t\t\t\t\t\t\t\t\t'{$membershipDB[ms_id]}'\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t"); $billID = mysqli_insert_id($db); // Create invoice mysqli_query($db, "\r\n\t\t\t\t\t\t\t\tINSERT INTO {$dbinfo[pre]}invoices \r\n\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\tinvoice_number,\r\n\t\t\t\t\t\t\t\t\tinvoice_mem_id,\r\n\t\t\t\t\t\t\t\t\tbill_id,\r\n\t\t\t\t\t\t\t\t\tinvoice_date,\r\n\t\t\t\t\t\t\t\t\tdue_date,\r\n\t\t\t\t\t\t\t\t\tpayment_status,\r\n\t\t\t\t\t\t\t\t\tinv_f_name,\r\n\t\t\t\t\t\t\t\t\tinv_l_name,\r\n\t\t\t\t\t\t\t\t\tship_name,\r\n\t\t\t\t\t\t\t\t\tship_email,\r\n\t\t\t\t\t\t\t\t\tship_address,\r\n\t\t\t\t\t\t\t\t\tship_address2,\r\n\t\t\t\t\t\t\t\t\tship_city,\r\n\t\t\t\t\t\t\t\t\tship_country,\r\n\t\t\t\t\t\t\t\t\tship_state,\r\n\t\t\t\t\t\t\t\t\tship_zip,\r\n\t\t\t\t\t\t\t\t\tship_phone,\r\n\t\t\t\t\t\t\t\t\tbill_name,\r\n\t\t\t\t\t\t\t\t\tbill_email,\r\n\t\t\t\t\t\t\t\t\tbill_address,\r\n\t\t\t\t\t\t\t\t\tbill_address2,\r\n\t\t\t\t\t\t\t\t\tbill_city,\r\n\t\t\t\t\t\t\t\t\tbill_country,\r\n\t\t\t\t\t\t\t\t\tbill_state,\r\n\t\t\t\t\t\t\t\t\tbill_zip,\r\n\t\t\t\t\t\t\t\t\tbill_phone\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\tVALUES\r\n\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'{$invoice_number}',\r\n\t\t\t\t\t\t\t\t\t'{$saveID}',\r\n\t\t\t\t\t\t\t\t\t'{$billID}',\r\n\t\t\t\t\t\t\t\t\t'{$billDate}',\r\n\t\t\t\t\t\t\t\t\t'{$dueDate}',\r\n\t\t\t\t\t\t\t\t\t'2',\r\n\t\t\t\t\t\t\t\t\t'{$invFirstName}',\r\n\t\t\t\t\t\t\t\t\t'{$invLastName}',\r\n\t\t\t\t\t\t\t\t\t'{$invFullName}',\r\n\t\t\t\t\t\t\t\t\t'{$invEmail}',\r\n\t\t\t\t\t\t\t\t\t'{$invAddress}',\r\n\t\t\t\t\t\t\t\t\t'{$invAddress2}',\r\n\t\t\t\t\t\t\t\t\t'{$invCity}',\r\n\t\t\t\t\t\t\t\t\t'{$invCountry}',\r\n\t\t\t\t\t\t\t\t\t'{$invState}',\r\n\t\t\t\t\t\t\t\t\t'{$invPostalCode}',\r\n\t\t\t\t\t\t\t\t\t'{$invPhone}',\r\n\t\t\t\t\t\t\t\t\t'{$invFullName}',\r\n\t\t\t\t\t\t\t\t\t'{$invEmail}',\r\n\t\t\t\t\t\t\t\t\t'{$invAddress}',\r\n\t\t\t\t\t\t\t\t\t'{$invAddress2}',\r\n\t\t\t\t\t\t\t\t\t'{$invCity}',\r\n\t\t\t\t\t\t\t\t\t'{$invCountry}',\r\n\t\t\t\t\t\t\t\t\t'{$invState}',\r\n\t\t\t\t\t\t\t\t\t'{$invPostalCode}',\r\n\t\t\t\t\t\t\t\t\t'{$invPhone}'\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t"); $saveid2 = mysqli_insert_id($db);
//$result = mysqli_query($db,$sql); } } } switch ($albumType) { case "none": // No album selected $albumID = 0; break; case "new": // Create a new album $everyone = 0; // Private album $perm = 'mem' . $_SESSION['member']['mem_id']; // Permissions $ugalleryID = create_unique2(); // Unique gallery ID if (!$newAlbumName) { // If no name entered then use date $newAlbumName = date("Y-m-d"); } // Create Gallery mysqli_query($db, "\r\n\t\t\t\t\t\t\tINSERT INTO {$dbinfo[pre]}galleries \r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\tname,\r\n\t\t\t\t\t\t\t\towner,\r\n\t\t\t\t\t\t\t\tcreated,\r\n\t\t\t\t\t\t\t\tactive,\r\n\t\t\t\t\t\t\t\tdescription,\r\n\t\t\t\t\t\t\t\tpublicgal,\r\n\t\t\t\t\t\t\t\teveryone,\r\n\t\t\t\t\t\t\t\talbum,\r\n\t\t\t\t\t\t\t\tugallery_id\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\tVALUES\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'{$newAlbumName}',\r\n\t\t\t\t\t\t\t\t'{$memID}',\r\n\t\t\t\t\t\t\t\t'{$nowGMT}',\r\n\t\t\t\t\t\t\t\t'1',\r\n\t\t\t\t\t\t\t\t'{$newAlbumDescription}',\r\n\t\t\t\t\t\t\t\t'{$newAlbumPublic}',\r\n\t\t\t\t\t\t\t\t'{$everyone}',\r\n\t\t\t\t\t\t\t\t'1',\r\n\t\t\t\t\t\t\t\t'{$ugalleryID}'\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t"); $albumID = mysqli_insert_id($db); // New album ID $page = 'galleries'; save_mem_permissions(); // Save member permissions $_SESSION['member']['contrAlbumsQueried'] = 0; // Make sure the albums are reloaded /*