forked from leftypol/leftypol
Manage boards
This commit is contained in:
parent
23f67abb0e
commit
a1f300cc8f
4 changed files with 104 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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>';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue