aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_recent_cats.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-10-23 17:56:46 +0000
committerz0rglub <z0rglub@piwigo.org>2004-10-23 17:56:46 +0000
commit98b65edb831e95695cc840692ab8ad294478f80d (patch)
tree2b1ffe5ba3c8bc1fcdb209e8f8d793bd18e9dd1d /include/category_recent_cats.inc.php
parent60ac6f180e9500c6fea0c872277f107f05d7d26d (diff)
- refactoring of comments.php
- creation of function get_thumbnail_src used everywhere a thumbnail must be displayed - creation of function parse_comment_content (used in comments.php and picture.php) - concerning undefined index on arrays retrieved in database, instead of testing possibly unset values, use of @ operator (smarter...) - add pre tag in default.css stylesheet for debugging purpose (need to have left aligned text) git-svn-id: http://piwigo.org/svn/trunk@579 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/category_recent_cats.inc.php19
1 files changed, 4 insertions, 15 deletions
diff --git a/include/category_recent_cats.inc.php b/include/category_recent_cats.inc.php
index 283d15ec6..a71148353 100644
--- a/include/category_recent_cats.inc.php
+++ b/include/category_recent_cats.inc.php
@@ -77,27 +77,16 @@ SELECT id,file,tn_ext,storage_category_id
;';
$subrow = mysql_fetch_array( mysql_query( $query ) );
- $file = get_filename_wo_extension( $subrow['file'] );
-
- // creating links for thumbnail and associated category
- if (isset($subrow['tn_ext']) and $subrow['tn_ext'] != '')
- {
- $thumbnail_link = get_complete_dir($subrow['storage_category_id']);
- $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
- $thumbnail_link.= $file.'.'.$subrow['tn_ext'];
- }
- else
- {
- $thumbnail_link = './template/'.$user['template'].'/mimetypes/';
- $thumbnail_link.= strtolower(get_extension($subrow['file'])).'.png';
- }
+ $thumbnail_src = get_thumbnail_src($subrow['file'],
+ $subrow['storage_category_id'],
+ @$subrow['tn_ext']);
$url_link = PHPWG_ROOT_PATH.'category.php?cat='.$row['category_id'];
$template->assign_block_vars(
'thumbnails.line.thumbnail',
array(
- 'IMAGE' => $thumbnail_link,
+ 'IMAGE' => $thumbnail_src,
'IMAGE_ALT' => $subrow['file'],
'IMAGE_TITLE' => $lang['hint_category'],
'IMAGE_NAME' => '['.$name.']',