![]() |
Deluxe vB User login and access control on non vB pages
Hack Description
This is the deluxe version of the user authentication and access control system I use on the non vB pages on my website. For the simple no frills version [URL=https://vborg.vbsupport.ru/showthread.php?t=173693look here.[/URL] This uses the vB 3.7 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. It also displays the logged in users Avatar, number of unread PM's, New posts since last visit, total posts and total threads. It also allows you to specify a maximum Avatar size, and resize any avatars larger than that, while keeping their height/width ratios in proportion! Its very handy if you allow large avatars, but want a small format display on your non forum pages. If the user is not logged in, a login box is displayed, along with total posts and total threads in the forums. 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
Known Bugs Will not display Avatars correctly if they are kept in the file system (database avatars are fine) Change log Version 3.00 (21st March 2008)
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 |
Usage
The hack is pretty useless without some usage instructions so here they are. You can resize avatars, keeping them to their origional proportions to make them fit your prefered layout. For instance, if you are using a fixed width column layout. Do this by editing lines 5 and 6 in login_inc.php These values are in pixels. 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:
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.
|
Hi Bill, some shots?
|
Quote:
See the screenshots section above. |
Quote:
|
This is really easy to configure and use, its working great right out of the box, thanks.
|
Just wondering if you are working on this bug, or if it is not possible: Will not display Avatars correctly if they are kept in the file system (database avatars are fine)
|
Quote:
I did try and get around it in the past, but never came up with a workable solution. |
[high]* projectego clicks install :)[/high]
|
Adding PHP Code:
PHP Code:
Example here: http://members.thinkteen.co.uk (original page) http://members.co.uk/m2.php (Page broken + no login box) |
Try changing
PHP Code:
PHP Code:
Quote:
|
still broken :(
|
Quote:
|
hmm, I'll see if it works :)
PHP Code:
here's the page I'm trying to implement: http://members.thinkteen.co.uk/m2.html It's meant to look like this: http://members.thinkteen.co.uk |
Quote:
|
Good point - I forgot to do it :) and here's the new error:
Warning: getimagesize() [function.getimagesize]: Unable to access /mounted-stoarage/home86a/sub005/sc46797-PRWR/community/image.php?u=1 in /mounted-storage/home86a/sub005/sc46797-PRWR/members/login_inc.php on line 35 Warning: getimagesize(/mounted-stoarage/home86a/sub005/sc46797-PRWR/community/image.php?u=1) [function.getimagesize]: failed to open stream: No such file or directory in /mounted-storage/home86a/sub005/sc46797-PRWR/members/login_inc.php on line 35 The forum URL is http://community.thinkteen.co.uk - (aka. on a subdomain) |
Hi,
I had implemented this code and it was working fine. My password had presently expired and my homepage looks scrambled. It is not redirecting to the forum page where it shows password expiry message. If I go to the forums page, by typing http://www.example.com/forums then the message shows up. Can you please guide me on how I could rectify this error? Thanks, G |
Quote:
https://vborg.vbsupport.ru/showpost....23&postcount=2 |
Hi,
Which program has this word "passwordexpired"? I am using VB version 3.6.8. Please help. Thanks, G |
Quote:
It was in the table vb_phrase (phrase_id = 101362) :) |
Anyone know how to make this code validate with:
http://validator.w3.org/ under XHTML 1.0 Transitional? Almost all of my errors are coming from this one mod on my non vb pages. |
I have two tips for anyone using this system.
First, it's to change the wording of the private messages phrase to anything you want. I have it set to say "Private messages, "1 new message", and "2 new messages". Here's the code for that (it goes in the include): Code:
// Display PM Details and generate link to PM box Code:
// finds number of new posts |
I can't get it work.
Quote:
|
Does anyone know how to access the profile url? It's not located in $vbulletin->userinfo and I'm sure where else to look. I'd like to link the avatar there.
|
Quote:
I will update the next version with those improvements. |
Quote:
https://vborg.vbsupport.ru/showpost....23&postcount=2 |
I got file based avatars to work.
In the login_inc.php file find: PHP Code:
PHP Code:
|
Quote:
PHP Code:
|
What would I do if I wanted it to show friend requests in addition to private messaging?
|
Quote:
PHP Code:
|
Quote:
|
No, none of the code I have posted so far is contained in any templates, only in the file called login_inc.php the mod author provided. (The file you use for the main site)
|
Oh ok. Is there anyway to get all the notifications to show up. Like the ones that come from the dropdown menu.
|
How can i fix it so when you are logged in it looks like on the forum ? 'Laying down not standing up' ?
And thanks for this :) |
Quote:
Quote:
|
Quote:
|
I included global.php and I suddenly had an error with CuteNews:
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/content/xxx/html/xxx/private/v3beta/newsconf/inc/functions.inc.php on line 43 The news showed, but this error came up at the top of the page. Is anyone aware of anything? Update: Well, looks like I have ANOTHER problem and this is about the cookies it seems, as it logs me in but doesn't show. I have using different domains for the site/forums, will it cause me problems to log in in the forums, if I enter a custom Cookie Domain of my website's domain? |
Sorry to bump but, can anyone help me? (read previous post)
|
How does this work with vb 3.7 GOLD? I assume fine, but just wanted to check.
|
Quote:
Quote:
Quote:
Quote:
|
All times are GMT. The time now is 05:03 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:
|