/inc/classes/manage.class.php
PHP | 4602 lines | 4050 code | 375 blank | 177 comment | 981 complexity | 05741b6fad9baf617ffa2d4dcc051621 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
Large files files are truncated, but you can click here to view the full file
- <?php
- /*
- * arcNET 0.2
- *
- * arcNET uses core code from ONEECHAN and KUSABA X 0.9.3
- *
- * http://tsukihi.me
- *
- * http://img.oneechan.org
- *
- * +------------------------------------------------------------------------------+
- * Manage Class
- * +------------------------------------------------------------------------------+
- * Manage functions, along with the pages available
- * +------------------------------------------------------------------------------+
- */
- class Manage {
- /* Show the header of the manage page */
- function Header() {
- global $dwoo_data, $tpl_page;
- if (is_file(KU_ROOTDIR . 'inc/pages/modheader.html')) {
- $tpl_includeheader = file_get_contents(KU_ROOTDIR . 'inc/pages/modheader.html');
- } else {
- $tpl_includeheader = '';
- }
- $dwoo_data->assign('includeheader', $tpl_includeheader);
- }
- /* Show the footer of the manage page */
- function Footer() {
- global $dwoo_data, $dwoo, $tpl_page;
- $dwoo_data->assign('page', $tpl_page);
- $board_class = new Board('');
- $dwoo->output(KU_TEMPLATEDIR . '/manage.tpl', $dwoo_data);
- }
- // Creates a salt to be used for passwords
- function CreateSalt() {
- $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
- $salt = '';
- for ($i = 0; $i < 3; ++$i) {
- $salt .= $chars[mt_rand(0, strlen($chars) - 1)];
- }
- return $salt;
- }
- /* Validate the current session */
- function ValidateSession($is_menu = false) {
- global $tc_db, $tpl_page;
- if (isset($_SESSION['manageusername']) && isset($_SESSION['managepassword'])) {
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `username` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']) . " AND `password` = " . $tc_db->qstr($_SESSION['managepassword']) . " LIMIT 1");
- if (count($results) == 0) {
- session_destroy();
- exitWithErrorPage(_gettext('Invalid session.'), '<a href="manage_page.php">'. _gettext('Log in again.') . '</a>');
- }
- $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "staff` SET `lastactive` = " . time() . " WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']));
- return true;
- } else {
- if (!$is_menu) {
- $this->LoginForm();
- die($tpl_page);
- } else {
- return false;
- }
- }
- }
- /* Show the login form and halt execution */
- function LoginForm() {
- global $tc_db, $tpl_page;
- if (file_exists(KU_ROOTDIR . 'inc/pages/manage_login.html')) {
- $tpl_page .= file_get_contents(KU_ROOTDIR . 'inc/pages/manage_login.html');
- }
- }
- /* Log moderator IP's */
- function LogStaffIP(){
- global $tc_db;
-
- $getlog = $tc_db->GetAll("SELECT HIGH_PRIORITY `iplog` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']). " LIMIT 1");
- $ip = $_SERVER['REMOTE_ADDR'];
-
- if(filter_var($ip, FILTER_VALIDATE_IP)) {
-
- $encip = md5_encrypt($ip, KU_RANDOMSEED);
-
- $logevents = 2;
-
- if(isset($getlog[0]['iplog'])){
-
- $log = $getlog[0]['iplog'];
-
- $currentlog = explode('|', $log);
-
- foreach($currentlog as $log){
- if(!isset($log)){
- unset($log);
- }
- }
-
- $currentlog[] = $encip;
-
- if(count($currentlog)>$logevents){
- unset($currentlog[0]);
- }
-
- if(is_array($currentlog)){
- $log = implode('|', $currentlog);
- }
- }
- else{
- $log = $encip;
- }
-
- $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "staff` SET `iplog` = ".$tc_db->qstr($log)." WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']));
- }
-
- return true;
- }
-
-
- /* Check login names and create session if user/pass is correct */
- function CheckLogin() {
- global $tc_db, $action;
- $tc_db->Execute("DELETE FROM `" . KU_DBPREFIX . "loginattempts` WHERE `timestamp` < '" . (time() - 1200) . "'");
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `ip` FROM `" . KU_DBPREFIX . "loginattempts` WHERE `ip` = '" . $_SERVER['REMOTE_ADDR'] . "' LIMIT 6");
- if (count($results) > 5) {
- exitWithErrorPage(_gettext('System lockout'), _gettext('Sorry, because of your numerous failed logins, you have been locked out from logging in for 20 minutes. Please wait and then try again.'));
- } else {
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `username`, `password`, `salt` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = " . $tc_db->qstr($_POST['username']) . " AND `type` != 3 LIMIT 1");
- if (count($results) > 0) {
- if (empty($results[0]['salt'])) {
- if (md5($_POST['password']) == $results[0]['password']) {
- $salt = $this->CreateSalt();
- $tc_db->Execute("UPDATE `" .KU_DBPREFIX. "staff` SET salt = '" .$salt. "' WHERE username = " .$tc_db->qstr($_POST['username']));
- $newpass = md5($_POST['password'] . $salt);
- $tc_db->Execute("UPDATE `" .KU_DBPREFIX. "staff` SET password = '" .$newpass. "' WHERE username = " .$tc_db->qstr($_POST['username']));
- $_SESSION['manageusername'] = $_POST['username'];
- $_SESSION['managepassword'] = $newpass;
- $_SESSION['token'] = md5($_SESSION['manageusername'] . $_SESSION['managepassword'] . rand(0,100));
- $this->SetModerationCookies();
- $tc_db->Execute("DELETE FROM `" . KU_DBPREFIX . "loginattempts` WHERE `ip` < '" . $_SERVER['REMOTE_ADDR'] . "'");
- $action = 'posting_rates';
- $this->LogStaffIP();
- management_addlogentry(_gettext('Logged in'), 1);
- die('<script type="text/javascript">top.location.href = \''. KU_CGIPATH .'/manage.php\';</script>');
- } else {
- $tc_db->Execute("INSERT HIGH_PRIORITY INTO `" . KU_DBPREFIX . "loginattempts` ( `username` , `ip` , `timestamp` ) VALUES ( " . $tc_db->qstr($_POST['username']) . " , '" . $_SERVER['REMOTE_ADDR'] . "' , '" . time() . "' )");
- exitWithErrorPage(_gettext('Incorrect username/password.'));
- }
- } else {
- if (md5($_POST['password'] . $results[0]['salt']) == $results[0]['password']) {
- $_SESSION['manageusername'] = $_POST['username'];
- $_SESSION['managepassword'] = md5($_POST['password'] . $results[0]['salt']);
- $_SESSION['token'] = md5($_SESSION['manageusername'] . $_SESSION['managepassword'] . rand(0,100));
- $this->SetModerationCookies();
- $action = 'posting_rates';
- $this->LogStaffIP();
- management_addlogentry(_gettext('Logged in'), 1);
- die('<script type="text/javascript">top.location.href = \''. KU_CGIPATH .'/manage.php\';</script>');
- } else {
- $tc_db->Execute("INSERT HIGH_PRIORITY INTO `" . KU_DBPREFIX . "loginattempts` ( `username` , `ip` , `timestamp` ) VALUES ( " . $tc_db->qstr($_POST['username']) . " , '" . $_SERVER['REMOTE_ADDR'] . "' , '" . time() . "' )");
- exitWithErrorPage(_gettext('Incorrect username/password.'));
- }
- }
- } else {
- $tc_db->Execute("INSERT HIGH_PRIORITY INTO `" . KU_DBPREFIX . "loginattempts` ( `username` , `ip` , `timestamp` ) VALUES ( " . $tc_db->qstr($_POST['username']) . " , '" . $_SERVER['REMOTE_ADDR'] . "' , '" . time() . "' )");
- exitWithErrorPage(_gettext('Incorrect username/password.'));
- }
- }
- }
- /* Set mod cookies for boards */
- function SetModerationCookies() {
- global $tc_db, $tpl_page;
- if (isset($_SESSION['manageusername'])) {
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `boards` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']) . " LIMIT 1");
- if ($this->CurrentUserIsAdministrator() || $results[0][0] == 'allboards') {
- setcookie("kumod", "allboards", time() + 3600, KU_BOARDSFOLDER, KU_DOMAIN);
- } else {
- if ($results[0][0] != '') {
- setcookie("kumod", $results[0][0], time() + 3600, KU_BOARDSFOLDER, KU_DOMAIN);
- }
- }
- }
- }
-
- function CheckToken($posttoken) {
- if ($posttoken != $_SESSION['token']) {
- // Something is strange
- session_destroy();
- exitWithErrorPage(_gettext('Invalid Token'));
- }
- }
- /* Log current user out */
- function Logout() {
- global $tc_db, $tpl_page;
- setcookie('kumod', '', time() - 3600, KU_BOARDSFOLDER, KU_DOMAIN);
- session_destroy();
- unset($_SESSION['manageusername']);
- unset($_SESSION['managepassword']);
- unset($_SESSION['token']);
- die('<script type="text/javascript">top.location.href = \''. KU_CGIPATH .'/manage.php\';</script>');
- }
- /* If the user logged in isn't an admin, kill the script */
- function AdministratorsOnly() {
- global $tc_db, $tpl_page;
- if (!$this->CurrentUserIsAdministrator()) {
- exitWithErrorPage('That page is for admins only.');
- }
- }
- /* If the user logged in isn't an moderator or higher, kill the script */
- function ModeratorsOnly() {
- global $tc_db, $tpl_page;
- if ($this->CurrentUserIsAdministrator()) {
- return true;
- } else {
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `type` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = '" . $_SESSION['manageusername'] . "' AND `password` = '" . $_SESSION['managepassword'] . "' LIMIT 1");
- foreach ($results as $line) {
- if ($line['type'] != 2) {
- exitWithErrorPage(_gettext('That page is for moderators and administrators only.'));
- }
- }
- }
- }
- /* See if the user logged in is an admin */
- function CurrentUserIsAdministrator() {
- global $tc_db, $tpl_page;
- if ($_SESSION['manageusername'] == '' || $_SESSION['managepassword'] == '' || $_SESSION['token'] == '') {
- $_SESSION['manageusername'] = '';
- $_SESSION['managepassword'] = '';
- $_SESSION['token'] = '';
- return false;
- }
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `type` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = '" . $_SESSION['manageusername'] . "' AND `password` = '" . $_SESSION['managepassword'] . "' LIMIT 1");
- foreach ($results as $line) {
- if ($line['type'] == 1) {
- return true;
- } else {
- return false;
- }
- }
- /* If the function reaches this point, something is fishy. Kill their session */
- session_destroy();
- exitWithErrorPage(_gettext('Invalid session, please log in again.'));
- }
- /* See if the user logged in is a moderator */
- function CurrentUserIsModerator() {
- global $tc_db, $tpl_page;
- if ($_SESSION['manageusername'] == '' || $_SESSION['managepassword'] == '' || $_SESSION['token'] == '') {
- $_SESSION['manageusername'] = '';
- $_SESSION['managepassword'] = '';
- $_SESSION['token'] = '';
- return false;
- }
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `type` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = '" . $_SESSION['manageusername'] . "' AND `password` = '" . $_SESSION['managepassword'] . "' LIMIT 1");
- foreach ($results as $line) {
- if ($line['type'] == 2) {
- return true;
- } else {
- return false;
- }
- }
- /* If the function reaches this point, something is fishy. Kill their session */
- session_destroy();
- exitWithErrorPage(_gettext('Invalid session, please log in again.'));
- }
- /* See if the user logged in is a moderator of a specified board */
- function CurrentUserIsModeratorOfBoard($board, $username) {
- global $tc_db, $tpl_page;
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `type`, `boards` FROM `" . KU_DBPREFIX . "staff` WHERE `username` = '" . $username . "' LIMIT 1");
- if (count($results) > 0) {
- foreach ($results as $line) {
- if ($line['boards'] == 'allboards') {
- return true;
- } else {
- if ($line['type'] == '1') {
- return true;
- } else {
- $array_boards = explode('|', $line['boards']);
- if (in_array($board, $array_boards)) {
- return true;
- } else {
- return false;
- }
- }
- }
- }
- } else {
- return false;
- }
- }
- /*
- * +------------------------------------------------------------------------------+
- * Manage pages
- * +------------------------------------------------------------------------------+
- */
- /*
- * +------------------------------------------------------------------------------+
- * Home Pages
- * +------------------------------------------------------------------------------+
- */
- /* View Announcements */
- function announcements() {
- global $tc_db, $tpl_page;
- $this->ModeratorsOnly();
- $tpl_page .= '<h1><center>'. _gettext('Announcements') .'</center></h1>'. "\n";
- $entries = 0;
- /* Get all of the announcements, ordered with the newest one placed on top */
- $results = $tc_db->GetAll("SELECT * FROM `".KU_DBPREFIX."announcements` ORDER BY `postedat` DESC");
- foreach($results AS $line) {
- $entries++;
- $tpl_page .= '<h2>'.stripslashes($line['subject']).' '. _gettext('by') .' ';
- $tpl_page .= stripslashes($line['postedby']);
- $tpl_page .= ' - '.date("n/j/y @ g:iA T", $line['postedat']);
- $tpl_page .= '</h2>' .
- '<p>'. stripslashes($line['message']) . '</p>';
- }
- }
- function posting_rates() {
- global $tc_db, $tpl_page;
- $tpl_page .= '<h2>'. _gettext('Posting rates (past hour)') . '</h2><br />';
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "boards` ORDER BY `name` ASC");
- if (count($results) > 0) {
- $tpl_page .= '<table border="1" cellspacing="2" cellpadding="2" width="100%"><tr><th>'. _gettext('Board') . '</th><th>'. _gettext('Threads') . '</th><th>'. _gettext('Replies') . '</th><th>'. _gettext('Posts') . '</th></tr>';
- foreach ($results as $line) {
- $rows_threads = $tc_db->GetOne("SELECT HIGH_PRIORITY count(id) FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $line['id'] . " AND `parentid` = 0 AND `timestamp` >= " . (time() - 3600));
- $rows_replies = $tc_db->GetOne("SELECT HIGH_PRIORITY count(id) FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $line['id'] . " AND `parentid` != 0 AND `timestamp` >= " . (time() - 3600));
- $rows_posts = $rows_threads + $rows_replies;
- $threads_perminute = $rows_threads;
- $replies_perminute = $rows_replies;
- $posts_perminute = $rows_posts;
- $tpl_page .= '<tr><td><strong><a href="'. KU_WEBFOLDER . $line['name'] . '">'. $line['name'] . '</a></strong></td><td>'. $threads_perminute . '</td><td>'. $replies_perminute . '</td><td>'. $posts_perminute . '</td></tr>';
- }
- $tpl_page .= '</table>';
- } else {
- $tpl_page .= _gettext('No boards');
- }
- }
- function statistics() {
- global $tc_db, $tpl_page;
- $tpl_page .= '<h2>'. _gettext('Statistics') .'</h2><br />';
- $tpl_page .= '<img src="manage_page.php?graph&type=day" />
- <img src="manage_page.php?graph&type=week" />
- <img src="manage_page.php?graph&type=postnum" />
- <img src="manage_page.php?graph&type=unique" />
- <img src="manage_page.php?graph&type=posttime" />';
- }
- function changepwd() {
- global $tc_db, $tpl_page;
- $tpl_page .= '<h2>'. _gettext('Change account password') . '</h2><br />';
- if (isset($_POST['oldpwd']) && isset($_POST['newpwd']) && isset($_POST['newpwd2'])) {
- $this->CheckToken($_POST['token']);
- if ($_POST['oldpwd'] != '' && $_POST['newpwd'] != '' && $_POST['newpwd2'] != '') {
- if ($_POST['newpwd'] == $_POST['newpwd2']) {
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "staff` WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']) . "");
- foreach ($results as $line) {
- $staff_passwordenc = $line['password'];
- $staff_salt = $line['salt'];
- }
- if (md5($_POST['oldpwd'].$staff_salt) == $staff_passwordenc) {
- $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "staff` SET `password` = '" . md5($_POST['newpwd'].$staff_salt) . "' WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']) . "");
- $_SESSION['managepassword'] = md5($_POST['newpwd'].$staff_salt);
- $tpl_page .= _gettext('Password successfully changed.');
- } else {
- $tpl_page .= _gettext('The old password you provided did not match the current one.');
- }
- } else {
- $tpl_page .= _gettext('The second password did not match the first.');
- }
- } else {
- $tpl_page .= _gettext('Please fill in all required fields.');
- }
- $tpl_page .= '<hr />';
- }
- $tpl_page .= '<form action="manage_page.php?action=changepwd" method="post">
- <input type="hidden" name="token" value="' . $_SESSION['token'] . '" />
- <label for="oldpwd">'. _gettext('Old password') . ':</label>
- <input type="password" name="oldpwd" /><br />
- <label for="newpwd">'. _gettext('New password') . ':</label>
- <input type="password" name="newpwd" /><br />
- <label for="newpwd2">'. _gettext('New password again') . ':</label>
- <input type="password" name="newpwd2" /><br />
- <input type="submit" value="' ._gettext('Change account password') . '" />
- </form>';
- }
- /*
- * +------------------------------------------------------------------------------+
- * Site Administration Pages
- * +------------------------------------------------------------------------------+
- */
- function addannouncement() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- $disptable = true; $formval = 'add'; $title = _gettext('Announcement Management');
- if(isset($_GET['act'])) {
- if ($_GET['act'] == 'edit') {
- if (isset($_POST['announcement'])) {
- $this->CheckToken($_POST['token']);
- $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "announcements` SET `subject` = " . $tc_db->qstr($_POST['subject']) . ", `message` = " . $tc_db->qstr($_POST['announcement']) . " WHERE `id` = " . $tc_db->qstr($_GET['id']));
- $tpl_page .= '<hr /><h3>'. _gettext('Announcement edited') .'</h3><hr />';
- management_addlogentry(_gettext('Edited an announcement'));
- }
- $formval = 'edit&id='. $_GET['id']; $title .= ' - Edit';
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "announcements` WHERE `id` = " . $tc_db->qstr($_GET['id']) . "");
- $values = $results[0]; $disptable = false;
- } elseif ($_GET['act'] == 'del') {
- $tc_db->Execute("DELETE FROM `" . KU_DBPREFIX . "announcements` WHERE `id` = " . $tc_db->qstr($_GET['id']) . "");
- $tpl_page .= '<hr /><h3>'. _gettext('Announcement successfully deleted') .'</h3><hr />';
- management_addlogentry(_gettext('Deleted an announcement'), 9);
- } elseif ($_GET['act'] == 'add' && isset($_POST['announcement']) && isset($_POST['subject'])) {
- if (!empty($_POST['announcement']) && !empty($_POST['subject'])) {
- $tpl_page .= '<hr />';
- $tc_db->Execute("INSERT HIGH_PRIORITY INTO `" . KU_DBPREFIX . "announcements` ( `subject` , `message` , `postedat` , `postedby` ) VALUES ( " . $tc_db->qstr($_POST['subject']) . " , " . $tc_db->qstr($_POST['announcement']) . " , '" . time() . "' , " . $tc_db->qstr($_SESSION['manageusername']) . " )");
- $tpl_page .= '<h3>'. _gettext('Announcement successfully added.') . '</h3>';
- management_addlogentry(_gettext('Added an announcement'), 9);
- $tpl_page .= '<hr />';
- } else {
- $tpl_page .= '<hr />'. _gettext('You must enter a subject as well as a post.') .'<hr />';
- }
- }
- }
- $tpl_page .= '<h2>'. $title . '</h2><br />
- <form method="post" action="?action=addannouncement&act='. $formval . '">
- <input type="hidden" name="token" value="' . $_SESSION['token'] . '" />
- <table><tr><td>
- <label for="subject">'. _gettext('Subject') . ':</label>
- </td><td>
- <input type="text" id="subject" name="subject" value="'. (isset($values['subject']) ? $values['subject'] : '') . '" />
- <div class="desc">'. _gettext('Can not be left blank') . '</div>
- </td></tr><tr><td>
- <label for="announcement">'. _gettext('Post') . ':</label>
- </td><td>
- <textarea id="announcement" name="announcement" rows="25" cols="80">' . (isset($values['message']) ? htmlspecialchars($values['message']) : '') . '</textarea>
- </td></tr></table>
- <input type="submit" value="'. _gettext('Add') . '" />
- </form>
-
- <script type="text/javascript">
- $(document).ready(function() {
- $("#announcement").markItUp(myHtmlSettings);
- });
- </script>
- ';
- if ($disptable) {
- $tpl_page .= '<br /><hr /><h1>'. _gettext('Edit/Delete announcement') .'</h1>';
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "announcements` ORDER BY `id` DESC");
- if (count($results) > 0) {
- $tpl_page .= '<table border="1" width="100%"><tr><th>'. _gettext('Date Added') .'</th><th>'. _gettext('Subject') .'</th><th>'. _gettext('Message') .'</th><th>'. _gettext('Edit/Delete') .'</th></tr>';
- foreach ($results as $line) {
- $tpl_page .= '<tr><td>'. date('F j, Y, g:i a', $line['postedat']) . '</td><td>'. $line['subject'] . '</td><td>'. $line['message'] . '</td><td>[<a href="?action=addannouncement&act=edit&id='. $line['id'] . '">'. _gettext('Edit') .'</a>] [<a href="?action=addannouncement&act=del&id='. $line['id'] . '">'. _gettext('Delete') .'</a>]</td></tr>';
- }
- $tpl_page .= '</table>';
- } else {
- $tpl_page .= _gettext('No announcements yet.');
- }
- }
- }
- /* Edit Dwoo templates */
- function templates() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- $files = array();
- $tpl_page .= '<h2>'. _gettext('Template editor') .'</h2><br />';
- if ($dh = opendir(KU_TEMPLATEDIR)) {
- while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..')
- $files[] = $file;
- }
- closedir($dh);
- }
- sort($files);
- if(isset($_POST['templatedata']) && isset($_POST['template'])) {
- $this->CheckToken($_POST['token']);
- $file = basename($_POST['template']);
- if (in_array($file, $files)) {
- if(file_exists(KU_TEMPLATEDIR . '/'. $file)) {
- file_put_contents(KU_TEMPLATEDIR . '/'. $file, $_POST['templatedata']);
- $tpl_page .= '<hr /><h3>'. _gettext('Template edited') .'</h3><hr />';
- if (isset($_POST['rebuild'])) {
- $this->rebuildall();
- }
- unset($_POST['template']);
- unset($_POST['templatedata']);
- }
- }
- }
- if(!isset($_POST['templatedata']) && !isset($_POST['template'])) {
- $tpl_page .= '<form method="post" action="?action=templates">
- <label for="template">' ._gettext('Template'). ':</label>
- <select name="template" id="template">';
- foreach($files as $template) {
- $tpl_page .='<option name="'. $template .'">'. $template . '</option>';
- }
- $tpl_page .= '</select>';
- }
- if(!isset($_POST['templatedata']) && isset($_POST['template'])) {
- $file = basename($_POST['template']);
- if (in_array($file, $files)) {
- if(file_exists(KU_TEMPLATEDIR . '/'. $file)) {
- $tpl_page .= '<form method="post" action="?action=templates">
- <input type="hidden" name="token" value="' . $_SESSION['token'] . '" />
- <input type="hidden" name="template" value="'. $file .'" />
- <textarea wrap=off rows=40 cols=100 name="templatedata">'. htmlspecialchars(file_get_contents(KU_TEMPLATEDIR . '/'. $file)) . '</textarea>
- <label for="rebuild">'. _gettext('Rebuild HTML after edit?') .'</label>
- <input type="checkbox" name="rebuild" /><br /><br />
- <div class="desc">'. _gettext('Visit <a href="http://wiki.dwoo.org/">http://wiki.dwoo.org/</a> for syntax information.') . '</div>
- <div class="desc">'. sprintf(_gettext('To access Kusaba variables, use {%%KU_VARNAME}, for example {%%KU_BOARDSPATH} would be replaced with %s'), KU_BOARDSPATH) . '</div>
- <div class="desc">'. _gettext('Enclose text in {t}{/t} blocks to allow them to be translated for different languages.') . '</div><br /><br />';
- }
- }
- }
- $tpl_page .= '<input type="submit" value="' ._gettext('Edit') . '" /></form>';
- }
- function index() {
- global $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'index.php';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'index.php');
- $tpl_page .= '<h2>'. _gettext('Index.php') .'</h2> Raw PHP editor for the index.php page.<br /><br />'. "\n" .
- '<form action="?action=index" method="post">'. "\n" .
- '<textarea name="niggers" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>'. "\n";
- }
- # SQL Dumper
- function sqldump() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- $tpl_page .= '<h2>' . _gettext('Execute a MySQL dump') . '</h2><br />';
- $tpl_page .= '<table width="400px"><tr><td>Connecting to server...</td><td>';
- $con = mysql_connect(KU_DBHOST, KU_DBUSERNAME, KU_DBPASSWORD);
- if (!$con) {
- $tpl_page .= '[ <span style="color:#FF0000">FAILED</span> ]</td></tr><tr><td colspan="2">' . mysql_error() . '</td></tr></table><br /><br />A dump cannot be taken until connection error(s) are corrected.';
- } else {
- $tpl_page .= '[ <span style="color:#00FF00">OK</span> ]</td></tr><tr><td>Connecting to database...</td><td>';
- $db_selected = mysql_select_db(KU_DBDATABASE, $con);
- if (!$db_selected) {
- $tpl_page .= '[ <span style="color:#FF0000">FAILED</span> ]</td></tr><tr><td colspan="2">' . mysql_error() . '</td></tr></table><br /><br />A dump cannot be taken until database error(s) are corrected.';
- } else {
- $tpl_page .= '[ <span style="color:#00FF00">OK</span> ]</td></tr></table><br /><br />A dump can be taken. [ <a href="manage_page.php?action=sqldump&dump=1">Execute</a> ]';
- }
- }
- if (isset($_GET['dump'])) {
- header('Content-type: text/plain');
- header('Content-Disposition: attachment; filename="' . date('Y') . '.' . date('m') . '.' . date ('d') . '.http@www' . KU_DOMAIN . '.sql"');
- _mysqldump($db_selected);
- die();
- }
- }
-
- /* Add, edit, delete, and view news entries */
- function news() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- $disptable = true; $formval = 'add'; $title = _gettext('News Management');
- if(isset($_GET['act'])) {
- if ($_GET['act'] == 'edit') {
- if (isset($_POST['news'])) {
- $this->CheckToken($_POST['token']);
- $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "front` SET `subject` = " . $tc_db->qstr($_POST['subject']) . ", `message` = " . $tc_db->qstr($_POST['news']) . ", `email` = " . $tc_db->qstr($_POST['email']) . " WHERE `id` = " . $tc_db->qstr($_GET['id']) . " AND `page` = 0");
- $tpl_page .= '<hr /><h3>'. _gettext('News post edited') .'</h3><hr />';
- management_addlogentry(_gettext('Edited a news entry'), 9);
- }
- $formval = 'edit&id='. $_GET['id']; $title .= ' - Edit';
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "front` WHERE `id` = " . $tc_db->qstr($_GET['id']) . "");
- $values = $results[0];
- $disptable = false;
- } elseif ($_GET['act'] == 'del') {
- $results = $tc_db->Execute("DELETE FROM `" . KU_DBPREFIX . "front` WHERE `id` = " . $tc_db->qstr($_GET['id']) . "");
- $tpl_page .= '<hr /><h3>'. _gettext('News post deleted') .'</h3><hr />';
- management_addlogentry(_gettext('Deleted a news entry'), 9);
- } elseif ($_GET['act'] == 'add') {
- if (isset($_POST['news']) && isset($_POST['subject']) && isset($_POST['email'])) {
- if (!empty($_POST['news']) || !empty($_POST['subject'])) {
- $this->CheckToken($_POST['token']);
- $tpl_page .= '<hr />';
- $tc_db->Execute("INSERT HIGH_PRIORITY INTO `" . KU_DBPREFIX . "front` ( `page`, `subject` , `message` , `timestamp` , `poster` , `email` ) VALUES ( '0', " . $tc_db->qstr($_POST['subject']) . " , " . $tc_db->qstr($_POST['news']) . " , '" . time() . "' , " . $tc_db->qstr($_SESSION['manageusername']) . " , " . $tc_db->qstr($_POST['email']) . " )");
- $tpl_page .= '<h3>'. _gettext('News entry successfully added.') . '</h3>';
- management_addlogentry(_gettext('Added a news entry'), 9);
- $tpl_page .= '<hr />';
- } else {
- $tpl_page .= '<hr />'. _gettext('You must enter a subject as well as a post.') .'<hr />';
- }
- }
- }
- }
- $tpl_page .= '<h2>'. $title . '</h2><br />
- <form method="post" action="?action=news&act='. $formval . '">
- <input type="hidden" name="token" value="' . $_SESSION['token'] . '" />
- <table><tr>
- <td><label for="subject">'. _gettext('Subject') . ':</label></td>
- <td><input type="text" size="50" id="subject" name="subject" value="'. (isset($values['subject']) ? $values['subject'] : '') . '" />
- <div class="desc">'. _gettext('Can not be left blank.') . '</div></td></tr><tr>
- <td><label for="news"> '. _gettext('Post') . ':</label></td>
- <td><textarea id="news" name="news" rows="25" cols="80">' . (isset($values['message']) ? htmlspecialchars($values['message']) : '') . '</textarea><br /></td></tr><tr>
- <td><label for="email">'. _gettext('E-mail') . ':</label></td>
- <td><input type="text" id="email" name="email" value="'. (isset($values['postedemail']) ? $values['postedemail'] : '') . '" />
- <div class="desc">'. _gettext('Can be left blank.') . '</div></td></tr></table>
- <input type="submit" value="'. _gettext('Add') . '" />
- </form>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#news").markItUp(myHtmlSettings);
- });
- </script>
- ';
- if ($disptable) {
- $tpl_page .= '<br /><hr /><h1>'. _gettext('Edit/Delete News') .'</h1>';
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "front` WHERE `page` = 0 ORDER BY `timestamp` DESC");
- if (count($results) > 0) {
- $tpl_page .= '<table border="1" width="100%"><tr><th>'. _gettext('Date Added') .'</th><th>'. _gettext('Subject') .'</th><th>'. _gettext('Message') .'</th><th>'. _gettext('Edit/Delete') .'</th></tr>';
- foreach ($results as $line) {
- $tpl_page .= '<tr><td>'. date('F j, Y, g:i a', $line['timestamp']) . '</td><td>'. $line['subject'] . '</td><td>'. $line['message'] . '</td><td>[<a href="?action=news&act=edit&id='. $line['id'] . '">'. _gettext('Edit') .'</a>] [<a href="?action=news&act=del&id='. $line['id'] . '">'. _gettext('Delete') .'</a>]</td></tr>';
- }
- $tpl_page .= '</table>';
- } else {
- $tpl_page .= _gettext('No news posts yet.');
- }
- }
- }
-
- function faq() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'faq.php';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'faq.php');
- $tpl_page .= '<h2>'. _gettext('Frequently Asked Questions') .'</h2> Raw PHP editor for the FAQ page.<br /><br />'. "\n" .
- '<form action="?action=faq" method="post">'. "\n" .
- '<textarea name="niggers" id="faqEditor" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#faqEditor").markItUp(myHtmlSettings);
- });
- </script>
- '. "\n";
-
- }
- function rules() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- if (!empty($_POST['rules'])) {
- $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "front` SET `message` = " . $tc_db->qstr($_POST['rules']) . " WHERE `id` = " . $tc_db->qstr($_POST['ruleId']) . " AND `page` = 2");
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- $tpl_page .= $tc_db->ErrorMsg();
- }
- $vals = $tc_db->GetAll("SELECT `id`, `message` FROM `" . KU_DBPREFIX . "front` WHERE `page` = 2 ORDER BY `id` LIMIT 1");
-
- if (count($vals) == 0) {
- $id = $tc_db->Execute("INSERT INTO `" . KU_DBPREFIX . "front` ( `page`, `subject` , `message` , `timestamp` , `poster` , `email` ) VALUES ( '2', 'Rules', '', '" . time() . "', '', '')");
- $content = '';
- $tpl_page .= 'Inserted rules post with Id ' . $id;
- } else {
- $id = $vals[0]['id'];
- $content = $vals[0]['message'];
- }
- $tpl_page .= '<h2>'. _gettext('Rules Management') .'</h2> Raw HTML editor for the Rules page.<br /><br />'. "\n" .
- '<form action="?action=rules" method="post">'. "\n" .
- '<input type="hidden" name="ruleId" value="' . $id . '" />'."\n" .
- '<textarea name="rules" id="rulesEditor" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#rulesEditor").markItUp(myHtmlSettings);
- });
- </script>
- '. "\n";
- }
-
- function staffpage() {
- global $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'staff.php';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'staff.php');
- $tpl_page .= '<h2>'. _gettext('Staff') .'</h2> Raw PHP editor for the Staff page.<br /><br />'. "\n" .
- '<form action="?action=staffpage" method="post">'. "\n" .
- '<textarea name="niggers" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>'. "\n";
- }
-
- function legal() {
- global $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'legal.php';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'legal.php');
- $tpl_page .= '<h2>'. _gettext('Legal') .'</h2> Raw PHP editor for the Legal page.<br /><br />'. "\n" .
- '<form action="?action=legal" method="post">'. "\n" .
- '<textarea name="niggers" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>'. "\n";
- }
-
- function boardman() {
- global $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'boardlist.php';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'boardlist.php');
- $tpl_page .= '<h2>'. _gettext('Boardlist Template') .'</h2> Raw PHP editor for the boards table.<br /><br />'. "\n" .
- '<form action="?action=boardman" method="post">'. "\n" .
- '<textarea name="niggers" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>'. "\n";
- }
-
- function tempfooter() {
- global $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'footer.php';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'footer.php');
- $tpl_page .= '<h2>'. _gettext('Footer Template') .'</h2> Raw PHP editor for the footer template.<br /><br />'. "\n" .
- '<form action="?action=tempfooter" method="post">'. "\n" .
- '<textarea name="niggers" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>'. "\n";
- }
-
- function tempheader() {
- global $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'header.php';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('Templates successfully edited.') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'header.php');
- $tpl_page .= '<h2>'. _gettext('Header Template') .'</h2> Raw PHP editor for the header template.<br /><br />'. "\n" .
- '<form action="?action=tempheader" method="post">'. "\n" .
- '<textarea name="niggers" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>'. "\n";
- }
- function boardhtml() {
- global $tpl_page;
- $this->AdministratorsOnly();
- $faq = KU_ROOTDIR . 'boards.html';
- if (!empty($_POST['niggers'])) {
- file_put_contents($faq, $_POST['niggers']);
- $tpl_page .= '<hr />'. _gettext('boards.html successfully edited. REMEMBER TO REBUILD HTML') .'<hr />';
- }
- $content = file_get_contents(KU_ROOTDIR . 'boards.html');
- $tpl_page .= '<h2>'. _gettext('Header Template') .'</h2> Raw PHP editor for boards.html<br /><br />'. "\n" .
- '<form action="?action=tempheader" method="post">'. "\n" .
- '<textarea name="niggers" rows="25" cols="140">' . $content . '</textarea><br />' . "\n" .
- '<input type="submit" value="'. _gettext('Submit') .'" />'. "\n" .
- '</form>'. "\n";
- }
- function blotter() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- if (!KU_BLOTTER) exitWithErrorPage(_gettext('Blotter is disabled'));
- $tpl_page .= '<h2>' ._gettext('Blotter'). '</h2><br />';
- $act = 'add'; $values = array();
- if (isset($_GET['act'])) {
- switch($_GET['act']) {
- case 'add':
- if (isset($_POST['message'])) {
- $this->CheckToken($_POST['token']);
- $important = (isset($_POST['important'])) ? 1 : 0;
- $tc_db->Execute("INSERT INTO `" . KU_DBPREFIX . "blotter` (`at`, `message`, `important`) VALUES ('" . time() . "', " . $tc_db->qstr($_POST['message']) . ", '" . $important . "')");
- $tpl_page .= '<h3>'. _gettext('Blotter entry added.') . '</h3>';
- clearBlotterCache();
- }
- break;
- case 'del':
- if (is_numeric($_GET['id'])) {
- $tc_db->Execute("DELETE FROM `" . KU_DBPREFIX . "blotter` WHERE `id` = " . $tc_db->qstr($_GET['id']) . "");
- $tpl_page .= '<hr /><h3>'. _gettext('Blotter entry deleted.') . '</h3><hr />';
- clearBlotterCache();
- } else {
- exitWithErrorPage(_gettext('Invalid ID'));
- }
- break;
- case 'edit':
- if (is_numeric($_GET['id'])) {
- $act = 'edit&id=' .$_GET['id'];
- if (isset($_POST['message'])) {
- $this->CheckToken($_POST['token']);
- $important = (isset($_POST['important'])) ? 1 : 0;
- $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "blotter` SET `message` = " . $tc_db->qstr($_POST['message']) . ", `important` = '" . $important . "' WHERE `id` = " . $tc_db->qstr($_GET['id']) . "");
- $tpl_page .= '<h3>'. _gettext('Blotter entry updated.') . '</h3>';
- clearBlotterCache();
- }
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "blotter` WHERE `id` = " . $tc_db->qstr($_GET['id']) . " LIMIT 1");
- $values = $results[0];
- } else {
- exitWithErrorPage(_gettext('Invalid ID'));
- }
- break;
- default:
- exitWithErrorPage(_gettext('Invalid value for \'act\''));
- break;
- }
- }
- $tpl_page .= '<form action="?action=blotter&act=' .$act. '" method="post">
- <input type="hidden" name="token" value="' . $_SESSION['token'] . '" />
- <label for="message">' ._gettext('Message'). ':</label>
- <input type="text" id="message" name="message" value="' .(isset($values['message']) ? $values['message'] : ''). '" size="75" /><br />
- <label for="important">' ._gettext('Important'). ':</label>
- <input type="checkbox" id="important" name="important" ';
- if (isset($values['important']) && $values['important'] == 1) $tpl_page .= 'checked="checked" ';
- $tpl_page .= '/><br />
- <input type="submit" value="' ._gettext('Submit'). '" /><br />
- </form><br /><br />';
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "blotter` ORDER BY `id` DESC");
- if (count($results) > 0) {
- $tpl_page .= '<table border="1" width="100%"><tr><th>'. _gettext('At') . '</th><th>'. _gettext('Message') . '</th><th>'. _gettext('Important') . '</th><th> </th></tr>';
- foreach ($results as $line) {
- $tpl_page .= '<tr><td>'. date('m/d/y', $line['at']) . '</td><td>'. $line['message'] . '</td><td>';
- $tpl_page .= ($line['important'] == 1) ? _gettext('Yes') : _gettext('No');
- $tpl_page .= '</td><td>[<a href="?action=blotter&act=edit&id='. $line['id'] . '">'. _gettext('Edit') .'</a>] [<a href="?action=blotter&act=del&id='. $line['id'] . '">'. _gettext('Delete') .'</a>]</td></tr>';
- }
- $tpl_page .= '</table>';
- } else {
- $tpl_page .= _gettext('No blotter entries');
- }
- }
-
- /* Display disk space used per board, and finally total in a large table */
- function spaceused() {
- global $tc_db, $tpl_page;
- $this->AdministratorsOnly();
- $tpl_page .= '<h2>'. _gettext('Disk space used') . '</h2><br />';
- $spaceused_res = 0;
- $spaceused_src = 0;
- $spaceused_thumb = 0;
- $spaceused_total = 0;
- $files_res = 0;
- $files_src = 0;
- $files_thumb = 0;
- $files_total = 0;
- $tpl_page .= '<table border="1" width="100%"><tr><th>'. _gettext('Board') .'</th><th>'. _gettext('Area') .'</th><th>'. _gettext('Files') .'</th><th>'. _gettext('Space Used') .'</th></tr>';
- $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `name` FROM `" . KU_DBPREFIX . "boards` ORDER BY `name` ASC");
- foreach ($results as $line) {
- list($spaceused_board_res, $files_board_res) = recursive_directory_size(KU_BOARDSDIR . $line['name'] . '/res');
- list($spaceused_board_src, $files_board_src) = recursive_directory_size(KU_BOARDSDIR . $line['name'] . '/src');
- list($spaceused_board_thumb, $files_board_thumb) = recursive_directory_size(KU_BOARDSDIR . $line['name'] . '/thumb');
- $spaceused_board_total = $spaceused_board_res + $spaceused_board_src + $spaceused_board_thumb;
- $files_board_total = $files_board_res + $files_board_src + $files_board_thumb;
- $spaceused_res += $spaceused_board_res;
- $files_res += $files_board_res;
- $spaceused_src += $spaceused_board_src;
- $files_src += $files_board_src;
- $spaceused_thumb += $spaceused_board_thumb;
- $files_thumb += $files_board_thumb;
- $spaceused_total += $spaceused_board_total;
- $files_total += $files_board_total;
- $tpl_page .= '<tr><td rowspan="4">/'.$line['name'].'/</td><td>res/</td><td>'. number_format($files_board_res) . '</td><td>'. ConvertBytes($spaceused_board_res) . '</td></tr>';
- $tpl_page .= '<tr><td>src/</td><td>'. number_format($files_board_src) . '</td><td>'. ConvertBytes($spaceused_board_src) . '</td></tr>';
- $tpl_page .= '<tr><td>thumb/</td><td>'. number_format($files_board_thumb) . '</td><td>'. ConvertBytes($spaceused_board_thumb) . '</td></tr>';
- $tpl_page .= '<tr><td><strong>'. _gettext('Total') .'</strong></td><td>'. number_format($files_board_total) . '</td><td>'. ConvertBytes($spaceused_board_total) . '</td></tr>';
- }
- $tpl_page .= '<tr><td rowspan="4"><strong>'. _gettext('All boards') .'</strong></td><td>res/</td><td>'. number_format($files_res) . '</td><td>'. ConvertBytes($spaceused_res) . '</td></tr>';
- $tpl_page .= '<tr><td>src/</td><td>'. number_format($files_src) . '</td><td>'. ConvertBytes($spaceused_src) . '</td></tr>';
- $tpl_page .= '<tr><td>thumb/</td><td>'. number_format($files_thumb) . '</td><td>'. ConvertBytes($s…
Large files files are truncated, but you can click here to view the full file