Commit fa53942b authored by Jyrki's avatar Jyrki 🐾
Browse files

you can now view the inbox

parent e0224f86
......@@ -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
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment