The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with Datamanager/Sending Private Messages
Hi
I'm following instructions from https://vborg.vbsupport.ru/showthrea...ata+manager+pm to create a datamanager and send a PM. Everything looks good in my code, I believe, except that I'm having trouble including/requiring the files: core/includes/functions.php core/includes/class_core.php per http://www.vbulletin.com/docs/html/data_managers the file I'm working from is located in /public/my/includes/myscript.php, so what I'm trying is: PHP Code:
PHP Code:
I've tried various combinations of pointing to functions.php and class_core.php, but I keep end up getting "Access denied." on a blank white page, without it ever completing and going to the next actual web page. Can somebody point out my (hopefully) obvious mistake? This has been driving me crazy, any help would be appreciated. |
#2
|
||||
|
||||
That is a vB3 article, that will not work in vB5 it is completely different.
|
#3
|
||||
|
||||
Use the API
vB_Api_Content_Privatemessage::add() |
#4
|
|||
|
|||
Thanks.
I looked all over to find something specific to vb5, but that was really all Google could get for me. Would you be able to point me where I can find documentation on that? Sorry, I'm just looking at vBulletin for the first time, so it's all new. |
#5
|
||||
|
||||
Quote:
This is an example of calling the text API (for a new thread). Should give you an idea of where to start (since, basically, you're creating a text node, with additional PM data). Read the comments on the API method I referenced above and, if you're still stuck, someone will likely try to help. |
#6
|
||||
|
||||
Haven't worked with vB5 but seems that you're missing something. You've in your code:
PHP Code:
For vB4 I was using: PHP Code:
|
#7
|
|||
|
|||
I've done a bit more digging, and I believe I'm close with something like this:
PHP Code:
I'm not sure if it's the $data or the $options array that's having the "Illegal offset" problems, evan after looking at /vb/library/content/privatemessage.php Code:
Warning: Illegal offset type in isset or empty in .../vb/library/content/privatemessage.php on line 1723 Warning: Illegal offset type in .../vb/library/content/privatemessage.php on line 1787 Warning: Illegal offset type in .../vb/library/content/privatemessage.php on line 564 API Error Error: database_cant_escape_param Args: array ( 0 => 'array', ) Can anyone point me in the right direction? |
#8
|
||||
|
||||
I'm just guessing here...but it looks like 'sentto' probably isn't formatted correctly.
If I were debugging it, I'd probably add a few var_dumps in vB_Library_Content_Privatemessage:add() around where it calls the checkFolders method and inspect the variables it's passing. You'll probably catch one that's dropping invalid data (I'd start with the one at line 555). |
#9
|
|||
|
|||
I can't thank you enough...
Just got it working with: PHP Code:
And these options: PHP Code:
Thanks again for the help! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|