PDA

View Full Version : Construct Phrase Hmmm


paul41598
02-21-2007, 11:47 AM
Ok Im officially stumped on this one. The below code does not work and doesnt send the PM in one of the plugins I wrote. HOWEVER, if I replace $pmbody with something like 'hello test' (a string basically) then PM sends fine. It has something to do with the construct_phrase Im guessing here, but not sure what at this point



global $vbulletin, $vbphrase;

$pmbody = construct_phrase($vbphrase['sendpm_on_palertpm'], $user['username'], $subscription['title']);

$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();

nico_swd
02-21-2007, 12:21 PM
Are $user and $subscription global or accessable?

paul41598
02-21-2007, 01:09 PM
I don't think that matters either because I tried taking both variables out and testing it, and it still didnt work

$pmbody = construct_phrase($vbphrase['sendpm_on_palertpm'])


Actually this doesnt even work either:

$pmbody = $vbphrase['sendpm_on_paid_subscription_alertpm'];

$vbphrase is globalized too