Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit f6cb87e

Browse files
authored
Merge pull request #10 from KristianP26/v2.x
V2.x
2 parents 879c415 + ff6947c commit f6cb87e

File tree

4 files changed

+333
-300
lines changed

4 files changed

+333
-300
lines changed

dashboard-maps.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<section class="my-4 pb-1">
2121
<div class="" id="maps-load">
2222
<?php if((isset($mapname))&&($mapname!=='')): ?>
23-
<h5><a href="dashboard-maps.php" class="text-muted">Surf Community's Map Collection</a> / <?php echo $mapname;?></h5>
23+
<h5><a href="dashboard-maps.php" class="text-muted">Surf Stat's Map Collection</a> / <?php echo $mapname;?></h5>
2424
<hr class="mt-0 mb-3">
2525
<div class="text-center text-muted py-4">
2626
<div class="spinner-grow text-dark my-2" role="status">

inc/database.php

+30-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
};
1313

1414

15-
15+
// Create not existing database columns
1616
$sql_mtcheck = "SHOW COLUMNS FROM `ck_maptier` LIKE 'stages'";
1717
$sql_mtcheck_add = "ALTER TABLE `ck_maptier` ADD `stages` INT NULL DEFAULT NULL AFTER `ranked`, ADD `bonuses` INT NULL DEFAULT NULL AFTER `stages`;";
1818

@@ -22,5 +22,33 @@
2222
$db_conn_surftimer->query($sql_mtcheck_add);
2323
}
2424

25-
$db_conn_surftimer -> set_charset("utf8mb4");
25+
$sql_ptcheck = "SHOW COLUMNS FROM `ck_playertimes` LIKE 'date'";
26+
$sql_ptcheck_add = "ALTER TABLE `ck_playertimes` ADD `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `style`;";
27+
28+
$result_ptcheck = $db_conn_surftimer->query($sql_ptcheck);
29+
$exists_ptcheck = (mysqli_num_rows($result_ptcheck))?TRUE:FALSE;
30+
if(!$exists_ptcheck) {
31+
$db_conn_surftimer->query($sql_ptcheck_add);
32+
}
33+
34+
$sql_bonuscheck = "SHOW COLUMNS FROM `ck_bonus` LIKE 'date'";
35+
$sql_bonuscheck_add = "ALTER TABLE `ck_bonus` ADD `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `style`;";
36+
37+
$result_ptcheck = $db_conn_surftimer->query($sql_bonuscheck);
38+
$exists_ptcheck = (mysqli_num_rows($result_ptcheck))?TRUE:FALSE;
39+
if(!$exists_ptcheck) {
40+
$db_conn_surftimer->query($sql_bonuscheck_add);
41+
}
42+
43+
$sql_wrcpcheck = "SHOW COLUMNS FROM `ck_wrcps` LIKE 'date'";
44+
$sql_wrcpcheck_add = "ALTER TABLE `ck_wrcps` ADD `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `style`;";
45+
46+
$result_ptcheck = $db_conn_surftimer->query($sql_wrcpcheck);
47+
$exists_ptcheck = (mysqli_num_rows($result_ptcheck))?TRUE:FALSE;
48+
if(!$exists_ptcheck) {
49+
$db_conn_surftimer->query($sql_wrcpcheck_add);
50+
}
51+
// End of "Create not existing database columns"
52+
2653

54+
$db_conn_surftimer -> set_charset("utf8mb4");

0 commit comments

Comments
 (0)