diff --git a/common_config.php b/common_config.php index 7c33c0f..705028b 100644 --- a/common_config.php +++ b/common_config.php @@ -170,3 +170,23 @@ function set_curl_options($ch): void curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_ENCODING, ''); } + +function alt_links(): void +{ + global $language; + $canonical_query = []; + if(isset($_REQUEST['cat'])) { + $canonical_query['cat'] = $_REQUEST['cat']; + } + if(isset($_REQUEST['pg'])) { + $canonical_query['pg'] = $_REQUEST['pg']; + } + foreach(LANGUAGES as $lang => $data) { + if($lang === $language){ + continue; + } + $canonical_query['lang'] = $lang; + $link = CANONICAL_URL . $_SERVER['SCRIPT_NAME'] . '?' . http_build_query($canonical_query); + echo ''; + } +} diff --git a/www/admin.php b/www/admin.php index cc3d453..a1d6193 100644 --- a/www/admin.php +++ b/www/admin.php @@ -19,6 +19,8 @@ asort($categories); + +