diff --git a/app/streams/stream_edit.php b/app/streams/stream_edit.php index 0e8fed235..48ef9e751 100644 --- a/app/streams/stream_edit.php +++ b/app/streams/stream_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018-2025 + Portions created by the Initial Developer are Copyright (C) 2018-2026 the Initial Developer. All Rights Reserved. */ @@ -41,6 +41,32 @@ $stream_description = ''; $stream_uuid = ''; +// Set variables from http GET parameters + $page = is_numeric($_GET['page'] ?? '') ? $_GET['page'] : 0; + $order_by = preg_replace('#[^a-zA-Z0-9_\-]#', '', ($_GET['order_by'] ?? 'stream_name')); + $order = ($_GET['order'] ?? '') === 'desc' ? 'desc' : 'asc'; + $search = $_GET['search'] ?? ''; + $show = $_GET['show'] ?? ''; + +// Build the query string + $param = []; + if (!empty($page)) { + $param['page'] = $page; + } + if (!empty($_GET['order_by'])) { + $param['order_by'] = $order_by; + } + if (!empty($_GET['order'])) { + $param['order'] = $order; + } + if (!empty($search)) { + $param['search'] = $search; + } + if (!empty($show) && $show == 'all' && permission_exists('stream_all')) { + $param['show'] = $show; + } + $query_string = http_build_query($param); + //action add or update if (!empty($_REQUEST["id"])) { $action = "update"; @@ -73,7 +99,7 @@ $token = new token; if (!$token->validate($_SERVER['PHP_SELF'])) { message::add($text['message-invalid_token'],'negative'); - header('Location: streams.php'); + header('Location: streams.php'.($query_string ? '?'.$query_string : '')); exit; } @@ -204,7 +230,7 @@ if ($action == "update") { $_SESSION["message"] = $text['message-update']; } - header('Location: stream_edit.php?id='.urlencode($stream_uuid)); + header('Location: stream_edit.php?id='.urlencode($stream_uuid).($query_string ? '&'.$query_string : '')); return; } } @@ -228,7 +254,7 @@ //need stream_all permission to edit a global stream if (!permission_exists('stream_all') && $domain_uuid == null) { - header('Location: streams.php'); + header('Location: streams.php'.($query_string ? '?'.$query_string : '')); return; } @@ -249,7 +275,7 @@ echo "
\n"; echo "
".$text['title-stream']."
\n"; echo "
\n"; - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back'),'id'=>'btn_back','link'=>'streams.php']); + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back'),'id'=>'btn_back','link'=>'streams.php'.($query_string ? '?'.$query_string : '')]); echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$settings->get('theme', 'button_icon_save'),'id'=>'btn_save','style'=>'margin-left: 15px;']); echo "
\n"; echo "
\n"; diff --git a/app/streams/stream_map.php b/app/streams/stream_map.php index 11021eef3..c3852fd10 100644 --- a/app/streams/stream_map.php +++ b/app/streams/stream_map.php @@ -59,7 +59,7 @@ //add the search variable if (!empty($_GET["search"])) { - $search = strtolower($_GET["search"]); + $search = $_GET["search"]; } //add the show variable @@ -121,7 +121,7 @@ $sql .= " or music like :search \n"; $sql .= " or description like :search \n"; $sql .= ") \n"; - $parameters['search'] = '%'.$search.'%'; + $parameters['search'] = '%'.lower_case($search).'%'; } if (!empty($excluded_applications)) { $sql .= "AND application NOT IN ('" . implode("','", $excluded_app_array) . "') \n"; @@ -151,16 +151,16 @@ echo "
\n"; echo "
".$text['title-stream_map']."
".number_format($num_rows)."
\n"; echo "
\n"; - echo "