![]() |
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:
If everything is OK PHP Code:
Quote:
$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:
Furthermore you can specify ($pmdm->set(...)):
For multiple receipients just use user1;user2;useer3. This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent. |
This is a FANTASTIC tutorial - people can make up a zillion hacks based on this How-To. :)
|
KirbyDE, That is great! I just love this.
Finaly the old vB.org is BACK! |
Wow! Lots of good stuff here. I'm so excited about this new release. Thank you so much for the tutorial, as it really does teach you something useful. Thanks!
|
Kirby,
Is there anyway we can get this info for the other classes? |
Quote:
|
To send PMs to more than 1 user:
Retrieving usernames: To get a list of usernames from an array and output in the form of user1;user2;user3: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
The PM data manager seems to completely kill the page when I use this function. It just does a white page and no PM is sent.
PHP Code:
|
Quote:
|
Code:
$pmdm->set_recipients('newuser', $botpermissions); |
Quote:
|
Suggest @ Jelsoft to call die('Class vB_Datamanager not defined') instead of just exit; :)
|
Or just die ;)
Satan |
Hmm, die() without parameters does not produce any output as well, or am I wrong?
|
No - I meant that you could suggest to Jelsoft that they could just die:p
They haven't fixed the Beta 3 issue yet :cry: Satan |
I don't understand how to use this? Is this a class built into 3.5? Is this code you would place in one of the files in the include directory? Or you create a new php page with functions?
Would it be possible to explain this hack in detail as if you were speaking to a very dumb person :ninja: |
This is not a Hack, it's Howto ;)
Class vB_Datamanager_PM is a Class that comes with vB 3.5, yes. You can use code like this wherever you want in your vB Projects/Hacks. |
Quote:
Quote:
Quote:
right? Another dummy question, how do you get the array out of there? The "->" is throwing me off. |
For objects (that's an instantiated Class) you must always use ->.
$pmdm->errors was not meant to be used as a single Code-Line, it should just show which property you have to access (for example in an if) to check for errors. |
I hate OOP :)
I guess I'll have to get used to it unfortunately. |
Does anyone know How I can make this able to send this to new users once they register?
|
Thanks Kirby, another very useful How-to
|
How to parse URLs and email adresses in the pm text?
There must be some parameter :D -orban |
No. If it contains [email] and [url] codes those will be parsed, if it does not they will (obviously) not be parsed :)
|
Ooooooh!
Because I'm working on my Report to PM (without email notification in any case) plugin... So I have to change the email template phrase I guess. |
does anyone know how I can pass an additional variable to $pmdm?
I want to pass a single extra 1 or 0 and I then want to detect this in the $pmdm class and act accordingly. I know I'll have to modify the code in the $pmdm class, but I can't work out how to pass the extra boolean, and then detect it in the class. If anyone has any ideas, I'd be very grateful :) |
What is "touserarray" used for? It seems redundant. I can remove the data from touserarray in pmtext and it still works fine.
|
trying to use the PM data manager within a plugin at hook location profile_doremovelist. When the script at profile.php runs, everything works out fine, but no PM is sent. I'm stumped :ermm:
here's my code... PHP Code:
|
I finally figured it out by process of elimination, my results are here if anyone wants to check out the code I used.
Thanks for this howto Andreas, i couldn't have figured this out without this thread. :) |
Is anybody aware why when you send a pm from a given user to another user through the use of the sendpm code in this thread and found elsewhere, that no email is sent nor does it show a pop-up that you have a PM waiting.
This is kinda worthless in that sense. I have seen others with the same issue, but no work around. As a follow-up, it did email, but not notification online when sending a regular PM does do that. |
Quote:
|
Actually, it goes deeper than a pop-up. Even on the "Private Messages" for you under your username in the upper-right hand side of the default templates, it will show "0" even though I will have a new 1. EVEN if someone sends me a PM, it will show 1, when two are really available.
It's as though it thinks I have read it... but I haven't. It does show up as bold though likes its new , the PM area. |
I'm at a loss, I am not experiencing any of those behaviors on the hack I wrote to send automatic PMs which i learned from reading this HOWTO. All the stuff in the top right, everywhere seems to work as it should on my installations of vb. Maybe it has to do with the location where you're inserting the datamanager code?
|
OK I'm a little confused with PMing multiple users.
Suppose I have two textfields, user1 and user2. All I want to do is combine those two values into the format user1;user2 and input that into the "$pmdm->set_recipients" line so I can send the PM to the two users specified. |
i am working on a new hack "Auto PM in members birthday"
i will use it as a cron jop but i have a proplem in recipient i can't make it sends the message to any member |
I am confussed, how do i make it so that a new user will get a private message automaticly sent by me saying Welcome?
|
I'm interested in some hints, or pointers to other tutorials, on how I might use this to PM a user when a mod delete's their message. I'd like to include the reason they list in the delete reason blank.
|
This would be great to use as a "poke" sort of feature like facebook.com has, I'm not sure exactly how to do that at all - but it would be awesome to try ...
|
What is the "poke" feature? Never heard of it.
|
Quote:
Thanks, Alan. |
All times are GMT. The time now is 02:04 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|