Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Users create profile in full Uppercase! How to change this ?!

+2 votes
691 views
asked Feb 27, 2014 in Q2A Core by lancomega
edited Feb 27, 2014 by lancomega

Hi there,

Some users, are creating profile in full uppercase like this : "ALMANACH" to connect. Is there any way to put titles in users profiles like this => "Almanach"

Thanks, I can't find how!

 

Q2A version: Last version
commented Feb 27, 2014 by The One
same problem!
commented Feb 27, 2014 by lancomega
=> both answers below works perfecly together.

3 Answers

+2 votes
answered Feb 27, 2014 by q2apro
selected Feb 27, 2014 by lancomega
 
Best answer
Try to change the qa-include\qa-page-register.php - line:

$inhandle=qa_post_text('handle');

to:

$inhandle=strtolower(qa_post_text('handle'));

That should work.

Greetings,
Kai

 

PS: This is a core hack, if you update your q2a installation it will be lost. You should note that down to add the hack in the update.
commented Feb 27, 2014 by lancomega
edited Feb 27, 2014 by lancomega
Hi q2apro, thanks but every letters are lower now, but I want to keep First letter uppercase.
commented Feb 27, 2014 by lancomega
I fixe this by adding : $inhandle=ucfirst(strtolower(qa_post_text('handle')));
+1 vote
answered Feb 27, 2014 by jatin.soni

You can change for already registered user by adding this two lines in qa-include/qa-page-user.php

on line 35 find belo code at line #35

$handle=qa_request_part(1);

Add below line after that

$handle = str_replace($handle, strtolower($handle), $handle);
$handle = str_replace($handle, ucfirst($handle), $handle);

This will replace all existing users name with First letter uppercase and all other in lowercase.. Final code will be like this


	

$handle=qa_request_part(1); 
$handle = str_replace($handle, strtolower($handle), $handle); //this line to add 
$handle = str_replace($handle, ucfirst($handle), $handle); // this line to add

 

commented Feb 27, 2014 by lancomega
edited Feb 27, 2014 by lancomega
Hello Jatin, thanks, it works in the user page but it's not working in all other pages like "recent questions", i still have full uppercase profiles, any idea?
commented Feb 27, 2014 by lancomega
I fixe this by changing in the database.
0 votes
answered Feb 28, 2014 by ilkkanka
Thats works! Thx too much i have same problem, now i have solitions :)
...