From 64836fa7d99d0bbca8bce4baea7e30657539e688 Mon Sep 17 00:00:00 2001 From: mdPlusPlus Date: Wed, 4 Jan 2023 01:40:17 +0100 Subject: [PATCH] Add language flags --- get_online_session_communities.php | 15 +++-- language_flags.php | 98 ++++++++++++++++++++++++++++++ output/script.js | 10 +-- output/styles.css | 1 + 4 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 language_flags.php diff --git a/get_online_session_communities.php b/get_online_session_communities.php index 3b652d1..6dbd361 100644 --- a/get_online_session_communities.php +++ b/get_online_session_communities.php @@ -3,6 +3,7 @@ // require other php files require "helper_functions.php"; + require "language_flags.php"; // some global stuff @@ -526,6 +527,7 @@ * Token + shortened pubkey | Name | Description | Users | View Links(?) | Join URL */ function get_table_html($room_assignments_arr) { + global $languages; $shortened_pubkey_length = 4; // shorten pubkey to this length to make room token unique // contains the info for each line of the table $ordered_table_elements = array(); @@ -548,6 +550,7 @@ $info_array = array( "name" => $room_array["name"], + "language" => $languages[$identifier], "description" => $room_array["description"], "active_users" => $room_array["active_users"], "join_link" => $join_link @@ -591,6 +594,7 @@ $line = " " . PHP_EOL . " " . $id . "" . PHP_EOL . + " " . $content["language"] . "" . PHP_EOL . " " . $content["name"] . "" . PHP_EOL . " " . $content["description"] . "" . PHP_EOL . " " . $active_users . "" . PHP_EOL . @@ -608,11 +612,12 @@ "" . PHP_EOL . " " . PHP_EOL . " " . PHP_EOL . - " " . PHP_EOL . - " " . PHP_EOL . - " " . PHP_EOL . - " " . PHP_EOL . - " " . PHP_EOL . + " " . PHP_EOL . + " " . PHP_EOL . + " " . PHP_EOL . + " " . PHP_EOL . + " " . PHP_EOL . + " " . PHP_EOL . " " . PHP_EOL; // suffix diff --git a/language_flags.php b/language_flags.php new file mode 100644 index 0000000..2c6bb2b --- /dev/null +++ b/language_flags.php @@ -0,0 +1,98 @@ + "", + "brasil+118d" => "🇵🇹", + "deutsch+118d" => "🇩🇪", + "espanol+118d" => "🇪🇸", + "francais+118d" => "🇫🇷", + "gaming+118d" => "", + "health+118d" => "", + "im+118d" => "🇬🇧", + "italiano+118d" => "🇮🇹", + "linux+118d" => "", + "modernsurvival+118d" => "", + "music+118d" => "", + "nl+118d" => "🇳🇱", + "persian+118d" => "🇮🇷", + "portugues+118d" => "🇵🇹", + "privacy+118d" => "", + "russian+118d" => "🇷🇺", + "snops+118d" => "🇬🇧", + "sogops+118d" => "🇬🇧", + "travel+118d" => "", + "unix+118d" => "" + ); + + // http://45.77.102.159/ + $languages_132d = array( + "kat67world+132d" => "", + "origin+132d" => "🇨🇳", + "scammer+132d" => "" + ); + + // http://173.249.51.184/ + $languages_2812 = array( + "fi+2812" => "🇫🇮", + "main+2812" => "", + "scandinavia+2812" => "" + ); + + // http://95.217.236.112/ + $languages_8e2e = array( + "CrazyGamers+8e2e" => "", + "fishing+8e2e" => "", + "ohjelmointisuomi+8e2e" => "🇫🇮", + "pk+8e2e" => "🇫🇮", + "SuomenTori+8e2e" => "🇫🇮", + "suomentoriv2+8e2e" => "🇫🇮", + "tori+8e2e" => "" + ); + + // https://open.getsession.org/ + $languages_a03c = array( + "crypto+a03c" => "🇬🇧", + "lokinet+a03c" => "🇬🇧", + "oxen+a03c" => "🇬🇧", + "session-farsi+a03c" => "🇮🇷", + "session-updates+a03c" => "🇬🇧", + "session+a03c" => "🇬🇧" + ); + + // http://185.130.45.173/ + $languages_b79f = array( + "cryptography+b79f" => "", + "philosophy+b79f" => "", + "trading+b79f" => "", + "uncensored+b79f" => "", + "webdev+b79f" => "🇬🇧" + ); + + // http://open.session.codes/ + $languages_c7fb = array( + "4c2ba1+c7fb" => "🇪🇸", + "6e7b5f+c7fb" => "", + "90ca71+c7fb" => "🇷🇺", + "a80d69+c7fb" => "", + "d8dc40+c7fb" => "🇪🇸", + "edb497+c7fb" => "🇨🇳", + "sc+c7fb" => "" + ); + + // http://95.179.250.131/ + $languages_e5e0 = array( + "generalchat+e5e0" => "", + "nsfw+e5e0" => "", + "public+e5e0" => "🇬🇧" + ); + + $languages = array_merge( + $languages_118d, + $languages_132d, + $languages_8e2e, + $languages_a03c, + $languages_b79f, + $languages_c7fb, + $languages_e5e0 + ); +?> diff --git a/output/script.js b/output/script.js index 85aa95b..cfb0193 100644 --- a/output/script.js +++ b/output/script.js @@ -1,7 +1,7 @@ function onLoad(timestamp) { setLastChecked(timestamp); hideBadCommunities(); - sortTable(1); // 1 == Name + sortTable(2); // 2 == Name } function hideBadCommunities() { @@ -62,8 +62,8 @@ function sortTable(n) { y = rows[i + 1].getElementsByTagName("TD")[n]; // Check if the two rows should switch place, based on the direction, asc or desc: if (dir == "asc") { - // If columns is users (3), sort numerically - if ( n == 3 ) { + // If columns is users (4), sort numerically + if ( n == 4 ) { if (Number(x.innerHTML) > Number(y.innerHTML)) { shouldSwitch = true; break; @@ -75,8 +75,8 @@ function sortTable(n) { } } else if (dir == "desc") { - if ( n == 3 ) { - // If columns is users (3), sort numerically + if ( n == 4 ) { + // If columns is users (4), sort numerically if (Number(x.innerHTML) < Number(y.innerHTML)) { shouldSwitch = true; break; diff --git a/output/styles.css b/output/styles.css index 14ce9ff..abb0372 100644 --- a/output/styles.css +++ b/output/styles.css @@ -5,6 +5,7 @@ #th_identifier { width:9%; } .td_identifier { font-family: monospace; } #th_name { width:13%; } +#th_language { width:16px } #th_description { } #th_users { } .td_users { text-align: right; }
IdentifierNameDescriptionUsersPreviewJoin URLLNameDescriptionUsersPreviewJoin URL