PDA

View Full Version : Sending PM using datamanager....


LarryB
06-17-2006, 06:41 AM
Ok I followed the tutorial for this to the letter. When I send the pm it is received just fine. The problem that I'm having is that it is not updating the pmtotal or the pmunread like it should. I can't for the life of me figure out why. I have looked all through the code and I can't find a reason why it is not updating those fields. Normal pm's work just fine. Below is the code I currently have in. It is a far stretch from what it was @ the beginning, but it should still work none-the-less. Any help with this problem would be very much appreciated.

$id = 4;
$fromuser = fetch_userinfo($id);
$permissions = fetch_permissions(0, $id, $fromuser);

$registry =& $vbulletin;
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_SILENT);
$pmdm->set('fromuserid', $fromuser['userid']);
$pmdm->set('fromusername', $fromuser['username']);
$pmdm->set_info('receipt', false);
$pmdm->set_info('savecopy', false);
$pmdm->set('title', $title);
$pmdm->set('message', $pm);
$pmdm->set_recipients($username, $permissions);
$pmdm->set('dateline', TIMENOW);

$pmdm->save();

Paul M
06-17-2006, 07:09 AM
They are updated as shutdown queries, so maybe you have a problem with them running

LarryB
06-17-2006, 01:22 PM
Yes. I am pretty sure that is the problem. I have turned the mysql query log on and the queries don't show up for one of my pm's I'm sending, but they do show up when I use the normal pm facilities and I can't figure out why for the life of me.