Commit 3d09077f authored by Jyrki's avatar Jyrki 🐾
Browse files

added a flash and also some basic UCP code

parent 4558a51f
......@@ -68,8 +68,16 @@ if (!isset($notemplate)) {
$res = $sql->query("SELECT `value` FROM `config` WHERE `key` = \"sitename\";")->fetch_assoc();
$site_name = htmlspecialchars($res['value']);
// the flash
$message = null;
if (isset($_SESSION['flash'])) {
$message = $_SESSION['flash'];
unset($_SESSION['flash']);
}
$tpl->assign("logged_in", $_SESSION['logged_in']);
$tpl->assign("site_name", $site_name);
$tpl->assign("words_total", $words_total_count);
$tpl->assign("inbox_count", $new_words_count);
$tpl->assign("message", $message);
}
\ No newline at end of file
<?php
/* This file is part of 3words
*
* (c) 2014 Leafcat Coding -- http://leafc.at
*
* License: AGPLv3, see LICENSE for full license text
*
* This file was touched by:
* - nilsding <nilsding@nilsding.org>
*
* Oh, and before I forget...
* ________ __________ __ ____ __ ______
* / ____/ / / / ____/ //_/ / __ \/ / / / __ \
* / /_ / / / / / / ,< / /_/ / /_/ / /_/ / with
* / __/ / /_/ / /___/ /| | / ____/ __ / ____/ a
* /_/ \____/\____/_/ |_| /_/ /_/ /_/_/ cactus!
*
* Thanks for listening.
*/
include_once 'config.php';
switch ($_GET['page']) {
case "login": {
$tpl->draw("login");
break;
}
case "logout": {
session_destroy();
session_start();
$_SESSION['flash'] = "Sucessfully logged out";
header('Location: index.php');
break;
}
case "settings": {
$tpl->draw("settings");
break;
}
case "inbox":
default: {
$tpl->draw("inbox");
}
}
\ No newline at end of file
{include="layout"}
{include="navbar"}
<div class="container">
{if="$message"}
<div class="alert alert-info">{$message}</div>
{/if}
<div class="row">
<div class="col-md-3">
<ul class="nav nav-pills nav-stacked nav-justified">
......
{include="layout"}
{include="navbar"}
<div class="container">
{if="$message"}
<div class="alert alert-info">{$message}</div>
{/if}
<h1>{$site_name}!</h1>
<p>Want to tell them who you are? <input id="author" type="text" class="form-control" placeholder="Anonymous"></p>
<div class="row">
......
{include="layout"}
{include="navbar"}
<div class="container">
{if="$message"}
<div class="alert alert-info">{$message}</div>
{/if}
<form role="form" method="POST">
<div class="form-group">
<label for="InputUsername">Username</label>
......
{include="layout"}
{include="navbar"}
<div class="container">
{if="$message"}
<div class="alert alert-info">{$message}</div>
{/if}
<div class="row">
<div class="col-md-3">
<ul class="nav nav-pills nav-stacked nav-justified">
......
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