you can now view the inbox

This commit is contained in:
nilsding 2014-08-18 16:03:17 +02:00
parent e0224f867b
commit fa53942b17
2 changed files with 20 additions and 1 deletions

19
ucp.php
View File

@ -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");
}
}

View File

@ -16,7 +16,7 @@
<table class="table table-responsive table-bordered table-condensed">
<tbody>
{loop="$words"}
<td>{$value.author} wrote that you are <span class="label label-default">{$value.first}</span>, <span class="label label-default">{$value.second}</span> and <span class="label label-default">{$value.third}</span></td>
<td>{$value.author} wrote that you are <span class="label label-default">{$value.word1}</span>, <span class="label label-default">{$value.word2}</span> and <span class="label label-default">{$value.word3}</span></td>
{/loop}
</tbody>
</table>