Added Functionality - Users can now post from catalog page

Fix multi-image.js is a few commits later
This commit is contained in:
PupperWoff 2017-05-04 01:51:01 +02:00 committed by -
parent fcd7976881
commit 5419f49259
4 changed files with 13 additions and 4 deletions

View File

@ -1246,6 +1246,7 @@
// Location of files. // Location of files.
$config['file_index'] = 'index.html'; $config['file_index'] = 'index.html';
$config['file_catalog'] = 'catalog.html'; // Catalog page (used in preg_match for post referer)
$config['file_page'] = '%d.html'; // NB: page is both an index page and a thread $config['file_page'] = '%d.html'; // NB: page is both an index page and a thread
$config['file_page50'] = '%d+50.html'; $config['file_page50'] = '%d+50.html';
$config['file_page_slug'] = '%d-%s.html'; $config['file_page_slug'] = '%d-%s.html';

View File

@ -178,6 +178,7 @@ function loadConfig() {
str_replace('%s', $config['board_regex'], preg_quote($config['board_path'], '/')) . str_replace('%s', $config['board_regex'], preg_quote($config['board_path'], '/')) .
'(' . '(' .
preg_quote($config['file_index'], '/') . '|' . preg_quote($config['file_index'], '/') . '|' .
preg_quote($config['file_catalog'], '/') . '|' .
str_replace('%d', '\d+', preg_quote($config['file_page'])) . str_replace('%d', '\d+', preg_quote($config['file_page'])) .
')?' . ')?' .
'|' . '|' .

View File

@ -5,18 +5,20 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script type='text/javascript'> <script type='text/javascript'>
var active_page = "catalog" var active_page = "catalog"
, board_name = "{{ board }}"; , board_name = "{{ board_name }}";
</script> </script>
{% include 'header.html' %} {% include 'header.html' %}
<title>{{ board }} - Catalog</title> <title>{{ board_name }} - Catalog</title>
</head> </head>
<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} theme-catalog active-catalog" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}"> <body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} theme-catalog active-catalog" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
{{ boardlist.top }} {{ boardlist.top }}
<header> <header>
<h1>{{ settings.title }} (<a href="{{link}}">/{{ board }}/</a>)</h1> <h1>{{ settings.title }} (<a href="{{link}}">/{{ board_name }}/</a>)</h1>
<div class="subtitle">{{ settings.subtitle }}</div> <div class="subtitle">{{ settings.subtitle }}</div>
</header> </header>
{% include 'post_form.html' %}
<span>{% trans 'Sort by' %}: </span> <span>{% trans 'Sort by' %}: </span>
<select id="sort_by" style="display: inline-block"> <select id="sort_by" style="display: inline-block">
<option selected value="bump:desc">{% trans 'Bump order' %}</option> <option selected value="bump:desc">{% trans 'Bump order' %}</option>

View File

@ -259,6 +259,9 @@
$config['additional_javascript'][] = $s; $config['additional_javascript'][] = $s;
} }
$antibot = create_antibot($board_name);
$antibot->reset();
file_write($config['dir']['home'] . $board_name . '/catalog.html', Element('themes/catalog/catalog.html', Array( file_write($config['dir']['home'] . $board_name . '/catalog.html', Element('themes/catalog/catalog.html', Array(
'settings' => $this->settings, 'settings' => $this->settings,
'config' => $config, 'config' => $config,
@ -266,7 +269,9 @@
'recent_images' => array(), 'recent_images' => array(),
'recent_posts' => $recent_posts, 'recent_posts' => $recent_posts,
'stats' => array(), 'stats' => array(),
'board' => $board_name, 'board_name' => $board_name,
'board' => $board,
'antibot' => $antibot,
'link' => $board_link 'link' => $board_link
))); )));