Updated code to use config.cfg file instead of hard coded data
|
@ -1 +1 @@
|
|||
/config.php
|
||||
/config.cfg
|
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>
|
||||
<body>
|
||||
<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>
|
||||
<br>
|
||||
<br>
|
||||
<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>
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
<?php
|
||||
echo file_get_contents("ddd_source.html");
|
||||
include('/var/config/mysqlconnect.php');
|
||||
|
||||
// Load the configuration file
|
||||
$configFilePath = 'config.cfg';
|
||||
$config = parse_ini_file($configFilePath, true);
|
||||
|
||||
// Include the MySQL connection script from the config file
|
||||
include($config['mysql']['mysqlconnect_path']);
|
||||
|
||||
$mode = $_REQUEST['mode'];
|
||||
|
||||
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";
|
||||
} 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";
|
||||
}
|
||||
?>
|
||||
|
@ -42,14 +48,13 @@ if ($result->num_rows > 0) {
|
|||
$bossImage = trim(strtolower($boss)) . ".png";
|
||||
if($bossImage != ".png"){
|
||||
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>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
|
@ -68,4 +73,4 @@ $conn->close();
|
|||
?>
|
||||
|
||||
<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>
|
||||
<head>
|
||||
<link type="text/css" rel="stylesheet" href="./ddddxhs_files/ddd.css">
|
||||
<link rel="stylesheet" type="text/css" href="./ddddxhs_files/banner-styles.css">
|
||||
<link type="text/css" rel="stylesheet" href="ddddxhs_files/ddd.css">
|
||||
<!-- <link rel="stylesheet" type="text/css" href="ddddxhs_files/banner-styles.css"> -->
|
||||
</head>
|
||||
<center>
|
||||
<a href="./index.php">
|
||||
<img src="/ddddxhs_files/title.png" alt="DASH-DA-DASH DX" title="DASH-DA-DASH DX">
|
||||
<a href="index.php">
|
||||
<img src="ddddxhs_files/title.png" alt="DASH-DA-DASH DX" title="DASH-DA-DASH DX">
|
||||
</a>
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
@ -85,10 +85,14 @@ a img {
|
|||
|
||||
.even {
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
border: 1px solid white;
|
||||
border-radius: 10px; /* Adjust the value to get the desired roundness */
|
||||
}
|
||||
|
||||
.odd {
|
||||
background-color: rgba(26, 26, 26, 0.9);
|
||||
border: 1px solid white;
|
||||
border-radius: 10px; /* Adjust the value to get the desired roundness */
|
||||
}
|
||||
|
||||
.scoreEntry #player,
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
[mysql]
|
||||
mysqlconnect_path="/var/config/mysqlconnect.php"
|
||||
host="localhost"
|
||||
username="user"
|
||||
database="database"
|
||||
password="password"
|
||||
|
||||
#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
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
// Load the configuration file
|
||||
$configFilePath = 'config.cfg';
|
||||
$config = parse_ini_file($configFilePath, true);
|
||||
|
||||
// Check if the mysql section exists in the config file
|
||||
if (!isset($config['mysql'])) {
|
||||
die('MySQL configuration not found in config.cfg');
|
||||
}
|
||||
|
||||
// Extract MySQL connection parameters from the config file
|
||||
$host = $config['mysql']['host'];
|
||||
$username = $config['mysql']['username'];
|
||||
$password = $config['mysql']['password'];
|
||||
$database = $config['mysql']['database'];
|
||||
|
||||
// Create a connection
|
||||
$conn = new mysqli($host, $username, $password, $database);
|
||||
|
||||
// Check the connection
|
||||
if ($conn->connect_error) {
|
||||
die('Connection failed: ' . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Optionally, close the connection when done
|
||||
// $conn->close();
|
||||
?>
|
12
index.php
|
@ -3,13 +3,13 @@
|
|||
<center>
|
||||
<br><br><br><br>
|
||||
<ol class='scoreList'>
|
||||
<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">
|
||||
<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">
|
||||
</a>
|
||||
<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>
|
||||
|
@ -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.
|
||||
</li>
|
||||
<br>
|
||||
<a href='/ddd_index.php'>
|
||||
<img src="/ddddxhs_files/code.png" alt="CODE DASH-DA-DASH DX" title="CODE DASH-DA-DASH DX">
|
||||
<a href='ddd_index.php'>
|
||||
<img src="ddddxhs_files/code.png" alt="CODE DASH-DA-DASH DX" title="CODE DASH-DA-DASH DX">
|
||||
</a>
|
||||
<br><br>
|
||||
<li class='even ddd' id='player'>
|
||||
|
@ -42,7 +42,7 @@ Credits
|
|||
<br>
|
||||
<a href='https://web.archive.org/web/20120615011611if_/http://renard.teknolust.org/ddd/dddxv12install.exe'>Version 1.12 from WabyBackMachine Archive</a>
|
||||
<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>
|
||||
</ol>
|
||||
<br>
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
<?php
|
||||
echo file_get_contents("ddd_source.html");
|
||||
include('/var/config/mysqlconnect.php');
|
||||
|
||||
// Load the configuration file
|
||||
$configFilePath = 'config.cfg';
|
||||
$config = parse_ini_file($configFilePath, true);
|
||||
|
||||
// Include the MySQL connection script from the config file
|
||||
include($config['mysql']['mysqlconnect_path']);
|
||||
|
||||
$b64 = $_POST["gamePass"];
|
||||
$decode = base64_decode($b64, true);
|
||||
|
@ -33,4 +39,4 @@ $stmt->close();
|
|||
$conn->close();
|
||||
?>
|
||||
<br>
|
||||
<a class='ddd' href='/ddd_index.php'>Back</a>
|
||||
<a class='ddd' href='ddd_index.php'>Back</a>
|
||||
|
|