The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi
I am using a cookie check to see if the user is logged in. If the user is not logged in, I want to redirect the user to the forum login page, and then have the user be returned to the original page after login. Any ideas how I can do this? I could not find a page that was only login that I could redirect to. Thanks, Roy :bandit: |
#2
|
||||
|
||||
![]()
Are you wanting this to happen when they try to view the index or threads? I belive you could edit the usergroup options for Unregistered/Logged Out users in your admincp to make it so they have to log in before viewing anything.
|
#3
|
||||
|
||||
![]()
Royli57,
Can you please post or email the code for what you have? What you already had was good enough for me. I just want some of my non-VB pages to check to see if there's a bbuserid cookie present before allowing access. I can't figure out how to do it - of course, I have no clue what I'm doing, so maybe that's why... Thanks Sy |
#4
|
||||
|
||||
![]()
this could be easily done by using an if condition:
PHP Code:
I think we can change $bbuserinfo['userid'] == 0 to something like $bbuserinfo['usergroupid'] == 2 ( which is a usergroup of guests) |
#5
|
||||
|
||||
![]()
deathemperor, thank you for the response. I'm pretty uneducated with all of this stuff, so I'm not sure exactly what to do with it. I've taken just the snippet of code you provided and placed it within <?php and ?> tags at the head of my html file, and renamed my file to end in .php.
But that doesn't seem to work. All I get is a white screen. Do I need to use any other code? BTW, when I check to see what the cookie names are for my vbulletin site, the userid cookie comes back as 'bbuserid'. It would be really appreciated if you could help me with this. Thanks Sy |
#6
|
||||
|
||||
![]()
it's not simple by placing that code in a php file and hope it work for you. you must include the global.php to that file, and that code does something like:
PHP Code:
depending on what your purpose is use it properly |
#7
|
||||
|
||||
![]()
Thank you, Deathemperor. I really appreciate the help, but this is still too complicated for me. I have no idea how include a global.php in the file, etc. I don't really know anything about php, I only know html.
What I really need is a complete block of code to just insert into my html files that will redirect a user to the vbulletin login page if they aren't already logged in. Again, I really appreciate your help on this. Thanks Sy |
#8
|
||||
|
||||
![]()
then you would need these:
https://vborg.vbsupport.ru/showthread.php?t=62164 and php.net for how to include a page in a page and it's must be an php file, no way it can be html file I actually don't understand what you need for that file |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|