This is a cool mod. I'd like to add to it the functionality of sending me a PM when someone in the "waiting period" attempts to send more than X PM per day. I am able to send and receive the alert. But it also gives me a database error even though transaction was successful. This is what I included before the closing bracket
PHP Code:
$pmtitle = "Spammer Alert";
$pmmessage = "A new member, " . $vbulletin->userinfo['username'] . " is attempting to send numerous PM. Please verify for possible spammer.";
$sendtoname="Lionel";
// create the DM to do error checking and insert the new PM
$botpermissions['adminpermissions'] = 2;
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
$pmdm->set('fromusername', $vbulletin->userinfo['username']);
$pmdm->set('title', $pmtitle);
$pmdm->set('message', $pmmessage);
$pmdm->set_recipients($sendtoname, $botpermissions);
$pmdm->set('dateline', TIMENOW + 5);
// If no errors, save.
if ($pmdm->errors) {
return $pmdm->errors;
}
$pmdm->save();
Like I said, transaction is fine but the next page is about a duplicate entry. Do you still save the blocked PM ?
Quote:
MySQL Error : Duplicate entry '25031' for key 1
Error Number : 1062
|