PDA

View Full Version : Problem with Message System


HolySell
01-28-2012, 02:36 PM
Hey vBulletin.org members,

I have a big problem :(,

I have intigrated an payment option in my vBulletin board, and users can send other users "GP?s" (credits), and if someone sends anoter user an amount he must be informed why the sender has send him the amount, the problem is, How can I send an automatic message to the receiver with a few information about the reason why him is sended the credits.

Sry for my bad English

MfG HolySell

--------------- Added 1327773833 at 1327773833 ---------------

please :/

HolySell
01-29-2012, 05:19 PM
H E L P please :(

ForceHSS
01-29-2012, 05:21 PM
where did you get this plugin

HolySell
01-31-2012, 05:47 PM
I have written it by myself, how can I inform an user which have become sended an payment from another user ?

HolySell
02-05-2012, 06:57 PM
help please :(

kh99
02-05-2012, 07:19 PM
I'm not sure if this is what you're asking, but you can send a PM from code like this:

// Set these like you want
$title = "PM title";
$message = "PM message";
$touserid = id;
$fromuserid = id;

$touserinfo = fetch_userinfo($touserid);
$fromuserinfo = fetch_userinfo($fromuserid);
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_SILENT);
$pmdm->set_info('savecopy', false);
$pmdm->set_info('receipt', false);
$pmdm->set_info('cantrackpm', false);
$pmdm->set_info('forward', false);
$pmdm->overridequota = true;
$pmdm->setr('title', $title);
$pmdm->setr('message', $message);
$pmdm->set('dateline', TIMENOW);
$pmdm->set('fromuserid', $fromuserid);
$pmdm->set('fromusername', $fromuserinfo['username']);
$pmdm->set_recipients($touserinfo['username'], $fromuserinfo['permissions'], 'cc');
$pmdm->pre_save();
if (!$pmdm->errors)
$pmdm->save();