Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions actions/set_location.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@

} else {

$street = str_replace(" ", "%20", $_POST['street']);
$city = str_replace(" ", "%20", $_POST['city']);
$address = urlencode($_POST['street'] . ' ' . $_POST['city']);
//$filepath = rtrim($_SESSION['providerURL'], '/') . "/search?addressdetails=1&q=$address&format=json&limit=1";
$filepath=$_SESSION['providerURL']."/search?addressdetails=1&q=$address&format=json&limit=1";

$filepath=$_SESSION['providerURL']."/?addressdetails=1&q=".$street."%20".$city."&format=json&limit=1";
if ( strlen($_SESSION['staticKey']) == 32 ) {
if ( strlen($_SESSION['staticKey']) == 32 ) {
$filepath.="&key=".$_SESSION['staticKey'];
}

$request = file_get_contents($filepath);
//$request = file_get_contents($filepath);
$request = file_get_contents($filepath);
$request = mb_convert_encoding($request, 'UTF-8', 'auto'); // Ensures proper encoding
$json = json_decode($request, true);


if ( $request == "[]" ) {
header("Location: $redirect_url?type=display&page=area&return=error_update_location");
Expand Down
19 changes: 19 additions & 0 deletions custom_profile_msg.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
$conn2 = new mysqli($dbhost2 . ":" . $dbport2, $dbuser2, $dbpass2, $dbname2);
$conn2->set_charset("utf8");

// Use prepared statements to prevent SQL injection
$sql2 = "CALL user_curr_end(?)";
$stmt = $conn2->prepare($sql2);
$stmt->bind_param("i", $_SESSION['id']);
$stmt->execute();
$result2 = $stmt->get_result();

$custom_profile_msg = ""; // Initialize the variable
while ($row2 = $result2->fetch_assoc()) {
$custom_profile_msg = $row2['ends'];
}

$stmt->close(); // Close the prepared statement
$conn2->close(); // Close the database connection
?>
2 changes: 2 additions & 0 deletions include/db_connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
if ( !isset($conn) )
{
$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $_SESSION['dbname']);
// Set character set
$conn->set_charset("utf8mb4");
if ($conn->connect_errno) {
echo "Failed to connect to MySQL: " . $conn->connect_error;
exit();
Expand Down
2 changes: 1 addition & 1 deletion include/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@
<?php } ?>
<?php } ?>


<?php if ( isset($custom_profile_msg) ) { ?>
<button type='button' class='btn mt-3' style='width:100%; background-color:white; border: 2px solid darkgreen; padding:0px;'>
<font color=darkgreen size=2><?php echo $custom_profile_msg; ?></font>
</button>
<?php } ?>


<?php if ($_SESSION['type']=="discord:user" && !isset($admin_alarm) && $enable_telegram == "True") { ?>
<a href='<?php echo $redirect_url; ?>?type=display&page=migrate'>
<button type='button' class='btn mt-1' style='width:100%; background-color:white; border: 2px solid darkblue; padding:0px;'>
Expand Down
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
?>

<!DOCTYPE html>
<html lang="en">
<html lang="se">

<head>

Expand All @@ -25,7 +25,8 @@ function gtag(){dataLayer.push(arguments);}
}
?>

<meta charset="utf-8">
<meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html" charset="ISO-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
Expand Down
37 changes: 27 additions & 10 deletions locales/se.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"ALL": "ALLA",
"All": "Alla",
"ADD": "LÄGG TILL",
"ALL Monsters": "ALLA Pokémon",
"ALL Quests": "ALLA Quests",
"ALL Raids/Eggs": "ALLA Raider/Ägg",
"CANCEL": "Ångra",
"Cleaning Activated": "Städning Aktiverad",
"Cleaning activated on": "Städning aktiverad på",
"TRACK FOR ALL GYMS": "SPÅRA FÖR ALLA GYM",
"Alert on Battle Changes": "Avisera gym i strid",
"Donate": "Donera",
"command": "kommando",
"DELETE": "RADERA",
"DELETE ALL": "RADERA ALLT",
Expand Down Expand Up @@ -45,30 +49,42 @@
"This will delete all your Pokémon Alarms and cannot be undone, are you sure ?": "Detta tar bort alla dina Pokémon Alarm och kan inte ångras, är du säker?",
"This will delete all your Quests Alarms and cannot be undone, are you sure ?": "Detta tar bort alla dina Quest Alarm och kan inte ångras, är du säker?",
"WEIGHT": "VIKT",
"Weight": "Vikt (gram)",
"Include Pokemon with unknown IV": "Inkludera Pokémon med okänt IV",
"Use Areas": "Använd Områden",
"Set Distance": "Ställ in avstånd",
"Track PvP League": "Spåra PVP league",
"Gender": "Kön",
"Size": "Storlek",
"Clean": "Städa",
"Template": "Mall",
"Template:": "Mall:",
"APPLY TO ALL POKÉMON": "ANVÄND PÅ ALLA POKÈMON",
"NEW MONSTER ALARM": "NYTT MONSTER ALARM",
"AREAS": "OMRÅDEN",
"Your alarms are currently disabled!": "Dina Alarm är för närvarande inaktiverade!",
"You Request couldn't not be handled": "Din begäran kunde inte hanteras",
"Your location is not set. Distance settings won't be taken into account.": "Din plats är inte inställd. Avståndsinställningar kommer inte att inkluderas.",
"Form": "Form",
"Gender": "KÖN",
"Gender": "Kön",
"Male": "Manlig",
"Female": "Kvinnlig",
"Clean": "Städa",
"Yes": "Ja",
"No": "Nej",
"Apply to all Pokémon": "Använd på alla Pokémon",
"Apply to all Pokémon": "Använd på alla Pokèmon",
"NEW MONSTER ALARM": "NYTT POKÈMONALARM",
"Type": "Typ",
"Type": "Skriv",
"to display all Pokémon": "för att visa alla Pokémon",
"Search": "Sök",
"Submit": "Skicka",
"NEW RAID ALARM": "NYTT RAIDALARM",
"Select Egg Levels you want to add": "Välj vilka Ägg Levels du vill lägga till",
"Select Raid Levels you want to add": "Välj vilka Raid Levels du vill lägga till",
"Select Pokémon Quests you want to add": "Välj vilka Pokémon Quest du vill lägga till",
"Select the Raid Bosses you want to add": "Välj vilka RaidBossar du vill lägga till",
"Select Egg Levels you want to add": "Välj vilka Ägg du vill spåra",
"Select Raid Levels you want to add": "Välj vilka Raider du vill spåra",
"Select Pokémon Quests you want to add": "Välj vilka Pokémon Quest du vill spåra",
"Select the Raid Bosses you want to add": "Välj vilka RaidBossar du vill spåra",
"NEW QUEST ALARM": "NYTT QUESTALARM",
"Select Pokémon Quests you want to add (Pokemons Currently available on Map)": "Välj vilka Pokémon Quests du vill lägga till (Pokémon som för närvarande finns på kartan)",
"Select Pokémon Quests you want to add (Pokemons Currently available on Map)": "Välj vilka Pokémon Quests du vill spåra (Pokémon som för närvarande finns på kartan)",
"Pokemons Currently available on Map": "Pokémon för närvarande på kartan",
"Or use search below to add another pokemon": "Eller använd sökningen nedan för att lägga till en annan Pokémon",
"Select Quests Items you want to add": "Välj Item belöning som du vill lägga till",
Expand Down Expand Up @@ -335,7 +351,7 @@
"Successfully Updated Distance on ALL Gyms":"Avståndet för alla Gym uppdaterat",
"Delete ALL Gyms?":"Radera alla Gym alarm?",
"NEW GYMS ALARM":"NYTT GYM ALARM",
"ALL GYMS":"ALAL GYM",
"ALL GYMS":"ALLA GYM",
"Alert on Slots Available":"Avisera förändring av platser",
"Slots Available":"Lediga platser",
"Enable Options":"Aktivera val",
Expand Down Expand Up @@ -363,5 +379,6 @@
"Click the <i class='fas fa-plus'></i> button to quickly add a tracking":"Klicka på <i class='fas fa-plus'></i> för att snabbt lägga till en Spårning",
"Already tracked are shown in green":"Aktiva Spårningar visas i grönt",
"Template":"Mall",
"Dashboard": "Översikt"
"Dashboard": "Översikt",
"Search by name, type or ID": "Sök via namn, typ eller ID"
}
13 changes: 11 additions & 2 deletions pages/display/manage_channels.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
if (!isset($_SESSION['admin_id']) && !isset($_SESSION['channels_admin'])) {
header('Content-Type: text/html; charset=utf-8');
header("Location: $redirect_url");

exit();
}

Expand All @@ -10,6 +12,7 @@
$num_dbs=$num_dbs+1;
}


?>

<!-- Title -->
Expand Down Expand Up @@ -54,8 +57,10 @@
foreach ($dbnames as &$db) {

$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
// Set character set
$conn->set_charset("utf8mb4");
$sql = "select id, name, notes, type FROM humans WHERE type like 'discord:channel' ORDER by name";
$result = $conn->query($sql);
$result = $conn->query($sql);
?>

<?php if ($result->num_rows <> 0) { ?>
Expand Down Expand Up @@ -119,7 +124,9 @@ class="btn btn-primary btn-icon-split mr-2 mt-1">
foreach ($dbnames as &$db) {

$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
$sql = "select id, name, notes, type FROM humans WHERE type in ('telegram:channel','telegram:group') ORDER by name";
// Set character set
$conn->set_charset("utf8mb4");
$sql = "select id, name, notes, type FROM humans WHERE type in ('telegram:channel','telegram:group') ORDER by name";
$result = $conn->query($sql);
?>

Expand Down Expand Up @@ -183,6 +190,8 @@ class="btn btn-info btn-icon-split mr-2 mt-1">
foreach ($dbnames as &$db) {

$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
// Set character set
$conn->set_charset("utf8mb4");
$sql = "select id, name, notes, type FROM humans WHERE type like 'webhook' ORDER by name";
$result = $conn->query($sql);
?>
Expand Down
13 changes: 9 additions & 4 deletions pages/display/manage_users.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
if ( !isset($_SESSION['admin_id']) && !isset($_SESSION['users_admin']) ) {
header("Location: $redirect_url");
exit();
if (!isset($_SESSION['admin_id']) && !isset($_SESSION['channels_admin'])) {
header('Content-Type: text/html; charset=utf-8');
header("Location: $redirect_url");

exit();
}

$num_dbs=0;
Expand Down Expand Up @@ -72,6 +74,8 @@
// Get Discord Users

$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
// Set character set
$conn->set_charset("utf8mb4");
$sql = "select id, name, type FROM humans WHERE type like 'discord:user' ORDER by type,name";
$result = $conn->query($sql);
?>
Expand Down Expand Up @@ -105,8 +109,9 @@ class="btn btn-<?php if ($row['type']=='discord:user') { echo "primary"; } else
<?php }

// Get Discord Users

$conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db);
// Set character set
$conn->set_charset("utf8mb4");
$sql = "select id, name, type FROM humans WHERE type like 'telegram:user' ORDER by type,name";
$result = $conn->query($sql);
?>
Expand Down