mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
Starting on ?/ban/<post>
This commit is contained in:
parent
9286ec4928
commit
4fcf9c2c91
@ -365,6 +365,24 @@ function mod_bumplock($board, $unbumplock, $post) {
|
||||
header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']);
|
||||
}
|
||||
|
||||
function mod_ban_post($board, $delete, $post) {
|
||||
global $config, $mod;
|
||||
|
||||
if (!openBoard($board))
|
||||
error($config['error']['noboard']);
|
||||
|
||||
if (!hasPermission($config['mod']['delete'], $board))
|
||||
error($config['error']['noaccess']);
|
||||
|
||||
$query = prepare(sprintf('SELECT `ip` FROM `posts_%s` WHERE `id` = :id', $board));
|
||||
$query->bindValue(':id', $post);
|
||||
$query->execute() or error(db_error($query));
|
||||
if(!$ip = $query->fetchColumn(0))
|
||||
error($config['error']['404']);
|
||||
|
||||
mod_page("New ban", 'mod/ban_form.html', array());
|
||||
}
|
||||
|
||||
function mod_delete($board, $post) {
|
||||
global $config, $mod;
|
||||
|
||||
|
1
mod.php
1
mod.php
@ -44,6 +44,7 @@ $pages = array(
|
||||
'!^/bans/(\d+)$!' => 'bans', // ban list
|
||||
|
||||
'!^/(\w+)/delete/(\d+)$!' => 'delete', // delete post
|
||||
'!^/(\w+)/ban/(&delete/)?(\d+)$!' => 'ban_post', // ban poster
|
||||
'!^/(\w+)/(un)?lock/(\d+)$!' => 'lock', // lock thread
|
||||
'!^/(\w+)/(un)?sticky/(\d+)$!' => 'sticky', // sticky thread
|
||||
'!^/(\w+)/bump(un)?lock/(\d+)$!' => 'bumplock', // "bumplock" thread
|
||||
|
Loading…
Reference in New Issue
Block a user