The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
I want to use ajax in my calendar.php file but how do i get started?
I want to use some ajax with my form and i need to get started somewhere - I am hopeing at some point to be able to use some of the things all ready in vbulletin to get my mod to work for me.
I am going to start of some what slow step be step and hope on can follow along. The file I wish to make my modification to is calendar.php and I do know that the first thing is to setup the ajax hooks at the begining of the calendar.php but where and what and how does this happen. I did find in my investagation of the files I did locate a file that seems to have the required functions in which the calendar.php need to make a call to setup the ability to use ajax. The file I found was vbulletin_global.js and is located in the clentsscript folder. About line 711 to line 739 has what seems to me the first peice of this but it is only a guess. PHP Code:
Ok getting back to my question where in the calendar.php if that is the place do I make a call to setup the ajax request handler or handlers for all tyoes of browser and not only where but a example of the area in a non modifyed version of the calendar.php would i do this setup housekeeping and what would this call look like so as not to break the vbulletin system and has to handle all the avaibale browsers that vbulttin supports unmodifyed version? THANKS Frank H. Shaw --------------- Added [DATE]1236030263[/DATE] at [TIME]1236030263[/TIME] --------------- Please explain how this would work? I found a Templete - that seems to have calls to ajax functions the file is /forums/ajax.php I need to know what I have to do to use this file as a templete or model for using with my calendar.php can someone help me explain what needs to be added to the calendar.php so that it will supoort my ajax modification. I hope this better explains what i need thanks Is this the first place the actual ajax is setup or used please explain the line below? PHP Code:
THANKS Frank H. Shaw |
#2
|
|||
|
|||
There are some articles on AJAX in our articles section.
|
#3
|
|||
|
|||
The following i am going to start to modify the calendar.php and I will start to post the changes as i do them.
My first is where in the calendar.php do I put my first part of this the following: PHP Code:
If I have posted to much vbulletin please edited it down for me so that I have a good idea if i am doing good so far and if i run into any problems you will be able to help me through the problem. So I have posted the above incase placement is important if not then let me know that also? THANKS. Next is my javascript function modifaction to go with the dropdown. PHP Code:
Now my PHP function to handle the PHP Logic PHP Code:
AFTER LOOKING AT ALL THE ABOVE QUESTION 1 - DID I SET EVERYTHING UP RIGHT AND MAKE THE CORRECT CALLS AND DID NOT MIX UP MY VARIABLES? QUESTION 2 HOW DO I GET BACK TO THE SENDER IN THE JAVASCRPT FUNCTION process_selected I HOPE I HAVE THIS ALL CORRECT ABOVE? THANKS Frank H. Shaw --------------- Added [DATE]1236138456[/DATE] at [TIME]1236138456[/TIME] --------------- This the error message when I run my calendar.php 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:
THANKS Frank H. Shaw |
#4
|
||||
|
||||
I think you are confusing what is PHP code with JS. You are placing code that is meant for JS into a PHP file. Additionally, you should be using the YUI method of firing AJAX requests (see your other thread).
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|