Thursday, September 20, 2007, 9:51:49 AM, Hans wrote:

> The filter function will abort the posting if no valid email address
> is provided. To prevent aborting just comment the 'FoxAbort' line in
> the code, then fox will post valid email addresses, and replace any
> non-valid ones with a blank entry.

Or allow postings with no email address, but verify any emaikl address
given, with this code:

# add filter function
$FoxFilterFunctions['FoxVerifyEmail'] = 'FoxVerifyEmailFilter';

function FoxVerifyEmailFilter($pagename, $fields) {
  if(!$fields['email']=="") {
    if(!preg_match("/[EMAIL PROTECTED],4}$/i", $fields['email'])) {
      $fields['email'] = "";
      FoxAbort($pagename, "Please provide a valid email address!");
    }
  }
  return $fields;
}


  ~Hans


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to