From cc12d640519a673d1a422cc608ca6ec1a59ef46e Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 17 Sep 2008 01:48:31 +0000 Subject: - fix status header (web services + IE6 min display) - sql optims in feed /notification - dont send cookie for 10 years from admin/history.php git-svn-id: http://piwigo.org/svn/trunk@2543 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_notification.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/functions_notification.inc.php') diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php index 259a34613..32d3ed9c7 100644 --- a/include/functions_notification.inc.php +++ b/include/functions_notification.inc.php @@ -35,7 +35,7 @@ * * @return string sql where */ -function get_std_sql_where_restrict_filter($prefix_condition, $force_one_condition = false) +function get_std_sql_where_restrict_filter($prefix_condition, $img_field='ic.image_id', $force_one_condition = false) { return get_sql_condition_FandF ( @@ -43,7 +43,7 @@ function get_std_sql_where_restrict_filter($prefix_condition, $force_one_conditi ( 'forbidden_categories' => 'ic.category_id', 'visible_categories' => 'ic.category_id', - 'visible_images' => 'ic.image_id' + 'visible_images' => $img_field ), $prefix_condition, $force_one_condition @@ -89,7 +89,7 @@ function custom_notification_query($action, $type, $start, $end) FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON image_id = id WHERE date_available > \''.$start.'\' AND date_available <= \''.$end.'\' - '.get_std_sql_where_restrict_filter('AND').' + '.get_std_sql_where_restrict_filter('AND', 'id').' ;'; break; case 'updated_categories': @@ -97,7 +97,7 @@ function custom_notification_query($action, $type, $start, $end) FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON image_id = id WHERE date_available > \''.$start.'\' AND date_available <= \''.$end.'\' - '.get_std_sql_where_restrict_filter('AND').' + '.get_std_sql_where_restrict_filter('AND', 'id').' ;'; break; case 'new_users': @@ -434,13 +434,13 @@ function get_recent_post_dates($max_dates, $max_elements, $max_cats) { global $conf, $user; - $where_sql = get_std_sql_where_restrict_filter('WHERE', true); + $where_sql = get_std_sql_where_restrict_filter('WHERE', 'i.id', true); $query = ' SELECT date_available, COUNT(DISTINCT id) nb_elements, COUNT(DISTINCT category_id) nb_cats - FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id + FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id '.$where_sql.' GROUP BY date_available ORDER BY date_available DESC @@ -459,7 +459,7 @@ SELECT date_available, { // get some thumbnails ... $query = ' SELECT DISTINCT id, path, name, tn_ext, file - FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id + FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id '.$where_sql.' AND date_available="'.$dates[$i]['date_available'].'" AND tn_ext IS NOT NULL -- cgit v1.2.3