vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Integrate vbulletin with website (https://vborg.vbsupport.ru/showthread.php?t=184920)

paperboy741258 07-10-2008 04:11 PM

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?

paperboy741258 07-10-2008 08:05 PM

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?

Opserty 07-10-2008 08:20 PM

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.

paperboy741258 07-10-2008 08:45 PM

not quite what i was looking for

Dismounted 07-11-2008 04:59 AM

Have a look at this article.

EDIT: I've merged your threads, BTW.

ArbuZz 07-11-2008 09:51 AM

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.

paperboy741258 07-11-2008 08:52 PM

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.

Dismounted 07-12-2008 05:47 AM

Things called in a function will remain in the local (function) scope.

paperboy741258 07-14-2008 09:17 PM

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.

Dismounted 07-15-2008 09:20 AM

Basically, yes.


All times are GMT. The time now is 07:37 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.01255 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete