Mod stickies and redirects
This commit is contained in:
parent
13cd22e324
commit
d579771210
@ -144,7 +144,12 @@
|
|||||||
$query->bindValue(':time', time(), PDO::PARAM_INT);
|
$query->bindValue(':time', time(), PDO::PARAM_INT);
|
||||||
$query->bindValue(':password', $post['password']);
|
$query->bindValue(':password', $post['password']);
|
||||||
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
|
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
|
||||||
$query->bindValue(':sticky', 0, PDO::PARAM_INT);
|
|
||||||
|
if($post['mod'] && $post['sticky']) {
|
||||||
|
$query->bindValue(':sticky', 1, PDO::PARAM_INT);
|
||||||
|
} else {
|
||||||
|
$query->bindValue(':sticky', 0, PDO::PARAM_INT);
|
||||||
|
}
|
||||||
|
|
||||||
if($OP) {
|
if($OP) {
|
||||||
// No parent thread, image
|
// No parent thread, image
|
||||||
|
10
post.php
10
post.php
@ -91,6 +91,9 @@
|
|||||||
// Liar. You're not a mod.
|
// Liar. You're not a mod.
|
||||||
error(ERROR_NOTAMOD);
|
error(ERROR_NOTAMOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$post['sticky'] = isset($_POST['sticky']);
|
||||||
|
$post['locked'] = isset($_POST['lock']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($post['has_file']) {
|
if($post['has_file']) {
|
||||||
@ -311,10 +314,13 @@
|
|||||||
buildIndex();
|
buildIndex();
|
||||||
sql_close();
|
sql_close();
|
||||||
|
|
||||||
|
|
||||||
|
$root = $post['mod'] ? ROOT . FILE_MOD . '?/' : ROOT;
|
||||||
|
|
||||||
if(ALWAYS_NOKO || $noko) {
|
if(ALWAYS_NOKO || $noko) {
|
||||||
header('Location: ' . ROOT . $board['dir'] . DIR_RES . ($OP?$id:$post['thread']) . '.html' . (!$OP?'#'.$id:''), true, REDIRECT_HTTP);
|
header('Location: ' . $root . $board['dir'] . DIR_RES . ($OP?$id:$post['thread']) . '.html' . (!$OP?'#'.$id:''), true, REDIRECT_HTTP);
|
||||||
} else {
|
} else {
|
||||||
header('Location: ' . ROOT . $board['dir'] . FILE_INDEX, true, REDIRECT_HTTP);
|
header('Location: ' . $root . $board['dir'] . FILE_INDEX, true, REDIRECT_HTTP);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user