Quote:
Originally Posted by Sherif
Because the present code will check for new reply also. and generally new reply title are like this
|
Good point. But changing the hook to newthread_post_start doesn't seem to work. Your second suggestion works except that you have 'iff' at the beginning (is that a typo?).
Checking for $type == 'thread' will allow any characters in reply titles, but the OP does specifically say "thread titles", so maybe that's OK.
Gripi, sorry for any problems this may have caused on your forum.
Edit: I also figured out that it only quotes the title with "Re:" if you have set the "Automatically Quote Post / Thread Title" to true, otherwise title is blank by default (which also caused a problem since the pattern didn't allow blank titles). So I have the following suggestion (using newpost_process):
PHP Code:
if ($type != 'thread' && $vbulletin->options['quotetitle'])
$titlepat = '/^(' . preg_quote($vbphrase['reply_prefix'], "/") . ')?[A-Za-z0-9\s]*$/';
else
$titlepat = '/^[A-Za-z0-9\s]*$/';
if (!preg_match($titlepat, $post['title']))
$errors[] = "Only letters, number, and spaces are allowed in title.";