From fa53942b170673827e50711d60dac90310c750c6 Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 18 Aug 2014 16:03:17 +0200 Subject: [PATCH] you can now view the inbox --- ucp.php | 19 +++++++++++++++++++ views/inbox.html | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ucp.php b/ucp.php index 86182a9..85dd911 100644 --- a/ucp.php +++ b/ucp.php @@ -78,6 +78,25 @@ switch ($_GET['page']) { default: { check_privileges(); + $sql_str = "SELECT `word1`, `word2`, `word3`, `author`, `new` FROM `words`;"; + $res = $sql->query($sql_str); + + $words = array(); + + while ($r = $res->fetch_assoc()) { + array_push($words, array( + "word1" => $r['word1'], + "word2" => $r['word2'], + "word3" => $r['word3'], + "author" => $r['author'], + "new" => ($r['new'] == 1 ? true : false) + )); + } + + $sql_str = "UPDATE `words` SET `new` = 0;"; + $sql->query($sql_str); + + $tpl->assign("words", $words); $tpl->draw("inbox"); } } \ No newline at end of file diff --git a/views/inbox.html b/views/inbox.html index feffc25..54d0a3b 100644 --- a/views/inbox.html +++ b/views/inbox.html @@ -16,7 +16,7 @@ {loop="$words"} - + {/loop}
{$value.author} wrote that you are {$value.first}, {$value.second} and {$value.third}{$value.author} wrote that you are {$value.word1}, {$value.word2} and {$value.word3}