Cherry-picked several commits from https://github.com/vichan-devel/vichan/

This commit is contained in:
Daniel Saunders 2021-01-25 19:28:12 -05:00
parent 8b9ab76cb9
commit 08956edf56
5 changed files with 8 additions and 8 deletions

View File

@ -911,7 +911,7 @@ function checkBan($board = false) {
} }
foreach ($ips as $ip) { foreach ($ips as $ip) {
$bans = Bans::find($_SERVER['REMOTE_ADDR'], $board, $config['show_modname']); $bans = Bans::find($ip, $board, $config['show_modname']);
foreach ($bans as &$ban) { foreach ($bans as &$ban) {
if ($ban['expires'] && $ban['expires'] < time()) { if ($ban['expires'] && $ban['expires'] < time()) {

View File

@ -68,7 +68,7 @@ function refreshSettings() {
} }
} }
function setupControl(control) { function setUpControl(control) {
if (control.addEventListener) control.addEventListener("change", function(e) { if (control.addEventListener) control.addEventListener("change", function(e) {
if (control.type == "checkbox") { if (control.type == "checkbox") {
changeSetting(control.name, control.checked); changeSetting(control.name, control.checked);
@ -81,7 +81,7 @@ function setupControl(control) {
refreshSettings(); refreshSettings();
var settingsItems = settingsMenu.getElementsByTagName("input"); var settingsItems = settingsMenu.getElementsByTagName("input");
for (var i = 0; i < settingsItems.length; i++) { for (var i = 0; i < settingsItems.length; i++) {
setupControl(settingsItems[i]); setUpControl(settingsItems[i]);
} }
if (settingsMenu.addEventListener && !window.Options) { if (settingsMenu.addEventListener && !window.Options) {

View File

@ -3,9 +3,9 @@
{# start email #} {# start email #}
<a class="email" href="mailto:{{ post.email }}"> <a class="email" href="mailto:{{ post.email }}">
{% endif %} {% endif %}
<span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name|bidi_cleanup }}</span> <span {% if capcode.name %}style="{{ capcode.name }}" {% endif %} class="name">{{ post.name|bidi_cleanup }}</span>
{% if post.trip|length > 0 %} {% if post.trip|length > 0 %}
<span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span> <span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %} class="trip">{{ post.trip }}</span>
{% endif %} {% endif %}
{% if post.email|length > 0 and (config.hide_sage!=true or post.email!='sage') and config.hide_email!=true %} {% if post.email|length > 0 and (config.hide_sage!=true or post.email!='sage') and config.hide_email!=true %}
{# end email #} {# end email #}

View File

@ -24,8 +24,8 @@
$overflow = array(); $overflow = array();
$board = array( $board = array(
'url' => $this->settings['uri'], 'url' => $this->settings['uri'],
'name' => $this->settings['title'], 'title' => $this->settings['title'],
'title' => sprintf($this->settings['subtitle'], $this->settings['thread_limit']) 'subtitle' => sprintf($this->settings['subtitle'], $this->settings['thread_limit'])
); );
$query = ''; $query = '';

View File

@ -19,7 +19,7 @@
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:url" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.res }}{{ thread.id }}.html" /> <meta property="og:url" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.res }}{{ thread.id }}.html" />
{% if thread.files.0.thumb %}<meta property="og:image" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.thumb }}{{ thread.files.0.thumb }}" />{% endif %} {% if thread.files.0.thumb %}<meta property="og:image" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.thumb }}{{ thread.files.0.thumb }}" />{% endif %}
<meta property="og:description" content="{{ thread.body_nomarkup|e }}" /> <meta property="og:description" content="{{ thread.body_nomarkup|remove_modifiers|e }}" />
<title>{{ board.url }} - {{ meta_subject }}</title> <title>{{ board.url }} - {{ meta_subject }}</title>
</head> </head>