From 13ea9d50e35d9dd8cf7235a39d97a344e6091ea0 Mon Sep 17 00:00:00 2001 From: nikrou Date: Wed, 25 Nov 2009 19:02:57 +0000 Subject: Feature 1255: modification in sql queries - manage random function - manage regex syntax - manage quote (single instead of double) - manage interval git-svn-id: http://piwigo.org/svn/trunk@4367 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/category_cats.inc.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/category_cats.inc.php') diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php index dfd009519..e9e7b0e7c 100644 --- a/include/category_cats.inc.php +++ b/include/category_cats.inc.php @@ -35,9 +35,7 @@ SELECT c.*, nb_images, date_last, max_date_last, count_images, count_categories FROM '.CATEGORIES_TABLE.' c INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ON id = cat_id and user_id = '.$user['id'].' - WHERE date_last >= SUBDATE( - CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY - ) + WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']).' '.get_sql_condition_FandF ( array @@ -104,7 +102,7 @@ SELECT image_id ), "\n AND" ).' - ORDER BY RAND() + ORDER BY '.DB_RANDOM_FUNCTION.'() LIMIT 1 ;'; $subresult = pwg_query($query); @@ -132,7 +130,7 @@ SELECT image_id ), "\n AND" ).' - ORDER BY RAND() + ORDER BY '.DB_RANDOM_FUNCTION.'() LIMIT 1 ;'; $subresult = pwg_query($query); -- cgit v1.2.3