aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_default.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_default.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_default.inc.php28
1 files changed, 5 insertions, 23 deletions
diff --git a/include/category_default.inc.php b/include/category_default.inc.php
index 56b43524c..0bed31a36 100644
--- a/include/category_default.inc.php
+++ b/include/category_default.inc.php
@@ -61,15 +61,6 @@ if ( mysql_num_rows($result) > 0 )
while ($row = mysql_fetch_array($result))
{
- // retrieving the storage dir of the picture
- if (!isset($array_cat_directories[$row['storage_category_id']]))
- {
- $array_cat_directories[$row['storage_category_id']] =
- get_complete_dir($row['storage_category_id']);
- }
- $cat_directory = $array_cat_directories[$row['storage_category_id']];
-
- $file = get_filename_wo_extension($row['file']);
// name of the picture
if (isset($row['name']) and $row['name'] != '')
{
@@ -77,7 +68,7 @@ while ($row = mysql_fetch_array($result))
}
else
{
- $name = str_replace('_', ' ', $file);
+ $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
}
if ($page['cat'] == 'best_rated')
{
@@ -88,19 +79,10 @@ while ($row = mysql_fetch_array($result))
{
$name = replace_search($name, $_GET['search']);
}
- // thumbnail url
- if (isset($row['tn_ext']) and $row['tn_ext'] != '')
- {
- $thumbnail_url = $cat_directory;
- $thumbnail_url.= 'thumbnail/'.$conf['prefix_thumbnail'];
- $thumbnail_url.= $file.'.'.$row['tn_ext'];
- }
- else
- {
- $thumbnail_url = PHPWG_ROOT_PATH;
- $thumbnail_url.= 'template/'.$user['template'].'/mimetypes/';
- $thumbnail_url.= strtolower(get_extension($row['file'])).'.png';
- }
+
+ $thumbnail_url = get_thumbnail_src($row['file'],
+ $row['storage_category_id'],
+ @$row['tn_ext']);
// message in title for the thumbnail
$thumbnail_title = $row['file'];