aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_calendar.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-08-05 17:38:14 +0000
committerz0rglub <z0rglub@piwigo.org>2004-08-05 17:38:14 +0000
commitcedd2515b6b21404a419c1381a58b634b38aa304 (patch)
tree2da686a93e81d8e6f3a30b255bb7407d87e4c21e /include/category_calendar.inc.php
parent011d68c4d63f5cab39862f05ff1ae9b799e11df3 (diff)
non picture files management
git-svn-id: http://piwigo.org/svn/trunk@470 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/category_calendar.inc.php58
1 files changed, 45 insertions, 13 deletions
diff --git a/include/category_calendar.inc.php b/include/category_calendar.inc.php
index 0c44c5ea8..6ce68f31d 100644
--- a/include/category_calendar.inc.php
+++ b/include/category_calendar.inc.php
@@ -234,9 +234,17 @@ SELECT file,tn_ext,date_available,storage_category_id
$file = get_filename_wo_extension($row['file']);
// creating links for thumbnail and associated category
- $thumbnail_link = get_complete_dir($row['storage_category_id']);
- $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
- $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ if (isset($row['tn_ext']) and $row['tn_ext'] != '')
+ {
+ $thumbnail_link = get_complete_dir($row['storage_category_id']);
+ $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
+ $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ }
+ else
+ {
+ $thumbnail_link = './template/'.$user['template'].'/mimetypes/';
+ $thumbnail_link.= strtolower(get_extension($row['file'])).'.png';
+ }
$name = $calendar_year.' ('.$nb_pics.')';
@@ -284,11 +292,19 @@ SELECT file,tn_ext,date_available,storage_category_id
$row = mysql_fetch_array(mysql_query($query));
$file = get_filename_wo_extension($row['file']);
-
+
// creating links for thumbnail and associated category
- $thumbnail_link = get_complete_dir($row['storage_category_id']);
- $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
- $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ if (isset($row['tn_ext']) and $row['tn_ext'] != '')
+ {
+ $thumbnail_link = get_complete_dir($row['storage_category_id']);
+ $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
+ $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ }
+ else
+ {
+ $thumbnail_link = './template/'.$user['template'].'/mimetypes/';
+ $thumbnail_link.= strtolower(get_extension($row['file'])).'.png';
+ }
$name = $lang['month'][$calendar_month];
$name.= ' '.$page['calendar_year'];
@@ -344,9 +360,17 @@ SELECT file,tn_ext,date_available,storage_category_id
$file = get_filename_wo_extension($row['file']);
// creating links for thumbnail and associated category
- $thumbnail_link = get_complete_dir($row['storage_category_id']);
- $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
- $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ if (isset($row['tn_ext']) and $row['tn_ext'] != '')
+ {
+ $thumbnail_link = get_complete_dir($row['storage_category_id']);
+ $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
+ $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ }
+ else
+ {
+ $thumbnail_link = './template/'.$user['template'].'/mimetypes/';
+ $thumbnail_link.= strtolower(get_extension($row['file'])).'.png';
+ }
list($year,$month,$day) = explode('-', $calendar_day);
$unixdate = mktime(0,0,0,$month,$day,$year);
@@ -416,9 +440,17 @@ SELECT file,tn_ext,date_available,storage_category_id
$file = get_filename_wo_extension($row['file']);
// creating links for thumbnail and associated category
- $thumbnail_link = get_complete_dir($row['storage_category_id']);
- $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
- $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ if (isset($row['tn_ext']) and $row['tn_ext'] != '')
+ {
+ $thumbnail_link = get_complete_dir($row['storage_category_id']);
+ $thumbnail_link.= 'thumbnail/'.$conf['prefix_thumbnail'];
+ $thumbnail_link.= $file.'.'.$row['tn_ext'];
+ }
+ else
+ {
+ $thumbnail_link = './template/'.$user['template'].'/mimetypes/';
+ $thumbnail_link.= strtolower(get_extension($row['file'])).'.png';
+ }
$thumbnail_title = $lang['calendar_picture_hint'].$name;