Log in

View Full Version : Data Manager PM


geocodes
04-06-2012, 02:30 AM
When using the data manager to send pms, I run into something strange, no matter what I set the from username and id too, it will always send from the $vbulletin->userinfo details. (I have it hardcoded in the dm to set the id and username to the admin.) I want to make it always send it from the admin, no matter who triggers it. Does anyone have any information on this?

kh99
04-06-2012, 01:44 PM
The only thing I can think of is, are you reusing the data manager instance from a PM being sent from the current user? If so, try creating a new instance. Otherwise, could you post the code you're using?

geocodes
04-08-2012, 05:23 AM
Thanks for the reply. I'm creating a new one and assigning it to a new variable.

$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', 1);
$pmdm->set('fromusername', "Geocodes");
$pmdm->set('title', $title);
$pmdm->set('message', $message);
$pmdm->set('iconid', 1);
$pmdm->set('showsignature', 1);
$pmdm->set('allowsmilie', 1);
$pmdm->set_recipients($recipients, $botpermissions);
$pmdm->set('dateline', TIMENOW);
$pmdm->save();