![]() |
Simple vB User login and access control on non vB pages
Hack Description
This is a cutdown version of the user authentication and access control system I use on the non vB pages on my website. This uses the vB 3.6 login system to log you in and out. It allows you to move between your forums and other pages on your site while remaining logged in. It allows you to do things such as restrict pages by usergroup, display different content depending on a user being logged in or not. For example, you can have banner Adds displying to non members only, and/or let members access to specific content. Ive cut it down to the bare minimum that it needs to work, no fancy stuff such as avatars, PM's, or even formating. I will try and offer support, but work and family commitments mean I dont have much free time. This code is a mix of my own, and pieces I have used from other hacks that are floating around. This script has been confirmed as working on
Changelog Version 1.10 (24th April 2007)
Version 1.0 (2nd December 2006)
Click on Install If you have this script installed then please click on the install link because;
Donations First of all, to be clear. This script is 100% free. However if you feel an urge to donate I'm not going to say no. :) Donations can be made at http://www.billspaintball.com/vb3/bd_donate.php |
Edit: This usage and trouble shooting guide has been updated as of 24th of April 2007
Usage The hack is pretty useless without some usage instructions so here they are. We can use conditionals to hide or display depending on a number of things such as Logged in or out status, or restrict to members of a specific usergroup. We do this by using conditionals in php tags where the normal content of a webpage would go. If you want something only accessable to a certain usergroup, use this code in your webpage. This example is only visible to members of usergroup 6. PHP Code:
For example, PHP Code:
For example: PHP Code:
Another use is to display different content to users depending on if they are logged in or not. For example PHP Code:
For example PHP Code:
Troubleshooting If your reading this chances are you are having problems. Here are some common causes and fixes.
|
thanks!
|
Great work. Thanks!
|
Any chance of seeing a demo of some kind, I am wanting a login page for my homepage in which users can see there info on the homepage like PM's new posts, etc....
|
Quote:
See my sig for link to it. |
But if I am using 3.6 why do I need to use 3.5 if the hack is pretty much the same, if not the same?
Also I want the hack for HTML pages, if thats possible |
Quote:
It also works fine with all versions of vB 3.6 Quote:
|
Awesome work!, thanks so much.
|
i've got it working, but only when i remove my other script that i have to call which is require_once('./vBExternal.php'); for another add-on....how do i stop the top part of the login code
Code:
<?php Code:
<?php |
Quote:
We tried to track it down with an earlier release of this but with no luck. A workaround others have used is use vBexternal for the front page and this hack on the rest to provide access control. |
Quote:
np, thanks for that :D |
Just what the docotor ordered :) Great hack
Thanks |
It works great! I have one question however, how can I display the username?
|
Quote:
PHP Code:
|
I am trying to put $vbulletin->userinfo['username'] into a variable named $username, however it isn't working. Here is my code, is there something I am missing?
$username = $vbulletin->userinfo['username']; |
I'm having an interesting problem...
If I run this hack, it deletes any variable called before it, for example, if id=6 before global.php, id = NULL afterwards? Otherwise a great hack, but mucho help would be appreciated? |
Quote:
That should work as long as the page with that code includes global.php You dont have anything else that uses the variable $username do you? What happens if you name the variable something else like $member_name ? |
I have one strange issue, when someone is logged out, and they log in (or if they click the log out link) -- it opens in a new window --
is that normal behavior ? the plan I had for this makes it a look a bit strange... thanks for the help |
I need help....
please check http://gunge.gothic-craving.com/links.php for a demo I had to remove chdir line as it wasnt finding a file, which kept causing errors, now when I use the login box, it logs me in, but the login box stays there and at the bottom of the screen it says "done, with errors on page" I know nothing about php so I would appreciate some help here. I have no idea what im doing or anything :( Leigh |
Hey Bill, any chance of helping me out with my id=6 problem? It's for a giant of a site, would love to get it working as I've styled it in beautifully and everything :)
|
Great hack! Thanks so much! I really needed this. :)
Installed! |
Hey Bill:
Out of curosity, does this support multiple unique domains and subdomains,? Ie. vBulletin is here: http://www.myvbinstall.com But login pages are at http://beta.mydomain1.com http://placeholder.domainworld2.com ? |
Any idea what would be causing the attached error, and how to fix it? The only javascript that is included in the page is from the login_inc.php file.
|
hey any idea how i could make it show on whosonline page
so people who are using my page www.aur-phala.com/hotmail will show up on whos online so i can see whos checking that page out |
Quote:
Some have been able to do that, but others havent. You can try, and there is some information on that in the troubleshooting guide but dont be too disapointed if it wont work. :( |
Quote:
Theres a couple of hacks here that do just that. |
could you link me to it
the page is a php page tho,so how wud i go abt this liek what needs to be included |
is there a way i can show on my nonvb homepage who is online?
|
Quote:
This mod does not support that. |
I like the user authentication system that PhotoPost and ReviewPost utilize from Techimo.
I don't care about showing avatars and have no desire to do so. I just want the same functionality as PhotoPost has. Does this hack do the same thing? |
Quote:
|
Mine isnt working :(
Code:
<? |
OK, even with non-moron-2AM code it still doesnt work:
Code:
<? |
What exactly is it doing or not doing?
Any error messages? A little more info please. Edit: Your path statement up the top is wrong. I suspect that your path statement may not be correct. Do the 2nd step of the troubleshooting guide (post 2) and see what you get. |
Thanks, looking back i realized that 2AM coding is a bad idea ;) I feel ashamed now.
|
I've just come back to using my vb and i was wondering if this still works, if not..can someone link me? thanks
|
Quote:
|
Quote:
https://vborg.vbsupport.ru/showpost....&postcount=399 |
How to get this to work wid vbseo?
Code:
Unable to add cookies, header already sent. |
All times are GMT. The time now is 04:54 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|