User Name length

Discussion in 'General Support' started by g8spg, Aug 24, 2016.

  1. g8spg

    g8spg Donor Donor

    Joined:
    May 31, 2013
    Messages:
    10
    Likes Received:
    1
    Can the user name length be reduce from 6 to 4
    I run a site for UK radio hams and they like to use their call signs and there are still a few 4 character one's still a live and mines 5 "G8SPG", I do patch the registration files but every new version I have to do it again
     
  2. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,123
    Likes Received:
    236
    Wow! Congratulations on your first post after being on here for over 3 years! :)

    What page are you trying to do this on? The Register page? I think the limit is 20 on the register page. Look for maxlength on whatever .tpl theme page you want this on and set it to the length you want it to be at.
     
  3. hhavatar

    hhavatar Donor Donor

    Joined:
    Jul 28, 2014
    Messages:
    747
    Likes Received:
    74
    Absolutely. If you just want to reduce the number of characters the members use then edit the database table webid_users and change the nick column length.
    if you want to restrict what they enter, do it in register.tpl.
     
  4. g8spg

    g8spg Donor Donor

    Joined:
    May 31, 2013
    Messages:
    10
    Likes Received:
    1
    I dont want to impose any limit just that as its a site for Radio Hams we radio hams like to use our call sign given to us by Ofcom mostly 5 characters but some are 4 and some are 6 and webid does not allow less than 6
    each time I have to mod register.php and register.tpl and add a new text to message.php (Min 4)
     
  5. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,123
    Likes Received:
    236
    10-4 Copy that. What's your twenty? Just kidding about your 20. I don't need to know. I used to be into CBs a long time ago before we had the BIG WWW and know a little bit about radio lingo. It was amazing how far a radio transmission can go even on a CB. I know Hams can reach a GREAT distance.

    So, let me guess, you looked all over your register.tpl page in the modern theme and there is no maxlength. Is that correct? I'm just noticing it now for the first time that all of the modern theme maxlength codes are missing from the register.tpl page. That would be @super_st fault. He's the one that created the modern theme. He's never around to support it and somehow it's become part of the Webid script. It would be nice if he came back and helped us. That theme should of been made an add-on and not part of the Webid script. A lot of people will say this. It's not just me saying it. It's putting the project back a bit because if one of us is trying to fix something on it then we are stuck dealing with it and not working on something else.

    On the line it shows here in the link:
    https://github.com/renlok/WeBid/blob/master/themes/modern/register.tpl#L20 with tpl_nick change:
    HTML:
    <input type="text" name="TPL_nick" class="form-control"  value="{V_UNAME}" <!-- IF MISSING1 eq 1 -->id="inputError1"<!-- ENDIF --> placeholder="{L_050}">
    To this.
    HTML:
    <input type="text" name="TPL_nick" size=4 maxlength=4 class="form-control"   value="{V_UNAME}" <!-- IF MISSING1 eq 1 -->id="inputError1"<!-- ENDIF --> placeholder="{L_050}">
    That will limit the amount of characters to only allow 4 to be typed and it will not allow any more to be typed. If you want 5 then make it 5.

    Next in your register.php page go line 233 as shown here https://github.com/renlok/WeBid/blob/master/register.php#L233 and change:
    PHP:
    elseif (strlen($_POST['TPL_nick']) < 6)
    To:
    PHP:
    elseif (strlen($_POST['TPL_nick']) < 4)
    or make it 5 if you want it one character longer.

    To put a different message in the placeholder instead of the message (min 6 chars) you will want to go to your language folder and find the messages.inc.php in your EN and like it's written here at message 050. https://github.com/renlok/WeBid/blob/master/language/EN/messages.inc.php#L203 You can add a new message below that and make that line 50a like they did there with 67a and place the message:
    PHP:
    $MSG['050a'] = "(place your 4 character handle here)";
    or whatever message you want. If you do this and add a message then you will have to make a code adjustment on the register.tpl page and change the {L_050} to {L_050a}. Just a note on working with the messages.inc.php file: It's better to download the file and edit it and then upload it again rather than trying to edit it online. It would take a very long time to try to edit the messages.inc.php page online.

    Let us know if that works or if you need more help. We'll be glad to help you!
     
  6. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,123
    Likes Received:
    236
    If you wanted that for the register.tpl in the classic theme then you would basically change the same things.

    I've made a proposal on Github to add all of the size and maxlength codes on the register.tpl modern theme.
     
  7. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,123
    Likes Received:
    236
    Whoops, sorry moderators, that was not intentional that I posted that many times with the same message. I pressed post reply and the status went bar was moving and then it stopped and didn't show me it had posted my message so, I hit post reply a couple of times not knowing it was posting each time.
     
    nay27uk likes this.
  8. g8spg

    g8spg Donor Donor

    Joined:
    May 31, 2013
    Messages:
    10
    Likes Received:
    1
    Hi David

    All I had to do was change the line in register.php “elseif (strlen($_POST['TPL_nick']) < 6)” to “elseif (strlen($_POST['TPL_nick']) < 4)”

    What’s your 20 ha ha us radio hams would never ever say such a thing, because we communicate around the world not the next village like you CBers we would use the international agreed Q code which means the same around the world QTH is or what’s your home location

    My nephew was a CBer until he came around my house one day and under the terms of my full licence I let him use my rig under my supervision and call sign and his first contact was from the UK to the Cook Islands the other side of the world. He has since passed his radio ham exams and the CB consigned to the bin and has a proper transceiver now ha ha
     
    david62311 likes this.
  9. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,123
    Likes Received:
    236
    Correct that's all you had to do but, to set a limit so, people can't type anymore or you would want to place a message in the placeholder then add the other code options.
     
  10. g8spg

    g8spg Donor Donor

    Joined:
    May 31, 2013
    Messages:
    10
    Likes Received:
    1
    Hi David

    Just to tidy things I have got the registration form now asking for min 4 chars for the nick instead of 6
    that comes from message.inc.php line 203 $MSG['050'] = "(min 6 chars)";
    There is no $MSG[‘051’] so I added it 204 $MSG['051'] = "(min 4 chars)";
    And then amended line 30 of register.tpl at the very end from L_050 to L_051

    Sorry if I was taking the mick for being a ex CBer. I have been a radio ham or radio amateur for 50 years, but CB has brought a lot of new blood into Amateur Radio, they start on CB then get fedup with its limited range visit a local radio club and hear us hams talking to friends around the globe and the exams have been made more easy as you can do it in stages, ie beginner intermediate and then a full licence. In my day it was all or nothing

    73’s Geoff G8SPG 73 is radio ham talk for your 10-4 I think
     
    Last edited: Aug 26, 2016
  11. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,570
    Likes Received:
    546
    I thought 73's was for saying best regards and take care, whereas 10-4 is more for saying message received.

    I am another Radio fanatic here, I was like david and I was into CB for many years including the naughty freebandz 27.555 etc.
    I currently have no radio other than a few SW Communications Receivers (HF) and a Realistic Pro-2006 Communications Receiver (VHF-UHF) I regularly use my SW Communications Receivers to listen to the lads on the nightly ham net on 3.656 at night.
    When I moved in here 11 Years ago now I had to sell the last Rig/Radio I owned it was a Superstar 3900 10/11Mtr multiband, unfortunately I am allowed no antennas here, so I cant even sit for my Intermediate Ham Licence, something I would love to be able to do and something I have wanted to do for years now.

    @g8spg I found and started to use WeBid when I first joined here in 2009 for an idea I had for a Radio Auction Site aimed at all radio enthusiasts, mine was called TheRadioBay.com unfortunatly though I could'nt seem to get anyone to actualy sell on it, although I did get about 50 members sign up, in the end after 2 years of nothing happening on the site I decided to not renew my domain again and TheRadiobay.com ended.

    Anyway before this thread goes off topic and all about Radio I wish you all the best with your endeavour into Radio auctions and hope that all these years down the line and with your many ham contacts that you will make it a success, I would be interested in taking a look and joining myself.

    73's Nathan 26TM1995 (Tango Mike DX Group)
     
    Last edited: Aug 26, 2016
    g8spg likes this.
  12. g8spg

    g8spg Donor Donor

    Joined:
    May 31, 2013
    Messages:
    10
    Likes Received:
    1
    73 is from the old Phillips code back in the days when every thing was in Morse code
     

    Attached Files:

  13. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,123
    Likes Received:
    236
    Glad to hear decided to go with the other options and found you could make it Message #50. I wasn't even looking I guess and just said to make it 50a. That's even better.

    I wasn't upset about you making fun of the CBers. I wanted a Ham Radio as a kid in the 80's but, on $10 allowance per week, I could never save up enough money for one. I just didn't want to start chatting off topic here because we're in the General Support section and not the chat section and people down the road would be reading this. LOL There was two people in my Neighborhood who had a ham radio. I used to climb this guy's antenna and go to his top roof of his house that was two stories high. My parents got to be patched through our house phone through a ham radio to someone in the States and had to say over after each time they talked. Phone calls back then to the States from Panama were about $2 to connect and about $1.50 per minute so, that was a treat for them. I found out later I could have the Panama Operator connect me to 1-800 Toll Free Number in the States on a Sunday when I knew nobody would be there and once their answering machine recording hung up, there was an open line tone which allowed me to make a phone call to someone in the States for FREE.

    Morse code...haha! I was just a kid when I was into CBs. I didn't have a morse code button on mine. We used to talk to the people on the ships and try to find them out at sea driving around with our spot light hoping to see them reply. We never found them. :( We didn't know Much Morse code either. LOL I think we were doing ...---... when we tried to find the ship.

    I just found this:
    A .- B -... C -.-. D -..
    E . F ..-. G --. H ....
    I .. J .--- K -.- L .-..
    M -- N -. O --- P .--.
    Q --.- R .-. S ... T -
    U ..- V ...- W .-- X -..-
    Y -.-- Z --.. 0 ----- 1 .----
    2 ..--- 3 ...-- 4 ....- 5 .....
    6 -.... 7 --... 8 ---.. 9 ----.

    There was a jerk or two that would play music over the channel and hog up that Channel.

    That's it for being off topic for me. :p Glad you made the adjustments and got it work.
     
  14. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,570
    Likes Received:
    546
    I am also a Ham Operator now callsign 2E0LIG
     

Share This Page