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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2008, 04:11 PM
paperboy741258 paperboy741258 is offline
 
Join Date: Mar 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Integrate vbulletin with website

I am trying to create a custom cms system similar to phpnuke or vbadvanced for my website. I am trying to get vbulletin to include in the middle of the site with a php include.

When I do the following, the include works just fine

test.php
PHP Code:
<?PHP 
include ('modules/forum/index.php');
however, I dont want to use test.php I would like to have the url be something similar to index.php?modules=forum. When I use the same code with the differant url I get the following error.

Fatal error: Call to a member function query_first_slave() on a non-object in [some path removed]Public_html\modules\forum\includes\functions.php on line 1270

Any Suggestions?
Reply With Quote
  #2  
Old 07-10-2008, 08:05 PM
paperboy741258 paperboy741258 is offline
 
Join Date: Mar 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am trying to create a custom cms system similar to phpnuke or vbadvanced for my website. I am trying to get vbulletin to include in the middle of the site with a php include.

When I do the following, the include works just fine

test.php
PHP Code:
<?PHP
chdir
('[forum directory]');
include (
'index.php');?>
however, I don't want to use test.php I would like to have the url be something similar to index.php?modules=forum. When I use the same code with the different url I get the following error.

Fatal error: Call to a member function query_first_slave() on a non-object in [some path removed]Public_html\modules\forum\includes\functions.php on line 1270

Any Suggestions?
Reply With Quote
  #3  
Old 07-10-2008, 08:20 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not really quite sure but read this: [How-To] vBulletin API Basics: Creating Custom Pages & Misc.

Specifically there is a section titled "Creating Subpages" which you may find useful.
Reply With Quote
  #4  
Old 07-10-2008, 08:45 PM
paperboy741258 paperboy741258 is offline
 
Join Date: Mar 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not quite what i was looking for
Reply With Quote
  #5  
Old 07-11-2008, 04:59 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have a look at this article.

EDIT: I've merged your threads, BTW.
Reply With Quote
  #6  
Old 07-11-2008, 09:51 AM
ArbuZz ArbuZz is offline
 
Join Date: Jun 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This error:

Quote:
Fatal error: Call to a member function query_first_slave() on a non-object in [some path removed]Public_html\modules\forum\includes\functions.php on line 1270
has something with the global $db object. Probably you have one defined somewhere globally, and vBulletin uses another global $db of it's own. So that the overlap and conflict. You can try to rename your $db object to $db2 for example and try again. I wanted to try, but had no spare time to do this. So I cann't say for sure whether it will work or no. Also, vBulletin uses a lot of other global variables that may mess up with your own ones. There are guys that recommend to place vBulletin installation in different location and interact with it through the cURL, to totally isolate the namespaces. By now I think similarly.
Reply With Quote
  #7  
Old 07-11-2008, 08:52 PM
paperboy741258 paperboy741258 is offline
 
Join Date: Mar 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok update
The following works
PHP Code:
if ($_GET["module"] == "forum") {    
chdir('/Public_html/modules/forum');
include 
"/Public_html/modules/forum/index.php";

The next piece of code does not
PHP Code:
function somethingoranother() {    
chdir('/Public_html/modules/forum');
include 
"/Public_html/modules/forum/index.php";
}
somethingoranother(); 
It seems to be the fact that I am including it from a function. I would like to get it to work from within a function and don't really know what the problem could be.
Reply With Quote
  #8  
Old 07-12-2008, 05:47 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Things called in a function will remain in the local (function) scope.
Reply With Quote
  #9  
Old 07-14-2008, 09:17 PM
paperboy741258 paperboy741258 is offline
 
Join Date: Mar 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so that means that there is no way for me to include vbulletin from within a function? Sorry to play ignorant but as you can probably tell I am still working on learning PHP.
Reply With Quote
  #10  
Old 07-15-2008, 09:20 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Basically, yes.
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 06:47 PM.


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.03851 seconds
  • Memory Usage 2,245KB
  • 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_php
  • (1)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