Compare commits
5 Commits
bf0b05064a
...
02533addb4
Author | SHA1 | Date | |
---|---|---|---|
02533addb4 | |||
adcd4166c6 | |||
240f121298 | |||
10fa8e423a | |||
3152cca51f |
66
public/css/admin.css
Normal file
66
public/css/admin.css
Normal file
|
@ -0,0 +1,66 @@
|
|||
:root {
|
||||
--font-size: 12px;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: var(--font-size);
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
div#admin-container {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
main > nav {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
main > section {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #663300;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #330000;
|
||||
}
|
||||
.small {
|
||||
font: 10px verdana;
|
||||
}
|
||||
.highlight {
|
||||
color: red;
|
||||
}
|
||||
.light {
|
||||
color: #999999;
|
||||
}
|
||||
.title {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font-size: 0.8rem;
|
||||
padding: 0.5rem;
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
html {
|
||||
font-size: var(--font-size);
|
||||
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
|
@ -99,7 +99,7 @@ a:hover {
|
|||
}
|
||||
|
||||
.small {
|
||||
font: 10px verdana;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
|
@ -116,7 +116,7 @@ a:hover {
|
|||
font-weight: bold;
|
||||
padding: 5px;
|
||||
font-size: 1.2rem;
|
||||
font-family: 'Times New Roman', Times, serif;
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
|
|
73
public/css/help.css
Normal file
73
public/css/help.css
Normal file
|
@ -0,0 +1,73 @@
|
|||
:root {
|
||||
--font-size: 14px;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: var(--font-size);
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
background-image: url('/img/background.jpg');
|
||||
padding: 2rem;
|
||||
}
|
||||
table {
|
||||
border-style: none;
|
||||
padding: 0px;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: white;
|
||||
}
|
||||
td {
|
||||
border-style: none;
|
||||
padding: 3px;
|
||||
vertical-align: top;
|
||||
}
|
||||
td.top {
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
td.left {
|
||||
width: 150px;
|
||||
border-right: solid 2px black;
|
||||
}
|
||||
td.right {
|
||||
width: 150px;
|
||||
border-left: solid 2px black;
|
||||
}
|
||||
a {
|
||||
color: #663300;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #330000;
|
||||
}
|
||||
.small {
|
||||
font: 10px verdana;
|
||||
}
|
||||
.highlight {
|
||||
color: red;
|
||||
}
|
||||
.light {
|
||||
color: #999999;
|
||||
}
|
||||
.title {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
}
|
||||
.copyright {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font: 10px verdana;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-size: 0.8rem;
|
||||
padding: 0.5rem;
|
||||
margin-top: 2rem;
|
||||
}
|
|
@ -84,7 +84,7 @@ function dotown()
|
|||
if ($controlrow["shownews"] == 1) {
|
||||
$newsrow = db()->query('SELECT * FROM news ORDER BY id DESC LIMIT 1;')->fetchArray(SQLITE3_ASSOC);
|
||||
$townrow["news"] = '<div class="title">Latest News</div>';
|
||||
$townrow["news"] .= "<span class=\"light\">[".prettydate($newsrow["postdate"])."]</span><br>".nl2br($newsrow["content"]);
|
||||
$townrow["news"] .= "<span class=\"light\">[".pretty_date($newsrow["postdate"])."]</span><br>".nl2br($newsrow["content"]);
|
||||
}
|
||||
|
||||
// Who's Online. Currently just members. Guests maybe later.
|
||||
|
@ -114,7 +114,7 @@ function dotown()
|
|||
HTML;
|
||||
}
|
||||
|
||||
return parsetemplate(gettemplate("towns"), $townrow);
|
||||
return render('towns', ['town' => $townrow]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,14 +138,9 @@ function doexplore()
|
|||
*/
|
||||
function show_character_info(int $id = 0): void
|
||||
{
|
||||
global $controlrow;
|
||||
|
||||
if ($id === 0) {
|
||||
global $userrow;
|
||||
} else {
|
||||
$userrow = get_user_by_id($id);
|
||||
}
|
||||
global $controlrow, $userrow;
|
||||
|
||||
$userrow = ($id === 0) ? $userrow : get_user_by_id($id);
|
||||
if ($userrow === false) exit('Failed to show info for user ID '.$id);
|
||||
|
||||
$levelrow = db()->query("SELECT `{$userrow["charclass"]}_exp` FROM levels WHERE id=? LIMIT 1;", [$userrow['level'] + 1])->fetchArray(SQLITE3_ASSOC);
|
||||
|
|
|
@ -26,7 +26,7 @@ function register_routes(Router $r): Router
|
|||
$r->get('/admin/monsters', 'Admin\monsters');
|
||||
$r->form('/admin/monsters/:id', 'Admin\editmonster');
|
||||
|
||||
$r->get('/admin/level', 'Admin\levels');
|
||||
$r->form('/admin/level', 'Admin\levels');
|
||||
$r->form('/admin/level/:id', 'Admin\editlevel');
|
||||
|
||||
$r->get('/admin/spells', 'Admin\spells');
|
||||
|
@ -59,7 +59,7 @@ function donothing()
|
|||
because mistakes in the database content may result in script errors or your game breaking completely.
|
||||
HTML;
|
||||
|
||||
admindisplay($page, "Admin Home");
|
||||
display_admin($page, "Admin Home");
|
||||
}
|
||||
|
||||
function primary()
|
||||
|
@ -86,10 +86,10 @@ function primary()
|
|||
$form['gamename'], $form['gamesize'], $form['class1name'], $form['class2name'], $form['class3name'], $form['gameopen'], $form['verifyemail'], $form['gameurl'], $form['adminemail'], $form['shownews'], $form['showonline'], $form['showbabble']
|
||||
]);
|
||||
|
||||
admindisplay("Settings updated.", "Main Settings");
|
||||
display_admin("Settings updated.", "Main Settings");
|
||||
} else {
|
||||
$errorlist = ul_from_validate_errors($form['errors']);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Main Settings");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Main Settings");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ function primary()
|
|||
if ($controlrow["gameopen"] == 1) { $controlrow["open1select"] = "selected=\"selected\" "; } else { $controlrow["open1select"] = ""; }
|
||||
if ($controlrow["gameopen"] == 0) { $controlrow["open0select"] = "selected=\"selected\" "; } else { $controlrow["open0select"] = ""; }
|
||||
|
||||
admindisplay(parsetemplate($page, $controlrow), "Main Settings");
|
||||
display_admin(parse($page, $controlrow), "Main Settings");
|
||||
}
|
||||
|
||||
function items()
|
||||
|
@ -143,7 +143,7 @@ function items()
|
|||
}
|
||||
|
||||
if (!$hasItems) $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No items found.</td></tr>\n";
|
||||
admindisplay($page . "</table>", "Edit Items");
|
||||
display_admin($page . "</table>", "Edit Items");
|
||||
}
|
||||
|
||||
function edititem($id)
|
||||
|
@ -163,10 +163,10 @@ function edititem($id)
|
|||
db()->query('UPDATE items SET name=?, type=?, buycost=?, attribute=?, special=? WHERE id=?;', [
|
||||
$n, $_POST['type'] ?? 0, $bc, $a, $s, $id
|
||||
]);
|
||||
admindisplay("Item updated.","Edit Items");
|
||||
display_admin("Item updated.","Edit Items");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Items");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Items");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ function edititem($id)
|
|||
if ($item["type"] == 2) { $item["type2select"] = "selected=\"selected\" "; } else { $item["type2select"] = ""; }
|
||||
if ($item["type"] == 3) { $item["type3select"] = "selected=\"selected\" "; } else { $item["type3select"] = ""; }
|
||||
|
||||
admindisplay(parsetemplate($page, $item), "Edit Items");
|
||||
display_admin(parse($page, $item), "Edit Items");
|
||||
}
|
||||
|
||||
function drops()
|
||||
|
@ -219,7 +219,7 @@ function drops()
|
|||
|
||||
if (!$has_drops) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No drops found.</td></tr>\n"; }
|
||||
|
||||
admindisplay($page . "</table>", "Edit Drops");
|
||||
display_admin($page . "</table>", "Edit Drops");
|
||||
}
|
||||
|
||||
function editdrop($id)
|
||||
|
@ -241,10 +241,10 @@ function editdrop($id)
|
|||
db()->query('UPDATE drops SET name=?, mlevel=?, attribute1=?, attribute2=? WHERE id=?;', [
|
||||
$n, $ml, $a, $a2, $id
|
||||
]);
|
||||
admindisplay("Item updated.","Edit Drops");
|
||||
display_admin("Item updated.","Edit Drops");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Drops");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Drops");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ function editdrop($id)
|
|||
defensepower - total defense power
|
||||
HTML;
|
||||
|
||||
admindisplay(parsetemplate($page, $drop), "Edit Drops");
|
||||
display_admin(parse($page, $drop), "Edit Drops");
|
||||
}
|
||||
|
||||
function towns()
|
||||
|
@ -292,7 +292,7 @@ function towns()
|
|||
|
||||
if (!$has_towns) $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No towns found.</td></tr>\n";
|
||||
|
||||
admindisplay($page . "</table>", "Edit Towns");
|
||||
display_admin($page . "</table>", "Edit Towns");
|
||||
}
|
||||
|
||||
function edittown($id)
|
||||
|
@ -322,10 +322,10 @@ function edittown($id)
|
|||
db()->query('UPDATE towns SET name=?, latitude=?, longitude=?, innprice=?, mapprice=?, travelpoints=?, itemslist=? WHERE id=?;', [
|
||||
$n, $la, $lo, $ip, $mp, $tp, $il, $id
|
||||
]);
|
||||
admindisplay("Town updated.", "Edit Towns");
|
||||
display_admin("Town updated.", "Edit Towns");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Towns");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Towns");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ function edittown($id)
|
|||
</form>
|
||||
HTML;
|
||||
|
||||
admindisplay(parsetemplate($page, $row), "Edit Towns");
|
||||
display_admin(parse($page, $row), "Edit Towns");
|
||||
}
|
||||
|
||||
function monsters()
|
||||
|
@ -376,7 +376,7 @@ function monsters()
|
|||
|
||||
if (!$has_monsters) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No monsters found.</td></tr>\n"; }
|
||||
|
||||
admindisplay($page."</table>", "Edit Monster");
|
||||
display_admin($page."</table>", "Edit Monster");
|
||||
}
|
||||
|
||||
function editmonster($id)
|
||||
|
@ -403,10 +403,10 @@ function editmonster($id)
|
|||
db()->query('UPDATE monsters SET name=?, maxhp=?, maxdam=?, armor=?, level=?, maxexp=?, maxgold=?, immune=? WHERE id=?;', [
|
||||
$n, $mh, $md, $a, $l, $me, $mg, $_POST['immune'] ?? 0, $id
|
||||
]);
|
||||
admindisplay("Monster updated.", "Edit monsters");
|
||||
display_admin("Monster updated.", "Edit monsters");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit monsters");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit monsters");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ function editmonster($id)
|
|||
if ($row["immune"] == 2) { $row["immune2select"] = "selected=\"selected\" "; } else { $row["immune2select"] = ""; }
|
||||
if ($row["immune"] == 3) { $row["immune3select"] = "selected=\"selected\" "; } else { $row["immune3select"] = ""; }
|
||||
|
||||
admindisplay(parsetemplate($page, $row), "Edit Monsters");
|
||||
display_admin(parse($page, $row), "Edit Monsters");
|
||||
}
|
||||
|
||||
function spells()
|
||||
|
@ -451,7 +451,7 @@ function spells()
|
|||
|
||||
if (!$has_spells) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No spells found.</td></tr>\n"; }
|
||||
|
||||
admindisplay($page."</table>", "Edit Spells");
|
||||
display_admin($page."</table>", "Edit Spells");
|
||||
}
|
||||
|
||||
function editspell($id)
|
||||
|
@ -470,10 +470,10 @@ function editspell($id)
|
|||
db()->query('UPDATE spells SET name=?, mp=?, attribute=?, type=? WHERE id=?;', [
|
||||
$n, $mp, $a, $_POST['type'] ?? 0, $id
|
||||
]);
|
||||
admindisplay("Spell updated.", "Edit Spells");
|
||||
display_admin("Spell updated.", "Edit Spells");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Spells");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Spells");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -499,7 +499,7 @@ function editspell($id)
|
|||
if ($row["type"] == 4) { $row["type4select"] = "selected=\"selected\" "; } else { $row["type4select"] = ""; }
|
||||
if ($row["type"] == 5) { $row["type5select"] = "selected=\"selected\" "; } else { $row["type5select"] = ""; }
|
||||
|
||||
admindisplay(parsetemplate($page, $row), "Edit Spells");
|
||||
display_admin(parse($page, $row), "Edit Spells");
|
||||
}
|
||||
|
||||
function levels()
|
||||
|
@ -522,12 +522,12 @@ function levels()
|
|||
</form>
|
||||
HTML;
|
||||
|
||||
admindisplay($page, "Edit Levels");
|
||||
display_admin($page, "Edit Levels");
|
||||
}
|
||||
|
||||
function editlevel()
|
||||
{
|
||||
if (!isset($_POST["level"])) admindisplay("No level to edit.", "Edit Levels");
|
||||
if (!isset($_POST["level"])) display_admin("No level to edit.", "Edit Levels");
|
||||
$id = $_POST["level"];
|
||||
|
||||
if (isset($_POST["submit"])) {
|
||||
|
@ -594,10 +594,10 @@ function editlevel()
|
|||
$three_exp, $three_hp, $three_mp, $three_tp, $three_strength, $three_dexterity, $three_spells,
|
||||
$id
|
||||
]);
|
||||
admindisplay("Level updated.", "Edit Levels");
|
||||
display_admin("Level updated.", "Edit Levels");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Spells");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Spells");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -652,7 +652,7 @@ function editlevel()
|
|||
</form>
|
||||
HTML;
|
||||
|
||||
admindisplay(parsetemplate($page, $row), "Edit Levels");
|
||||
display_admin(parse($page, $row), "Edit Levels");
|
||||
}
|
||||
|
||||
function users()
|
||||
|
@ -669,7 +669,7 @@ function users()
|
|||
|
||||
if (!$has_users) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No spells found.</td></tr>\n"; }
|
||||
|
||||
admindisplay($page."</table>", "Edit Users");
|
||||
display_admin($page."</table>", "Edit Users");
|
||||
}
|
||||
|
||||
function edituser($id)
|
||||
|
@ -787,10 +787,10 @@ function edituser($id)
|
|||
$slot3name, $dropcode, $spells, $towns, $id
|
||||
]);
|
||||
|
||||
admindisplay("User updated.", "Edit Users");
|
||||
display_admin("User updated.", "Edit Users");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Users");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Edit Users");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -883,7 +883,7 @@ function edituser($id)
|
|||
if ($row["charclass"] == 2) { $row["class2select"] = "selected=\"selected\" "; } else { $row["class2select"] = ""; }
|
||||
if ($row["charclass"] == 3) { $row["class3select"] = "selected=\"selected\" "; } else { $row["class3select"] = ""; }
|
||||
|
||||
admindisplay(parsetemplate($page, $row), "Edit Users");
|
||||
display_admin(parse($page, $row), "Edit Users");
|
||||
}
|
||||
|
||||
function addnews()
|
||||
|
@ -898,10 +898,10 @@ function addnews()
|
|||
|
||||
if (count($errors) === 0) {
|
||||
db()->query('INSERT INTO news (author, content) VALUES (?, ?);', [$userrow['username'], $c]);
|
||||
admindisplay("News post added.", "Add News");
|
||||
display_admin("News post added.", "Add News");
|
||||
} else {
|
||||
$errorlist = implode('<br>', $errors);
|
||||
admindisplay("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Add News");
|
||||
display_admin("<b>Errors:</b><br><div style=\"color:red;\">$errorlist</div><br>Please go back and try again.", "Add News");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -914,5 +914,5 @@ function addnews()
|
|||
</form>
|
||||
HTML;
|
||||
|
||||
admindisplay($page, "Add News");
|
||||
display_admin($page, "Add News");
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ function fight()
|
|||
}
|
||||
|
||||
// Finalize page and display it
|
||||
display(parsetemplate(gettemplate("fight"), $pagearray), "Fighting");
|
||||
display(render('fight', ['page' => $pagearray]), "Fighting");
|
||||
}
|
||||
|
||||
function victory()
|
||||
|
|
|
@ -44,7 +44,7 @@ function showthread($id, $start)
|
|||
|
||||
$page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><td colspan=\"2\" style=\"background-color:#dddddd;\"><b><a href=\"/forum\">Forum</a> :: ".$title['title']."</b></td></tr>\n";
|
||||
while ($row = $posts->fetchArray(SQLITE3_ASSOC)) {
|
||||
$page .= "<tr><td width=\"25%\" style=\"background-color:#ffffff; vertical-align:top;\"><span class=\"small\"><b>".$row["author"]."</b><br><br>".prettyforumdate($row["postdate"])."</td><td style=\"background-color:#ffffff; vertical-align:top;\">".nl2br($row["content"])."</td></tr>\n";
|
||||
$page .= "<tr><td width=\"25%\" style=\"background-color:#ffffff; vertical-align:top;\"><span class=\"small\"><b>".$row["author"]."</b><br><br>".pretty_date($row["postdate"])."</td><td style=\"background-color:#ffffff; vertical-align:top;\">".nl2br($row["content"])."</td></tr>\n";
|
||||
}
|
||||
$page .= "</table></td></tr></table><br>";
|
||||
$page .= "<table width=\"100%\"><tr><td><b>Reply To This Thread:</b><br><form action=\"/forum/reply\" method=\"post\"><input type=\"hidden\" name=\"parent\" value=\"$id\" /><input type=\"hidden\" name=\"title\" value=\"Re: ".$title["title"]."\" /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>";
|
||||
|
|
|
@ -246,7 +246,7 @@ function main()
|
|||
[ <a href="#top">Top</a> ]
|
||||
HTML;
|
||||
|
||||
display_help(parsetemplate($page, $controlrow));
|
||||
display_help(parse($page, $controlrow));
|
||||
}
|
||||
|
||||
function items()
|
||||
|
@ -489,12 +489,16 @@ function levels()
|
|||
Experience points listed are total values up until that point. All other values are just the new amount that you gain for each level.
|
||||
HTML;
|
||||
|
||||
display_help(parsetemplate($page, $controlrow));
|
||||
display_help(parse($page, $controlrow));
|
||||
}
|
||||
|
||||
function display_help(string $content)
|
||||
{
|
||||
global $controlrow;
|
||||
$template = parsetemplate(gettemplate('help'), $controlrow);
|
||||
echo parsetemplate($template, ['content' => $content]);
|
||||
echo render('help', [
|
||||
'control' => $controlrow,
|
||||
'content' => $content,
|
||||
'version' => VERSION,
|
||||
'build' => BUILD
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -49,9 +49,7 @@ function login()
|
|||
redirect('/');
|
||||
}
|
||||
|
||||
$page = gettemplate("login");
|
||||
$title = "Log In";
|
||||
display($page, $title, false, false, false, false);
|
||||
display(render('login'), 'Log In', true, false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,7 +109,7 @@ function register()
|
|||
$page = render('register', ['controlrow' => $controlrow]);
|
||||
}
|
||||
|
||||
display($page, "Register", false, false, false);
|
||||
display($page, 'Register', true, false, false);
|
||||
}
|
||||
|
||||
function verify()
|
||||
|
@ -129,8 +127,7 @@ function verify()
|
|||
display("Your account was verified successfully.<br><br>You may now continue to the <a href=\"/login\">Login Page</a> and start playing the game.<br><br>Thanks for playing!","Verify Email",false,false,false);
|
||||
}
|
||||
|
||||
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
display(gettemplate("verify"), "Verify Email", false, false, false);
|
||||
display(render('verify'), "Verify Email", true, false, false);
|
||||
}
|
||||
|
||||
function lostpassword()
|
||||
|
@ -152,9 +149,7 @@ function lostpassword()
|
|||
}
|
||||
}
|
||||
|
||||
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
display(gettemplate("lostpassword"), "Lost Password", false, false, false);
|
||||
|
||||
display(render('lostpassword'), "Lost Password", true, false, false);
|
||||
}
|
||||
|
||||
function changepassword()
|
||||
|
@ -187,8 +182,7 @@ function changepassword()
|
|||
display("Your password was changed successfully.<br><br>You have been logged out of the game to avoid errors.<br><br>Please <a href=\"/login\">log back in</a> to continue playing.","Change Password",false,false,false);
|
||||
}
|
||||
|
||||
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
|
||||
display(gettemplate("changepassword"), "Change Password", false, false, false);
|
||||
display(render('changepassword'), "Change Password", true, false, false);
|
||||
}
|
||||
|
||||
function sendpassemail($emailaddress, $password)
|
||||
|
|
127
src/lib.php
127
src/lib.php
|
@ -5,7 +5,7 @@ require_once __DIR__ . '/database.php';
|
|||
define('VERSION', '1.2.5');
|
||||
define('BUILD', 'Reawaken');
|
||||
define('START', microtime(true));
|
||||
define('DEBUG', true);
|
||||
define('DEBUG', false);
|
||||
|
||||
/**
|
||||
* Open or get SQLite database connection.
|
||||
|
@ -44,46 +44,30 @@ function render(string $path_to_base_view, array $data = []): string|false
|
|||
return ob_get_clean();
|
||||
}
|
||||
|
||||
function gettemplate($templatename) { // SQL query for the template.
|
||||
|
||||
$filename = __DIR__ . "/../templates/" . $templatename . ".php";
|
||||
include("$filename");
|
||||
return $template;
|
||||
|
||||
/**
|
||||
* Replace tags with given content.
|
||||
*/
|
||||
function parse(string $template, array $array): string
|
||||
{
|
||||
return strtr($template, array_combine(
|
||||
array_map(fn($key) => "{{{$key}}}", array_keys($array)),
|
||||
array_values($array)
|
||||
));
|
||||
}
|
||||
|
||||
function parsetemplate($template, $array) { // Replace template with proper content.
|
||||
|
||||
foreach($array as $a => $b) {
|
||||
$template = str_replace("{{{$a}}}", $b, $template);
|
||||
}
|
||||
return $template;
|
||||
|
||||
}
|
||||
|
||||
function getmicrotime() { // Used for timing script operations.
|
||||
|
||||
list($usec, $sec) = explode(" ",microtime());
|
||||
return ((float)$usec + (float)$sec);
|
||||
|
||||
}
|
||||
|
||||
function prettydate($uglydate) { // Change the MySQL date format (YYYY-MM-DD) into something friendlier.
|
||||
|
||||
return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4)));
|
||||
|
||||
}
|
||||
|
||||
function prettyforumdate($uglydate) { // Change the MySQL date format (YYYY-MM-DD) into something friendlier.
|
||||
|
||||
return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4)));
|
||||
|
||||
}
|
||||
|
||||
function is_email($email) { // Thanks to "mail(at)philipp-louis.de" from php.net!
|
||||
|
||||
return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email));
|
||||
|
||||
/**
|
||||
* Change the SQLite3 datetime format (YYYY-MM-DD HH:MM:SS) into something friendlier.
|
||||
*/
|
||||
function pretty_date(string $uglydate): string
|
||||
{
|
||||
return date("l, F j, Y", mktime(
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
substr($uglydate, 5, 2), // Month
|
||||
substr($uglydate, 8, 2), // Day
|
||||
substr($uglydate, 0, 4) // Year
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,52 +79,44 @@ function make_safe(string $content): string
|
|||
}
|
||||
|
||||
/**
|
||||
* Finalize page and output to browser.
|
||||
* Finalize admin page and output to browser.
|
||||
*/
|
||||
function admindisplay($content, $title)
|
||||
function display_admin($content, $title)
|
||||
{
|
||||
global $userrow, $controlrow;
|
||||
if (!isset($controlrow)) {
|
||||
$query = db()->query('SELECT * FROM control WHERE id=1 LIMIT 1;');
|
||||
$controlrow = $query->fetchArray(SQLITE3_ASSOC);
|
||||
}
|
||||
|
||||
$page = parsetemplate(gettemplate("admin"), [
|
||||
echo render('admin', [
|
||||
"title" => $title,
|
||||
"content" => $content,
|
||||
"totaltime" => round(getmicrotime() - START, 4),
|
||||
"totaltime" => round(microtime(true) - START, 4),
|
||||
"numqueries" => db()->count,
|
||||
"version" => VERSION,
|
||||
"build" => BUILD
|
||||
]);
|
||||
|
||||
echo "<html>\n" . $page;
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, $badstart=false) { // Finalize page and output to browser.
|
||||
|
||||
/**
|
||||
* Finalize page and output to browser.
|
||||
*/
|
||||
function display($content, $title, bool $topnav = true, bool $leftnav = true, bool $rightnav = true): void
|
||||
{
|
||||
global $userrow, $controlrow;
|
||||
if (!isset($controlrow)) {
|
||||
$query = db()->query('SELECT * FROM control WHERE id=1 LIMIT 1;');
|
||||
$controlrow = $query->fetchArray(SQLITE3_ASSOC);
|
||||
}
|
||||
if ($badstart == false) { global $starttime; } else { $starttime = $badstart; }
|
||||
|
||||
if ($rightnav == true) { $rightnav = gettemplate("rightnav"); } else { $rightnav = ""; }
|
||||
if ($leftnav == true) { $leftnav = gettemplate("leftnav"); } else { $leftnav = ""; }
|
||||
if ($topnav == true) {
|
||||
$topnav = <<<HTML
|
||||
<a href='/logout'><img src='/img/button_logout.gif' alt='Log Out' title='Log Out'></a>
|
||||
<a href='/help'><img src='/img/button_help.gif' alt='Help' title='Help'></a>
|
||||
HTML;
|
||||
if ($userrow !== false) { // user should be logged in
|
||||
$topnav = <<<HTML
|
||||
<a href='/logout'><img src='/img/button_logout.gif' alt='Log Out' title='Log Out'></a>
|
||||
<a href='/help'><img src='/img/button_help.gif' alt='Help' title='Help'></a>
|
||||
HTML;
|
||||
} else {
|
||||
$topnav = <<<HTML
|
||||
<a href='/login'><img src='/img/button_login.gif' alt='Log In' title='Log In'></a>
|
||||
<a href='/register'><img src='/img/button_register.gif' alt='Register' title='Register'></a>
|
||||
<a href='/help'><img src='/img/button_help.gif' alt='Help' title='Help'></a>
|
||||
HTML;
|
||||
}
|
||||
} else {
|
||||
$topnav = <<<HTML
|
||||
<a href='/login'><img src='/img/button_login.gif' alt='Log In' title='Log In'></a>
|
||||
<a href='/register'><img src='/img/button_register.gif' alt='Register' title='Register'></a>
|
||||
<a href='/help'><img src='/img/button_help.gif' alt='Help' title='Help'></a>
|
||||
HTML;
|
||||
$topnav = '';
|
||||
}
|
||||
|
||||
if (isset($userrow) && $userrow !== false) {
|
||||
|
@ -226,22 +202,21 @@ function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true,
|
|||
$userrow = [];
|
||||
}
|
||||
|
||||
$page = parsetemplate(gettemplate("primary"), [
|
||||
echo render('primary', [
|
||||
"dkgamename" => $controlrow["gamename"],
|
||||
"title" => $title,
|
||||
"content" => $content,
|
||||
"rightnav" => parsetemplate($rightnav, $userrow),
|
||||
"leftnav" => parsetemplate($leftnav, $userrow),
|
||||
'rightnav' => $rightnav ? render('rightnav', ['user' => $userrow]) : '',
|
||||
"leftnav" => $leftnav ? render('leftnav', ['user' => $userrow]) : '',
|
||||
"topnav" => $topnav,
|
||||
"totaltime" => round(getmicrotime() - START, 4),
|
||||
"totaltime" => round(microtime(true) - START, 4),
|
||||
"numqueries" => db()->count,
|
||||
"version" => VERSION,
|
||||
"build" => BUILD,
|
||||
"querylog" => DEBUG ? '<pre>'.print_r(db()->log, true).'</pre>' : ''
|
||||
"querylog" => DEBUG ? db()->log : []
|
||||
]);
|
||||
|
||||
echo "<html>\n" . $page;
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
function checkcookies()
|
||||
|
|
|
@ -1,77 +1,46 @@
|
|||
<?php
|
||||
$template = <<<HTML
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{title}}</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
color: black;
|
||||
font: 11px verdana;
|
||||
}
|
||||
table {
|
||||
border-style: none;
|
||||
padding: 0px;
|
||||
font: 11px verdana;
|
||||
}
|
||||
td {
|
||||
border-style: none;
|
||||
padding: 3px;
|
||||
vertical-align: top;
|
||||
}
|
||||
a {
|
||||
color: #663300;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #330000;
|
||||
}
|
||||
.small {
|
||||
font: 10px verdana;
|
||||
}
|
||||
.highlight {
|
||||
color: red;
|
||||
}
|
||||
.light {
|
||||
color: #999999;
|
||||
}
|
||||
.title {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
}
|
||||
.copyright {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font: 10px verdana;
|
||||
}
|
||||
</style>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?= $title ?></title>
|
||||
<link rel="stylesheet" href="/css/admin.css">
|
||||
</head>
|
||||
<body><center>
|
||||
<table width="90%"><tr>
|
||||
<td width="150" style="border-right: solid 1px black;">
|
||||
<b><u>DK Administration</u></b><br><br>
|
||||
<b>Links:</b><br>
|
||||
<a href="/admina">Admin Home</a><br>
|
||||
<a href="/">Game Home</a><br><br>
|
||||
<b>Primary Data:</b><br>
|
||||
<a href="/admin/main">Main Settings</a><br>
|
||||
<a href="/admin/news">Add News Post</a><br>
|
||||
<a href="/admin/users">Edit Users</a><br><br>
|
||||
<b>Game Data:</b><br>
|
||||
<a href="/admin/items">Edit Items</a><br>
|
||||
<a href="/admin/drops">Edit Drops</a><br>
|
||||
<a href="/admin/towns">Edit Towns</a><br>
|
||||
<a href="/admin/monsters">Edit Monsters</a><br>
|
||||
<a href="/admin/levels">Edit Levels</a><br>
|
||||
<a href="/admin/spells">Edit Spells</a><br>
|
||||
</td><td>
|
||||
{{content}}
|
||||
</td></tr></table>
|
||||
<br>
|
||||
<table class="copyright" width="90%"><tr>
|
||||
<td width="25%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="25%" align="center">© 2003-2006 by renderse7en</td><td width="25%" align="center">{{totaltime}} Seconds, {{numqueries}} Queries</td><td width="25%" align="center">Version {{version}} {{build}}</td>
|
||||
</center></body>
|
||||
<body>
|
||||
<div id="admin-container">
|
||||
<main>
|
||||
<nav>
|
||||
<h1>Admin Panel</h1>
|
||||
|
||||
<b>Links:</b><br>
|
||||
<a href="/admin">Admin Home</a><br>
|
||||
<a href="/">Game Home</a><br><br>
|
||||
|
||||
<b>Primary Data:</b><br>
|
||||
<a href="/admin/main">Main Settings</a><br>
|
||||
<a href="/admin/news">Add News Post</a><br>
|
||||
<a href="/admin/users">Edit Users</a><br><br>
|
||||
|
||||
<b>Game Data:</b><br>
|
||||
<a href="/admin/items">Edit Items</a><br>
|
||||
<a href="/admin/drops">Edit Drops</a><br>
|
||||
<a href="/admin/towns">Edit Towns</a><br>
|
||||
<a href="/admin/monsters">Edit Monsters</a><br>
|
||||
<a href="/admin/level">Edit Levels</a><br>
|
||||
<a href="/admin/spells">Edit Spells</a><br>
|
||||
</nav>
|
||||
|
||||
<section>
|
||||
<?= $content ?>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div>Powered by <a href="/" target="_new">Dragon Knight</a></div>
|
||||
<div>© 2024 Sharkk</div>
|
||||
<div><?= $totaltime ?> Seconds, <?= $numqueries ?> Queries</div>
|
||||
<div>Version <?= $version ?> <?= $build ?></div>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
<?php
|
||||
$template = <<<THEVERYENDOFYOU
|
||||
<form action="users.php?do=changepassword" method="post">
|
||||
<table width="100%">
|
||||
<tr><td colspan="2">Use the form below to change your password. All fields are required. New passwords must be 10 alphanumeric characters or less.</td></tr>
|
||||
<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr>
|
||||
<tr><td>Old Password:</td><td><input type="password" name="password" /></td></tr>
|
||||
<tr><td>New Password:</td><td><input type="password" name="new_password" /></td></tr>
|
||||
<tr><td>Verify New Password:</td><td><input type="password" name="new_password2" /><br><br><br></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
|
||||
</table>
|
||||
<form action="/changepassword" method="post">
|
||||
<table width="100%">
|
||||
<tr><td colspan="2">Use the form below to change your password. All fields are required. New passwords must be 10 alphanumeric characters or less.</td></tr>
|
||||
<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr>
|
||||
<tr><td>Old Password:</td><td><input type="password" name="password" /></td></tr>
|
||||
<tr><td>New Password:</td><td><input type="password" name="new_password" /></td></tr>
|
||||
<tr><td>Verify New Password:</td><td><input type="password" name="new_password2" /><br><br><br></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
THEVERYENDOFYOU;
|
||||
?>
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
<?php
|
||||
$template = <<<THEVERYENDOFYOU
|
||||
<table width="100%">
|
||||
<tr><td class="title"><img src="/img/title_fighting.gif" alt="Fighting" /></td></tr>
|
||||
<tr><td>
|
||||
You are fighting a <b>{{monstername}}</b><br><br>
|
||||
{{monsterhp}}
|
||||
{{yourturn}}
|
||||
{{monsterturn}}
|
||||
{{command}}
|
||||
</td></tr>
|
||||
<tr><td class="title"><img src="/img/title_fighting.gif" alt="Fighting" /></td></tr>
|
||||
<tr><td>
|
||||
You are fighting a <b><?= $page['monstername'] ?></b><br><br>
|
||||
<?= $page['monsterhp'] ?>
|
||||
<?= $page['yourturn'] ?>
|
||||
<?= $page['monsterturn'] ?>
|
||||
<?= $page['command'] ?>
|
||||
</td></tr>
|
||||
</table>
|
||||
THEVERYENDOFYOU;
|
||||
?>
|
||||
|
|
|
@ -1,85 +1,27 @@
|
|||
<?php
|
||||
|
||||
$template = <<<HTML
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{gamename}} Help</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-image: url('/img/background.jpg');
|
||||
color: black;
|
||||
font: 11px verdana;
|
||||
}
|
||||
table {
|
||||
border-style: none;
|
||||
padding: 0px;
|
||||
font: 11px verdana;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: white;
|
||||
}
|
||||
td {
|
||||
border-style: none;
|
||||
padding: 3px;
|
||||
vertical-align: top;
|
||||
}
|
||||
td.top {
|
||||
border-bottom: solid 2px black;
|
||||
}
|
||||
td.left {
|
||||
width: 150px;
|
||||
border-right: solid 2px black;
|
||||
}
|
||||
td.right {
|
||||
width: 150px;
|
||||
border-left: solid 2px black;
|
||||
}
|
||||
a {
|
||||
color: #663300;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #330000;
|
||||
}
|
||||
.small {
|
||||
font: 10px verdana;
|
||||
}
|
||||
.highlight {
|
||||
color: red;
|
||||
}
|
||||
.light {
|
||||
color: #999999;
|
||||
}
|
||||
.title {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
}
|
||||
.copyright {
|
||||
border: solid 1px black;
|
||||
background-color: #eeeeee;
|
||||
font: 10px verdana;
|
||||
}
|
||||
</style>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?= $control['gamename'] ?> Help</title>
|
||||
<link rel="stylesheet" href="/css/help.css">
|
||||
</head>
|
||||
<body>
|
||||
<a name="top"></a>
|
||||
<h1>{{gamename}} Help</h1>
|
||||
[ <a href="/">Return to the game</a> ]
|
||||
<h1><?= $control['gamename'] ?> Help</h1>
|
||||
[ <a href="/help">Back to Help</a> ]<br>
|
||||
[ <a href="/">Return to Game</a> ]
|
||||
|
||||
<br><br><hr>
|
||||
|
||||
{{content}}
|
||||
<?= $content ?>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="copyright" width="100%"><tr>
|
||||
<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2006 by renderse7en</td>
|
||||
</tr></table>
|
||||
<footer>
|
||||
<div>Powered by <a href="/" target="_new">Dragon Knight</a></div>
|
||||
<div>© 2024 Sharkk</div>
|
||||
<div>Version <?= $version ?> <?= $build ?></div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<?php
|
||||
$template = <<<HTML
|
||||
<section>
|
||||
<div class="title"><img src="/img/button_location.gif" alt="Location" title="Location"></div>
|
||||
Currently: {{currentaction}}<br>
|
||||
Latitude: {{latitude}}<br>
|
||||
Longitude: {{longitude}}<br>
|
||||
Currently: <?= $user['currentaction'] ?><br>
|
||||
Latitude: <?= $user['latitude'] ?><br>
|
||||
Longitude: <?= $user['longitude'] ?><br>
|
||||
<a href="javascript:openmappopup()">View Map</a><br>
|
||||
<form action="/move" method="post" class="move-compass">
|
||||
<button type="submit" name="direction" value="north" class="north">North</button>
|
||||
|
@ -18,18 +16,17 @@ $template = <<<HTML
|
|||
|
||||
<section>
|
||||
<div class="title"><img src="/img/button_towns.gif" alt="Towns" title="Towns"></div>
|
||||
{{currenttown}}
|
||||
<?= $user['currenttown'] ?>
|
||||
Travel To:<br>
|
||||
{{townslist}}
|
||||
<?= $user['townslist'] ?>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="title"><img src="/img/button_functions.gif" alt="Functions" title="Functions"></div>
|
||||
<a href="/">Home</a><br>
|
||||
{{forumslink}}
|
||||
{{adminlink}}
|
||||
<?= $user['forumslink'] ?>
|
||||
<?= $user['adminlink'] ?>
|
||||
<a href="/changepassword">Change Password</a><br>
|
||||
<a href="/logout">Log Out</a><br>
|
||||
<a href="/help">Help</a>
|
||||
</section>
|
||||
HTML;
|
||||
|
|
|
@ -1,35 +1,31 @@
|
|||
<?php
|
||||
|
||||
$template = <<<HTML
|
||||
<form action="/login" method="post">
|
||||
<table width="75%">
|
||||
<tr>
|
||||
<td width="30%">Username:</td>
|
||||
<td><input type="text" name="username"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password:</td>
|
||||
<td><input type="password" name="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Remember me?</td>
|
||||
<td>
|
||||
<input type="hidden" name="remember" value="0">
|
||||
<input type="checkbox" name="remember" value="1">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="submit" name="submit" value="Log In"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Checking the "Remember Me" option will store your login information in a cookie so you don't have
|
||||
to enter it next time you get online.<br><br>Want to play? You gotta
|
||||
<a href="users.php?do=register">register your own character.</a><br><br>You may also
|
||||
<a href="users.php?do=changepassword">change your password</a>, or
|
||||
<a href="users.php?do=lostpassword">request a new one</a> if you've lost yours.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
HTML;
|
||||
<form action="/login" method="post">
|
||||
<table width="75%">
|
||||
<tr>
|
||||
<td width="30%">Username:</td>
|
||||
<td><input type="text" name="username"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password:</td>
|
||||
<td><input type="password" name="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Remember me?</td>
|
||||
<td>
|
||||
<input type="hidden" name="remember" value="0">
|
||||
<input type="checkbox" name="remember" value="1">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><input type="submit" name="submit" value="Log In"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Checking the "Remember Me" option will store your login information in a cookie so you don't have
|
||||
to enter it next time you get online.<br><br>Want to play? You gotta
|
||||
<a href="users.php?do=register">register your own character.</a><br><br>You may also
|
||||
<a href="users.php?do=changepassword">change your password</a>, or
|
||||
<a href="users.php?do=lostpassword">request a new one</a> if you've lost yours.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
<?php
|
||||
$template = <<<THEVERYENDOFYOU
|
||||
<form action="users.php?do=lostpassword" method="post">
|
||||
<table width="80%">
|
||||
<tr><td colspan="2">If you've lost your password, enter your email address below and you will be sent a new one.</td></tr>
|
||||
<tr><td width="20%">Email Address:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
|
||||
</table>
|
||||
<form action="/lostpassword" method="post">
|
||||
<table width="80%">
|
||||
<tr><td colspan="2">If you've lost your password, enter your email address below and you will be sent a new one.</td></tr>
|
||||
<tr><td width="20%">Email Address:</td><td><input type="text" name="email"></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
THEVERYENDOFYOU;
|
||||
?>
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
$template = <<<HTML
|
||||
Here is the character profile for <b>{{username}}</b>.<br><br>
|
||||
When you're finished, you may <a href="/">return to town</a>.<br><br>
|
||||
<table width="200">
|
||||
<tr><td class="title"><img src="/img/button_character.gif" alt="Character" title="Character" /></td></tr>
|
||||
<tr><td>
|
||||
<b>{{username}}</b><br><br>
|
||||
|
||||
Class: {{charclass}}<br><br>
|
||||
|
||||
Level: {{level}}<br>
|
||||
Experience: {{experience}}<br>
|
||||
Gold: {{gold}}<br>
|
||||
Hit Points: {{currenthp}} / {{maxhp}}<br>
|
||||
Magic Points: {{currentmp}} / {{maxmp}}<br>
|
||||
Travel Points: {{currenttp}} / {{maxtp}}<br><br>
|
||||
|
||||
Strength: {{strength}}<br>
|
||||
Dexterity: {{dexterity}}<br>
|
||||
Attack Power: {{attackpower}}<br>
|
||||
Defense Power: {{defensepower}}<br>
|
||||
</td></tr>
|
||||
</table><br>
|
||||
|
||||
<table width="200">
|
||||
<tr><td class="title"><img src="/img/button_inventory.gif" alt="Inventory" title="Inventory" /></td></tr>
|
||||
<tr><td>
|
||||
<table width="100%">
|
||||
<tr><td><img src="/img/icon_weapon.gif" alt="Weapon" title="Weapon" /></td><td width="100%">Weapon: {{weaponname}}</td></tr>
|
||||
<tr><td><img src="/img/icon_armor.gif" alt="Armor" title="Armor" /></td><td width="100%">Armor: {{armorname}}</td></tr>
|
||||
<tr><td><img src="/img/icon_shield.gif" alt="Shield" title="Shield" /></td><td width="100%">Shield: {{shieldname}}</td></tr>
|
||||
</table>
|
||||
Slot 1: {{slot1name}}<br>
|
||||
Slot 2: {{slot2name}}<br>
|
||||
Slot 3: {{slot3name}}
|
||||
</td></tr>
|
||||
</table><br>
|
||||
HTML;
|
|
@ -1,11 +1,9 @@
|
|||
<?php
|
||||
$template = <<<HTML
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{title}}</title>
|
||||
<title><?= $title ?></title>
|
||||
<link rel="stylesheet" href="/css/dk.css">
|
||||
|
||||
<script>
|
||||
|
@ -24,25 +22,30 @@ $template = <<<HTML
|
|||
<body>
|
||||
<div id="game-container">
|
||||
<header>
|
||||
<img id="logo" src="/img/logo.gif" alt="{{dkgamename}}" title="{{dkgamename}}">
|
||||
<nav>{{topnav}}</nav>
|
||||
<img id="logo" src="/img/logo.gif" alt="<?= $dkgamename ?>" title="<?= $dkgamename ?>">
|
||||
<nav><?= $topnav ?></nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="left">{{leftnav}}</section>
|
||||
<section id="middle">{{content}}</section>
|
||||
<section id="right">{{rightnav}}</section>
|
||||
<section id="left"><?= $leftnav ?></section>
|
||||
<section id="middle"><?= $content ?></section>
|
||||
<section id="right"><?= $rightnav ?></section>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div>Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></div>
|
||||
<div>Powered by <a href="/" target="_new">Dragon Knight</a></div>
|
||||
<div>© 2024 Sharkk</div>
|
||||
<div>{{totaltime}} Seconds, {{numqueries}} Queries</div>
|
||||
<div>Version {{version}} {{build}}</div>
|
||||
<div><?= $totaltime ?> Seconds, <?= $numqueries ?> Queries</div>
|
||||
<div>Version <?= $version ?> <?= $build ?></div>
|
||||
</footer>
|
||||
|
||||
{{querylog}}
|
||||
<?php
|
||||
if (!empty($querylog)) {
|
||||
echo '<pre>';
|
||||
foreach ($querylog as $record) echo '<div>['.round($record[1], 2)."s] {$record[0]}</div>";
|
||||
echo '</pre>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
|
|
|
@ -1,30 +1,27 @@
|
|||
<?php
|
||||
$template = <<<HTML
|
||||
<section>
|
||||
<div class="title"><img src="/img/button_character.gif" alt="Character" title="Character"></div>
|
||||
<b>{{username}}</b><br>
|
||||
Level: {{level}}<br>
|
||||
Exp: {{experience}}<br>
|
||||
Gold: {{gold}}<br>
|
||||
HP: {{currenthp}}<br>
|
||||
MP: {{currentmp}}<br>
|
||||
TP: {{currenttp}}<br>
|
||||
{{statbars}}<br>
|
||||
<b><?= $user['username'] ?></b><br>
|
||||
Level: <?= $user['level'] ?><br>
|
||||
Exp: <?= $user['experience'] ?><br>
|
||||
Gold: <?= $user['gold'] ?><br>
|
||||
HP: <?= $user['currenthp'] ?><br>
|
||||
MP: <?= $user['currentmp'] ?><br>
|
||||
TP: <?= $user['currenttp'] ?><br>
|
||||
<?= $user['statbars'] ?><br>
|
||||
<a href="javascript:opencharpopup()">Extended Stats</a>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="title"><img src="/img/button_inventory.gif" alt="Inventory" title="Inventory"></div>
|
||||
<img src="/img/icon_weapon.gif" alt="Weapon" title="Weapon"> Weapon: {{weaponname}}<br>
|
||||
<img src="/img/icon_armor.gif" alt="Armor" title="Armor"> Armor: {{armorname}}<br>
|
||||
<img src="/img/icon_shield.gif" alt="Shield" title="Shield"> Shield: {{shieldname}}<br>
|
||||
Slot 1: {{slot1name}}<br>
|
||||
Slot 2: {{slot2name}}<br>
|
||||
Slot 3: {{slot3name}}
|
||||
<img src="/img/icon_weapon.gif" alt="Weapon" title="Weapon"> Weapon: <?= $user['weaponname'] ?><br>
|
||||
<img src="/img/icon_armor.gif" alt="Armor" title="Armor"> Armor: <?= $user['armorname'] ?><br>
|
||||
<img src="/img/icon_shield.gif" alt="Shield" title="Shield"> Shield: <?= $user['shieldname'] ?><br>
|
||||
Slot 1: <?= $user['slot1name'] ?><br>
|
||||
Slot 2: <?= $user['slot2name'] ?><br>
|
||||
Slot 3: <?= $user['slot3name'] ?>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="title"><img src="/img/button_fastspells.gif" alt="Fast Spells" title="Fast Spells"></div>
|
||||
{{magiclist}}
|
||||
<?= $user['magiclist'] ?>
|
||||
</section>
|
||||
HTML;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<?php
|
||||
$template = <<<HTML
|
||||
<div class="town-content">
|
||||
<div class="options">
|
||||
<div class="title"><img src="/img/town_{{id}}.gif" alt="Welcome to {{name}}" title="Welcome to {{name}}"></div>
|
||||
<div class="title"><img src="/img/town_<?= $town['id'] ?>.gif" alt="Welcome to <?= $town['name'] ?>" title="Welcome to <?= $town['name'] ?>"></div>
|
||||
<b>Town Options:</b><br>
|
||||
<ul>
|
||||
<li><a href="/inn">Rest at the Inn</a></li>
|
||||
|
@ -12,15 +10,14 @@ $template = <<<HTML
|
|||
</div>
|
||||
|
||||
<div class="news">
|
||||
{{news}}
|
||||
<?= $town['news'] ?>
|
||||
</div>
|
||||
|
||||
<div class="whos-online">
|
||||
{{whosonline}}
|
||||
<?= $town['whosonline'] ?>
|
||||
</div>
|
||||
|
||||
<div class="babblebox">
|
||||
{{babblebox}}
|
||||
<?= $town['babblebox'] ?>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
<?php
|
||||
|
||||
$template = <<<HTML
|
||||
<form action="users.php?do=verify" method="post">
|
||||
<table width="80%">
|
||||
<tr><td colspan="2">Thank you for registering a character. Please enter your username, email address, and the verification code
|
||||
that was emailed to you to unlock your character.</td></tr>
|
||||
<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr>
|
||||
<tr><td>Email Address:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr>
|
||||
<tr><td>Verification Code:</td><td><input type="text" name="token" /><br><br><br></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
HTML;
|
||||
<form action="/verify" method="post">
|
||||
<table width="80%">
|
||||
<tr><td colspan="2">Thank you for registering a character. Please enter your username, email address, and the verification code
|
||||
that was emailed to you to unlock your character.</td></tr>
|
||||
<tr><td width="20%">Username:</td><td><input type="text" name="username"></td></tr>
|
||||
<tr><td>Email Address:</td><td><input type="text" name="email"></td></tr>
|
||||
<tr><td>Verification Code:</td><td><input type="text" name="token"><br><br><br></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue
Block a user