aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_calendar.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/category_calendar.inc.php')
-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;