summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/config.php4
-rw-r--r--inc/functions.php16
-rw-r--r--inc/mod.php2
3 files changed, 22 insertions, 0 deletions
diff --git a/inc/config.php b/inc/config.php
index 5bd8eb97..d19af058 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -295,6 +295,10 @@
$config['mod']['view_ban'] = $config['mod']['view_banlist'];
// Create a new board
$config['mod']['newboard'] = ADMIN;
+ // Manage existing boards (change title, etc)
+ $config['mod']['manageboards'] = ADMIN;
+ // Delete a board
+ $config['mod']['deleteboard'] = ADMIN;
// Mod links (full HTML)
// Correspond to above permission directives
diff --git a/inc/functions.php b/inc/functions.php
index 0fa20fc3..dabdbb64 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -988,6 +988,22 @@
@file_put_contents($board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $id), $body) or error("Couldn't write to file.");
}
+ function rrmdir($dir) {
+ if (is_dir($dir)) {
+ $objects = scandir($dir);
+ foreach ($objects as $object) {
+ if ($object != "." && $object != "..") {
+ if (filetype($dir."/".$object) == "dir")
+ rrmdir($dir."/".$object);
+ else
+ unlink($dir."/".$object);
+ }
+ }
+ reset($objects);
+ rmdir($dir);
+ }
+ }
+
function generate_tripcode ( $name, $length = 10 ) {
global $config;
$name = stripslashes ( $name );
diff --git a/inc/mod.php b/inc/mod.php
index 89ab8d35..51ff7785 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -112,6 +112,8 @@
'</a> - ' .
$b['title'] .
(isset($b['subtitle']) ? '<span class="unimportant"> — ' . $b['subtitle'] . '</span>' : '') .
+ ($mod['type'] >= $config['mod']['manageboards'] ?
+ ' <a href="?/board/' . $b['uri'] . '" class="unimportant">[manage]</a>' : '') .
'</li>';
}