Pagemakers Design wrote: Yup, I would like to use this as an admin feature with the change usernames option off.
Code: Select all
if ( ( $userdata['session_logged_in'] && ($row['username'] != $userdata['username'] && preg_match("/^" . preg_replace('/ /', '', $username=preg_replace("/ +/", ' ', $username)) . "$/i", preg_replace('/ /', '', $userdata['username']))) ) || !$userdata['session_logged_in'] )
Code: Select all
if ( ( $userdata['session_logged_in'] && strcasecmp($row['username'], $userdata['username']) ) || !$userdata['session_logged_in'] )
sj26 wrote: instead of the long winded
sj26 wrote: why not use the simpler
sj26 wrote: Using the case-insensitive strcasecmp function built into php? This returns 0 when the strings are the same (case insensitivly)...
May I also suggest that in Admin instead of 'Allow name changes' and 'none' have a middle option like 'allow changing of username case'...
sj26 wrote: if you like I can help you out with the admin bit.
Pagemakers Design wrote: Another option would be to force the name to display as "John Smith", no matter how it appears in the database......