The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
OK, well, it's getting closer. I think it's possible to do the include in a function, but you have to define some variables as global first. I know $vbulletin is one of them, but I can't remember what the others were. I know user Disasterpiece was trying to do that a while back and I think he finally succeeded.
Edit: here's the thread I was thinking of: www.vbulletin.org/forum/showthread.php?t=274455 . It looks like you also need $bootstrap as global. And it does look like maybe he wasn't completely successful (at least the last time he posted in that thread). |
#12
|
|||
|
|||
I have change the global.php file like so :
PHP Code:
|
#13
|
|||
|
|||
OK, sorry for the confusion - those comments were only about being able to include global.php from a function. And BTW, you could put the global statement in your code before it's included, that way you don't need to modify the vbulletin code.
But, if you put your include outside any function you should see the user info, so obviously you still have some other problem. One thing you might do is turn on errors in your custom script, if you haven't already. I think you can put error_reporting(E_ALL) and ini_set('display_errors', 1) at the beginning of your file. Sorry I'm not a lot of help, but this is a question that's asked periodically, and it's usually the cookie thing. |
#14
|
|||
|
|||
1. tried global $bootstrap in the main php file.
2. tried error_reporting(E_ALL) and ini_set('display_errors', 1) - got errors but nothing to do with global.php 3. what do you mean by "and it's usually the cookie thing."? I have checked my browser cookies and I see the relevant cookies - bb_userid , etc... |
#15
|
|||
|
|||
Quote:
You said you see the cookies - do you have a way to look at the request that's sent to your custom script to see if it includes the cookies? (Edit: or I suppose another way would be to have your custom script check to see if they're set). |
#16
|
|||
|
|||
I see that the cookie bb_userid is set in my forum domain but if try to check in the other domain
PHP Code:
it's weird . aren't cookies suppose to be general for the whole browser? |
#17
|
|||
|
|||
To be honest I don't know a lot about it. But my understanding is that cookies are only sent back to the domain/path that set them (so that you're not letting every site see all your cookies). I believe the script that sets the cookie can modify the cookie to allow it to be sent to other scripts. Here's a paragraph from the Wikipedia article on http cookies:
Quote:
that brings up another question - are your two sites on the same (top-level) domain? I believe leaving the "cookie domain" setting blank (which seems to be the default) will allow it to be sent to all related subdomains, but if you have an entirely different domain name for your other site, that might be the issue. |
#18
|
|||
|
|||
Quote:
on is s-maof.com/GoldSig/app and the other s-maof.com/Forum I have set the cookie path to '/' (as you advised) which means the cookies are being sent to s-maof.com. from your logic - I should be able to see them from s-maof.com/GoldSig/app due to the face that it is a subdomain of s-maof.com. |
#19
|
|||
|
|||
I did see in your first post where it looked like they were at the same domain, but thought I'd make sure. You're right, as far as I know the cookies should be sent with the settings you have.
Sorry, maybe someone else will have an idea. |
#20
|
|||
|
|||
Hi kh99,
thank for all your help, I got it working with PHP Code:
It's weird sometimes it worked and sometimes it didn't. now it workes all the time. Thanks again --------------- Added [DATE]1347188933[/DATE] at [TIME]1347188933[/TIME] --------------- damm, it stopped working again for some reason... It works only on chrome kh99, what can be the cause? it worked fine, recognized me and another user, and now it stopped again.. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|