Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Deluxe vB User login and access control on non vB pages Details »»
Deluxe vB User login and access control on non vB pages
Version: 2.20, by Billspaintball Billspaintball is offline
Developer Last Online: Nov 2011 Show Printable Version Email this Page

Version: 3.5.8 Rating:
Released: 02-14-2006 Last Update: 04-23-2007 Installs: 223
Additional Files  
No support by the author.

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 look here.

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.

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 is a work in progress and currently a beta version. It was a little rushed as a few people were pushing for it Its missing a couple of planned things like newest member etc, but they will be added in a later version.

This script has been confirmed as working on
  • vB 3.5.x - All Versions
  • vB 3.6.x - All Versions

Known Bugs
Will not display Avatars correctly if they are kept in the file system (database avatars are fine)

Changelog

Version 2.20 (24th April 2007)
  • Fixed - // in paths bug
  • Fixed - Javascript warning in some browsers
  • Fixed - Tidied up some code
  • Fixed - Avatar display code bug

Version 2.10 (4th June 2006)
  • Fixed - "MySQL Error : Invalid SQL " when using Database thread/forum marking.
  • Fixed - Javascrip error in some versions of IE.

Version 2.00 (16th April 2006)
  • Fixed - "MySQL Error : Unknown column 'newposts' in 'field list' "
  • Fixed - Number of PM's not displaying in all installs.
  • Added - Displays date and time of last login.
  • Added - Total number of saved PM's.
To upgrade just overwrite the existing login_inc.php file with the new one.
You will need to re-edit the path on line 3 and also redo any formatting changes you may have done for the last version.

Version 1.0 (15th Feb 2006)
  • Initial Release


Click on Install
If you have this script installed then please click on the install link because;
  • You will get notified if any security issues are reported.
  • You will get notified when there are any upgrades to this script
  • It gives me a warm fuzzy feeling and motivates me to develop more

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #302  
Old 04-19-2007, 06:07 AM
devilsmania devilsmania is offline
 
Join Date: Nov 2001
Location: Rome, Italy
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey

i get this error ===================================


Warning: main(): open_basedir restriction in effect. File(/var/www/virtual/devilsmania.com/www/forum/global.php) is not within the allowed path(s): (/var/www/virtual/devilsmania.com/www/www/:/var/www/virtual/devilsmania.com/_data/:/var/www/virtual/devilsmania.com/errors/:/usr/share/php/:/tmp/) in /var/www/virtual/devilsmania.com/www/www/index.php on line 3

Warning: main(/var/www/virtual/devilsmania.com/www/forum/global.php): failed to open stream: Operation not permitted in /var/www/virtual/devilsmania.com/www/www/index.php on line 3

Fatal error: main(): Failed opening required '/var/www/virtual/devilsmania.com/www/forum/global.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/virtual/devilsmania.com/www/www/index.php on line 3
===================================


i have vb 3.6.5

forums :
forum.devilsmania.com

login for non VB page :
www.devilsmania.com


what to do ?
sorry/thanks...
Reply With Quote
  #303  
Old 04-20-2007, 12:00 AM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do step two of the troubleshooting guide to ensure that your using the correct paths.
https://vborg.vbsupport.ru/showpost....49&postcount=2

If the path is fine then try the sample login in step five to rule out anything on your page causing a conflict.
Reply With Quote
  #304  
Old 04-24-2007, 01:55 PM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by erinys View Post
Hi bill,

Sorry, i have deactivated this addon for now when you buy something in vbplaza and it expires (like a sticky topic) this addon also makes the whole site go 404

Something is up with the way it handles something when it "expires", and when it does it breaks every single page on the site where this module is loaded

im running 3.6.4 btw, can that be the problem? this works fine on 3.6.4 right?
Ok,
I have finally had enougth time to play around with this and find the cause and solution.

Cause - When redirected for expired password you are redirected to the directory that your login script is located in, not your forums root.

Fix - Edit phrase called
Code:
passwordexpired
Your current phrase should be
Code:
Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="profile.php?{2}do=editpassword">this page</a>.
change it to

Code:
Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="../forums/profile.php?{2}do=editpassword">this page</a>.
where ../forums/ is your forums directory.

Ive only tested this for expired passwords, not for expired vbplaza, but I would think you would have to edit the expiring vbplaza phrases in the same manner.
Reply With Quote
  #305  
Old 04-24-2007, 02:03 PM
devilsmania devilsmania is offline
 
Join Date: Nov 2001
Location: Rome, Italy
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok fixed thanks
Reply With Quote
  #306  
Old 04-24-2007, 02:54 PM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated
  • Fixed - // in paths bug
  • Fixed - Javascript warning in some browsers
  • Fixed - Tidied up some code
  • Fixed - Avatar display code bug

Download the update from the first post, and see the 2nd post for additional workarounds for the 404 on Expired passwords and cross domain login issues.
Reply With Quote
  #307  
Old 04-29-2007, 10:29 PM
CSGCarl CSGCarl is offline
 
Join Date: Feb 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm kinda lost(which isnt hard hehe) I'm trying to make it so when loged out menu a appears but when loged in menu b appears...

I have used the conditionals in the web page its self is that right? if so I take it you can insert code/image/links etc?

Please could someone clear things up abit here/help me out abit

Carl
Reply With Quote
  #308  
Old 04-30-2007, 12:22 AM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CSGCarl View Post
I have used the conditionals in the web page its self is that right?
Yes thats correct.
Quote:
if so I take it you can insert code/image/links etc?
Correct.

The 2nd post in this thread shows various usage examples on how to do this.
See https://vborg.vbsupport.ru/showpost....49&postcount=2

A brief example that shows one lot of text if your logged in and different text if your not is
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"
    } 
?>
Naturally you can have links, pics, more text, HTML code inside these echo statements.
Hope this helps.
Reply With Quote
  #309  
Old 04-30-2007, 10:43 AM
CSGCarl CSGCarl is offline
 
Join Date: Feb 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for clearing that up, I must be doing somthing wrong(probably somthing stupid) as I keep getting errors.

Thanks again,
Carl
Reply With Quote
  #310  
Old 04-30-2007, 04:31 PM
CSGCarl CSGCarl is offline
 
Join Date: Feb 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I get this error 'Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/*****/public_html/homepage.php on line 928'

Code:
This is the code I put in the website:
If ($vbulletin->userinfo['userid']!=0)
	{	
	echo "<img src="http://www.mysite.com/images/bse_top.png" width="248" height="32">";
	} else {
	echo "Your not logged in so we display this";
	}
?>
Can some one tell me what I'm doing wrong please?
Reply With Quote
  #311  
Old 04-30-2007, 08:42 PM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CSGCarl View Post
Ok I get this error 'Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/*****/public_html/homepage.php on line 928'

Code:
This is the code I put in the website:
If ($vbulletin->userinfo['userid']!=0)
	{	
	echo "<img src="http://www.mysite.com/images/bse_top.png" width="248" height="32">";
	} else {
	echo "Your not logged in so we display this";
	}
?>
Can some one tell me what I'm doing wrong please?
You need to escape the " in your HTML.
Just put \ in front of the " that are part of the HTML and not your PHP.

Like this
PHP Code:
If ($vbulletin->userinfo['userid']!=0)
    {    
    echo 
"<img src=\"http://www.mysite.com/images/bse_top.png\" width=\"248\" height=\"32\">";
    } else {
    echo 
"Your not logged in so we display this";
    }
?> 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:38 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.15992 seconds
  • Memory Usage 2,334KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete