The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Code Excutes when called direct, but not as plug :(
Here are my forums: http://www.gamegavel.com/forum I do have the license you can ask vB
Anyways, I run an auction site and so does this fellow I know in AU, we are both trying to do the same thing, but since I can code and he can't I am writing it. I managed to get the code how I wanted it to exceute as a stand alone... seen here: http://www.gamegavel.com/forum/cats.php Code for the file: PHP Code:
I go in, add the plugin like so: PHP Code:
Warning: include(home/gamega5/public_html/auction/forums/cats.php) [function.include]: failed to open stream: No such file or directory in [path]/global.php(405) : eval()'d code on line 2 Warning: include(home/gamega5/public_html/auction/forums/cats.php) [function.include]: failed to open stream: No such file or directory in [path]/global.php(405) : eval()'d code on line 2 Warning: include() [function.include]: Failed opening 'home/gamega5/public_html/auction/forums/cats.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/global.php(405) : eval()'d code on line 2 At the top of the forums where I inserted the $includephp. So then, I change the path so the plugin code now looks like this: PHP Code:
|
#2
|
|||
|
|||
Maybe
PHP Code:
|
#3
|
|||
|
|||
Tried that and received this error:
Fatal error: Call to undefined method database::query_read_slave() in /home/gamega5/public_html/forums/index.php on line 415 |
#4
|
||||
|
||||
Always chdir() to the forum directory in your scripts if they are located outside the forum root directory. Most likely, that is the problem.
|
#5
|
|||
|
|||
cats.php is in the forum directory.... let me do some research on chdir() to see if it will help. Thanks for the tips.
EDIT* I added chdir('forums'); as suggested. The script ran, but gave the error no folder called forums. Maybe because the file is alreayd in the forums directory. This is really kicking my butt, it seems so simple. The file works when called direct, but gives an error when called in vB. Is my code for the call right (in the plugin)? --------------- Added [DATE]1216930223[/DATE] at [TIME]1216930223[/TIME] --------------- Any other advice? |
#6
|
||||
|
||||
Please post the code you are using now.
|
#7
|
|||
|
|||
Dismounted....
Same as above in the OP since the chdir() within cats.php didnt do anything except cause an error. Here is the gist of what I did... 1. Wrote cats.php a standalone php file, that you can call directly from your browser. Check it out: www.gamegavel.com/forums/cats.php. It generates a nice list of categories from my Auction site. 2. Then I went to the plugins manager, and just did a simple include to call the file, cats.php. I used the required ob stuff to do the include. 3. I tried to use chdir('forums'); to ensure I was in the forums folder where the file was located, but it gave an error because the file was in the forums folder already. This seems so weird, I mean the file executes when called from the browser but if I try to call it within vB... vB throws the error. |
#8
|
||||
|
||||
Use the full path in chdir (eg. /home/someuser/public_html/). Then make sure all your includes are just "./somefile.php" (one preceding dot only).
|
#9
|
|||
|
|||
Do I use the chdir(/home/gamega5/public_html/forum); in the external php file (cats.php)? or do I use it in the plugin code itself?
|
#10
|
||||
|
||||
cats.php, at the very top.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|