PDA

View Full Version : Problem with registration hook


MarkPW
07-11-2006, 12:41 AM
I'm attempting to add a small plug-in to the register_addmember_process hook so that I can check for invalid characters in usernames.

I've put together the following code, however when testing on the registration page the phrase (which I have added as a custom phrase) is not retrieved and is returned as... "Could not find phrase 'm24_invalidusername'". I've also tested using default phrases so I know there isn't a problem with my custom phrase, and I receive the same error.


if(!ereg("^[a-zA-Z0-9_-]+$",$vbulletin->GPC['username']))
{
$userdata->error('m24_invalidusername');
}


Would anyone know why this isn't working?

Paul M
07-11-2006, 12:13 PM
As I recall, you would have to define it as an error phrase rather than a global phrase.

MarkPW
07-11-2006, 03:55 PM
Thank you so much, that worked! :cool: