diff options
author | nikrou <nikrou@piwigo.org> | 2009-11-25 19:02:57 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2009-11-25 19:02:57 +0000 |
commit | 13ea9d50e35d9dd8cf7235a39d97a344e6091ea0 (patch) | |
tree | a3c6e08df8ea10d0d5f56ffc2f1f14d6cbcfcd67 /include/category_cats.inc.php | |
parent | d30639ec98f8e2929137ab6e00cb2fe3ba295957 (diff) |
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
Diffstat (limited to 'include/category_cats.inc.php')
-rw-r--r-- | include/category_cats.inc.php | 8 |
1 files changed, 3 insertions, 5 deletions
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); |