예제 #1
0
 }
 $sql .= "\t\r\n\t\t\t\t\t\tAND {$dbinfo[pre]}media.active = 1 \r\n\t\t\t\t\t\tGROUP BY {$dbinfo[pre]}media.media_id \r\n\t\t\t\t\t";
 if ($_SESSION['searchForm']['hex']) {
     $sql .= "ORDER BY {$dbinfo[pre]}color_palettes.percentage DESC ";
 } else {
     $sql .= "ORDER BY {$dbinfo[pre]}media.{$_SESSION[searchForm][searchSortBy]} {$_SESSION[searchForm][searchSortType]}";
 }
 $sql .= "\r\n\t\t\t\t\t\tLIMIT {$mediaStartRecord},{$mediaPerPage}\r\n\t\t\t\t\t";
 //echo $sql; exit;
 //$mediaCount = mysqli_num_rows(mysqli_query($db,$sql)); // Get the total number of items
 //$mediaPages->setTotalResults($mediaCount); // Pass the total number of results to the $pages object
 //$sql.= " LIMIT {$mediaStartRecord},{$mediaPerPage}";
 //}
 $media = new mediaList($sql);
 // Create a new mediaList object
 if ($returnRows = $media->getRows()) {
     if ($returnRows > $mediaPerPage * $config['searchResultLimit']) {
         $returnRows = $mediaPerPage * $config['searchResultLimit'];
     }
     // Limit the results to X pages
     $mediaPages->setTotalResults($returnRows);
     // Pass the total number of results to the $pages object
     $media->getMediaDetails();
     // Run the getMediaDetails function to grab all the media file details
     $mediaArray = $media->getMediaArray();
     // Get the array of media
     $thumbMediaDetailsArray = $media->getDetailsFields('thumb');
     // Get thumb details
     $smarty->assign('thumbMediaDetails', $thumbMediaDetailsArray);
     $smarty->assign('mediaRows', $returnRows);
     $smarty->assign('mediaArray', $mediaArray);
//require_once BASE_PATH.'/assets/includes/cart.inc.php';
//require_once BASE_PATH.'/assets/includes/affiliate.inc.php';
require_once BASE_PATH . '/assets/includes/header.inc.php';
require_once BASE_PATH . '/assets/includes/errors.php';
try {
    $useMediaID = $mediaID;
    // Original untouched media ID
    if (!$mediaID) {
        // Make sure a media ID was passed
        exit;
    } else {
        idCheck($mediaID);
        // Make sure ID is numeric
        $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM {$dbinfo[pre]}media WHERE media_id = '{$mediaID}'";
        $mediaInfo = new mediaList($sql);
        if ($mediaInfo->getRows()) {
            $media = $mediaInfo->getSingleMediaDetails('preview');
            $galleryIDArray = $mediaInfo->getMediaGalleryIDs();
            // Get an array of galleries this media is in
            switch ($incMode) {
                default:
                case 'digital':
                    $galleryIDArrayFlat = $galleryIDArray ? implode(",", $galleryIDArray) : 0;
                    // Get the gallery IDs for this photo
                    require_once 'media.details.inc.php';
                    $smarty->assign('mediaID', $mediaID);
                    $smarty->display('download.mini.window.tpl');
                    // Smarty template
                    break;
            }
        }
require_once BASE_PATH . '/assets/includes/errors.php';
try {
    $memberID = $_SESSION['member']['mem_id'];
    if (!$memberID) {
        die('No member ID exists');
    }
    // Just to be safe make sure a memberID exists before continuing
    $downloadsResult = mysqli_query($db, "\r\n\t\t\tSELECT *\r\n\t\t\tFROM {$dbinfo[pre]}downloads \r\n\t\t\tWHERE mem_id = {$memberID} \r\n\t\t\tORDER BY dl_id DESC\r\n\t\t\t");
    if ($returnRows = mysqli_num_rows($downloadsResult)) {
        while ($downloads = mysqli_fetch_array($downloadsResult)) {
            $downloadsArray[$downloads['dl_id']] = $downloads;
            $downloadsArray[$downloads['dl_id']]['download_date_display'] = $customDate->showdate($downloads['dl_date'], 1);
            $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM {$dbinfo[pre]}media WHERE media_id = '{$downloads[asset_id]}'";
            $mediaObj = new mediaList($sql);
            // Create a new mediaList object
            if ($returnMediaRows = $mediaObj->getRows()) {
                $downloadsArray[$downloads['dl_id']]['media'] = $mediaObj->getSingleMediaDetails();
            }
            switch ($downloads['dl_type']) {
                default:
                    $downloadsArray[$downloads['dl_id']]['download_type_display'] = $lang['unknown'];
                    break;
                case "free":
                    $downloadsArray[$downloads['dl_id']]['download_type_display'] = $lang['freeDownload'];
                    break;
                case "sub":
                    $downloadsArray[$downloads['dl_id']]['download_type_display'] = $lang['subscription'];
                    break;
                case "order":
                    $downloadsArray[$downloads['dl_id']]['download_type_display'] = $lang['order'];
                    break;
예제 #4
0
     echo '{"errorCode": "emailSent","errorMessage": "emailSent"}';
     // Send confirmation
     break;
 case "downloadNotAvailable":
 case "emailForFile":
     if ($config['EncryptIDs']) {
         // Decrypt IDs
         $mediaID = k_decrypt($mediaID);
     } else {
         $mediaID = $mediaID;
     }
     idCheck($mediaID);
     // Make sure ID is numeric
     $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM {$dbinfo[pre]}media WHERE media_id = '{$mediaID}'";
     $mediaObj = new mediaList($sql);
     if ($mediaObj->getRows()) {
         $mediaObj->getMediaDetails();
         // Run the getMediaDetails function so I can grab the info later
         $media = $mediaObj->getMediaSingle();
         // Grab the single returned media info
         $smarty->assign('media', $media);
     }
     //test('workedA');
     if ($profileID) {
         $dspResult = mysqli_query($db, "SELECT name,ds_id FROM {$dbinfo[pre]}digital_sizes WHERE ds_id = '{$profileID}'");
         $dsp = mysqli_fetch_assoc($dspResult);
     } else {
         $dsp['name'] = $mgrlang['gen_base_price'];
     }
     $smarty->assign('dsp', $dsp);
     if ($_SESSION['loggedIn']) {
예제 #5
0
require_once BASE_PATH . '/assets/includes/security.inc.php';
require_once BASE_PATH . '/assets/includes/language.inc.php';
require_once BASE_PATH . '/assets/includes/cart.inc.php';
require_once BASE_PATH . '/assets/includes/affiliate.inc.php';
//define('META_TITLE',''); // Override page title, description, keywords and page encoding here
//define('META_DESCRIPTION','');
//define('META_KEYWORDS','');
//define('PAGE_ENCODING','');
require_once BASE_PATH . '/assets/includes/header.inc.php';
require_once BASE_PATH . '/assets/includes/errors.php';
require_once BASE_PATH . '/assets/classes/mediatools.php';
/*
$mediaObj = new mediaTools(588);

$sample = $mediaObj->getSampleInfoFromDB();

print_r($sample);
*/
//mediaImage mediaID=$media.encryptedID type=thumb folderID=$media.encryptedFID
$sql = "SELECT SQL_CALC_FOUND_ROWS * FROM {$dbinfo[pre]}media";
$mediaObject = new mediaList($sql);
if ($returnRows = $mediaObject->getRows()) {
    $mediaObject->getMediaDetails();
    // Run the getMediaDetails function to grab all the media file details
    $mediaArray = $mediaObject->getMediaArray();
    // Get the array of media
    //print_r($mediaArray);
    foreach ($mediaArray as $key => $media) {
        echo "{$media[media_id]} - {$media[linkto]}<br>";
    }
}
예제 #6
0
 	FROM {$dbinfo[pre]}media
 	LEFT JOIN {$dbinfo[pre]}media_galleries 
 	ON {$dbinfo[pre]}media.media_id = {$dbinfo[pre]}media_galleries.gmedia_id
 	WHERE {$dbinfo[pre]}media_galleries.gallery_id IN ({$memberPermGalleriesForDB})
 	AND {$dbinfo[pre]}media.active = 1 
 	AND {$dbinfo[pre]}media.approval_status = 1 
 	GROUP BY {$dbinfo[pre]}media.media_id
 	ORDER BY {$dbinfo[pre]}media.views DESC
 	LIMIT {$config[settings][popular_media_count]}
 	";
 */
 $sql = "\r\n\t\t\t\tSELECT SQL_CALC_FOUND_ROWS *\r\n\t\t\t\tFROM {$dbinfo[pre]}media \r\n\t\t\t\tWHERE {$dbinfo[pre]}media.active = 1 \r\n\t\t\t\tAND {$dbinfo[pre]}media.approval_status = 1 \t\t\t\t\r\n\t\t\t\tAND {$dbinfo[pre]}media.media_id IN (SELECT DISTINCT(gmedia_id) FROM {$dbinfo[pre]}media_galleries WHERE gallery_id IN ({$memberPermGalleriesForDB})) \t\t\t\t\r\n\t\t\t\tORDER BY {$dbinfo[pre]}media.views DESC\r\n\t\t\t\tLIMIT {$config[settings][popular_media_count]}\r\n\t\t\t";
 // New 4.3.2
 $popularMedia = new mediaList($sql);
 // Create a new mediaList object
 if ($returnRows = $popularMedia->getRows()) {
     //echo "test: ".$returnRows; exit;
     $popularMedia->getMediaDetails();
     // Run the getMediaDetails function to grab all the media file details
     $popularMedia->addThumbDetails = true;
     // Get the thumb details as part of the array
     $popularMediaArray = $popularMedia->getMediaArray();
     // Get the array of popular media
     $popularMediaDetailsFields = $popularMedia->getDetailsFields('thumb');
     if ($popularMediaDetailsFields) {
         $thumbMediaDetailsArray = $thumbMediaDetailsArray + $popularMediaDetailsFields;
     }
     // Get the output for the details shown under thumbnails
     $smarty->assign('popularMediaRows', $returnRows);
     // Assign to smarty
     $smarty->assign('popularMedia', $popularMediaArray);