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
  #182  
Old 08-21-2006, 03:20 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 Grasty
here you go, i just now tried replacing the one i changed with the one you posted. and it still gave me the error, the only thing i changed on this one was the forum path
Sorry I should have been more clear, I ment the page that calls this include.
Thats were the problem will be.
Reply With Quote
  #183  
Old 08-21-2006, 08:46 AM
Remonh Remonh is offline
 
Join Date: Nov 2004
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi I keep ketting this error
Fatal error: Call to a member function on a non-object in /home/saiyanli/public_html/login_inc.php on line 150
Reply With Quote
  #184  
Old 08-23-2006, 03:41 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 Remonh
Hi I keep ketting this error
Fatal error: Call to a member function on a non-object in /home/saiyanli/public_html/login_inc.php on line 150
Try step 5 in the troubleshooting section first https://vborg.vbsupport.ru/showp...49&postcount=2
Let me know if that works.
Reply With Quote
  #185  
Old 08-24-2006, 12:55 AM
Grasty Grasty is offline
 
Join Date: Jun 2006
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Grastyzone.net</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,th {
    color: #FFFFFF;
}
body {
    background-color: #000000;
    
}
.style1 {font-size: 12px}
.style2 {
    font-family: Watertank;
    font-size: 24px;
}
-->
</style></head>

<body>
  <table border="0" cellpadding="0" cellspacing="0" width="625">
    <tr>
      <td width="625" height="100" background="/images/banner.png">&nbsp;</td>
    </tr>
    <tr>
      <td width="650" height="10">
      <div align="left"><img src="images/spacer.png" width="625" height="10"></div></td>
    </tr>
    <tr>
      <td><table width="600" height="100"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="100"><div align="center"><a href="http://grastyzone.net/about.php"><img src="images/about.png" width="100" height="100" border="0"></a></div></td>
            <td width="100"><a href="http://grastyzone.net/cs.php"><img src="images/cs.png" width="100" height="100" border="0"></a></td>
            <td width="100"><a href="http://grastyzone.net/techcrew.php"><img src="images/techcrew.png" width="100" height="100" border="0"></a></td>
            <td width="100"><a href="http://grastyzone.net/comedy.php"><img src="images/comedy.png" width="100" height="100" border="0"></a></td>
            <td width="100"><a href="http://grastyzone.net/affiliations.php"><img src="images/affiliations.png" width="100" height="100" border="0" align="top"></a></td>
            <td width="100"><a href="http://grastyzone.net/contact.php"><img src="images/contact.png" width="100" height="100" border="0"></a></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="16%" valign="top"><table width="200"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="200" height="200"><?php 
    
require_once('login_inc.php'); 
?> </td>
              </tr>
              <tr>
                <td>&nbsp;   </td>
              </tr>
              <tr>
                <td><img src="images/forums.png" width="100" height="40"></td>
              </tr>
              <tr>
                <td><img src="images/links.png" width="100" height="40"></td>
              </tr>
            </table></td>
            <td width="84%"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="2%"><img src="images/construction.png" width="100" height="100"></td>
                    <td width="98%"><span class="style2">Yes that is right, the site is under construction. The site will feature a variety of new changes soon so check back often </span></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td><div align="center" class="style1">Chris Grasty (2006) Grastyzone.net </div></td>
    </tr>
</table>
</body>
</html>
Here you go, index.php
Reply With Quote
  #186  
Old 08-24-2006, 03:05 AM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, looks like you skipped the first half of part one of the instructions.

Change
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<
html>
<
head>
<
title>Grastyzone.net</title>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
style type="text/css">
<!--
body,td,th 
to

PHP Code:
<?php
chdir
('/path/to/your/forums'); 
require_once(
'/path/to/your/forums/global.php');  
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Grastyzone.net</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,th {
NOTE: You need to change line 2 and 3 to reflect your sites layout.
Reply With Quote
  #187  
Old 08-25-2006, 01:41 AM
Grasty Grasty is offline
 
Join Date: Jun 2006
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i didnt think i needed that because i wasnt restricting access to that page. That is the index page

And that fixed the error, but when i log in it still doesnt redirect back to where i logged in from, it goes to the forum home.

Nevermind, apparently sometimes it goes to the forum index, sometimes to where i logged in from.

Is there a way to make it go back to the home page (not forum home) on logout???? it doesnt do that for me
Reply With Quote
  #188  
Old 08-25-2006, 05:24 PM
L9IAnime L9IAnime is offline
 
Join Date: May 2006
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

brilliant, just what i needed, /me clicks install
Reply With Quote
  #189  
Old 08-26-2006, 01:43 PM
delive delive is offline
 
Join Date: May 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is the code that evaluates the users additional usergroups. Is it possible to check and see if they are part of an additional usergroup?

What should i change
$vbulletin->userinfo['usergroupid'] == '5'
to?
Reply With Quote
  #190  
Old 08-26-2006, 04:16 PM
Mysticales's Avatar
Mysticales Mysticales is offline
 
Join Date: Oct 2005
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey with this code. I could technically connect to my user profiles and pull "x" profile field from it to display in a page table of my site, right?
Reply With Quote
  #191  
Old 08-26-2006, 08:59 PM
bandare bandare is offline
 
Join Date: Nov 2004
Location: Derby, UK
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will this work on 3.6 forums?
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 10:21 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
  • Page Generation 0.05039 seconds
  • Memory Usage 2,333KB
  • Queries Executed 27 (?)
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
  • (3)bbcode_php
  • (2)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
  • (2)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_postinfo_query
  • fetch_postinfo
  • 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