Changeset 606 for trunk/include/functions.inc.php
- Timestamp:
- Nov 17, 2004, 12:38:34 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r599 r606 571 571 * given element 572 572 * 573 * this function could have taken only the element id as parameter but to574 * optimize database access we directly ask file, storage category575 * identifier and extension since when this function is called,576 * PhpWebGallery should have all these infos. No need to retrieve them577 * another time in the database.578 *579 573 * the returned string can represente the filepath of the thumbnail or the 580 574 * filepath to the corresponding icon for non picture elements 581 575 * 582 * complete directories are cached to be used more than once during a page 583 * generation (many thumbnails of the same category on the same page) 584 * 585 * @param string file 586 * @param int storage_category_id 576 * @param string path 587 577 * @param string tn_ext 588 578 * @return string 589 579 */ 590 function get_thumbnail_src($file, $storage_category_id, $tn_ext = '') 591 { 592 global $conf, $user, $array_cat_directories; 593 594 if (!isset($array_cat_directories[$storage_category_id])) 595 { 596 $array_cat_directories[$storage_category_id] = 597 get_complete_dir($storage_category_id); 598 } 599 580 function get_thumbnail_src($path, $tn_ext = '') 581 { 582 global $conf, $user; 583 600 584 if ($tn_ext != '') 601 585 { 602 $src = $array_cat_directories[$storage_category_id]; 603 $src.= 'thumbnail/'.$conf['prefix_thumbnail']; 604 $src.= get_filename_wo_extension($file); 586 $src = substr_replace(get_filename_wo_extension($path), 587 '/thumbnail/'.$conf['prefix_thumbnail'], 588 strrpos($path,'/'), 589 1); 605 590 $src.= '.'.$tn_ext; 606 591 } … … 609 594 $src = PHPWG_ROOT_PATH; 610 595 $src.= 'template/'.$user['template'].'/mimetypes/'; 611 $src.= strtolower(get_extension($ file)).'.png';612 } 613 596 $src.= strtolower(get_extension($path)).'.png'; 597 } 598 614 599 return $src; 615 600 }
Note: See TracChangeset
for help on using the changeset viewer.