[2] | 1 | <?php |
---|
| 2 | /*************************************************************************** |
---|
[26] | 3 | * thumbnail.php * |
---|
[2] | 4 | * ------------------- * |
---|
[57] | 5 | * application : PhpWebGallery 1.3 <http://phpwebgallery.net> * |
---|
| 6 | * author : Pierrick LE GALL <pierrick@z0rglub.com> * |
---|
[2] | 7 | * * |
---|
[57] | 8 | * $Id: thumbnail.php 345 2004-02-02 00:55:18Z gweltas $ |
---|
| 9 | * * |
---|
[2] | 10 | ***************************************************************************/ |
---|
| 11 | |
---|
| 12 | /*************************************************************************** |
---|
| 13 | * * |
---|
| 14 | * This program is free software; you can redistribute it and/or modify * |
---|
| 15 | * it under the terms of the GNU General Public License as published by * |
---|
| 16 | * the Free Software Foundation; * |
---|
| 17 | * * |
---|
| 18 | ***************************************************************************/ |
---|
[226] | 19 | include_once( './admin/include/isadmin.inc.php' ); |
---|
[26] | 20 | //------------------------------------------------------------------- functions |
---|
| 21 | // get_subdirs returns an array containing all sub directory names, |
---|
| 22 | // excepting : '.', '..' and 'thumbnail'. |
---|
| 23 | function get_subdirs( $dir ) |
---|
[2] | 24 | { |
---|
[26] | 25 | $sub_dirs = array(); |
---|
| 26 | if ( $opendir = opendir( $dir ) ) |
---|
[2] | 27 | { |
---|
[26] | 28 | while ( $file = readdir( $opendir ) ) |
---|
[2] | 29 | { |
---|
[26] | 30 | if ( $file != 'thumbnail' and $file != '.' |
---|
| 31 | and $file != '..' and is_dir( $dir.'/'.$file ) ) |
---|
[2] | 32 | { |
---|
[26] | 33 | array_push( $sub_dirs, $file ); |
---|
[2] | 34 | } |
---|
| 35 | } |
---|
| 36 | } |
---|
[26] | 37 | return $sub_dirs; |
---|
[2] | 38 | } |
---|
| 39 | |
---|
[26] | 40 | // get_images_without_thumbnail returns an array with all the picture names |
---|
| 41 | // that don't have associated thumbnail in the directory. Each picture name |
---|
| 42 | // is associated with the width, heigh and filesize of the picture. |
---|
[2] | 43 | function get_images_without_thumbnail( $dir ) |
---|
| 44 | { |
---|
[26] | 45 | $images = array(); |
---|
| 46 | if ( $opendir = opendir( $dir ) ) |
---|
[2] | 47 | { |
---|
[26] | 48 | while ( $file = readdir( $opendir ) ) |
---|
[2] | 49 | { |
---|
[26] | 50 | $path = $dir.'/'.$file; |
---|
| 51 | if ( is_image( $path, true ) ) |
---|
[2] | 52 | { |
---|
[26] | 53 | if ( !TN_exists( $dir, $file ) ) |
---|
[2] | 54 | { |
---|
[26] | 55 | $image_infos = getimagesize( $path ); |
---|
| 56 | $size = floor( filesize( $path ) / 1024 ). ' KB'; |
---|
| 57 | array_push( $images, array( 'name' => $file, |
---|
| 58 | 'width' => $image_infos[0], |
---|
| 59 | 'height' => $image_infos[1], |
---|
| 60 | 'size' => $size ) ); |
---|
[2] | 61 | } |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | } |
---|
| 65 | return $images; |
---|
| 66 | } |
---|
[26] | 67 | |
---|
| 68 | // scandir scans a dir to find pictures without thumbnails. Once found, |
---|
| 69 | // creation of the thumbnails (RatioResizeImg). Only the first $_POST['n'] |
---|
| 70 | // pictures without thumbnails are treated. |
---|
| 71 | // scandir returns an array with the generation time of each thumbnail (for |
---|
| 72 | // statistics purpose) |
---|
| 73 | function scandir( $dir, $width, $height ) |
---|
[2] | 74 | { |
---|
[26] | 75 | global $conf; |
---|
| 76 | $stats = array(); |
---|
| 77 | if ( $opendir = opendir( $dir ) ) |
---|
[2] | 78 | { |
---|
[26] | 79 | while ( $file = readdir ( $opendir ) ) |
---|
[2] | 80 | { |
---|
[26] | 81 | $path = $dir.'/'.$file; |
---|
| 82 | if ( is_image( $path, true ) ) |
---|
[2] | 83 | { |
---|
[26] | 84 | if ( count( $stats ) < $_POST['n'] and !TN_exists( $dir, $file ) ) |
---|
[2] | 85 | { |
---|
[26] | 86 | $starttime = get_moment(); |
---|
| 87 | $info = RatioResizeImg( $file, $width, $height, $dir.'/', 'jpg' ); |
---|
| 88 | $endtime = get_moment(); |
---|
| 89 | $info['time'] = ( $endtime - $starttime ) * 1000; |
---|
| 90 | array_push( $stats, $info ); |
---|
[2] | 91 | } |
---|
| 92 | } |
---|
| 93 | } |
---|
| 94 | } |
---|
[26] | 95 | return $stats; |
---|
[2] | 96 | } |
---|
[26] | 97 | |
---|
| 98 | // RatioResizeImg creates a new picture (a thumbnail since it is supposed to |
---|
| 99 | // be smaller than original picture !) in the sub directory named |
---|
| 100 | // "thumbnail". |
---|
| 101 | function RatioResizeImg( $filename, $newWidth, $newHeight, $path, $tn_ext ) |
---|
[2] | 102 | { |
---|
[26] | 103 | global $conf, $lang; |
---|
| 104 | // full path to picture |
---|
| 105 | $filepath = $path.$filename; |
---|
| 106 | // extension of the picture filename |
---|
| 107 | $extension = get_extension( $filepath ); |
---|
| 108 | switch( $extension ) |
---|
[2] | 109 | { |
---|
[26] | 110 | case 'jpg': $srcImage = @imagecreatefromjpeg( $filepath ); break; |
---|
| 111 | case 'JPG': $srcImage = @imagecreatefromjpeg( $filepath ); break; |
---|
| 112 | case 'png': $srcImage = @imagecreatefrompng( $filepath ); break; |
---|
| 113 | case 'PNG': $srcImage = @imagecreatefrompng( $filepath ); break; |
---|
| 114 | default : unset( $extension ); break; |
---|
[2] | 115 | } |
---|
| 116 | |
---|
[26] | 117 | if ( isset( $srcImage ) ) |
---|
[2] | 118 | { |
---|
[26] | 119 | // width/height |
---|
| 120 | $srcWidth = imagesx( $srcImage ); |
---|
| 121 | $srcHeight = imagesy( $srcImage ); |
---|
| 122 | $ratioWidth = $srcWidth/$newWidth; |
---|
[2] | 123 | $ratioHeight = $srcHeight/$newHeight; |
---|
[26] | 124 | |
---|
| 125 | // maximal size exceeded ? |
---|
| 126 | if ( ( $ratioWidth > 1 ) or ( $ratioHeight > 1 ) ) |
---|
[2] | 127 | { |
---|
[26] | 128 | if ( $ratioWidth < $ratioHeight) |
---|
[2] | 129 | { |
---|
| 130 | $destWidth = $srcWidth/$ratioHeight; |
---|
| 131 | $destHeight = $newHeight; |
---|
| 132 | } |
---|
| 133 | else |
---|
| 134 | { |
---|
| 135 | $destWidth = $newWidth; |
---|
| 136 | $destHeight = $srcHeight/$ratioWidth; |
---|
| 137 | } |
---|
| 138 | } |
---|
| 139 | else |
---|
| 140 | { |
---|
| 141 | $destWidth = $srcWidth; |
---|
| 142 | $destHeight = $srcHeight; |
---|
| 143 | } |
---|
[26] | 144 | // according to the GD version installed on the server |
---|
| 145 | if ( $_POST['gd'] == 2 ) |
---|
[2] | 146 | { |
---|
[26] | 147 | // GD 2.0 or more recent -> good results (but slower) |
---|
[2] | 148 | $destImage = imagecreatetruecolor( $destWidth, $destHeight); |
---|
[26] | 149 | imagecopyresampled( $destImage, $srcImage, 0, 0, 0, 0, |
---|
| 150 | $destWidth,$destHeight,$srcWidth,$srcHeight ); |
---|
[2] | 151 | } |
---|
| 152 | else |
---|
| 153 | { |
---|
[26] | 154 | // GD prior to version 2 -> pretty bad results :-/ (but fast) |
---|
[2] | 155 | $destImage = imagecreate( $destWidth, $destHeight); |
---|
[26] | 156 | imagecopyresized( $destImage, $srcImage, 0, 0, 0, 0, |
---|
| 157 | $destWidth,$destHeight,$srcWidth,$srcHeight ); |
---|
[2] | 158 | } |
---|
| 159 | |
---|
| 160 | |
---|
[26] | 161 | if( !is_dir( $path.'thumbnail' ) ) |
---|
[2] | 162 | { |
---|
[26] | 163 | umask( 0000 ); |
---|
| 164 | mkdir( $path.'thumbnail', 0777 ); |
---|
[2] | 165 | } |
---|
[26] | 166 | $dest_file = $path.'thumbnail/'.$conf['prefix_thumbnail']; |
---|
| 167 | $dest_file.= get_filename_wo_extension( $filename ); |
---|
| 168 | $dest_file.= '.'.$tn_ext; |
---|
[2] | 169 | |
---|
[26] | 170 | // creation and backup of final picture |
---|
| 171 | imagejpeg( $destImage, $dest_file ); |
---|
| 172 | // freeing memory ressources |
---|
[2] | 173 | imagedestroy( $srcImage ); |
---|
| 174 | imagedestroy( $destImage ); |
---|
| 175 | |
---|
[26] | 176 | list( $width,$height ) = getimagesize( $filepath ); |
---|
| 177 | $size = floor( filesize( $filepath ) / 1024 ).' KB'; |
---|
| 178 | list( $tn_width,$tn_height ) = getimagesize( $dest_file ); |
---|
| 179 | $tn_size = floor( filesize( $dest_file ) / 1024 ).' KB'; |
---|
| 180 | $info = array( 'file' => $filename, |
---|
| 181 | 'width' => $width, |
---|
| 182 | 'height' => $height, |
---|
| 183 | 'size' => $size, |
---|
| 184 | 'tn_file' => $dest_file, |
---|
| 185 | 'tn_width' => $tn_width, |
---|
| 186 | 'tn_height' => $tn_height, |
---|
| 187 | 'tn_size' => $tn_size ); |
---|
[2] | 188 | return $info; |
---|
| 189 | } |
---|
[26] | 190 | // error |
---|
[2] | 191 | else |
---|
| 192 | { |
---|
| 193 | echo $lang['tn_no_support']." "; |
---|
[26] | 194 | if ( isset( $extenstion ) ) |
---|
[2] | 195 | { |
---|
[26] | 196 | echo $lang['tn_format'].' '.$extension; |
---|
[2] | 197 | } |
---|
| 198 | else |
---|
| 199 | { |
---|
| 200 | echo $lang['tn_thisformat']; |
---|
| 201 | } |
---|
| 202 | exit(); |
---|
| 203 | } |
---|
| 204 | } |
---|
[26] | 205 | |
---|
| 206 | // array_max returns the highest value of the given array |
---|
[2] | 207 | function array_max( $array ) |
---|
| 208 | { |
---|
[26] | 209 | sort( $array, SORT_NUMERIC ); |
---|
| 210 | return array_pop( $array ); |
---|
[2] | 211 | } |
---|
[26] | 212 | |
---|
| 213 | // array_min returns the lowest value of the given array |
---|
[2] | 214 | function array_min( $array ) |
---|
| 215 | { |
---|
[26] | 216 | sort( $array, SORT_NUMERIC ); |
---|
| 217 | return array_shift( $array ); |
---|
[2] | 218 | } |
---|
[26] | 219 | |
---|
| 220 | // array_avg returns the average value of the array |
---|
| 221 | function array_avg( $array ) |
---|
[2] | 222 | { |
---|
| 223 | return array_sum( $array ) / sizeof( $array ); |
---|
| 224 | } |
---|
| 225 | |
---|
[26] | 226 | // get_displayed_dirs builds the tree of dirs under "galleries". If a |
---|
| 227 | // directory contains pictures without thumbnails, the become linked to the |
---|
| 228 | // page of thumbnails creation. |
---|
| 229 | function get_displayed_dirs( $dir, $indent ) |
---|
[2] | 230 | { |
---|
[26] | 231 | global $conf,$lang,$vtp,$sub; |
---|
[2] | 232 | |
---|
[26] | 233 | $sub_dirs = get_subdirs( $dir ); |
---|
[2] | 234 | // write of the dirs |
---|
[26] | 235 | foreach ( $sub_dirs as $sub_dir ) { |
---|
| 236 | $pictures = get_images_without_thumbnail( $dir.'/'.$sub_dir ); |
---|
| 237 | $vtp->addSession( $sub, 'dir' ); |
---|
| 238 | $vtp->setVar( $sub, 'dir.indent', $indent ); |
---|
| 239 | if ( count( $pictures ) > 0 ) |
---|
[2] | 240 | { |
---|
[26] | 241 | $vtp->addSession( $sub, 'linked' ); |
---|
| 242 | $url = './admin.php?page=thumbnail&dir='.$dir."/".$sub_dir; |
---|
| 243 | $vtp->setVar( $sub, 'linked.url', add_session_id( $url ) ); |
---|
| 244 | $vtp->setVar( $sub, 'linked.name', $sub_dir ); |
---|
| 245 | $vtp->setVar( $sub, 'linked.nb_pic', count( $pictures ) ); |
---|
| 246 | $vtp->closeSession( $sub, 'linked' ); |
---|
[2] | 247 | } |
---|
[26] | 248 | else |
---|
[2] | 249 | { |
---|
[26] | 250 | $vtp->addSession( $sub, 'unlinked' ); |
---|
| 251 | $vtp->setVar( $sub, 'unlinked.name', $sub_dir ); |
---|
| 252 | $vtp->closeSession( $sub, 'unlinked' ); |
---|
[2] | 253 | } |
---|
[26] | 254 | $vtp->closeSession( $sub, 'dir' ); |
---|
| 255 | // recursive call |
---|
[345] | 256 | get_displayed_dirs( $dir.'/'.$sub_dir, |
---|
| 257 | $indent+30 ); |
---|
[2] | 258 | } |
---|
| 259 | } |
---|
[26] | 260 | //----------------------------------------------------- template initialization |
---|
[225] | 261 | $sub = $vtp->Open( './template/'.$user['template'].'/admin/thumbnail.vtp' ); |
---|
[26] | 262 | $tpl = array( |
---|
| 263 | 'tn_dirs_title','tn_dirs_alone','tn_params_title','tn_params_GD', |
---|
| 264 | 'tn_params_GD_info','tn_width','tn_params_width_info','tn_height', |
---|
| 265 | 'tn_params_height_info','tn_params_create','tn_params_create_info', |
---|
| 266 | 'tn_params_format','tn_params_format_info','submit','tn_alone_title', |
---|
| 267 | 'filesize','tn_picture','tn_results_title','thumbnail', |
---|
| 268 | 'tn_results_gen_time','tn_stats','tn_stats_nb','tn_stats_total', |
---|
| 269 | 'tn_stats_max','tn_stats_min','tn_stats_mean' ); |
---|
| 270 | templatize_array( $tpl, 'lang', $sub ); |
---|
[29] | 271 | $vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); |
---|
[26] | 272 | //----------------------------------------------------- miniaturization results |
---|
| 273 | if ( isset( $_GET['dir'] ) ) |
---|
[2] | 274 | { |
---|
[26] | 275 | $pictures = get_images_without_thumbnail( $_GET['dir'] ); |
---|
| 276 | if ( count( $pictures ) == 0 ) |
---|
[2] | 277 | { |
---|
[26] | 278 | $vtp->addSession( $sub, 'warning' ); |
---|
| 279 | $vtp->closeSession( $sub, 'warning' ); |
---|
[2] | 280 | } |
---|
[26] | 281 | elseif ( isset( $_POST['submit'] ) ) |
---|
[2] | 282 | { |
---|
[26] | 283 | // checking criteria |
---|
| 284 | $errors = array(); |
---|
| 285 | if ( !ereg( "^[0-9]{2,3}$", $_POST['width'] ) or $_POST['width'] < 10 ) |
---|
[2] | 286 | { |
---|
[26] | 287 | array_push( $errors, $lang['tn_err_width'].' 10' ); |
---|
[2] | 288 | } |
---|
[26] | 289 | if ( !ereg( "^[0-9]{2,3}$", $_POST['height'] ) or $_POST['height'] < 10 ) |
---|
[2] | 290 | { |
---|
[26] | 291 | array_push( $errors, $lang['tn_err_height'].' 10' ); |
---|
[2] | 292 | } |
---|
[26] | 293 | // picture miniaturization |
---|
| 294 | if ( count( $errors ) == 0 ) |
---|
[2] | 295 | { |
---|
[26] | 296 | $vtp->addSession( $sub, 'results' ); |
---|
| 297 | $stats = scandir( $_GET['dir'], $_POST['width'], $_POST['height'] ); |
---|
| 298 | $times = array(); |
---|
| 299 | foreach ( $stats as $stat ) { |
---|
| 300 | array_push( $times, $stat['time'] ); |
---|
[2] | 301 | } |
---|
[26] | 302 | $max = array_max( $times ); |
---|
| 303 | $min = array_min( $times ); |
---|
| 304 | foreach ( $stats as $i => $stat ) { |
---|
| 305 | $vtp->addSession( $sub, 'picture' ); |
---|
| 306 | if ( $i % 2 == 1 ) |
---|
[2] | 307 | { |
---|
[26] | 308 | $vtp->setVar( $sub, 'picture.class', 'row2' ); |
---|
[2] | 309 | } |
---|
[26] | 310 | $vtp->setVar( $sub, 'picture.num', ($i+1) ); |
---|
| 311 | $vtp->setVar( $sub, 'picture.file', $stat['file'] ); |
---|
| 312 | $vtp->setVar( $sub, 'picture.filesize', $stat['size'] ); |
---|
| 313 | $vtp->setVar( $sub, 'picture.width', $stat['width'] ); |
---|
| 314 | $vtp->setVar( $sub, 'picture.height', $stat['height'] ); |
---|
| 315 | $vtp->setVar( $sub, 'picture.thumb_file', $stat['tn_file'] ); |
---|
| 316 | $vtp->setVar( $sub, 'picture.thumb_filesize', $stat['tn_size'] ); |
---|
| 317 | $vtp->setVar( $sub, 'picture.thumb_width', $stat['tn_width'] ); |
---|
| 318 | $vtp->setVar( $sub, 'picture.thumb_height', $stat['tn_height'] ); |
---|
| 319 | $vtp->setVar( $sub, 'picture.time', |
---|
| 320 | number_format( $stat['time'], 2, '.', ' ').' ms' ); |
---|
| 321 | if ( $stat['time'] == $max ) |
---|
[2] | 322 | { |
---|
[26] | 323 | $vtp->setVar( $sub, 'picture.color', 'red' ); |
---|
[2] | 324 | } |
---|
[26] | 325 | else if ( $stat['time'] == $min ) |
---|
[2] | 326 | { |
---|
[26] | 327 | $vtp->setVar( $sub, 'picture.color', 'green' ); |
---|
[2] | 328 | } |
---|
[26] | 329 | $vtp->closeSession( $sub, 'picture' ); |
---|
[2] | 330 | } |
---|
[26] | 331 | // general statistics |
---|
| 332 | $vtp->setVar( $sub, 'results.stats_nb', count( $stats ) ); |
---|
| 333 | $vtp->setVar( $sub, 'results.stats_total', |
---|
| 334 | number_format( array_sum( $times ), 2, '.', ' ').' ms' ); |
---|
| 335 | $vtp->setVar( $sub, 'results.stats_max', |
---|
| 336 | number_format( $max, 2, '.', ' ').' ms' ); |
---|
| 337 | $vtp->setVar( $sub, 'results.stats_min', |
---|
| 338 | number_format( $min, 2, '.', ' ').' ms' ); |
---|
| 339 | $vtp->setVar( $sub, 'results.stats_mean', |
---|
| 340 | number_format( array_avg( $times ), 2, '.', ' ').' ms' ); |
---|
| 341 | $vtp->closeSession( $sub, 'results' ); |
---|
[2] | 342 | } |
---|
| 343 | else |
---|
| 344 | { |
---|
[26] | 345 | $vtp->addSession( $sub, 'errors' ); |
---|
| 346 | foreach ( $errors as $error ) { |
---|
| 347 | $vtp->addSession( $sub, 'li' ); |
---|
| 348 | $vtp->setVar( $sub, 'li.li', $error ); |
---|
| 349 | $vtp->closeSession( $sub, 'li' ); |
---|
| 350 | } |
---|
| 351 | $vtp->closeSession( $sub, 'errors' ); |
---|
[2] | 352 | } |
---|
| 353 | } |
---|
[26] | 354 | //-------------------------------------------------- miniaturization parameters |
---|
| 355 | if ( sizeof( $pictures ) != 0 ) |
---|
[2] | 356 | { |
---|
[26] | 357 | $vtp->addSession( $sub, 'params' ); |
---|
| 358 | $url = './admin.php?page=thumbnail&dir='.$_GET['dir']; |
---|
| 359 | $vtp->setVar( $sub, 'params.action', add_session_id( $url ) ); |
---|
| 360 | // GD version selected... |
---|
[345] | 361 | if ( isset( $_POST['gd'] ) and $_POST['gd'] == 1 ) |
---|
[2] | 362 | { |
---|
[26] | 363 | $vtp->setVar( $sub, 'params.gd1_checked', ' checked="checked"' ); |
---|
[2] | 364 | } |
---|
[26] | 365 | else |
---|
[2] | 366 | { |
---|
[26] | 367 | $vtp->setVar( $sub, 'params.gd2_checked', ' checked="checked"' ); |
---|
[2] | 368 | } |
---|
[26] | 369 | // width values |
---|
| 370 | if ( isset( $_POST['width'] ) ) |
---|
| 371 | { |
---|
| 372 | $vtp->setVar( $sub, 'params.width_value', $_POST['width'] ); |
---|
| 373 | } |
---|
[2] | 374 | else |
---|
| 375 | { |
---|
[26] | 376 | $vtp->setVar( $sub, 'params.width_value', '128' ); |
---|
[2] | 377 | } |
---|
[26] | 378 | // height value |
---|
| 379 | if ( isset( $_POST['height'] ) ) |
---|
[2] | 380 | { |
---|
[26] | 381 | $vtp->setVar( $sub, 'params.height_value', $_POST['height'] ); |
---|
[2] | 382 | } |
---|
| 383 | else |
---|
| 384 | { |
---|
[26] | 385 | $vtp->setVar( $sub, 'params.height_value', '96' ); |
---|
[2] | 386 | } |
---|
[26] | 387 | // options for the number of picture to miniaturize : "n" |
---|
| 388 | $options = array( 5,10,20,40 ); |
---|
[345] | 389 | if ( isset( $_POST['n'] ) ) $n = $_POST['n']; |
---|
| 390 | else $n = 5; |
---|
[26] | 391 | foreach ( $options as $option ) { |
---|
| 392 | $vtp->addSession( $sub, 'n_option' ); |
---|
| 393 | $vtp->setVar( $sub, 'n_option.option', $option ); |
---|
[345] | 394 | if ( $option == $n ) |
---|
[2] | 395 | { |
---|
[26] | 396 | $vtp->setVar( $sub, 'n_option.selected', ' selected="selected"' ); |
---|
[2] | 397 | } |
---|
[26] | 398 | $vtp->closeSession( $sub, 'n_option' ); |
---|
[2] | 399 | } |
---|
[26] | 400 | $vtp->closeSession( $sub, 'params' ); |
---|
| 401 | //---------------------------------------------------------- remaining pictures |
---|
| 402 | $vtp->addSession( $sub, 'remainings' ); |
---|
| 403 | $pictures = get_images_without_thumbnail( $_GET['dir'] ); |
---|
| 404 | $vtp->setVar( $sub, 'remainings.total', count( $pictures ) ); |
---|
| 405 | foreach ( $pictures as $i => $picture ) { |
---|
| 406 | $vtp->addSession( $sub, 'remaining' ); |
---|
| 407 | if ( $i % 2 == 1 ) |
---|
| 408 | { |
---|
| 409 | $vtp->setVar( $sub, 'remaining.class', 'row2' ); |
---|
| 410 | } |
---|
| 411 | $vtp->setVar( $sub, 'remaining.num', ($i+1) ); |
---|
| 412 | $vtp->setVar( $sub, 'remaining.file', $picture['name'] ); |
---|
| 413 | $vtp->setVar( $sub, 'remaining.filesize', $picture['size'] ); |
---|
| 414 | $vtp->setVar( $sub, 'remaining.width', $picture['width'] ); |
---|
| 415 | $vtp->setVar( $sub, 'remaining.height', $picture['height'] ); |
---|
| 416 | $vtp->closeSession( $sub, 'remaining' ); |
---|
| 417 | } |
---|
| 418 | $vtp->closeSession( $sub, 'remainings' ); |
---|
[2] | 419 | } |
---|
| 420 | } |
---|
[26] | 421 | //-------------------------------------------------------------- directory list |
---|
[2] | 422 | else |
---|
| 423 | { |
---|
[26] | 424 | $vtp->addSession( $sub, 'directory_list' ); |
---|
[228] | 425 | get_displayed_dirs( './galleries', 60 ); |
---|
[26] | 426 | $vtp->closeSession( $sub, 'directory_list' ); |
---|
[2] | 427 | } |
---|
[26] | 428 | //----------------------------------------------------------- sending html code |
---|
| 429 | $vtp->Parse( $handle , 'sub', $sub ); |
---|
[2] | 430 | ?> |
---|