Hi all, Happy Easter and isn’t it great to have a brilliant excuse to eat all those chocs!! Anyways, can anyone help on this? Have been trying for a few weeks to get this right, need to do it so that it’s a pre-requisite to do 100 posts to post an email address and 50 posts to post a website address.
if ($submit || $preview || $refresh)
{
if ($user->data['user_posts'] < 100)
{
if (preg_match('/(http|www|dotcom|dotcodotuk)/i', request_var('message', '', true)))
{
$error[] = $user->lang['NO_URLS'];
}
if (preg_match('/(@)/i', request_var('message', '', true)))
{
$error[] = $user->lang['NO_EMAILS'];
}
}
I’m using shorthands there to avoid excess brackets, this piece of code alone shouldn’t give that error but combined with your own code it could (if there is a ‘}’ left from your previous code that shouldn’t be there).
Here is the same code without shorthands:
if ($submit || $preview || $refresh){
if ($user->data['user_posts'] < 100){
if (preg_match('/(http|www|dotcom|dotcodotuk)/i', request_var('message', '', true))){
$error[] = $user->lang['NO_URLS'];
}
if($user->data['user_posts'] < 50){
if (preg_match('/(@)/i', request_var('message', '', true))){
$error[] = $user->lang['NO_EMAILS'];
}
}
}
}