The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to have one mod call another mod and return?
I would like to imbed into a mod a "call" to a cleanup routine I've written in php and then return control to the mod. The mod would need to pass one parameter ($forumid) to the cleanup routine. Both php files are in the vb forum root directory.
How does one "call" to another php file and "return" control to the original file such as this? As an aside, can anyone tell me what "vbflush()" does as I see many people putting it at the end of their routines and I can't find an explanation? Thanks for any help here! -- Rik ps: I assume I could make the cleanup routine a function within the mod but I really want to keep the two separate as I'll be using the cleanup routine for other things outside of the mod. |
#2
|
|||
|
|||
hmmz.. if i got you stright, the solution should be require_once('./....');
that way you call the other file, send what eva you want to do, and the control stays on the same file. im using it instead of long functions. |
#3
|
||||
|
||||
Quote:
What I'd like to do is have the first script either call a URL such as vbulletin.com/myscript.php?do=run&forum=25 or pass the parameter such a forum 25 to the 2nd script which would then revert control to the first script once the 2nd script completed its tasks. Thanks again. -- Rik |
#4
|
||||
|
||||
Require_once() won't work for us do to conflicts between variables in two scripts by two different authors.
1.) Can anyone show me an example of what to embed in the first script to use $_POST to send variables to a 2nd script (I think I understand how to evaluation them in the 2nd script)? 2.) Otherwise, I see that PHP has curl functions built into it. I'm temporarily using curl on our server via cron and a bash script to execute these 2nd php scripts. But I'd much rather have have them invoked from the first php script. Again, we manually invoke our script with URLs such as vb.com/script.php?do=run&forum=27&days=30 etc. But we could make these script utilize any passed $_POST variable if there are no variables embeded in the script's command line. Any suggestions? Thanks. -- Rik |
#5
|
||||
|
||||
How about if you set a post variable before you call the script via require_once?
PHP Code:
|
#6
|
||||
|
||||
Thanks to both Tuk4 and Dismounted. Both of your suggestions were of help.
We went with the cURL option since the 2nd script was already designed for "get" instead of "post" parameters. Here is the code that works for us: PHP Code:
|
#7
|
||||
|
||||
thanx for the info...!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|