diff --git a/db/_ddd_db.sqlite b/db/_ddd_db.sqlite
new file mode 100644
index 0000000..6369f7c
Binary files /dev/null and b/db/_ddd_db.sqlite differ
diff --git a/db/ddd_db.sqlite b/db/ddd_db.sqlite
new file mode 100644
index 0000000..c8aa2ca
Binary files /dev/null and b/db/ddd_db.sqlite differ
diff --git a/ddd_scores.php b/ddd_scores.php
index bddc96d..552ad46 100755
--- a/ddd_scores.php
+++ b/ddd_scores.php
@@ -1,76 +1,87 @@
";
+ echo "";
$query = "SELECT * FROM ddd_db.scores WHERE ddd_db.scores.Mode = 'DX' ORDER BY ddd_db.scores.Score DESC LIMIT 100";
} elseif ($mode == "EX") {
- echo "";
+ echo "";
$query = "SELECT * FROM ddd_db.scores WHERE ddd_db.scores.Mode = 'EX' ORDER BY ddd_db.scores.Score DESC LIMIT 100";
}
-?>
-query($query);
+$result = $db->query($query);
-if ($result->num_rows > 0) {
- // output data of each row
- $counter = 1;
+if ($result) {
+ // output data of each row
+ $counter = 1;
- echo "
";
+ echo "
";
- while ($row = $result->fetch_assoc()) {
- $output = "" . $counter . " " . $row["Name"] . "" . " " .
- "" . number_format($row["Score"]) . "";
+ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
+ $output = "" . $counter . " " . $row["Name"] . "" . " " .
+ "" . number_format($row["Score"]) . "";
- // Retrieve the boss names and split them into an array
- $bosses = explode(",", $row["Bosses"]);
+ // Retrieve the boss names and split them into an array
+ $bosses = explode(",", $row["Bosses"]);
- echo "
";
- echo "
";
- echo $output;
- echo "
";
+ echo "
";
+ echo "
";
+ echo $output;
+ echo "
";
- if (!empty($bosses)) {
- echo "
";
+ if (!empty($bosses)) {
+ echo "
";
// Display an image for each boss name
foreach ($bosses as $boss) {
$bossImage = trim(strtolower($boss)) . ".png";
if($bossImage != ".png"){
echo "
";
- echo "";
+ echo "";
echo "
" . $boss . "
";
echo "
";
}
}
- echo "
";
+
+ echo "
";
+ }
+
+ echo "
";
+
+ $counter++;
}
- echo "";
-
- $counter++;
- }
-
- echo "";
+ echo "";
} else {
- echo " 0 results";
+ echo " 0 results";
}
-$conn->close();
+$db->close();
?>
-
Back
diff --git a/example.config.cfg b/example.config.cfg
index 3c15d08..b1b42cf 100755
--- a/example.config.cfg
+++ b/example.config.cfg
@@ -1,13 +1,23 @@
+[options]
+database="sqlite" #sqlite or mysql
+
[mysql]
mysqlconnect_path="/var/config/mysqlconnect.php"
host="localhost"
-username="user"
-database="database"
-password="password"
+username="dbUser"
+database="dbName"
+password="dbPassword"
-#To use this file, run the following
-# cp example.config.cfg config.cfg
-# mkdir /var/config
-# cp example.mysqlconnect.php
-# Change the password, do not remove the quotes
-# Access the admin page at yourwebsite.com/update_db.php
\ No newline at end of file
+[sqlite]
+password="CHANGE_ME!" #This is used to manage the sqlite database from a ui at /update_db.php
+
+# To use this file, run setup.sh with bash
+# or you can use
+#
+# cp example.config.cfg config.cfg
+# cp example.mysqlconnect.php /var/config/mysqlconnect.php
+# chmod 755 /var/config/mysqlconnect.php
+#
+# and manually enter the values into the config.cfg file
+# the mysqlconnect.php is moved to /var/config to be outside the scope of the end user,
+# you can place it elsewhere if you desire, be sure to update the mysqlconnect_path variable
\ No newline at end of file
diff --git a/index.php b/index.php
index 41cbfe6..b278019 100755
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
-
+
+
+
+ query("SELECT * FROM scores WHERE Mode = 'DX' ORDER BY Score DESC");
+
+ // Display the rows
+ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
+ echo "
+
+
+ query("SELECT * FROM scores WHERE Mode = 'EX' ORDER BY Score DESC");
+
+ // Display the rows
+ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
+ echo "