$userid = $_SESSION[userid]; $today = mktime(0, 0, 0, date("m"), date("d"), date("Y")); $userposts = $db->query_read("select postid from post where userid=\"$userid\" AND dateline > \"$today\" "); $user_posts = $db->num_rows($userposts); if ($user_posts < $vbulletin->options['devel_cant_pm_posts']) { // throw the error ... standard_error(fetch_error('cantusepm', $vbulletin->options['devel_cant_pm_posts'], $userposts)); }