mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-31 12:23:48 +01:00
Allow a board called news to exist
This commit is contained in:
parent
6ed13f3fb0
commit
d705606729
@ -633,7 +633,7 @@ function mod_news($page_no = 1) {
|
||||
|
||||
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");
|
||||
@ -646,14 +646,14 @@ function mod_news($page_no = 1) {
|
||||
error($config['error']['404']);
|
||||
|
||||
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->execute() or error(db_error($query));
|
||||
$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) {
|
||||
@ -668,7 +668,7 @@ function mod_news_delete($id) {
|
||||
|
||||
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) {
|
||||
|
6
mod.php
6
mod.php
@ -42,9 +42,9 @@ $pages = array(
|
||||
'/log/(\d+)' => 'log', // modlog
|
||||
'/log:([^/]+)' => 'user_log', // modlog
|
||||
'/log:([^/]+)/(\d+)' => 'user_log', // modlog
|
||||
'/news' => 'secure_POST news', // view news
|
||||
'/news/(\d+)' => 'secure_POST news', // view news
|
||||
'/news/delete/(\d+)' => 'secure news_delete', // delete from news
|
||||
'/edit_news' => 'secure_POST news', // view news
|
||||
'/edit_news/(\d+)' => 'secure_POST news', // view news
|
||||
'/edit_news/delete/(\d+)' => 'secure news_delete', // delete from news
|
||||
|
||||
'/noticeboard' => 'secure_POST noticeboard', // view noticeboard
|
||||
'/noticeboard/(\d+)' => 'secure_POST noticeboard', // view noticeboard
|
||||
|
Loading…
x
Reference in New Issue
Block a user