Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2005, 06:03 PM
Deviation Deviation is offline
 
Join Date: Sep 2005
Location: Ohio
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Accessing vBulletin Classes - global.php

Ok. According to the few posts I've read this should be easy. Fo whatever reason I can't get this to work for me.

Let's say I have a directory under the forum called vBTest.
/forumtest/vBtest
In that directory I have a file called test.php. Here's the basic code for that file:
PHP Code:
        error_reporting(E_ALL);
        
define('NO_REGISTER_GLOBALS'1);
        
define('THIS_SCRIPT''vBTest');

        
$phrasegroups = array();
        
$globaltemplates = array();
        
$actiontemplates = array();
        
$specialtemplates = array();
        
        
chdir('/home/username/public_html/forumtest');
        
        require_once(
'./global.php'); 
Just requiring global.php throws the following errors.

Code:
Notice: Undefined index: HTTP_REFERER in /home/username/public_html/forumtest/includes/class_core.php on line 1500

Notice: Undefined index: url in /home/username/public_html/forumtest/includes/class_core.php on line 1905

Notice: Undefined index: HTTP_REFERER in /home/username/public_html/forumtest/includes/class_core.php on line 1911

Fatal error: Call to a member function on a non-object in /home/username/public_html/forumtest/includes/functions.php on line 1545

Fatal error: Call to a member function on a non-object in /home/username/public_html/forumtest/includes/functions.php on line 4279
I'm obviously missing something simple here. I see there's a few NOTICEs, so perhaps I didn't define something I should have??

I searched the forums, but I couldn't really find anything. I'm just piecing various bits of info to try this out. i'm good with PHP/mySQL, but I've never done a vB hack/plugin/extension.

Hopefully someone can help me out. :nervous:
Reply With Quote
  #2  
Old 09-21-2005, 06:22 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
error_reporting(E_ALL & ~E_NOTICE); 
Reply With Quote
  #3  
Old 09-21-2005, 06:24 PM
Deviation Deviation is offline
 
Join Date: Sep 2005
Location: Ohio
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
PHP Code:
error_reporting(E_ALL & ~E_NOTICE); 
That supresses the NOTICE errors, but it won't 'fix' the others. I set it to E_ALL to see what I might have missed. It did change the errors I get now.

Code:
Fatal error: Call to a member function on a non-object in /home/username/public_html/forumtest/includes/functions.php on line 988

Fatal error: Call to a member function on a non-object in /home/username/public_html/forumtest/includes/functions.php on line 4279
Thoughts?
Reply With Quote
  #4  
Old 09-21-2005, 09:20 PM
Reven Reven is offline
 
Join Date: Aug 2005
Location: UK
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you've just copied and pasted an example of your webspace path relative to the server, then the 'username' bit is probably supposed to be changed to your own webspace username:

PHP Code:
chdir('/home/USERNAME - CHANGE/public_html/forumtest'); 
This is most likely the problem because the PHP parser can't find what you want it to find - meaning it's either not there, or you've specified the wrong path.
Reply With Quote
  #5  
Old 09-22-2005, 07:52 PM
Deviation Deviation is offline
 
Join Date: Sep 2005
Location: Ohio
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Reven
If you've just copied and pasted an example of your webspace path relative to the server, then the 'username' bit is probably supposed to be changed to your own webspace username:

PHP Code:
chdir('/home/USERNAME - CHANGE/public_html/forumtest'); 
This is most likely the problem because the PHP parser can't find what you want it to find - meaning it's either not there, or you've specified the wrong path.
I just altered that for posting here. It seems to find the files, but as you can see from the errors, it doesn't like the function that's being called. It seems like I'm following all the other examples I've seen on this site.

Is there some reference material for vBulletin? You'd think there would be an SDK provided from vBulletin. *sigh*

Man this is frustrating.
Reply With Quote
  #6  
Old 09-22-2005, 07:59 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this the whole script or is there more?
Reply With Quote
  #7  
Old 09-23-2005, 12:40 AM
Deviation Deviation is offline
 
Join Date: Sep 2005
Location: Ohio
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Is this the whole script or is there more?
What you see is all I have.

The php file resides in:
Code:
/home/username/public_html/forumtest/vBTest/test.php
The forum is in:
Code:
/home/username/public_html/forumtest/
Any other ideas??:disappointed: Is there something simple I can echo out on this page to test it?

Here's line 988 of functions.php
PHP Code:
    $user $vbulletin->db->query_first(
an line 4279
PHP Code:
    $vbulletin->db->unlock_tables(); 
Do I need to do something with $vbulletin or $db??
Reply With Quote
  #8  
Old 09-23-2005, 11:25 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, you don't need to do anything with that at all, asuming your includes/config.php is correct (ie. your board working normal).
Reply With Quote
  #9  
Old 09-23-2005, 08:27 PM
Deviation Deviation is offline
 
Join Date: Sep 2005
Location: Ohio
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
No, you don't need to do anything with that at all, asuming your includes/config.php is correct (ie. your board working normal).
Its functioning fine. This makes no sense. I have to be missing something.

I checked for suspect files and everything checked OK.

Not real sure what I did, but its working now.

I downloaded a fresh copy of 3.5 and FTP'd the files. Ran my test file. Didn't work. Looked up some others extensions to see what they did. Made a minor change and it worked. Undid the change and it still works... :lol:

Oh well. Thanks for the help.
Reply With Quote
  #10  
Old 10-28-2005, 12:47 AM
Gellpak Gellpak is offline
 
Join Date: Jul 2002
Location: Raleigh, NC
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having the same problem... what minor change did you make?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:14 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04313 seconds
  • Memory Usage 2,257KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (7)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete