1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-12 09:13:07 +01:00

Allow a board called news to exist

This commit is contained in:
8chan 2014-12-14 03:27:26 -08:00
parent 6ed13f3fb0
commit d705606729
2 changed files with 7 additions and 7 deletions

View File

@ -633,7 +633,7 @@ function mod_news($page_no = 1) {
rebuildThemes('news'); rebuildThemes('news');
header('Location: ?/news#' . $pdo->lastInsertId(), true, $config['redirect_http']); header('Location: ?/edit_news#' . $pdo->lastInsertId(), true, $config['redirect_http']);
} }
$query = prepare("SELECT * FROM ``news`` ORDER BY `id` DESC LIMIT :offset, :limit"); $query = prepare("SELECT * FROM ``news`` ORDER BY `id` DESC LIMIT :offset, :limit");
@ -646,14 +646,14 @@ function mod_news($page_no = 1) {
error($config['error']['404']); error($config['error']['404']);
foreach ($news as &$entry) { foreach ($news as &$entry) {
$entry['delete_token'] = make_secure_link_token('news/delete/' . $entry['id']); $entry['delete_token'] = make_secure_link_token('edit_news/delete/' . $entry['id']);
} }
$query = prepare("SELECT COUNT(*) FROM ``news``"); $query = prepare("SELECT COUNT(*) FROM ``news``");
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
$count = $query->fetchColumn(); $count = $query->fetchColumn();
mod_page(_('News'), 'mod/news.html', array('news' => $news, 'count' => $count, 'token' => make_secure_link_token('news'))); mod_page(_('News'), 'mod/news.html', array('news' => $news, 'count' => $count, 'token' => make_secure_link_token('edit_news')));
} }
function mod_news_delete($id) { function mod_news_delete($id) {
@ -668,7 +668,7 @@ function mod_news_delete($id) {
modLog('Deleted a news entry'); modLog('Deleted a news entry');
header('Location: ?/news', true, $config['redirect_http']); header('Location: ?/edit_news', true, $config['redirect_http']);
} }
function mod_log($page_no = 1) { function mod_log($page_no = 1) {

View File

@ -42,9 +42,9 @@ $pages = array(
'/log/(\d+)' => 'log', // modlog '/log/(\d+)' => 'log', // modlog
'/log:([^/]+)' => 'user_log', // modlog '/log:([^/]+)' => 'user_log', // modlog
'/log:([^/]+)/(\d+)' => 'user_log', // modlog '/log:([^/]+)/(\d+)' => 'user_log', // modlog
'/news' => 'secure_POST news', // view news '/edit_news' => 'secure_POST news', // view news
'/news/(\d+)' => 'secure_POST news', // view news '/edit_news/(\d+)' => 'secure_POST news', // view news
'/news/delete/(\d+)' => 'secure news_delete', // delete from news '/edit_news/delete/(\d+)' => 'secure news_delete', // delete from news
'/noticeboard' => 'secure_POST noticeboard', // view noticeboard '/noticeboard' => 'secure_POST noticeboard', // view noticeboard
'/noticeboard/(\d+)' => 'secure_POST noticeboard', // view noticeboard '/noticeboard/(\d+)' => 'secure_POST noticeboard', // view noticeboard