22.01.2013, 19:38
Also, wenn ich den Code jetzt im UserCP einfüge, funktioniert er ohne Probleme.
Nur bei der Freigabe eines Threads wird er nicht ausgeführt.
Ich habe ihn jetzt in der Moderation.php definiert.
Oder muss der wo anderst hin :o
Nur bei der Freigabe eines Threads wird er nicht ausgeführt.
Ich habe ihn jetzt in der Moderation.php definiert.
Oder muss der wo anderst hin :o
PHP-Code:
// We are ready to send it.
require_once MYBB_ROOT.'inc/datahandlers/pm.php';
$pmhandler = new PMDataHandler;
$pmhandler->admin_override = true; // if you want Flood checking, useless if the PM is send automatically
$pmhandler->set_data(array(
'subject' => 'Hello!', // the PM title
'message' => 'Hi!', // The message
'icon' => -1, // the icon
'fromid' => (int)$mybb->user['uid'], // UID who is sending the PM, MyBB Engine = -1
'toid' => array(1, 345) // users to send the PM to
));
if($pmhandler->validate_pm()) // insert if PM is valid
{
$pmhandler->insert_pm();
return true;
}
return false;