The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
I am trying to use ajax and getting this error message and do not understand Why
The following error is happening and I have some idea that the defining class for the ajax is missing and do not have any idea of how to include the class defination into my php file.
The error i am getting is this error: Fatal error: Class 'vB_AJAX_Handler' not found in C:\Inetpub\vhosts\burningtaper.org\httpdocs\forums \calendar.php on line 131 At the line 131 number is the following line. PHP Code: PHP Code:
Here is all the setup code that i put in the top of my file calendar.php you can look at the other posting of mine to get more detail but I have include that part below. PHP Code:
In my guess it seems to me the error means that the ajax defination for the class is not tirned on or was never defined. I really do not know at this level in the vbulletin product how this is done so things get even more complex when it is all kind new stuff for me. I have read all the articals on ajax it was a help but it is not enough because - I do not know how to defne the class as the error sujgest above. Can someone give me a example how this is done and how to fix things up so that at least when I make a call vB_AJAX_Handler(true) the thing does not error out first thing. I also know that there is a need to allow for multi browser support in the class define but I can not understand that either. Please explain? I have spent the last couple of days looking through the scripts my eyes hurt me. Please explain me what is missing here and then I think I have the rest preity close I hope. THANKS Frank H. Shaw PS I more details are needed all this: i have posted every thing i have done so far in my modifaction is also posted on a old thread at this url : PHP Code:
|
#2
|
||||
|
||||
All you've done is copied what was in the tutorial without changing it for your specific needs. And what did you do regarding Step 3 in that tutorial to "Fire and Receive Data"?
You might want to also see this - https://vborg.vbsupport.ru/showthread.php?t=81626 (I don't 'do' ajax, so I can't really help with the specifics of your ajax problems.) |
#3
|
|||
|
|||
Quote:
https://vborg.vbsupport.ru/showthrea...93#post1759693 |
#4
|
||||
|
||||
You should not be using the (old) AJAX object. vBulletin now uses the YUI Javascript framework. You can fire a request with just:
Code:
YAHOO.util.Connect.asyncRequest('POST', scriptpath + '?do=ajax', { success: this.handle_ajax_response, failure: this.handle_ajax_error, timeout: vB_Default_Timeout, scope: this }, SESSIONURL + 'securitytoken=' + SECURITYTOKEN + '&foo=' + foo); |
#5
|
|||
|
|||
You say there is a dffenrent type of ajax used now with vbulletin how do I get documation for this and how do I setup the sender and reciever part.
As you know my javascript function needs to fire of some ajax to a handler of some kind on the server that is running PHP. Now I have taken the first part of the calandar down to where the actaul start of the script and posted above and this was in hopes that someone would be able to make the changes in what I posted for me. I put in the post the php function calls that I thought would at least deal with this and now I find there is a new way to do it no wonder I could not get any thing I tried to even remoty work or be close to any thing other then a buch of errors. Would someone please go thorugh the setup part and explain in very clear details how to setup this so all I have to do is write the send and reciever functions. I want to go from my javascript that is hooked to my form and resides in the same templete a custom one i modified and thorugh ajax store the values selected off into a log or some other thing I have to do before my javescript actual sends the form submit after housekeeping is complete. The function doing the housekeeping is in PHP and that is what i am good in myself. But I have never in my life done ajax so any help on this is very much needed. THANKS Frank H. Shaw |
#6
|
|||
|
|||
hi
i think you'll find all the answers on the yui page http://developer.yahoo.com/yui/connection/ here's a example how i'm using it: Code:
var invites = { init:function() { YAHOO.util.Event.removeListener("ajaxinvites", "click", invites.init); YAHOO.util.Connect.asyncRequest("POST", "ajax.php?do=showinviteform", { success: invites.initform, failure: vBulletin_AJAX_Error_Handler, timeout: vB_Default_Timeout },SESSIONURL + "securitytoken=" + SECURITYTOKEN + "&do=showinviteform"); }, initform:function(a) { b = a.responseXML.getElementsByTagName("template")[0].firstChild.nodeValue; t = YAHOO.util.Dom.get('ajaxinvites').innerHTML; YAHOO.util.Dom.get('ajaxinvites').innerHTML = b; YAHOO.util.Event.on('sendinvite', 'click', invites.send, this, true); }, .....} Code:
vBTwitter.prototype.senddirect = function(e) { YAHOO.util.Event.stopEvent(e); YAHOO.util.Dom.get("progress_tweet").style.display='block'; YAHOO.util.Connect.asyncRequest("POST", "tweet.php?do=tweet", { success: this.sended, failure: vBulletin_AJAX_Error_Handler, timeout: vB_Default_Timeout },SESSIONURL + "securitytoken=" + SECURITYTOKEN + "&do=tweet&tweet=" + PHP.urlencode(YAHOO.util.Dom.get('twitter_tweet').value) ); // TODO need to check which function to use here to code msg } vBTwitter.prototype.sended = function(a) { var error = a.responseXML.getElementsByTagName("error")[0]; if (error) { YAHOO.util.Dom.get("progress_tweet").style.display='none'; alert(a.responseXML.getElementsByTagName("error")[0].firstChild.nodeValue); } else { YAHOO.util.Dom.get("progress_tweet").style.display='none'; YAHOO.util.Dom.get('twitter_tweet').value = ''; vBmenu.hide(); } } |
#7
|
|||
|
|||
I would like to ask can you let me look at the file or files you are allready using and I can only assume that you are using ajax in vbulletin and if you have some really good PHP that I can use as a refernce to how you ingrated the ajax into your project it might help me sort this new stuff out.
THANKS Frank H. Shaw |
#8
|
|||
|
|||
hmm, just look at the ajax.php there you see the php part
and in the uncompressed js files you can see the js things i think that will be better examples, then my code. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|