Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, Send PMs (automatically) in vBulletin; Send PMs (automatically) If you want to (automatically) send a PM to a user, you can use the Class vB_Datamanager_PM. ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=3308


Reply
LinkBack Thread Tools Display Modes
Send PMs (automatically)
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
08-09-2008, 07:30 PM
 
Send PMs (automatically)

If you want to (automatically) send a PM to a user, you can use the Class vB_Datamanager_PM.
This class makes sure that all values are correct, handles quota for the recipients, notification eMails, etc.

Example

PHP Code:
PHP Code:
           // create the DM to do error checking and insert the new PM
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', 1234);
$pmdm->set('fromusername', 'Welcome-Bot');
$pmdm->set('title', 'Welcom to our Forums');
$pmdm->set('message', "Hello\nI am a Bot and would like to give you a warm welcome :)");
$pmdm->set_recipients('newuser', $botpermissions);
$pmdm->set('dateline', TIMENOW);
</div>
If anything goes wrong you can check for errors using
PHP Code:
PHP Code:
           $pmdm->errors
</div>
This is an erray containing the errors.

If everything is OK
PHP Code:
PHP Code:
      $pmdm->save();
</div>
This will send a PM to user newuser telling him
Hello.
I am a Bot and would like to give you a warm welcome Egypt.Com EnForum
The message will appear to be coming from User Welcom-Bot (Userid 1234).

$botpermissions must be the permissions for the sending user, but can just be empty.
If you want to send PMs no matter if the PM box of the recipient is full or not:

PHP Code:
PHP Code:
      $botpermissions['adminpermissions'] = 2;
If you want, you can set other options as well ($pmdm->set_info(...)):
  • forward = 1/0 if this is a forwarded PM, Default=0
  • savecopy = 1/0 to keep a copy if the PM in outbox, Default=0
  • receipt = 1/0 to request a read-receipt, Default=0
  • parentpmid = ID of the PM you are responding to (if applicable)

Furthermore you can specify ($pmdm->set(...)):
  • iconid = ID of the message icon the PM should carry, Default=0
  • showsignature = 0/1 Whether the signature should be shown or not, Default=0
  • showsmilie = 0/1 Wheter smilies should be parsed or not, Default=1

For multiple receipients just use user1;user2;useer3.
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
 
Junior Member

Reply With Quote
 
Join Date: Apr 2009
Location: Papua New Guinea
Posts: 6
18-04-2009, 08:48 AM
 
What the hell he is selling much reseller stuff.http://reseller-heaven.ko.cxorhttp:/...er.200gigs.com
__________________
Life is short
 
 
 
Reply

Articles Thread, Send PMs (automatically) in vBulletin; Send PMs (automatically) If you want to (automatically) send a PM to a user, you can use the Class vB_Datamanager_PM. ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=3308


Bookmarks

Tags
automatically, pms, send


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send SMS (Short Message Service) Developer Classes & Source Code 18 16-05-2009 06:15 PM
Automatically Add Friend Developer Mods for 3.7.x 0 25-09-2008 11:46 PM
Send HTML email via adminCP Developer Mods for 3.7.x 0 22-09-2008 04:04 AM
Add new Users (automatically) Developer Articles 0 20-09-2008 02:09 AM
Automatically close threads after X repliesProduct name: Automatically close threads Developer Mods for 3.7.x 0 15-09-2008 09:30 PM