The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Simple vB User login and access control on non vB pages Details »» | |||||||||||||||||||||||||||
Simple vB User login and access control on non vB pages
Developer Last Online: Nov 2011
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 Show Your Support
|
Comments |
#42
|
|||
|
|||
Uninstall vBSEO.
|
#43
|
||||
|
||||
Quote:
Post the first few lines of that page so we can see whats happening. |
#44
|
|||
|
|||
Hi,
I'm trying to use this in a page which contains other variables, but they're all being wiped. I've done some general reading on the VBulletin variable cleaning utility, but can't for the life of me figure out what I'm doing wrong. Basically an "id" variable is passed (using the "request" function) with the URL for a simple news script (news.php?action=viewnews&id=5) But with global.php (thus init.php) being used the variable is being wiped. How can I get around that? Code:
switch($_REQUEST['action']) { case 'viewnews': viewNews($id); break; } Thanks |
#45
|
|||
|
|||
Nevermind, I discovered just how stupid I was being!
|
#46
|
||||
|
||||
At a guess your using the same variable names that vB uses.
|
#47
|
|||
|
|||
I ended up putting the variable through the vbulletin variable cleaner which sorted things out nicely.
I'm able to log-in and out fine from any page with the includes, but when I attempt to use the user's name/id in the page then I don't get any result. I'm using the following code in the page: Code:
$member_name = $vbulletin->userinfo['username']; echo 'Hello there ' . $member_name; Code:
<?php $curdir = getcwd (); chdir('/home/######/public_html/forum'); require_once('global.php'); chdir ($curdir); include 'db.php'; global $db; ?> |
#48
|
|||
|
|||
Found the problem - it doesn't like being inside a function. Think I'm sorted now!
|
#49
|
|||
|
|||
Ok well I keep on getting an error...here it is
Quote:
PHP Code:
I have tried to check it out, but I don't have a clue what it could be... Any help would be much appreciated!!! |
#50
|
||||
|
||||
There should be nothing wrong with the functions.php file, the problem will be in the page that has called it.
Have you followed the steps in the troubleshooting guide? https://vborg.vbsupport.ru/showpost....79&postcount=2 Including step 5 with the test code. If you still have problems after this, please post the first few lines of the page you are trying to use this hack on. |
#51
|
|||
|
|||
Is it possible to redirect back to the page you accessed the login form from? if so can someone please give me the code to edit?
Thnx |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|