mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
Added ability to set country name manually (#1652)
* Minor improvements
* Updated
* Revert "Updated"
This reverts commit 927e085cc0
.
* Update CHANGELOG.md
* Update usercp_register.tpl
* Updated
* Updated
* Updated
* Update usercp_register.tpl
* Update usercp_register.tpl
* Update usercp_register.tpl
* Updated
* Update CHANGELOG.md
* Update usercp_register.tpl
This commit is contained in:
parent
ca81d99a71
commit
408635cd52
6 changed files with 42 additions and 7 deletions
|
@ -12,6 +12,7 @@
|
||||||
- Added [TorrServer](https://github.com/YouROK/TorrServer) instance support! 🎞 [\#1603](https://github.com/torrentpier/torrentpier/pull/1603), [\#1623](https://github.com/torrentpier/torrentpier/pull/1623), [\#1624](https://github.com/torrentpier/torrentpier/pull/1624), [\#1628](https://github.com/torrentpier/torrentpier/pull/1628) ([belomaxorka](https://github.com/belomaxorka))
|
- Added [TorrServer](https://github.com/YouROK/TorrServer) instance support! 🎞 [\#1603](https://github.com/torrentpier/torrentpier/pull/1603), [\#1623](https://github.com/torrentpier/torrentpier/pull/1623), [\#1624](https://github.com/torrentpier/torrentpier/pull/1624), [\#1628](https://github.com/torrentpier/torrentpier/pull/1628) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Newtopic: Added configuring robots indexing [\#1599](https://github.com/torrentpier/torrentpier/pull/1599) ([belomaxorka](https://github.com/belomaxorka))
|
- Newtopic: Added configuring robots indexing [\#1599](https://github.com/torrentpier/torrentpier/pull/1599) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Added showing releaser stats in profile [\#1568](https://github.com/torrentpier/torrentpier/pull/1568) ([belomaxorka](https://github.com/belomaxorka))
|
- Added showing releaser stats in profile [\#1568](https://github.com/torrentpier/torrentpier/pull/1568) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
|
- Added ability to set country name manually [\#1652](https://github.com/torrentpier/torrentpier/pull/1652) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Improved `filelist.php` [\#1586](https://github.com/torrentpier/torrentpier/pull/1586) ([belomaxorka](https://github.com/belomaxorka))
|
- Improved `filelist.php` [\#1586](https://github.com/torrentpier/torrentpier/pull/1586) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka))
|
- Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- BBCode: Fixed relative links working [\#1613](https://github.com/torrentpier/torrentpier/pull/1613) ([belomaxorka](https://github.com/belomaxorka))
|
- BBCode: Fixed relative links working [\#1613](https://github.com/torrentpier/torrentpier/pull/1613) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
|
|
|
@ -178,7 +178,7 @@ out("- All extensions are installed!\n", 'success');
|
||||||
if (is_file(BB_ROOT . '.env')) {
|
if (is_file(BB_ROOT . '.env')) {
|
||||||
out('- TorrentPier already installed', 'warning');
|
out('- TorrentPier already installed', 'warning');
|
||||||
echo 'Are you sure want to re-install TorrentPier? [y/N]: ';
|
echo 'Are you sure want to re-install TorrentPier? [y/N]: ';
|
||||||
if (in_array(mb_strtolower(readline()), ['y', 'ye', 'yes', 'yep', 'yeah'])) {
|
if (str_starts_with(mb_strtolower(readline()), 'y')) {
|
||||||
out("\n- Re-install process started...", 'info');
|
out("\n- Re-install process started...", 'info');
|
||||||
// environment
|
// environment
|
||||||
if (is_file(BB_ROOT . '.env')) {
|
if (is_file(BB_ROOT . '.env')) {
|
||||||
|
|
|
@ -465,8 +465,10 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$pr_data['user_from'] = $from;
|
$pr_data['user_from'] = $from;
|
||||||
$db_data['user_from'] = (string)$from;
|
$db_data['user_from'] = (string)$from;
|
||||||
}
|
}
|
||||||
|
$tp_data['USER_FROM'] = $pr_data['user_from'];
|
||||||
$tp_data['COUNTRY_SELECTED'] = render_flag($pr_data['user_from']);
|
$tp_data['COUNTRY_SELECTED'] = render_flag($pr_data['user_from']);
|
||||||
$tp_data['COUNTRY_SELECT'] = build_select('user_from', array_flip($lang['COUNTRIES']), $pr_data['user_from']);
|
$tp_data['COUNTRY_SELECT'] = build_select('user_from', array_flip($lang['COUNTRIES']), $pr_data['user_from']);
|
||||||
|
$tp_data['CHECKED_MANUAL_COUNTRY'] = ($tp_data['COUNTRY_SELECTED'] === $pr_data['user_from']) ? 'checked' : '';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -987,6 +987,7 @@ $lang['DATETIME']['DEC'] = 'Dec';
|
||||||
|
|
||||||
// Country selector
|
// Country selector
|
||||||
$lang['COUNTRY'] = 'Country';
|
$lang['COUNTRY'] = 'Country';
|
||||||
|
$lang['SET_OWN_COUNTRY'] = 'Set own country (Manually)';
|
||||||
$lang['COUNTRIES'] = [
|
$lang['COUNTRIES'] = [
|
||||||
0 => 'No select',
|
0 => 'No select',
|
||||||
'AD' => 'Andorra',
|
'AD' => 'Andorra',
|
||||||
|
|
|
@ -52,6 +52,7 @@ class Html
|
||||||
$this->_build_select_rec($params);
|
$this->_build_select_rec($params);
|
||||||
|
|
||||||
$select_params = $js ? " $js" : '';
|
$select_params = $js ? " $js" : '';
|
||||||
|
$select_params .= ' autocomplete="off"';
|
||||||
$select_params .= $multiple_size ? ' multiple size="' . $multiple_size . '"' : '';
|
$select_params .= $multiple_size ? ' multiple size="' . $multiple_size . '"' : '';
|
||||||
$select_params .= ' name="' . htmlCHR($name) . '"';
|
$select_params .= ' name="' . htmlCHR($name) . '"';
|
||||||
$select_params .= ' id="' . htmlCHR($name) . '"';
|
$select_params .= ' id="' . htmlCHR($name) . '"';
|
||||||
|
|
|
@ -155,13 +155,43 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="prof-title">{L_LOCATION}:</td>
|
<td class="prof-title">{L_LOCATION}:</td>
|
||||||
<td>{COUNTRY_SELECT} <span id="check_country">{COUNTRY_SELECTED}</td>
|
<td>
|
||||||
|
<label>{L_SET_OWN_COUNTRY}
|
||||||
|
<input {CHECKED_MANUAL_COUNTRY} name="user_from_set_manual" type="checkbox">
|
||||||
|
</label>
|
||||||
|
<hr>
|
||||||
|
<div id="country_select_hide">{COUNTRY_SELECT} <span id="check_country">{COUNTRY_SELECTED}</span></div>
|
||||||
|
<div style="display: none;" id="country_manual_select"><input type="text" name="user_from" size="50" maxlength="150" value="{USER_FROM}"/></div>
|
||||||
|
</td>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('#user_from').bind('change', function () {
|
$(document).ready(function () {
|
||||||
ajax.exec({
|
// Handle manual country select
|
||||||
action: 'user_register',
|
const $manualCheckbox = $('input[name="user_from_set_manual"]');
|
||||||
mode: 'check_country',
|
const $countrySelectHide = $('div#country_select_hide');
|
||||||
country: $(this).val()
|
const $countryManualSelect = $('div#country_manual_select');
|
||||||
|
function toggleCountrySelectors() {
|
||||||
|
if ($manualCheckbox.is(':checked')) {
|
||||||
|
$countrySelectHide.find('select').prop('disabled', true);
|
||||||
|
$countrySelectHide.hide();
|
||||||
|
$countryManualSelect.find('input').prop('disabled', false);
|
||||||
|
$countryManualSelect.show();
|
||||||
|
} else {
|
||||||
|
$countryManualSelect.find('input').prop('disabled', true);
|
||||||
|
$countryManualSelect.hide();
|
||||||
|
$countrySelectHide.find('select').prop('disabled', false);
|
||||||
|
$countrySelectHide.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggleCountrySelectors();
|
||||||
|
$manualCheckbox.change(toggleCountrySelectors);
|
||||||
|
|
||||||
|
// Handle flag icon changing
|
||||||
|
$('#user_from').bind('change', function () {
|
||||||
|
ajax.exec({
|
||||||
|
action: 'user_register',
|
||||||
|
mode: 'check_country',
|
||||||
|
country: $(this).val()
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue