Moved hardcoded html filepaths into config file for extensibility (#354)
Co-authored-by: chatfield <chatfield@creatuity.com> Co-authored-by: Fred Brennan <copypaste@kittens.ph>
This commit is contained in:
@@ -877,11 +877,11 @@ function displayBan($ban) {
|
||||
|
||||
// Show banned page and exit
|
||||
die(
|
||||
Element('page.html', array(
|
||||
Element($config['file_page_template'], array(
|
||||
'title' => _('Banned!'),
|
||||
'config' => $config,
|
||||
'boardlist' => createBoardlist(isset($mod) ? $mod : false),
|
||||
'body' => Element('banned.html', array(
|
||||
'body' => Element($config['file_banned'], array(
|
||||
'config' => $config,
|
||||
'ban' => $ban,
|
||||
'board' => $board,
|
||||
@@ -1218,7 +1218,7 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) {
|
||||
// Delete posts and maybe replies
|
||||
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
event('delete', $post);
|
||||
|
||||
|
||||
$thread_id = $post['thread'];
|
||||
if (!$post['thread']) {
|
||||
// Delete thread HTML page
|
||||
@@ -1435,7 +1435,7 @@ function index($page, $mod=false, $brief = false) {
|
||||
}
|
||||
|
||||
if ($config['file_board']) {
|
||||
$body = Element('fileboard.html', array('body' => $body, 'mod' => $mod));
|
||||
$body = Element($config['file_fileboard'], array('body' => $body, 'mod' => $mod));
|
||||
}
|
||||
|
||||
return array(
|
||||
@@ -1795,7 +1795,7 @@ function buildIndex($global_api = "yes") {
|
||||
$content['btn'] = getPageButtons($content['pages']);
|
||||
$content['antibot'] = $antibot;
|
||||
|
||||
file_write($filename, Element('index.html', $content));
|
||||
file_write($filename, Element($config['file_board_index'], $content));
|
||||
}
|
||||
elseif ($action == 'delete' || $catalog_api_action == 'delete') {
|
||||
file_unlink($filename);
|
||||
@@ -2366,7 +2366,7 @@ function buildThread($id, $return = false, $mod = false) {
|
||||
$hasnoko50 = $thread->postCount() >= $config['noko50_min'];
|
||||
$antibot = $mod || $return ? false : create_antibot($board['uri'], $id);
|
||||
|
||||
$body = Element('thread.html', array(
|
||||
$body = Element($config['file_thread'], array(
|
||||
'board' => $board,
|
||||
'thread' => $thread,
|
||||
'body' => $thread->build(),
|
||||
@@ -2469,7 +2469,7 @@ function buildThread50($id, $return = false, $mod = false, $thread = null, $anti
|
||||
|
||||
$hasnoko50 = $thread->postCount() >= $config['noko50_min'];
|
||||
|
||||
$body = Element('thread.html', array(
|
||||
$body = Element($config['file_thread'], array(
|
||||
'board' => $board,
|
||||
'thread' => $thread,
|
||||
'body' => $thread->build(false, true),
|
||||
|
Reference in New Issue
Block a user