The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
identify user in a different folder then the forum
Hi,
I have a another site which is not a part of the vbulletin forum but it's located in the parent directory. vbulletin forum => s-maof/Forum dir another site => s-maof/aaa dir I want to idintify users that are logged in the forum in the other site. I have included this code: PHP Code:
even though I am. Any help? |
#2
|
|||
|
|||
Since it works using cookies, that will only work if you set "Path to Save Cookies" to "/" (should be one of the choices in the dropdown menu). That's in "Cookies and HTTP Header Options" section of the options. You might have to log out and back in again for it to take effect.
|
#3
|
||||
|
||||
You need to actually activate a session. Are you seen in the session table at all?
|
#4
|
|||
|
|||
Quote:
The domain that I am talking about is in : mydmoain.com/myFolder/app wheras my regular vbulletin forum users are in mydomain.com/Forum I want to detect my users in both urls! |
#5
|
|||
|
|||
It shouldn't. It should just make it so that the vbulletin cookies are sent on any request to your server, instead of being sent only if the request starts with /Forum. I think your problem is that if your custom script is in /myFolder/app, the cookies aren't being sent because it doesn't start with /Forum.
It could cause a problem if you have more than one forum installed on your server, but if you do, I think you could fix that by using a unique cookie prefix for each one. |
#6
|
|||
|
|||
Quote:
Entering an invalid setting can leave you unable to login to your forum so i'm a little hesitent about changing it (leaving my users unable to login and me unable to change it). isn't there another way. something like: PHP Code:
(I get an empty username and id..) |
#7
|
|||
|
|||
I understand your concern, but I'm not sure what else to tell you. I think you either need to change the cookie path, or else your custom script needs to be under the /Forum directory. The issue has to do with when the user's browser decides to send the cookies, so you can't fix that by doing a chdir() in your script (because by the time your script is running, the cookies have either been sent with the request, or they weren't).
There is a file that comes with the vb distribution, in the "do not upload" folder, called tools.php. It allows you to fix certain things without neding to log in, by uploading that file to your admincp directory and then pointing your browser to admincp/tools.php (don't do it until you need it, because some other things won't work when the tools.php file is present). Anyway, one of the things it lets you do is reset the cookie path, so if you run in to a problem you should be able to fix it that way. |
#8
|
|||
|
|||
hi kh99,
I have changed the setting to 'Path to Save Cookies' to '\' logged out and back in again. with the browser tried this sctipt again: PHP Code:
|
#9
|
|||
|
|||
Hmm...well, at least it didn't break the forum. So are you seeing *any* info in $vbulletin->userinfo? (edit: I see now in your first post you say you are). You could try using something like Firefox with Firebug (the net tab) and see if the cookies are being sent (I still think it might be a cookie problem).
Also, maybe try include "./global.php" (with the ./ in front). Looking at your code I think you know php much better than I do, and I don't know why it should make any difference, but I seem to remember someone else having an issue before that was fixed by adding the ./ (Edit: but now that I see where you said you *are* getting some info in $vbulletin, it must be included correctly so probably that's not it). Edit: is the code you posted inside a function? That's another thing that doesn't work. |
#10
|
|||
|
|||
no, it's empty,
I taught it was the xcache.var_size, so I changed it from 0M to 2M (restart apache) and tried again (no luck).. change it to ./global.php - also nothing. the $vbulletin->userinfo is empty. It was in a function -->I took it out from it and now the $vbulletin->userinfo is not empty but i get userid = 0 and username = not registered |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|