The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I suspect this is probably a server/php config issue.. any ideas welcome.
I am including the vbulletin 3.8.3 forums/global.php file in my index.php file as follows: $curdir = getcwd(); chdir('./forums'); require_once('global.php); ... I get the following message on my browser screen: "Unable to add cookies, header already sent." "File: path_to_my/index.php" "Line: 9" Looking at the page source, I see that the head and title tags are rendered per the inclusion of global.php. The above error is occurring since these tags were already used previously in the page. <html xmlns="http://www.w3.org/1999/xhtml" dir="" lang=""> <head> <title>My Community Forums</title> </head> The host server is Apache 1.3 with php 5.2. I don't have the above problem with Apache 2.x and php 4.2. I am using the same browser for both hosts. Any ideas? |
#2
|
||||
|
||||
![]()
You need to include the global.php file before you do anything html related on the page or you will get that error.
|
#3
|
|||
|
|||
![]()
Thanks, I'll try that, but this doesn't explain why the behavior is different among server or php installations. Including this particular file should not render anything html, but apparently this assumption is wrong...
|
#4
|
||||
|
||||
![]()
Maybe you just aren't seeing the errors on one of the servers. Check your error_logs and see if they are in there.
|
#5
|
|||
|
|||
![]()
Ok, I made the change you suggested and it was much worse. I am now basically getting the entire forum home page rendered on the browser -- this is not what I expected.
![]() So here's the deal.. I'm simply trying to retrieve vb user info for a non-vb page on my site. I need access to vbulletin global.php to accomplish this, or at least the old thread below led me to believe this would work. It did seem to work fine for a newer version of apache and php, regardless of where I included globals.php. Is there a different method I should used for 3.8, or do I have a configuration problem? I'd like to avoid passing command line arguements. https://vborg.vbsupport.ru/showthrea...ssing+userinfo |
#6
|
||||
|
||||
![]()
So this is a page you're writing? Perhaps you should post up your code and the template and we can see what is going on.
|
#7
|
|||
|
|||
![]()
yes, it is my docroot splash page (index.php). It seems that including global.php in a page that is hyper linked from a forum page works fine. If you try to include it anywhere else, stange things happen. I assume the vbulletin forum has configured something that effects the page rendering when including global.php (and it's includes) elsewhere. So, until someone has a solution for obtaining loged in user information in pages outside the forum, or until I can investigate further, I will refrain from including globals in those pages.
I think your original suggestion of placing the include ahead of the html is still valid. Thanks for the help! |
#8
|
|||
|
|||
![]()
Change the require for global to this:
PHP Code:
![]() |
#9
|
||||
|
||||
![]()
I'm not understanding what you think the problem is. I have an index.php page that is outside of my vbulletin /forums directory and you can login on it and it works just fine.
|
#10
|
|||
|
|||
![]()
Yes but, when using this format, sometimes there's an extra HTML code outputted by requiring the global.php file. By adding an at (@) symbol before the php code, it removes any output returned.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|