diff --git a/www/index.php b/www/index.php
index 9ed9e71..e933e05 100644
--- a/www/index.php
+++ b/www/index.php
@@ -24,6 +24,7 @@ function send_html(): void
{
global $categories, $db, $language, $dir, $locale, $canonical_query;
$numrows = 0;
+ $not_found = false;
$style = '.row{display:flex;flex-wrap:wrap}.headerrow{font-weight:bold}.col{display:flex;flex:1;padding:3px 3px;flex-direction:column}';
$style .= '.red{color:red}.green{color:green}.up .col:nth-child(0n+3){background-color:#aaff88}.down .col:nth-child(0n+3){background-color:#ff4444}';
$style .= '.promo{outline:medium solid #FFD700}.list{padding:0;}.list li{display:inline-block;padding:0.35em}.pagination{font-size:1.2em}';
@@ -89,10 +90,32 @@ function send_html(): void
}
if ( $_REQUEST[ 'pg' ] > $pages && $_REQUEST[ 'pg' ] > 1 ) {
http_response_code( 404 );
+ $not_found = true;
}
}
+ if($not_found) {
+ $title = _( 'Onion link list - Not found');
+ }elseif(!empty($_REQUEST['q'])) {
+ $title = sprintf(_( 'Onion link list - Searching for %s' ), htmlspecialchars($_REQUEST['q']));
+ } elseif ($cat === count($categories) && $_REQUEST[ 'pg' ] > 1){
+ $title = sprintf(_( 'Onion link list - Page %d' ), $_REQUEST[ 'pg' ]);
+ } elseif ($cat < count($categories) && $_REQUEST[ 'pg' ] > 1){
+ $title = sprintf(_( 'Onion link list - %1$s - Page %2$d' ), $categories[$cat], $_REQUEST[ 'pg' ]);
+ } elseif ($cat < count($categories)){
+ $title = sprintf(_( 'Onion link list - %s' ), $categories[$cat]);
+ } elseif ($cat === count($categories) + 3){
+ $title = sprintf(_( 'Onion link list - %s' ), _('Phishing Clones'));
+ } elseif ($cat === count($categories) + 2 && $_REQUEST[ 'pg' ] > 1){
+ $title = sprintf(_( 'Onion link list - %1$s - Page %2$d' ), _('Offline > 1 week'), $_REQUEST['pg']);
+ } elseif ($cat === count($categories) + 2){
+ $title = sprintf(_( 'Onion link list - %s' ), _('Offline > 1 week'));
+ } elseif ($cat === count($categories) + 1){
+ $title = sprintf(_( 'Onion link list - %s' ), _('Last added'));
+ } else {
+ $title = _( 'Onion link list' );
+ }
echo '
';
- echo ''._('Onion link list').'';
+ echo ''.$title.'';
echo '';
echo '';
echo '';
@@ -102,15 +125,17 @@ function send_html(): void
echo '';
alt_links();
echo '';
- echo '';
+ echo '';
echo '';
echo '';
echo '';
- echo '';
+ if(empty($_SERVER['QUERY_STRING'])) {
+ echo '';
+ }
echo '';
echo '';
echo '';
- echo ''._('Onion link list').'
';
+ echo ''.$title.'
';
if(!isset($db)){
send_error(_('Error: No database connection!'));
}
@@ -182,7 +207,7 @@ function send_html(): void
echo '- '._('Special categories:').'
';
$cat=count($categories);
foreach($special as $name=>$query){
- echo ' - '."$name ($category_count[$cat])
";
+ echo ' - '."$name ($category_count[$cat])
";
++$cat;
}
echo ' - '._('Phishing Clones')." ($category_count[$cat])
";
diff --git a/www/robots.txt b/www/robots.txt
index 185a634..9c3cefd 100644
--- a/www/robots.txt
+++ b/www/robots.txt
@@ -1,4 +1,5 @@
User-agent: *
Disallow: /*?*addr=
+Disallow: /*?*q=
Allow: *
Sitemap: /sitemap.php
diff --git a/www/sitemap.php b/www/sitemap.php
index de2932a..4e94bcc 100644
--- a/www/sitemap.php
+++ b/www/sitemap.php
@@ -40,7 +40,7 @@ foreach (LANGUAGES as $lang_code => $data){
];
$cat=count($categories);
foreach($special as $query){
- $links []= ['loc' => CANONICAL_URL . "/?cat=$cat&lang=$lang_code", 'changefreq' => 'daily', 'priority' => '0.3'];
+ $links []= ['loc' => CANONICAL_URL . "/?".($cat===count($categories) ? '' : "cat=$cat&")."lang=$lang_code", 'changefreq' => 'daily', 'priority' => '0.3'];
if($cat===count($categories)+1){
$num[0]=PER_PAGE;
}else{