PDA

View Full Version : Pm Datamanager


paul41598
02-20-2007, 06:28 PM
n/m

paul41598
02-21-2007, 07:44 PM
Ok reviving this after a day cuz Im stumped, utterly. This sends the PM great, fine it works. However, IT DOES NOT indicate to the user that they have a new PM on forumhome. You basically have to open up your USERCP -- > Private Messages or whathaveyou in order to see the PM. Basically it doesnt update the pmtotal and pmunread fields. I've been at it all day, and just don't understand :eek: :mad:



global $vbulletin, $vbphrase;
$vbphrase = init_language();

$pmbody = construct_phrase($vbphrase['sendpm_on_p_alertpm']);

$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', $vbulletin->options['sendpm_on_fromuserid']);
$pmdm->set('fromusername', $vbulletin->options['sendpm_on_fromusername']);
$pmdm->set('title', $vbulletin->options['sendpm_on_subject']);
$pmdm->set('message', $pmbody);
$pmdm->set_recipients($user['username'], $botpermissions);
$pmdm->set('dateline', TIMENOW);
$pmdm->save();

Guest190829
02-22-2007, 07:05 AM
Ok reviving this after a day cuz Im stumped, utterly. This sends the PM great, fine it works. However, IT DOES NOT indicate to the user that they have a new PM on forumhome. You basically have to open up your USERCP -- > Private Messages or whathaveyou in order to see the PM. Basically it doesnt update the pmtotal and pmunread fields. I've been at it all day, and just don't understand :eek: :mad:



global $vbulletin, $vbphrase;
$vbphrase = init_language();

$pmbody = construct_phrase($vbphrase['sendpm_on_p_alertpm']);

$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', $vbulletin->options['sendpm_on_fromuserid']);
$pmdm->set('fromusername', $vbulletin->options['sendpm_on_fromusername']);
$pmdm->set('title', $vbulletin->options['sendpm_on_subject']);
$pmdm->set('message', $pmbody);
$pmdm->set_recipients($user['username'], $botpermissions);
$pmdm->set('dateline', TIMENOW);
$pmdm->save();


Where are you running this code?

paul41598
02-22-2007, 09:58 AM
paidsub_build actually, which there in might be the problem. You can see by my code that in order for the phrases to actually work, I had to initiate the language there. Its very hard to work within that plugin, lol

Guest190829
02-25-2007, 10:19 PM
You need to make sure print_output is being called somewhere, as those fields (pmunread and pmtotal) are updated via a shutdown query.

Adrian Schneider
02-25-2007, 10:31 PM
I remember bashing my head on the desk for a while on that one (shutdown query) last year... :(

paul41598
02-25-2007, 11:01 PM
hmmm, print_output as in for fetching a template? What if Im not using any?

Adrian Schneider
02-25-2007, 11:08 PM
Call the exec_shut_down() function