Started conversion to sqlite for easier end user setup
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
@ -1,12 +1,12 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<body>
|
<body>
|
||||||
<a href="ddd_scores.php?mode=DX">
|
<a href="ddd_scores.php?mode=DX">
|
||||||
<img src="/ddddxhs_files/top100dx.png" alt="Top 100 DX Mode">
|
<img src="ddddxhs_files/top100dx.png" alt="Top 100 DX Mode">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<a href="ddd_scores.php?mode=EX">
|
<a href="ddd_scores.php?mode=EX">
|
||||||
<img src="/ddddxhs_files/top100ex.png" alt="Top 100 EX Mode">
|
<img src="ddddxhs_files/top100ex.png" alt="Top 100 EX Mode">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -1,71 +1,68 @@
|
||||||
<?php
|
<?php
|
||||||
echo file_get_contents("ddd_source.html");
|
echo file_get_contents("ddd_source.html");
|
||||||
include('/var/config/mysqlconnect.php');
|
|
||||||
|
$db_path = 'db/ddd_db.sqlite';
|
||||||
|
$db = new SQLite3($db_path);
|
||||||
|
|
||||||
$mode = $_REQUEST['mode'];
|
$mode = $_REQUEST['mode'];
|
||||||
|
|
||||||
if ($mode == "DX") {
|
if ($mode == "DX") {
|
||||||
echo "<img src='/ddddxhs_files/top100dx.png' alt='Top 100 DX Mode'>";
|
echo "<img src='ddddxhs_files/top100dx.png' alt='Top 100 DX Mode'>";
|
||||||
$query = "SELECT * FROM ddd_db.scores WHERE ddd_db.scores.Mode = 'DX' ORDER BY ddd_db.scores.Score DESC LIMIT 100";
|
$query = "SELECT * FROM scores WHERE Mode = 'DX' ORDER BY Score DESC LIMIT 100";
|
||||||
} elseif ($mode == "EX") {
|
} elseif ($mode == "EX") {
|
||||||
echo "<img src='/ddddxhs_files/top100ex.png' alt='Top 100 EX Mode'>";
|
echo "<img src='ddddxhs_files/top100ex.png' alt='Top 100 EX Mode'>";
|
||||||
$query = "SELECT * FROM ddd_db.scores WHERE ddd_db.scores.Mode = 'EX' ORDER BY ddd_db.scores.Score DESC LIMIT 100";
|
$query = "SELECT * FROM scores WHERE Mode = 'EX' ORDER BY Score DESC LIMIT 100";
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
$result = $db->query($query);
|
||||||
$result = $conn->query($query);
|
|
||||||
|
|
||||||
if ($result->num_rows > 0) {
|
if ($result) {
|
||||||
// output data of each row
|
// output data of each row
|
||||||
$counter = 1;
|
$counter = 1;
|
||||||
|
|
||||||
echo "<div class='top3'>";
|
echo "<div class='top3'>";
|
||||||
|
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||||
$output = "<span id='player'>" . $counter . " " . $row["Name"] . "</span>" . " " .
|
$output = "<span id='player'>" . $counter . " " . $row["Name"] . "</span>" . " " .
|
||||||
"<span id='score'>" . number_format($row["Score"]) . "</span>";
|
"<span id='score'>" . number_format($row["Score"]) . "</span>";
|
||||||
|
|
||||||
// Retrieve the boss names and split them into an array
|
// Retrieve the boss names and split them into an array
|
||||||
$bosses = explode(",", $row["Bosses"]);
|
$bosses = explode(",", $row["Bosses"]);
|
||||||
|
|
||||||
echo "<li class='scoreEntry " . ($counter % 2 == 0 ? 'even' : 'odd') . "'>";
|
echo "<li class='scoreEntry " . ($counter % 2 == 0 ? 'even' : 'odd') . "'>";
|
||||||
echo "<div class='scoreInfo'>";
|
echo "<div class='scoreInfo'>";
|
||||||
echo $output;
|
echo $output;
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
|
||||||
if (!empty($bosses)) {
|
if (!empty($bosses)) {
|
||||||
echo "<div class='bossImages'>";
|
echo "<div class='bossImages'>";
|
||||||
|
|
||||||
// Display an image for each boss name
|
// Display an image for each boss name
|
||||||
foreach ($bosses as $boss) {
|
foreach ($bosses as $boss) {
|
||||||
$bossImage = trim(strtolower($boss)) . ".png";
|
$bossImage = trim(strtolower($boss)) . ".png";
|
||||||
if($bossImage != ".png"){
|
if ($bossImage != ".png") {
|
||||||
echo "<div class='bossImageWrapper'>";
|
echo "<div class='bossImageWrapper'>";
|
||||||
echo "<img id='boss_image' src='/boss_images/" . $bossImage . "' alt='" . $boss . "' title='" . $boss . "'>";
|
echo "<img id='boss_image' src='boss_images/" . $bossImage . "' alt='" . $boss . "' title='" . $boss . "'>";
|
||||||
echo "<div class='bossLabel'>" . $boss . "</div>";
|
echo "<div class='bossLabel'>" . $boss . "</div>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
echo "</li>";
|
||||||
|
|
||||||
|
$counter++;
|
||||||
echo "</div>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</li>";
|
echo "</ol>";
|
||||||
|
|
||||||
$counter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "</ol>";
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo "<br>0 results";
|
echo "<br>0 results";
|
||||||
}
|
}
|
||||||
|
|
||||||
$conn->close();
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a class='ddd' href='/ddd_index.php'>Back</a>
|
<a class='ddd' href='ddd_index.php'>Back</a>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<head>
|
<head>
|
||||||
<link type="text/css" rel="stylesheet" href="./ddddxhs_files/ddd.css">
|
<link type="text/css" rel="stylesheet" href="ddddxhs_files/ddd.css">
|
||||||
<link rel="stylesheet" type="text/css" href="./ddddxhs_files/banner-styles.css">
|
<!-- <link rel="stylesheet" type="text/css" href="ddddxhs_files/banner-styles.css"> -->
|
||||||
</head>
|
</head>
|
||||||
<center>
|
<center>
|
||||||
<a href="./index.php">
|
<a href="index.php">
|
||||||
<img src="/ddddxhs_files/title.png" alt="DASH-DA-DASH DX" title="DASH-DA-DASH DX">
|
<img src="ddddxhs_files/title.png" alt="DASH-DA-DASH DX" title="DASH-DA-DASH DX">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
14
index.php
|
@ -1,15 +1,15 @@
|
||||||
<!--Load Original Source Files-->
|
<!--Load Original Source Files-->
|
||||||
<?php echo file_get_contents("ddd_source.html"); ?>
|
<?php echo file_get_contents('ddd_source.html'); ?>
|
||||||
<center>
|
<center>
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
<ol class='scoreList'>
|
<ol class='scoreList'>
|
||||||
<a href='/ddddxhs_files/DASH-DA-DASH DX (2023 Fan Patch).exe'>
|
<a href='ddddxhs_files/DASH-DA-DASH DX (2023 Fan Patch).exe'>
|
||||||
<img src="/ddddxhs_files/download.png" alt="DOWNLOAD DASH-DA-DASH DX" title="DOWNLOAD DASH-DA-DASH DX">
|
<img src="ddddxhs_files/download.png" alt="DOWNLOAD DASH-DA-DASH DX" title="DOWNLOAD DASH-DA-DASH DX">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<img class='center' src="/ddddxhs_files/features.png" alt="FEATURES DASH-DA-DASH DX" title="FEATURES DASH-DA-DASH DX">
|
<img class='center' src="ddddxhs_files/features.png" alt="FEATURES DASH-DA-DASH DX" title="FEATURES DASH-DA-DASH DX">
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
@ -21,8 +21,8 @@ Welcome to the fan made Dash Da Dash DX High Score Board
|
||||||
I created this homage as a way for my friends and I to post our high scores to an online leaderboard like back in the day.
|
I created this homage as a way for my friends and I to post our high scores to an online leaderboard like back in the day.
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
<a href='/ddd_index.php'>
|
<a href='ddd_index.php'>
|
||||||
<img src="/ddddxhs_files/code.png" alt="CODE DASH-DA-DASH DX" title="CODE DASH-DA-DASH DX">
|
<img src="ddddxhs_files/code.png" alt="CODE DASH-DA-DASH DX" title="CODE DASH-DA-DASH DX">
|
||||||
</a>
|
</a>
|
||||||
<br><br>
|
<br><br>
|
||||||
<li class='even ddd' id='player'>
|
<li class='even ddd' id='player'>
|
||||||
|
@ -42,7 +42,7 @@ Credits
|
||||||
<br>
|
<br>
|
||||||
<a href='https://web.archive.org/web/20120615011611if_/http://renard.teknolust.org/ddd/dddxv12install.exe'>Version 1.12 from WabyBackMachine Archive</a>
|
<a href='https://web.archive.org/web/20120615011611if_/http://renard.teknolust.org/ddd/dddxv12install.exe'>Version 1.12 from WabyBackMachine Archive</a>
|
||||||
<br>
|
<br>
|
||||||
<a href='/ddddxhs_files/DASH-DA-DASH DX (2023 Fan Patch).mfa'>2023 Fan Patch .mfa Source File for Clickteam Fusion 2.5</a>
|
<a href='ddddxhs_files/DASH-DA-DASH DX (2023 Fan Patch).mfa'>2023 Fan Patch .mfa Source File for Clickteam Fusion 2.5</a>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
// Path to the SQLite database file
|
||||||
|
$db_path = 'db/ddd_db.sqlite';
|
||||||
|
|
||||||
|
// Check if the 'db' directory exists, if not, create it
|
||||||
|
if (!is_dir('db')) {
|
||||||
|
if (!mkdir('db', 0777, true)) {
|
||||||
|
die('Failed to create directories...');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo 'test1';
|
||||||
|
|
||||||
|
// Check if the database file exists
|
||||||
|
if (!file_exists($db_path)) {
|
||||||
|
try {
|
||||||
|
// Create a new SQLite3 database file
|
||||||
|
echo 'test2';
|
||||||
|
$db = new SQLite3($db_path);
|
||||||
|
echo 'test3';
|
||||||
|
|
||||||
|
// Create the 'scores' table
|
||||||
|
$createTableQuery = "
|
||||||
|
CREATE TABLE IF NOT EXISTS scores (
|
||||||
|
ID INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
Name TEXT NOT NULL,
|
||||||
|
Score INTEGER NOT NULL,
|
||||||
|
Mode TEXT NOT NULL,
|
||||||
|
Bosses TEXT NOT NULL
|
||||||
|
);
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($db->exec($createTableQuery)) {
|
||||||
|
echo "Database and table created successfully.<br>";
|
||||||
|
} else {
|
||||||
|
echo "Error creating table: " . $db->lastErrorMsg() . "<br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the database connection
|
||||||
|
$db->close();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo 'Caught exception: ', $e->getMessage(), "<br>";
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo 'Caught error: ', $e->getMessage(), "<br>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "Database already exists.<br>";
|
||||||
|
}
|
||||||
|
?>
|
|
@ -1,8 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
echo file_get_contents("ddd_source.html");
|
echo file_get_contents("ddd_source.html");
|
||||||
include('/var/config/mysqlconnect.php');
|
|
||||||
|
|
||||||
$b64 = $_POST["gamePass"];
|
$db_path = 'db/ddd_db.sqlite';
|
||||||
|
$db = new SQLite3($db_path);
|
||||||
|
|
||||||
|
$b64 = $_POST["gamePass"];
|
||||||
$decode = base64_decode($b64, true);
|
$decode = base64_decode($b64, true);
|
||||||
$dataArr = explode("|", $decode);
|
$dataArr = explode("|", $decode);
|
||||||
$name = $dataArr[0];
|
$name = $dataArr[0];
|
||||||
|
@ -19,18 +21,21 @@ echo $name . "<br>" . $score . "<br>" . $mode . "<br>";
|
||||||
echo "Bosses: " . $bossNames . "<br>";
|
echo "Bosses: " . $bossNames . "<br>";
|
||||||
|
|
||||||
// Prepare an SQL statement
|
// Prepare an SQL statement
|
||||||
$stmt = $conn->prepare("INSERT INTO ddd_db.scores (Name, Score, Mode, Bosses) VALUES (?, ?, ?, ?)");
|
$stmt = $db->prepare("INSERT INTO scores (Name, Score, Mode, Bosses) VALUES (?, ?, ?, ?)");
|
||||||
$stmt->bind_param("siss", $name, $score, $mode, $bossNames);
|
$stmt->bindValue(1, $name, SQLITE3_TEXT);
|
||||||
|
$stmt->bindValue(2, $score, SQLITE3_INTEGER);
|
||||||
|
$stmt->bindValue(3, $mode, SQLITE3_TEXT);
|
||||||
|
$stmt->bindValue(4, $bossNames, SQLITE3_TEXT);
|
||||||
|
|
||||||
// Execute the statement
|
// Execute the statement
|
||||||
if ($stmt->execute()) {
|
if ($stmt->execute()) {
|
||||||
echo "New record created successfully";
|
echo "New record created successfully";
|
||||||
} else {
|
} else {
|
||||||
echo "Error: " . $stmt->error;
|
echo "Error: " . $db->lastErrorMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
$conn->close();
|
$db->close();
|
||||||
?>
|
?>
|
||||||
<br>
|
<br>
|
||||||
<a class='ddd' href='/ddd_index.php'>Back</a>
|
<a class='ddd' href='ddd_index.php'>Back</a>
|
||||||
|
|