Show the queue and hidden stories to editors only.

With allow_queue_image in the session, queue=1 showed a visitor the whole
queue and the hidden stories. display.php now shows a visitor only the
image they submitted.
This commit is contained in:
tim
2026-09-25 21:26:32 +02:00
parent 0e5e742210
commit cda0602c95
2 changed files with 13 additions and 8 deletions
+5 -5
View File
@@ -118,7 +118,7 @@ function get_count() {
} else {
$count_query = "SELECT COUNT(*) FROM ".$table." WHERE 1";
}
if (!$is_admin && !$queue)
if (!$is_admin)
$count_query .= " AND hidden IS NOT TRUE";
$count_query .= " ;";
@@ -152,7 +152,7 @@ function get_query($id = NULL) {
// If id= is defined, show the corresponding application only
if (is_numeric($id)) {
if (!$is_admin && !$queue)
if (!$is_admin)
$query = "SELECT * FROM $table WHERE 1 AND hidden IS NOT TRUE AND id = ".$id." LIMIT 0, 1";
else
$query = "SELECT * FROM $table WHERE 1 AND id = ".$id." LIMIT 0, 1";
@@ -165,13 +165,13 @@ function get_query($id = NULL) {
" OR date LIKE '%".$search."%'".
" OR story LIKE '%".$search."%'".
" )";
if (!$is_admin && !$queue)
if (!$is_admin)
$query .= " AND hidden IS NOT TRUE";
$query .= " ORDER BY ".$sort." " .$order." LIMIT " .$start." , ".$show." ;";
// Otherwise, fall back to default view
} else {
$query = "SELECT * FROM ".$table." WHERE 1";
if (!$is_admin && !$queue)
if (!$is_admin)
$query .= " AND hidden IS NOT TRUE";
$query .= " ORDER BY ".$sort." " .$order." LIMIT " .$start." , ".$show." ;";
}
@@ -349,7 +349,7 @@ function which_table($move = FALSE, $action = 'read') {
return 'queue';
// Viewing
} else if ($queue && ($is_admin || isset($_SESSION['allow_queue_image']))) {
} else if ($queue && $is_admin) {
return 'queue';
} else {
return 'xxx';