Drag to reposition your photo
Welcome to phpFox community
Threads
Quote:
Originally posted by: webwolf

Well, if I were going to do this I would set username on registration off to make the username input go away. Then I would make 2 plugins.

*Product: core
*Module: user
Title: UserNameCheck
Hook: user.service_process_add_1
Active: yes
code:
PHP:
if (Phpfox::getParam('user.split_full_name'))
{
    
$aVals['full_name'] = $aVals['first_name'] . ' ' $aVals['last_name'];
}
$aVals['user_name'] = str_replace(' ''_'$aVals['full_name']);
$aInsert['user_name'] = $oParseInput->clean($aVals['user_name']);
Phpfox::getService('user.validate')->user($aInsert['user_name']);
$sSiteUserName=$aInsert['user_name']; 


and

*Product: core
*Module: user
Title: UserNameChange
Hook: user.service_process_add_feed
Active: yes
code:
PHP:
$this->database()->update(Phpfox::getT('user'), array('user_name' => $sSiteUserName), 'user_id = ' $iId); 


This will make the user_name a title-ized version of the full_name for registrants. Developed on 3.7.0 but only briefly tested.


Wow man, no words for you. Perfect, just what i wanted. Please send me on PM your paypal, I gonna send little bit bonus for your help.

You make me so happy today.
January 21, 2014 1:47 pm