Quote:
Originally Posted by CyberRanger
The only item that I can't get working is overriding the mailbox full restriction. I've used the code above but setting adminpermissions to 2 doesn't seem to work. In class_dm_pm.php, $overridequota = false seems to need to be set to "true" but I can't figure out how to do that.
|
I had the same issue. What I found by searching through all the vB code is a couple of places where overridequota was referenced. All that is required to set this to send the PM even if the recipient's mailbox is full is to:
PHP Code:
$pmdm->overridequota = true;
Here is how my code looks with this:
PHP Code:
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
$pmdm->set('fromusername', $vbulletin->userinfo['username']);
$pmdm->set_info('receipt', false);
$pmdm->set_info('savecopy', false);
$pmdm->overridequota = true; // Force pm send even if recipient's mailbox is full
$pmdm->set('title', $title);
$pmdm->set('message', $message);
$pmdm->set('dateline', TIMENOW);
$pmdm->set('allowsmilie', true);
$pmtousernames = implode(';', $pmto_users);
$pmdm->set_recipients($pmtousernames, $botpermissions);
$pmdm->save();
Hope this helps everyone that was running into similar problems.
Mark
When testing my auto send pm's code I kept seeing users that had pmpopup (popup-based pm notification) not being updated when I sent my auto pm.
If a user has pmpopup notification on this column should show as "1" in the user table. If they receive a new message and haven't read it yet it should show as "2" in the user table. The two denotes that there is an unread popup.
In the case where I was sending a message to multiple recipients I noticed that only the last of the recipients that also had pmpopup notification was having the pmpopup column updated to "2" while other's weren't.
In debuggint this problem I found that in the forums/includes/class_dm_pm.php file that line 557:
PHP Code:
$popupusers = array();
is reinitializing the array and therefore causes any previous userids that have pmpopup enabled to be lost (since its within a foreach loop processing all the users)
To resolve this I've commented the line out for now and also filed a bug report with vBulletin to get it resolved in a future release. I found this is 3.6.1 and also in 3.6.3.
Hope this helps some others that found problems in getting this mod working as expected.
Mark