mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-31 04:13:49 +01:00
custom capcode fix
This commit is contained in:
parent
b3dba69b50
commit
c5a961a6a5
@ -133,13 +133,25 @@
|
|||||||
function capcode($cap) {
|
function capcode($cap) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
if(!$cap)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$capcode = Array();
|
||||||
if(isset($config['custom_capcode'][$cap])) {
|
if(isset($config['custom_capcode'][$cap])) {
|
||||||
if(is_array($config['custom_capcode'][$cap]))
|
if(is_array($config['custom_capcode'][$cap])) {
|
||||||
return sprintf($config['custom_capcode'][$cap][0], $cap);
|
$capcode['cap'] = sprintf($config['custom_capcode'][$cap][0], $cap);
|
||||||
return sprintf($config['custom_capcode'][$cap], $cap);
|
if(isset($config['custom_capcode'][$cap][1]))
|
||||||
|
$capcode['name'] = $config['custom_capcode'][$cap][1];
|
||||||
|
if(isset($config['custom_capcode'][$cap][2]))
|
||||||
|
$capcode['trip'] = $config['custom_capcode'][$cap][2];
|
||||||
|
} else {
|
||||||
|
$capcode['cap'] = sprintf($config['custom_capcode'][$cap], $cap);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$capcode['cap'] = sprintf($config['capcode'], $cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return sprintf($config['capcode'], $cap);
|
return $capcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
function truncate($body, $url, $max_lines = false, $max_chars = false) {
|
function truncate($body, $url, $max_lines = false, $max_chars = false) {
|
||||||
|
@ -14,17 +14,17 @@
|
|||||||
{# start email #}
|
{# start email #}
|
||||||
<a class="email" href="mailto:{{ post.email }}">
|
<a class="email" href="mailto:{{ post.email }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="name">{{ post.name }}</span>
|
{% set capcode = post.capcode|capcode %}
|
||||||
|
<span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name }}</span>
|
||||||
{% if post.trip|length > 0 %}
|
{% if post.trip|length > 0 %}
|
||||||
<span 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 %}
|
{% if post.email|length > 0 %}
|
||||||
{# end email #}
|
{# end email #}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if post.capcode|length > 0 %}
|
{% if capcode %}
|
||||||
{# show capcode #}
|
{{ capcode.cap }}
|
||||||
{{ post.capcode|capcode }}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
|
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
|
||||||
[<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
|
[<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
|
||||||
|
@ -58,17 +58,17 @@
|
|||||||
{# start email #}
|
{# start email #}
|
||||||
<a class="email" href="mailto:{{ post.email }}">
|
<a class="email" href="mailto:{{ post.email }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="name">{{ post.name }}</span>
|
{% set capcode = post.capcode|capcode %}
|
||||||
|
<span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name }}</span>
|
||||||
{% if post.trip|length > 0 %}
|
{% if post.trip|length > 0 %}
|
||||||
<span 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 %}
|
{% if post.email|length > 0 %}
|
||||||
{# end email #}
|
{# end email #}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if post.capcode|length > 0 %}
|
{% if capcode %}
|
||||||
{# show capcode #}
|
{{ capcode.cap }}
|
||||||
{{ post.capcode|capcode }}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
|
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
|
||||||
[<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
|
[<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user