aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/functions_category.inc.php7
-rw-r--r--template/default/htmlfunctions.inc.php11
2 files changed, 15 insertions, 3 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index 77f0234a3..ec7d97a51 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -107,8 +107,11 @@ function get_user_plain_structure()
foreach ( $infos as $info ) {
if ( $info == 'uc.date_last' )
{
- list($year,$month,$day) = explode( '-', $row['date_last'] );
- $category['date_last'] = mktime(0,0,0,$month,$day,$year);
+ if ( isset( $row['date_last'] ) and $row['date_last'] != '' )
+ {
+ list($year,$month,$day) = explode( '-', $row['date_last'] );
+ $category['date_last'] = mktime(0,0,0,$month,$day,$year);
+ }
}
else if ( isset( $row[$info] ) ) $category[$info] = $row[$info];
else $category[$info] = '';
diff --git a/template/default/htmlfunctions.inc.php b/template/default/htmlfunctions.inc.php
index ad52bfc13..e37597835 100644
--- a/template/default/htmlfunctions.inc.php
+++ b/template/default/htmlfunctions.inc.php
@@ -25,6 +25,12 @@ $user['lien_collapsed']='./template/'.$user['template'].'/theme/collapsed.gif';
function get_icon( $date_comparaison )
{
global $user, $conf;
+
+ if ( !is_numeric( $date_comparaison ) )
+ {
+ return '';
+ }
+
$difference = time() - $date_comparaison;
$jours = 24*60*60;
$output = '';
@@ -230,7 +236,10 @@ function display_category( $category, $indent, $handle )
$vtp->closeSession( $handle, 'subcat' );
}
$vtp->setVar( $handle, 'category.total_cat', $category['nb_images'] );
- $vtp->setVar( $handle, 'category.cat_icon',get_icon($category['date_last']));
+ if ( isset( $category['date_last'] ) )
+ {
+ $vtp->setVar($handle,'category.cat_icon',get_icon($category['date_last']));
+ }
$vtp->closeSession( $handle, 'category' );
// recursive call