I am a noob with PHP and know enough to be dangerous.
I have already asked this question on the SMF support forum and the response have been general rather than specific. I hope that someone here will be able to help me.
The requirement I have is that when a user registers on the forum that their registration name must be their membership number which is a positive integer between 1 and 9999. I have identified the lines of code that i think need changing but all the changes I have made here do not do what I need.
[php]// Only these characters are permitted.
if (preg_match(’/^\d+$/’, preg_replace(’~&#(?:\d{1,7}|x[0-9a-fA-F]{1,6});~’, ‘’, $context[‘checked_username’])) != 0 || $context[‘checked_username’] == ‘_’ || $context[‘checked_username’] == ‘|’ || strpos($context[‘checked_username’], ‘[code’) !== false || strpos($context[‘checked_username’], ‘[/code’) !== false)
$context[‘valid_username’] = false;
if (stristr($context['checked_username'], $txt['guest_title']) !== false)
$context['valid_username'] = false;
if (trim($context['checked_username']) == '')
$context['valid_username'] = false;[/php]
Any help / code/ advice would be most welcome.
Colin