diff --git a/public/css/dk.css b/public/css/dk.css index 65ae3a0..ce56c18 100644 --- a/public/css/dk.css +++ b/public/css/dk.css @@ -170,3 +170,12 @@ a:hover { height: 38px; } +div.town-content { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1rem; +} + +div.town-content div.options, div.town-content div.news { + grid-column: span 2; +} diff --git a/public/index.php b/public/index.php index 5e05fc0..0a4fd2b 100644 --- a/public/index.php +++ b/public/index.php @@ -101,34 +101,6 @@ if ($l['code'] !== 200) exit($l['code']); if (!empty($l['middleware'])) foreach ($l['middleware'] as $middleware) $middleware(); $l['handler'](...$l['params'] ?? []); -/* -$do = explode(':', $_GET['do'] ?? ''); -match ($do[0]) { - 'inn' => inn(), - 'buy' => buy(), - 'buy2' => buy2($do[1]), - 'buy3' => buy3($do[1]), - // 'sell' => sell(), - 'maps' => maps(), - 'maps2' => maps2($do[1]), - 'maps3' => maps3($do[1]), - 'gotown' => travelto($do[1]), - 'move' => move(), - 'fight' => fight(), - 'victory' => victory(), - 'drop' => drop(), - 'dead' => dead(), - 'verify' => header("Location: users.php?do=verify"), - 'spell' => healspells($do[1]), - 'showchar' => showchar(), - 'onlinechar' => onlinechar($do[1]), - 'showmap' => showmap(), - 'babblebox' => babblebox(), - 'ninja' => ninja(), - default => donothing() -}; -*/ - function donothing() { global $userrow; @@ -163,9 +135,8 @@ function dotown() // News box. Grab latest news entry and display it. Something a little more graceful coming soon maybe. if ($controlrow["shownews"] == 1) { $newsrow = db()->query('SELECT * FROM news ORDER BY id DESC LIMIT 1;')->fetchArray(SQLITE3_ASSOC); - $townrow["news"] = "
Latest News
\n"; + $townrow["news"] = '
Latest News
'; $townrow["news"] .= "[".prettydate($newsrow["postdate"])."]
".nl2br($newsrow["content"]); - $townrow["news"] .= "
\n"; } // Who's Online. Currently just members. Guests maybe later. @@ -180,22 +151,18 @@ function dotown() $online_rows[] = "".$onlinerow["username"].""; } - $townrow["whosonline"] = "
Who's Online
\n"; + $townrow["whosonline"] = '
Who\'s Online
'; $townrow["whosonline"] .= "There are $online_count user(s) online within the last 10 minutes: "; $townrow["whosonline"] .= rtrim(implode(', ', $online_rows), ', '); - $townrow["whosonline"] .= "
\n"; } if ($controlrow["showbabble"] == 1) { $townrow["babblebox"] = << - Babble Box - - - - +
Babble Box
+ HTML; } @@ -305,15 +272,13 @@ function babblebox() redirect('/babblebox'); } - $babblebox = ["content" => ""]; - $bg = 1; - $query = db()->query('SELECT * FROM babble ORDER BY id DESC LIMIT 20;'); + $babblebox['content'] = ''; + $query = db()->query('SELECT * FROM babble ORDER BY id DESC LIMIT 40;'); while ($babblerow = $query->fetchArray(SQLITE3_ASSOC)) { - if ($bg == 1) { $new = "
[".$babblerow["author"]."] ".$babblerow["babble"]."
\n"; $bg = 2; } - else { $new = "
[".$babblerow["author"]."] ".stripslashes($babblerow["babble"])."
\n"; $bg = 1; } + $new = "
[{$babblerow["author"]}] {$babblerow["babble"]}
\n"; $babblebox["content"] = $new . $babblebox["content"]; } - $babblebox["content"] .= "

"; + $babblebox["content"] .= '

'; echo parsetemplate("\n" . gettemplate("babblebox"), $babblebox); } diff --git a/templates/babblebox.php b/templates/babblebox.php index 31213e7..8c2387b 100644 --- a/templates/babblebox.php +++ b/templates/babblebox.php @@ -1,34 +1,44 @@ -shoutbox - + Babblebox + -{{content}} + {{content}} -THEVERYENDOFYOU; -?> +HTML; diff --git a/templates/towns.php b/templates/towns.php index 052b941..417d995 100644 --- a/templates/towns.php +++ b/templates/towns.php @@ -1,26 +1,26 @@ -Welcome to {{name}} - -Town Options:
- - -
-{{news}} -
- - -
-{{whosonline}} - -{{babblebox}} -
- - -THEVERYENDOFYOU; -?> +$template = << +
+
Welcome to {{name}}
+ Town Options:
+ +
+ +
+ {{news}} +
+ +
+ {{whosonline}} +
+ +
+ {{babblebox}} +
+ +HTML;