[How to] Send Auto PM in vb4.0
In this article I am going to explain you how to send a PM with the Vbulletin 4.0.X
it is based on this article https://vborg.vbsupport.ru/showthread.php?t=82786 written by Andreas PHP Code:
Firstly it is to say, that you have to use the following three 3 lines if you are excluding that code in a class or function in a folder like /includes. PHP Code:
Anyway lets continue: Before we can start setting anykind of information, we need a class with which we can work, this class is called "vB_DataManager_PM" it extends "vB_DataManager". (that is the reason why we had to require 2 classes from the /includes directory). "vB_DataManager_PM" works with the table: "pmtext" of your database. However we have to give her the registry, which is $vbulletin. So it should like this: PHP Code:
from now on "$pmSystem" represents our class and we are finally able to set things up for sending a pm - so lets do it: Before I actually set the message and the title to the PM I want to make shure, that it is ok and that there are no unallowed things inside. PHP Code:
After that we do the actual PM set up: PHP Code:
We say:
So lets send our PM or not? Before we actually send we can check if it successes by: PHP Code:
So in the case shown above we say: if its possible and everything is fine, then: send it! ($pmSystem->save();) otherwise check if there are errors! PHP Code:
That is it. You should now be able to automatically send a message with the Vbulletin 4.0.X What can you do after reading this article? Have a look at the API http://members.vbulletin.com/api/vBu...anager_PM.html I hope that I was able to help at least one person! Because it took me like three hours to figure this out!!! Enjoy, maybe you could write for what you are using automatic PMs All the best, Bjoern aka bpr |
Is it mass PM to all members?
|
No, it is an article to show how you can automatically send a pm !
|
This is the code from my mod:
Code:
$dm =& datamanager_init('PM', $vbulletin); Code:
Database error in vBulletin 4.0.3: |
hmm looks interesting,
I had never developed for 3.X and dont have that much experience with the 4.X but why are you not using PHP Code:
i dont think it would change something .... but I also dont have any idea, why it tries to write it twice in the db |
1.
PHP Code:
the second file is also in the includes folder 2. that wouldn't happen if you would use datamanager_init;) |
Quote:
2. ah sounds good, why is nobody saying those kind of things : ( |
Here's how i would make it in vB4 ;)
PHP Code:
|
ragtek your so mean lol! Couldv'e atleast just pointed out what spots he did wrong :)
|
Quote:
I've commented everything in the code... But ok, i've seen that the big part of the user here don't need help in making the code better.... The "only" thing you'll get when you help somebody, are some "very friendly" messages in the forum or per skype/icq "why i attack other users which are helping,etc......." |
All times are GMT. The time now is 07:35 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|