!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/home/jerryg/public_html/gallery2/modules/slideshow/   drwxr-xr-x
Free 318.38 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Slideshow.inc (7.07 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2007 Bharat Mediratta
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */

/**
 * Display the slideshow
 * @package Slideshow
 * @subpackage UserInterface
 * @author Alan Harder <alan.harder@sun.com>
 * @version $Revision: 15513 $
 */
class SlideshowView extends GalleryView {

    
/**
     * @see GalleryView::loadTemplate
     */
    
function loadTemplate(&$template, &$form) {
    global 
$gallery;
    
$SlideShow = array();
    
$startId null;

    
$itemListString GalleryUtilities::getRequestVariables('itemList');
    if (!empty(
$itemListString)) {
        
/* Build slideshow using specified items */
        
$item explode('|'$itemListString);
    } else {
        
/* Build slideshow for an album */
        
list ($ret$item) = $this->getItem();
        if (
$ret) {
        return array(
$retnull);
        }
        if (!
$item->getCanContainChildren()) {
        
/* Photo: do slideshow of parent album, start at this photo */
        
$startId $item->getId();
        list (
$ret$item) = GalleryCoreApi::loadEntitiesById($item->getParentId());
        if (
$ret) {
            return array(
$retnull);
        }
        }
        
$SlideShow['item'] = (array)$item;
    }

    list (
$ret$itemList$start) =
        
$this->buildSlideshow($item$startId);
    if (
$ret) {
        return array(
$retnull);
    }

    
$SlideShow['itemList'] = $itemList;
    
$SlideShow['count'] = count($itemList);
    
$SlideShow['start'] = $start;
    
$template->setVariable('SlideShow'$SlideShow);
    
$template->head('modules/slideshow/templates/Header.tpl');

    list (
$ret$module) = GalleryCoreApi::loadPlugin('module''slideshow');
    if (
$ret) {
        return array(
$retnull);
    }
    if (!empty(
$SlideShow['item']['title'])) {
        
$template->title($module->translate(array('text' => 'Slideshow for %s',
                              
'arg1' => $SlideShow['item']['title'])));
    } else {
        
$template->title($module->translate('Slideshow'));
    }

    return array(
null, array('body' => 'modules/slideshow/templates/Slideshow.tpl',
                 
'useFullScreen' => true));
    }

    
/**
     * Build data set to be used by template to render slideshow.
     * If $item parameter is a single object then build using all children
     * of that item; if an array then build using the ids in the array.
     */
    
function buildSlideshow($item$startId null$recursive false) {
    global 
$gallery;
    if (!isset(
$this->init)) {
        
$this->sizeClasses = array(
        array(
320,320),     /* 0:   <320x240  */
        
array(640,640),     /* 1:  ..640x480  */
        
array(800,800),     /* 2:  ..800x600  */
        
array(1024,1024),   /* 3: ..1024x768  */
        
array(1280,1280),   /* 4: ..1280x1024 */
        
);                      /* 5:  >1280x1024 */
        
$this->init 1;
    }
    if (
is_array($item)) {
        
$childIds $item;
    } else {
        list (
$ret$childIds) = GalleryCoreApi::fetchChildItemIds($item);
        if (
$ret) {
        return array(
$retnullnull);
        }
    }
    
$itemList = array();
    
$childItems = array();
    if (!empty(
$childIds)) {
        
$gallery->guaranteeTimeLimit(30);
        
$ret GalleryCoreApi::studyPermissions($childIds);
        if (
$ret) {
        return array(
$retnullnull);
        }
        list (
$ret$childItems) = GalleryCoreApi::loadEntitiesById($childIds);
        if (
$ret) {
        return array(
$retnullnull);
        }
        list (
$ret$preferredFullImages) =
        
GalleryCoreApi::fetchPreferredsByItemIds($childIds);
        if (
$ret) {
        return array(
$retnullnull);
        }
        list (
$ret$resizedImages) =
        
GalleryCoreApi::fetchResizesByItemIds($childIds);
        if (
$ret) {
        return array(
$retnullnull);
        }
        list (
$ret$thumbnails) =
        
GalleryCoreApi::fetchThumbnailsByItemIds($childIds);
        if (
$ret) {
        return array(
$retnullnull);
        }
    }
    if (!isset(
$startId)) {
        
$start 0;
    }
    foreach (
$childItems as $child) {
        if (
count($itemList) % 100 == 0) {
        
$gallery->guaranteeTimeLimit(30);
        }

        
$childId $child->getId();
        if (!isset(
$start) && $childId == $startId) {
        
$start count($itemList);
        }

        if (
$child->getCanContainChildren()) {

        if (
$recursive) {
            list (
$ret$sublist) =
            
$this->buildSlideshow($childnull$recursive);
            if (
$ret) {
            return array(
$retnullnull);
            }
            
$itemList array_merge($itemList$sublist);
        }

        } else if (
GalleryUtilities::isA($child'GalleryPhotoItem')) {

        list (
$ret$permissions) =
            
GalleryCoreApi::getPermissions($childId);
        if (
$ret) {
            return array(
$retnullnull);
        }

        
$images = array();
        if (isset(
$permissions['core.viewSource'])) {
            
/* Full size; check for preferred copy */
            
if (isset($preferredFullImages[$childId])) {
            
$images[] = $preferredFullImages[$childId];
            } else if (
$child->canBeViewedInline()) {
            
$images[] = $child;
            }
        }
        if (isset(
$permissions['core.viewResizes']) &&
            isset(
$resizedImages[$childId])) {
            foreach (
$resizedImages[$childId] as $resize) {
            
$images[] = $resize;
            }
        }
        if (isset(
$thumbnails[$childId])) {
            
$images[] = $thumbnails[$childId];
        }

        
/* build table of {sizeClass}=>{sources_index} */
        
$sizeClassMap $sizeClassArea = array();
        for (
$i 0$i <= count($this->sizeClasses); $i++) {
            
$sizeClassMap[] = $sizeClassArea[] = -1;
        }
        for (
$i 0$i sizeof($images); $i++) {
            
$image $images[$i];
            if (
GalleryUtilities::isA($image'GalleryDerivativeImage')) {
            if (!(
$image->getWidth() && $image->getHeight())) {
                list (
$ret$image) =
                
GalleryCoreApi::rebuildDerivativeCache($image->getId());
                if (
$ret) {
                return array(
$retnullnull);
                }
            }
            }
            
$image $images[$i] = (array)$image;
            if (!isset(
$image['width']) || !isset($image['height'])) {
            continue; 
/* Should not happen */
            
}
            
$area $image['width'] * $image['height'];
            for (
$j count($this->sizeClasses); $j >= 0$j--) {
            if (
$j count($this->sizeClasses) &&
                  (
$image['width'] > $this->sizeClasses[$j][0] ||
                   
$image['height'] > $this->sizeClasses[$j][1])) {
                break;
            }
            if (
$area $sizeClassArea[$j]) {
                
$sizeClassMap[$j] = $i;
                
$sizeClassArea[$j] = $area;
            }
            }
        }

        for (
$j 0$i count($this->sizeClasses); $i >= 0$i--) {
            if (
$sizeClassMap[$i] < 0) {
            
$sizeClassMap[$i] = $j;
            } else {
            
$j $sizeClassMap[$i];
            }
        }

        if (!empty(
$images)) {
            
$itemList[] = array(
            
'id' => $childId,
            
'data' => (array)$child,
            
'sources' => $images,
            
'sizeClassMap' => $sizeClassMap);
        }
        }
    }
    return array(
null$itemList, isset($start) ? $start 0);
    }
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.016 ]--