diff --git a/WebInterface/master-site/common.php b/WebInterface/master-site/common.php index 119e180..2312882 100755 --- a/WebInterface/master-site/common.php +++ b/WebInterface/master-site/common.php @@ -210,7 +210,7 @@ function get_fourm_threads($fourm) { include('config.php'); $connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'"); - $stmt = $connect->prepare("SELECT * FROM FourmThread WHERE Fourm=?"); + $stmt = $connect->prepare("SELECT * FROM FourmThread WHERE Fourm=? ORDER BY CreationTime DESC"); $stmt->bind_param("s", $fourm); $stmt->execute(); $result = $stmt->get_result(); diff --git a/WebInterface/master-site/web/forums.php b/WebInterface/master-site/web/forums.php index 95de95f..d41f9b4 100755 --- a/WebInterface/master-site/web/forums.php +++ b/WebInterface/master-site/web/forums.php @@ -5,6 +5,7 @@ include("header.php"); ?> Forum thread not found!?'); - exit(); + $nope = 1; + goto ex; } create_fourm_reply($threadId, $_SESSION['USERNAME'], $text, $forum, $_SESSION['ADMIN']); @@ -49,6 +60,13 @@ if(!is_logged_in()){ } ?>
SUPPORT
( topics)
BUGS
( topics)
GENERAL
( topics)
HORSES
( topics)
GAME
( topics)
Forum thread not found!?'); + exit(); +} + if(isset($_GET['FORUM']) && isset($_GET['VIEWID'])){ $forum = strtoupper($_GET['FORUM']); $threadId = $_GET['VIEWID']; @@ -57,11 +75,8 @@ if(isset($_GET['FORUM']) && isset($_GET['VIEWID'])){ echo('Unknown Forum'); exit(); } - if(count_replies($threadId) <= 0) - { - echo('
Forum thread not found!?'); - exit(); - } + if(count_replies($threadId) <= 0 || $nope) + goto nope; $thread = get_fourm_thread($threadId); echo('
VIEWING '.htmlspecialchars($forum).' FORUM THREAD: '.htmlspecialchars($thread['title']).'
'); @@ -103,10 +118,13 @@ if(isset($_GET['FORUM']) && !isset($_GET['VIEWID'])){ $minsAgo = 0; $current_time = time(); $difference = $current_time - $createTime; + $secsAgo = $difference; $minsAgo = $difference/60; $daysAgo = $difference/86400; - if($minsAgo <= 1440) + if($secsAgo <= 60) + echo(''.number_format((float)$minsAgo, 0, '.', '').' sec ago'); + else if($minsAgo <= 1440) echo(''.number_format((float)$minsAgo, 0, '.', '').' min ago'); else echo(number_format((float)$daysAgo, 0, '.', '').' days ago');