@ -1317,36 +1317,15 @@ if (isset($_POST['delete'])) {
$query->execute() or error(db_error($query));
$telegrams = $query->fetchAll(PDO::FETCH_ASSOC);
if (count($telegrams) > 0)
goto skip_redirect;
if (!isset($_POST['json_response'])) {
header('Location: ' . $redirect, true, $config['redirect_http']);
} else {
header('Content-Type: text/json; charset=utf-8');
echo json_encode(array(
'redirect' => $redirect,
'noko' => $noko,
'id' => $id
));
}
skip_redirect:
if ($config['try_smarter'] & & $post['op'])
$build_pages = range(1, $config['max_pages']);
if ($post['op'])
clean($id);
event('post-after', $post);
buildIndex();
if (count($telegrams) > 0) {
$ids = implode(', ', array_map(function($x) { return (int)$x['id']; }, $telegrams));
query("UPDATE ``telegrams`` SET ``seen`` = 1 WHERE ``id`` IN({$ids})") or error(db_error());
die(Element('page.html', array(
// Give JS users a redirect instead of an error
if (isset($_POST['json_response'])) {
header('Content-Type: text/json');
echo json_encode(array('error' => true, 'telegram' => true));
} else {
echo Element('page.html', array(
'title' => _('Important message from Moderation'),
'config' => $config,
'body' => Element('important.html', array(
@ -1354,18 +1333,47 @@ if (isset($_POST['delete'])) {
'redirect' => $redirect,
'telegrams' => $telegrams,
))
)));
));
}
} else {
if (!isset($_POST['json_response'])) {
header('Location: ' . $redirect, true, $config['redirect_http']);
} else {
header('Content-Type: text/json; charset=utf-8');
echo json_encode(array(
'redirect' => $redirect,
'noko' => $noko,
'id' => $id
));
}
}
if ($post['op']) {
clean($id);
if ($config['try_smarter'])
$build_pages = range(1, $config['max_pages']);
}
event('post-after', $post);
// If this is a new thread or the poster is returning to the index, build it before they redirect
if ($post['op'] || !$noko)
buildIndex();
// We are already done, let's continue our heavy-lifting work in the background (if we run off FastCGI)
if (function_exists('fastcgi_finish_request'))
if (function_exists('fastcgi_finish_request')) {
@fastcgi_finish_request();
}
if ($post['op'])
if (!$post['op'] & & $noko)
buildIndex();
if ($post['op']) {
rebuildThemes('post-thread', $board['uri']);
else
} else {
rebuildThemes('post', $board['uri']);
}
} elseif (isset($_POST['appeal'])) {
if (!isset($_POST['ban_id']))
error($config['error']['bot']);