Wednesday, July 01, 2009

Increase Username field for Silent Registration in Virtuemart. Allows for long email addresses to be used as a username

FOR Joomla 1.0.x & Virtuemart 1.10.x only

use phpMyAdmin to modify jos_users

Change Type/Length of username field from 25 to 255

Edit File:

administrator\components\com_virtuemart\classes\ps_shopper.php

Line: 174

Change Code:

$silent_username = substr( str_replace( '-', '_', $d['email'] ), 0, 25 );

To:

$silent_username = substr( str_replace( '-', '_', $d['email'] ), 0, 255 );


Editincludes/joomla.php file

find the lines

// check that username is not greater than 25 characters
$username = $this->username;
if ( strlen($username) > 25 ) {
$this->username = substr( $username, 0, 25 );

To:

$username = $this->username;
if ( strlen($username) > 25 ) {
$this->username = substr( $username, 0, 25 );

To Increase in com_registration

EDIT:

administrator/components/com_users/admin.users.html.php

Replace <> with []

[input type="text" name="username" class="inputbox" size="40" value="username; ?>" maxlength="25" /]

to

[input type="text" name="username" class="inputbox" size="40" value="username; ?>" maxlength="255" /]

EDIT:

line 123

components/com_registration/registration.html.php