PDA

View Full Version : Personal page same as username



Petrache Nicolae
September 13, 2012, 09:35 AM
Hello. How can we make the personal page to autofill with the username chosen? for instance username: new_user - have as personal page www.my_site.com/new_user
When a user creates a new account, he insert his username and olso can chose a diferent personal page. I think it would be best if that area will catch the username and add it in there and so, not letting a user to add a diferent personal page.

Vladimir
September 14, 2012, 09:05 AM
Hello,

You can try change it the following way:

1.
- open file includes/controllers/registration.inc.php
- find this code:



if ( !$account_types[$profile_data['type']]['Own_location'] )
{
/* load the utf8 lib */
loadUTF8functions( 'ascii', 'utf8_to_ascii', 'unicode' );

$username = $profile_data['username'];
if ( !utf8_is_ascii( $username ) )
{
$username = utf8_to_ascii( $username );
}

$profile_data['location'] = $rlSmarty -> str2path( $profile_data['username'] );
}


and change it to:



/* load the utf8 lib */
loadUTF8functions( 'ascii', 'utf8_to_ascii', 'unicode' );

$username = $profile_data['username'];
if ( !utf8_is_ascii( $username ) )
{
$username = utf8_to_ascii( $username );
}

$profile_data['location'] = $rlSmarty -> str2path( $profile_data['username'] );


2.
- open file templates/your_template/tpl/controllers/registration.tpl
- find the code:



<div id="personal_address_field" class="{if $account_types|@count > 1 || !$account_types.0.Own_location}hide{/if}">


and replace it with following line:



<div class="hide">

Petrache Nicolae
September 14, 2012, 10:24 AM
Hello,

You can try change it the following way:

1.
- open file includes/controllers/registration.inc.php
- find this code:



if ( !$account_types[$profile_data['type']]['Own_location'] )
{
/* load the utf8 lib */
loadUTF8functions( 'ascii', 'utf8_to_ascii', 'unicode' );

$username = $profile_data['username'];
if ( !utf8_is_ascii( $username ) )
{
$username = utf8_to_ascii( $username );
}

$profile_data['location'] = $rlSmarty -> str2path( $profile_data['username'] );
}


and change it to:



/* load the utf8 lib */
loadUTF8functions( 'ascii', 'utf8_to_ascii', 'unicode' );

$username = $profile_data['username'];
if ( !utf8_is_ascii( $username ) )
{
$username = utf8_to_ascii( $username );
}

$profile_data['location'] = $rlSmarty -> str2path( $profile_data['username'] );


2.
- open file templates/your_template/tpl/controllers/registration.tpl
- find the code:



<div id="personal_address_field" class="{if $account_types|@count > 1 || !$account_types.0.Own_location}hide{/if}">


and replace it with following line:



<div class="hide">



Hello. Does not work. The personal adress area doesn't show but when i try to move to step 2 i receive ""Personal address" either has not been entered or is incorrect; please try again". What could be wrong?

Vladimir
September 14, 2012, 11:02 AM
I am sorry, you need to perform 3-d step:

3.
- open file: includes/classes/rlAccount.class.php;
- go to the method: ajaxSubmitProfile();
- find this line:



$username = trim( $username );


and add the following code after this line:



$location = $username;

Petrache Nicolae
September 14, 2012, 03:15 PM
I am sorry, you need to perform 3-d step:

3.
- open file: includes/classes/rlAccount.class.php;
- go to the method: ajaxSubmitProfile();
- find this line:



$username = trim( $username );


and add the following code after this line:



$location = $username;


That did the trick. Works perfect. Thank you

Petrache Nicolae
September 20, 2012, 05:11 AM
I am sorry, you need to perform 3-d step:

3.
- open file: includes/classes/rlAccount.class.php;
- go to the method: ajaxSubmitProfile();
- find this line:



$username = trim( $username );


and add the following code after this line:



$location = $username;



seems to be a issue. is working perfect if i use a username like NewUser but if i add the username as New User, will not work. will get ""Personal address" either has not been entered or is incorrect; please try again". how do we lose the space between if a user ads a username made of 2-3 words? thanks

Mike
September 21, 2012, 09:20 AM
Hi,

Find function in rlAccount.class.php and find function ajaxValidateProfile, add line as below. Think it will work after the change



function ajaxValidateProfile( $username = false, $email = false, $location = false, $check_location = false )
{
$location = $username;

Petrache Nicolae
September 21, 2012, 09:30 AM
Hi,

Find function in rlAccount.class.php and find function ajaxValidateProfile, add line as below. Think it will work after the change



function ajaxValidateProfile( $username = false, $email = false, $location = false, $check_location = false )
{
$location = $username;


thanks. will try it

Petrache Nicolae
October 7, 2012, 01:14 PM
Hi,

Find function in rlAccount.class.php and find function ajaxValidateProfile, add line as below. Think it will work after the change



function ajaxValidateProfile( $username = false, $email = false, $location = false, $check_location = false )
{
$location = $username;


unfortunaly is not working. have tried 2 times after cache refresh. when i use "test" is ok, when i use "test-test or test_test" is ok but when i use "test test" is not working. any ideea what should i try?

Viktor
October 9, 2012, 10:50 AM
Hello Petrache Nicolae,

You should replace free space to _ or -or remove only, like you want.

Petrache Nicolae
October 9, 2012, 10:58 AM
Hello Petrache Nicolae,

You should replace free space to _ or -or remove only, like you want.

hello Viktor. i was looking for a solution in wich the script strips away any free space inserted by clients and ads - or _ or combine all the words into 1 word wich your script accept.
users do not get any info buble or any hint that they should enter a single word or have multiple words joined by - or _ .thanks

Petrache Nicolae
November 18, 2013, 07:17 AM
if user fills his name as John Wayne, how can we make the script create the personal address as john_wayne or john-wayne? so add a _ or - instead of the blank space? this is the only thing missing to complete this feature. thanks

Shlomit Steinitz
February 11, 2015, 12:06 AM
Hi
How to fix the 404 error page not found with the Personal Address like: www.xxx.com/username
Thanks.

Pete Young
February 11, 2015, 12:32 AM
Hi
How to fix the 404 error page not found with the Personal Address like: www.xxx.com/username
Thanks.

http://www.flynax.com/forum/showthread.php?2152-Question-about-Allow-own-Sub-directory-for-this-account-type-users&p=10323#post10323

go to the last post for a guide that may help

Shlomit Steinitz
February 11, 2015, 09:21 AM
http://www.flynax.com/forum/showthread.php?2152-Question-about-Allow-own-Sub-directory-for-this-account-type-users&p=10323#post10323

go to the last post for a guide that may help

Thank you so much, Pete!