mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-27 17:00:52 +01:00
Allow the user to decide whether or not he wants to display his country
This commit is contained in:
parent
1ce9fb8174
commit
23c73ca839
@ -274,6 +274,7 @@
|
|||||||
'file_url',
|
'file_url',
|
||||||
'json_response',
|
'json_response',
|
||||||
'user_flag',
|
'user_flag',
|
||||||
|
'no_country'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Enable reCaptcha to make spam even harder. Rarely necessary.
|
// Enable reCaptcha to make spam even harder. Rarely necessary.
|
||||||
@ -531,6 +532,9 @@
|
|||||||
// Attach country flags to posts.
|
// Attach country flags to posts.
|
||||||
$config['country_flags'] = false;
|
$config['country_flags'] = false;
|
||||||
|
|
||||||
|
// Allow the user to decide whether or not he wants to display his country
|
||||||
|
$config['allow_no_country'] = false;
|
||||||
|
|
||||||
// Load all country flags from one file
|
// Load all country flags from one file
|
||||||
$config['country_flags_condensed'] = true;
|
$config['country_flags_condensed'] = true;
|
||||||
$config['country_flags_condensed_css'] = 'static/flags/flags.css';
|
$config['country_flags_condensed_css'] = 'static/flags/flags.css';
|
||||||
|
@ -266,6 +266,8 @@
|
|||||||
$postForm.find('input[type="file"]').parent()
|
$postForm.find('input[type="file"]').parent()
|
||||||
.removeAttr('colspan')
|
.removeAttr('colspan')
|
||||||
.after($('<td class="spoiler"></td>').append(this, ' ', $('<label for="q-spoiler-image">').text(_('Spoiler Image'))));
|
.after($('<td class="spoiler"></td>').append(this, ' ', $('<label for="q-spoiler-image">').text(_('Spoiler Image'))));
|
||||||
|
} else if ($(this).attr('name') == 'no_country') {
|
||||||
|
$td.find('label,input[type="checkbox"]').remove();
|
||||||
} else {
|
} else {
|
||||||
$(tr).remove();
|
$(tr).remove();
|
||||||
}
|
}
|
||||||
|
2
post.php
2
post.php
@ -487,7 +487,7 @@ if (isset($_POST['delete'])) {
|
|||||||
$post['body'] .= "\n<tinyboard raw html>1</tinyboard>";
|
$post['body'] .= "\n<tinyboard raw html>1</tinyboard>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['country_flags']) {
|
if (($config['country_flags'] && !$config['allow_no_country']) || ($config['country_flags'] && $config['allow_no_country'] && !isset($_POST['no_country']))) {
|
||||||
require 'inc/lib/geoip/geoip.inc';
|
require 'inc/lib/geoip/geoip.inc';
|
||||||
$gi=geoip\geoip_open('inc/lib/geoip/GeoIPv6.dat', GEOIP_STANDARD);
|
$gi=geoip\geoip_open('inc/lib/geoip/GeoIPv6.dat', GEOIP_STANDARD);
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="name" size="25" maxlength="35" autocomplete="off">
|
<input type="text" name="name" size="25" maxlength="35" autocomplete="off"> {% if config.allow_no_country and config.country_flags %}<input id="no_country" name="no_country" type="checkbox"> <label for="no_country">{% trans %}Don't show my flag{% endtrans %}</label>{% endif %}
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</td>
|
</td>
|
||||||
</tr>{% endif %}
|
</tr>{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user