diff options
author | rvelices <rv-github@modusoptimus.com> | 2008-09-17 01:48:31 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2008-09-17 01:48:31 +0000 |
commit | cc12d640519a673d1a422cc608ca6ec1a59ef46e (patch) | |
tree | 988c8cb507ee9561d5b96f30974dbb2753c426b6 /include/functions_notification.inc.php | |
parent | 7ea85bc0355c7ad60c51a4a1d3078e3dc4603031 (diff) |
- 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
Diffstat (limited to 'include/functions_notification.inc.php')
-rw-r--r-- | include/functions_notification.inc.php | 14 |
1 files changed, 7 insertions, 7 deletions
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 |