Version: 1.30, by Billspaintball
Developer Last Online: Nov 2011
Version: 3.5.8
Rating:
Released: 11-16-2005
Last Update: 04-23-2007
Installs: 138
Additional Files
No support by the author.
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.5 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
vB 3.5.x - All Versions
Changelog
Version 1.30 (24th April 2007)
Fixed - // in paths bug
Fixed - Javascript warning in some browsers
Fixed - Tidied up some code
Version 1.20 (2nd December 2006)
Fixed Logout incorrect path bug
Made change to reduce compatibility problems with foreign scripts
Version 1.10 (4th Feb 2006)
Changed login_inc.php so you only need to edit path in one place now.
Added more commenting to login_inc.php
Added usage instructions to instructions file
Added troubleshooting guide with all common problems and fixes to instructions file.
Note: It is NOT necessary to update from 1.0 to 1.10.
There is no functionality changes or bug fixes between these 2 releases.
Version 1.0 (17th November 2005)
Initial Release
Deluxe Version of this hack is now available
Has Avatars, PM's, Number of Posts etc.
To show different content depending of if people are logged in or not, you want to use this one.
PHP Code:
<?php
If ($vbulletin->userinfo['userid']!=0)
{
echo "Your logged in so we can display this";
} else {
echo "Your not logged in so we display this";
}
?>
The content can be text, html, php, inlude another page etc.
Is it possible to add the user's avatar yet?
Does anyone know how to do this?
In login_inc.php locate:
PHP Code:
// We check if user is logged in
Above this place:
Code:
if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php'); //make sure we have the function we need
$navbar_ava = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!is_array($navbar_ava))
{
$navbar_ava[] = "/images/misc/noavatar.gif";
}
}
Upload the attached noavatar.gif image to your images/misc folder.
This will show the User's current avatar, and if the User has no avatar specified, it'll show the no avatar image. Don't forget to change the "yoursite.com" to reflect your forum.
It shows me logged in, but doesnt look like my cookie ever expires when it should. so, on the page i created, i'm always logged in, even after the cookie should have timed out with me idling.
Also, from the who's online page, it never updates the time of last activity or the location if i'm on a page outside of vb.
It shows me logged in, but doesnt look like my cookie ever expires when it should. so, on the page i created, i'm always logged in, even after the cookie should have timed out with me idling.
I will look at that.
Quote:
Also, from the who's online page, it never updates the time of last activity or the location if i'm on a page outside of vb.
if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php'); //make sure we have the function we need
$navbar_ava = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!is_array($navbar_ava))
{
$navbar_ava[] = "/images/misc/noavatar.gif";
}
}
Upload the attached noavatar.gif image to your images/misc folder.
This will show the User's current avatar, and if the User has no avatar specified, it'll show the no avatar image. Don't forget to change the "yoursite.com" to reflect your forum.
Enhanced version with avatar, number of PM's and user stats is ready.... I think....
I just need to test it on someone who uses a table prefix for their database.
I'm having an issue where everything looks like it's logging in fine, but when it goes back to the page, it shows me as not being logged in. I checked the cookie fix discussed in the Troubleshooting section and it's as it should be. Sometimes though, if I go to the Forum and then go back to the page, it shows me as logged in. Any ideas? I love this hack, but I don't want it acting up like this to the regular users.