// Member ID $downloadTypeID = $orderInfo['order_id']; // Download Type ID / Order ID } // Downloadable Status - 0 = order not approved | 1 = active/ok | 2 = expired | 3 = downloads exceeded | 4 = Not available for download if ($nowGMT > $itemValue['expires'] and $itemValue['expires'] != '0000-00-00 00:00:00') { $downloadableStatus = 2; } elseif ($itemValue['downloads'] >= $maxDownloadAttempts) { $downloadableStatus = 3; } else { // Check if file is available try { // Get the media information $mediaObj = new mediaTools($itemValue['asset_id']); $media = $mediaObj->getMediaInfoFromDB($itemValue['asset_id']); $folderInfo = $mediaObj->getFolderStorageInfoFromDB($media['folder_id']); //echo $itemValue['asset_id']; print_r($folderInfo); echo "<br /><br /><br /><br />"; // testing if ($itemValue['item_id']) { $mdspResult = mysqli_query($db, "\r\n\t\t\t\t\t\t\t\t\t\t\tSELECT *\r\n\t\t\t\t\t\t\t\t\t\t\tFROM {$dbinfo[pre]}media_digital_sizes \r\n\t\t\t\t\t\t\t\t\t\t\tWHERE ds_id = '{$itemValue[item_id]}' \r\n\t\t\t\t\t\t\t\t\t\t\tAND media_id = '{$itemValue[asset_id]}'\r\n\t\t\t\t\t\t\t\t\t\t\t"); if ($mdspRows = mysqli_num_rows($mdspResult)) { $mdsp = mysqli_fetch_assoc($mdspResult); } // Get the digital profile details $dspResult = mysqli_query($db, "\r\n\t\t\t\t\t\t\t\t\t\t\tSELECT * \r\n\t\t\t\t\t\t\t\t\t\t\tFROM {$dbinfo[pre]}digital_sizes \r\n\t\t\t\t\t\t\t\t\t\t\tWHERE ds_id = '{$itemValue[item_id]}'\r\n\t\t\t\t\t\t\t\t\t\t\t"); $dsp = mysqli_fetch_assoc($dspResult); // Get the digital profile details $deliveryMethod = $dsp['delivery_method']; // Delivery method of file // echo $deliveryMethod.'<br>'; // Testing switch ($deliveryMethod) { case '0':
} catch (Exception $e) { echo $e->getMessage(); exit; } //print_k($digitalItem); // Testing //echo $_SESSION['downloadAuthorization']; exit; // Testing } } // End authorization check try { idCheck($download['mediaID']); // Make sure ID is numeric // Get the media information $media = new mediaTools($download['mediaID']); $mediaInfo = $media->getMediaInfoFromDB(); $folderInfo = $media->getFolderStorageInfoFromDB($mediaInfo['folder_id']); if ($download['externalLink']) { $externalLink = 1; // External Link $filecheck['status'] = checkExternalFile($download['externalLink']) > 400 ? 0 : 1; $filecheck['path'] = $download['externalLink']; } else { $filecheck = $media->verifyMediaFileExists(); // Returns array [stauts,path,filename] } //$filecheck = $media->verifyMediaFileExists(); // Returns array [stauts,path,filename] // Old //print_r($mediaInfo); //echo $_SESSION['member']['mem_id']; //exit; } catch (Exception $e) { echo $e->getMessage();