aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_notification.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2010-07-06 20:11:06 +0000
committerrvelices <rv-github@modusoptimus.com>2010-07-06 20:11:06 +0000
commit6c7b53e0b6ee7fcd9c58570d999efa6d1bd158b8 (patch)
treeb1c9b048c3091ebb979e35964ed995d30413fa1e /include/functions_notification.inc.php
parent4845a85685c3d9cb02334dd78a008f58b0b98c10 (diff)
merge r6668 from trunk
- removed function get_extra_fields and its usage (unnecessary + perf issue when retrieving many image ids in a section) - 2 fixes recent feed.php commit * month names were decalated by one * strptime function is not implemented under Windows in php - added somme missing $ROOT_URL in templates git-svn-id: http://piwigo.org/svn/branches/2.1@6669 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_notification.inc.php')
-rw-r--r--include/functions_notification.inc.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php
index ebb713fb6..363ea7e58 100644
--- a/include/functions_notification.inc.php
+++ b/include/functions_notification.inc.php
@@ -79,7 +79,7 @@ function custom_notification_query($action, $type, $start, $end)
}
if (!empty($end))
{
- $query .= '
+ $query .= '
AND c.validation_date <= \''.$end.'\'';
}
$query .= get_std_sql_where_restrict_filter('AND').'
@@ -94,7 +94,7 @@ function custom_notification_query($action, $type, $start, $end)
$query .= ' AND date> \''.$start.'\'';
}
if (!empty($end))
- {
+ {
$query .= ' AND date <= \''.$end.'\'';
}
$query .= ' AND validated = \'false\'
@@ -619,9 +619,20 @@ function get_title_recent_post_date($date_detail)
$exploded_date = strptime($date, '%Y-%m-%d %H:%M:%S');
$title = l10n_dec('%d new image', '%d new images', $date_detail['nb_elements']);
- $title .= ' ('.$lang['month'][(int)$exploded_date['tm_mon']].' '.$exploded_date['tm_mday'].')';
+ $title .= ' ('.$lang['month'][1+$exploded_date['tm_mon']].' '.$exploded_date['tm_mday'].')';
return $title;
}
+if(!function_exists("strptime"))
+{
+ function strptime($date, $fmt)
+ {
+ if ($fmt != '%Y-%m-%d %H:%M:%S')
+ die('Invalid strptime format '.$fmt);
+ list($y,$m,$d,$H,$M,$S) = preg_split('/[-: ]/', $date);
+ $res = localtime( mktime($H,$M,$S,$m,$d,$y), true );
+ return $res;
+ }
+ }
?> \ No newline at end of file