Gambalunga
💖 Chevereto Fan
I previously asked a question in the Support forum about implementing hyphen (-) in user names. I have now modified a little code to achieve this.
Line 186 in \app\lib\classes\class.settings.php has been modified as follows to include the "-" (hyphen) character in the user names pattern.
I then modified the two files where I found the tool tip:
Line 40 (comment line 41) in /app/themes/Peafowl/views/signup.php
And
Line in 144 in /app/themes/Peafowl/views/settings.php
Note in both cases the words
Letters, numbers and "_"
have been modified to
Letters, numbers, "-" and "_"
Line 186 in \app\lib\classes\class.settings.php has been modified as follows to include the "-" (hyphen) character in the user names pattern.
Code:
'username_pattern' => '^[\w-]{3,16}$',// - added after w
I then modified the two files where I found the tool tip:
Line 40 (comment line 41) in /app/themes/Peafowl/views/signup.php
Code:
<input type="text" name="username" id="signup-username" class="text-input" autocomplete="off" value="<?php echo get_safe_post()["username"]; ?>" pattern="<?php echo CHV\getSetting('username_pattern'); ?>" rel="tooltip" title='<?php _se('%i to %f characters<br>Letters, numbers, "-" and "_"', ['%i' => CHV\getSetting('username_min_length'), '%f' => CHV\getSetting('username_max_length')]); ?>' data-tipTip="right" placeholder="<?php _se('Username'); ?>" required>
<?php /* tooltip modified to include "-" */?>
Line in 144 in /app/themes/Peafowl/views/settings.php
Code:
<input type="text" name="username" id="username" maxlength="<?php echo CHV\getSetting('username_max_length'); ?>" class="text-input" value="<?php echo get_safe_post() ? get_safe_post()["username"] : get_user()["username"]; ?>" pattern="<?php echo CHV\getSetting('username_pattern'); ?>" rel="tooltip" title='<?php _se('%i to %f characters<br>Letters, numbers, "-" and "_"', ['%i' => CHV\getSetting('username_min_length'), '%f' => CHV\getSetting('username_max_length')]); ?>' data-tipTip="right" placeholder="<?php _se('Username'); ?>" required>
Note in both cases the words
Letters, numbers and "_"
have been modified to
Letters, numbers, "-" and "_"