aboutsummaryrefslogtreecommitdiffstats
path: root/action.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2007-02-14 22:53:02 +0000
committerplegall <plg@piwigo.org>2007-02-14 22:53:02 +0000
commitaabdb3e9295474760b2d3fd5d76d2c235970fe16 (patch)
treea2ced85a4923136c28fd963f52b28f8348cd830f /action.php
parent58a359e3c17b711be1663985e5e7801407eb50ed (diff)
New: history logs high quality access via action.php. A new column
#history.is_high was added. Filter was added on administration history detail view. Modification: function get_sql_condition_FandF was slightly refactored for presentation improvement. git-svn-id: http://piwigo.org/svn/trunk@1817 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--action.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/action.php b/action.php
index 586d730a3..73ac6d72b 100644
--- a/action.php
+++ b/action.php
@@ -61,17 +61,17 @@ function do_error( $code, $str )
}
-if ( !isset($_GET['id']) or !is_numeric($_GET['id'])
+if (!isset($_GET['id'])
+ or !is_numeric($_GET['id'])
or !isset($_GET['part'])
or !in_array($_GET['part'], array('t','e','i','h') ) )
{
do_error(400, 'Invalid request - id/part');
}
-$id = $_GET['id'];
$query = '
SELECT * FROM '. IMAGES_TABLE.'
- WHERE id='.$id.'
+ WHERE id='.$_GET['id'].'
;';
$result = pwg_query($query);
@@ -84,11 +84,14 @@ if ( empty($element_info) )
// $filter['visible_categories'] and $filter['visible_images']
// are not used because it's not necessary (filter <> restriction)
$query='
-SELECT id FROM '.CATEGORIES_TABLE.'
- INNER JOIN '.IMAGE_CATEGORY_TABLE.'
- ON category_id=id
- WHERE image_id='.$id.'
-'.get_sql_condition_FandF(array('forbidden_categories' => 'category_id'), 'AND').'
+SELECT id
+ FROM '.CATEGORIES_TABLE.'
+ INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON category_id = id
+ WHERE image_id = '.$_GET['id'].'
+'.get_sql_condition_FandF(
+ array('forbidden_categories' => 'category_id'),
+ ' AND'
+ ).'
LIMIT 1
;';
if ( mysql_num_rows(pwg_query($query))<1 )
@@ -123,6 +126,11 @@ if ( empty($file) )
do_error(404, 'Requested file not found');
}
+if ($_GET['part'] == 'h') {
+ $is_high = true;
+ pwg_log($_GET['id'], $is_high);
+}
+
$http_headers = array();
$ctype = null;