Browse Source

Allow the user to decide whether or not he wants to display his country

pull/40/head
Fredrick Brennan 10 years ago
parent
commit
23c73ca839
  1. 4
      inc/config.php
  2. 2
      js/quick-reply.js
  3. 2
      post.php
  4. 2
      templates/post_form.html

4
inc/config.php

@ -274,6 +274,7 @@
'file_url',
'json_response',
'user_flag',
'no_country'
);
// Enable reCaptcha to make spam even harder. Rarely necessary.
@ -531,6 +532,9 @@
// Attach country flags to posts.
$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
$config['country_flags_condensed'] = true;
$config['country_flags_condensed_css'] = 'static/flags/flags.css';

2
js/quick-reply.js

@ -266,6 +266,8 @@
$postForm.find('input[type="file"]').parent()
.removeAttr('colspan')
.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 {
$(tr).remove();
}

2
post.php

@ -487,7 +487,7 @@ if (isset($_POST['delete'])) {
$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';
$gi=geoip\geoip_open('inc/lib/geoip/GeoIPv6.dat', GEOIP_STANDARD);

2
templates/post_form.html

@ -15,7 +15,7 @@
{{ antibot.html() }}
</th>
<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() }}
</td>
</tr>{% endif %}

Loading…
Cancel
Save