![]() |
|
|
Article Options |
|
[How to] Send Auto PM in vb4.0
bpr
Join Date: Dec 2009
Posts: 57
German person living in London, writing some crazy php codes and usually provide my knowledge to others over the internet by writing or recording tutorials London
by
Rating:
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 http://www.vbulletin.org/forum/showthread.php?t=82786 written by Andreas
That's it basically. Lets go through those lines: 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.
Those will provide you the usage of the whole system. I assume, that you dont need those lines if you already included the global.php! - But I am not that shure maybe somebody could confirm that. 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:
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.
(Just to let you know if you did not recognize it, I was creating two variables for the text and the title earlier in the script I had shown above) After that we do the actual PM set up:
$pmSystem->set_recipients("bpr");[/php] We say:
So lets send our PM or not? Before we actually send we can check if it successes by:
This will return "true" or "false" - obviously true represents that it will be successfull and false it wont! 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!
if there are errors, then print them. 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 No members have liked this post.
Last edited by bpr : 12 May 2010 at 15:20. |
||||||||||||||||||||||||||||
|
Views: 1951
|
||||||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Is it mass PM to all members?
No members have liked this post.
|
|
#3
|
||||
|
||||
|
No, it is an article to show how you can automatically send a pm !
No members have liked this post.
|
|
#4
|
||||||||
|
||||||||
|
This is the code from my mod:
As you can see, there are no mistakes in this code... however it prompts the following error:
It looks like the system attempts to input the PMTEXT into the database twice... anyone know how to fix? No members have liked this post.
|
||||||||
|
#5
|
||||
|
||||
|
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
and does the same happen if you use it like I wrote in the article ? i dont think it would change something .... but I also dont have any idea, why it tries to write it twice in the db No members have liked this post.
|
||||
|
#6
|
||||
|
||||
|
1.
is wrong ![]() the second file is also in the includes folder 2. that wouldn't happen if you would use datamanager_init ![]()
__________________
my addons: http://ragtek.github.com No members have liked this post.
|
||||
|
#7
|
||||
|
||||
|
Originally Posted by ragtek
1. thanks ragtek i was changing it immediately
2. ah sounds good, why is nobody saying those kind of things : ( No members have liked this post.
|
||||
|
#8
|
||||
|
||||
|
Here's how i would make it in vB4
![]()
__________________
my addons: http://ragtek.github.com No members have liked this post.
|
||||
|
#9
|
|||
|
|||
|
ragtek your so mean lol! Couldv'e atleast just pointed out what spots he did wrong
![]() No members have liked this post.
|
|
#10
|
||||
|
||||
|
Originally Posted by ChopSuey
And why i'm that?
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......."
__________________
my addons: http://ragtek.github.com No members have liked this post.
|
|
#11
|
||||
|
||||
|
Hello everyone, I have been trying to get my code to work but every time I run this file all I get is internal server errors everytime. What am I doing wrong?? Here is my php file:
Please Help...? ![]() --------------- Added 24 Jul 2011 at 04:57 --------------- GOT IT! Just needed to add this file to a new scheduled task and done! WORKS!
__________________
Aniworlds.net - Anime, Manga, Games and Friends. No members have liked this post.
|
||||
![]() |
«
Previous Article
|
Next Article
»
Similar Article
|
||||
| Article | Author | Type | Replies | Last Post |
| Send Message Auto Reply | 1Unreal | vBulletin 3.8 Add-ons | 15 | 24 Jul 2009 19:54 |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Article Options | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 17:06.






