function clearLogs() { global $prefs; $log = $_POST['log']; $send = array(); $ys = ys($_SESSION['yLog']); switch (true) { case !loggedIn(): $send['error'] = 'admin'; break; default: for ($i = 1; $i <= $prefs['logs']; $i++) { $ys = ys($i); $ys->clear(); } $send['error'] = false; } echo jsonEncode($send); }
include '../php/filestorage.class.php'; include '../preferences.php'; include '../php/functions.php'; include '../php/yshout.class.php'; $html = '<div id="history-posts">'; $admin = loggedIn(); if (isset($_GET['log'])) { $log = $_GET['log']; } if (isset($_POST['log'])) { $log = $_POST['log']; } if (!isset($log)) { $log = 1; } $ys = ys($log); $posts = $ys->posts(); if (sizeof($posts) === 0) { $html .= ' <div id="ys-post-1" class="ys-post ys-first ys-admin-post"> <span class="ys-post-timestamp">13:37</span> <span class="ys-post-nickname">Yurivish:<span> <span class="ys-post-message">Hey, there aren\'t any posts in this log.</span> </div> '; } $id = 0; foreach ($posts as $post) { $id++; $banned = $ys->banned($post['adminInfo']['ip']); $html .= '<div ' . ($admin ? 'rel="' . $post['adminInfo']['ip'] . '" ' : '') . 'id="ys-post-' . $id . '" class="ys-post' . ($post['admin'] ? ' ys-admin-post' : '') . ($banned ? ' ys-banned-post' : '') . '">' . "\n";
function bansList() { global $kioskMode; $ys = ys(); $bans = $ys->bans(); $html = '<ul id="bans-list">'; $hasBans = false; foreach ($bans as $ban) { $hasBans = true; $html .= ' <li> <span class="nickname">' . $ban['nickname'] . '</span> (<span class="ip">' . ($kioskMode ? '[No IP in Kiosk Mode]' : $ban['ip']) . '</span>) <a title="Unban" class="unban-link" href="#" rel="' . $ban['timestamp'] . '">Unban</a> </li> '; } if (!$hasBans) { $html = '<p id="no-bans">No one is banned.</p>'; } else { $html .= '</ul>'; } return $html; }