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
  #332  
Old 06-06-2007, 01:48 PM
isnichwahr isnichwahr is offline
 
Join Date: Apr 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone got an idea for my problem?
Reply With Quote
  #333  
Old 06-08-2007, 06:43 PM
NetRover NetRover is offline
 
Join Date: Jul 2004
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi there, great hack which I have installed and got working. Really pleased and will probably donate but wondered if anyone has managed to resolve an issue mentioned in one of these postings.

Has anyone managed to edit the script to get it to validate to xhtml strict?

My web template is valid without the script but gets lots of validation errors once included in my site template.

I would appreciate if anyone has managed to do this and maybe it could be included??
Reply With Quote
  #334  
Old 06-09-2007, 11:39 AM
isnichwahr isnichwahr is offline
 
Join Date: Apr 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i will donate and not to less, if someone can help me, its really urgent, my problem is on page 22 of this thread

thanks again, dave
Reply With Quote
  #335  
Old 06-13-2007, 08:26 AM
isnichwahr isnichwahr is offline
 
Join Date: Apr 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dont understand that nobody can help me, even for money? maybe i will write the text with javascript and include this
Reply With Quote
  #336  
Old 06-13-2007, 11:16 AM
Muppettt Muppettt is offline
 
Join Date: Jun 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I still seem to be plagued with this:

Fatal error: Call to a member function on a non-object in /home/pause/public_html/dev/modules/login_inc.php on line 169

error. The offending line is:

PHP Code:
// finds number of new posts
$newposts $db->query_first("SELECT COUNT(*) AS count FROM " TABLE_PREFIX "post AS post " iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' TABLE_PREFIX 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)'));


$newposts vb_number_format($newposts['count']);

echo
"<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$vbphrase[new_posts]</a>: $newposts<br />";


So i went and did a SQL query:
Quote:
SQL query: Documentation

SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)')

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], '' at line 1
I have total posts commented out due to a similar problem - but don't need that feature anyway. However, the rest of the files works fine - avatar, pm's etc.

I am pretty sure i have all the correct includes and files/paths. So i can only assume there is either a problem in the query, or people are using different versions of SQL and in one of these MySQL updates, some function has been changed.

I am currently on MySQL version 4.1.21-standard.

Any ideas?
Reply With Quote
  #337  
Old 06-13-2007, 02:11 PM
consolegaming consolegaming is offline
 
Join Date: Jan 2007
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Muppettt View Post
I still seem to be plagued with this:

Fatal error: Call to a member function on a non-object in /home/pause/public_html/dev/modules/login_inc.php on line 169

error. The offending line is:

PHP Code:
// finds number of new posts
$newposts $db->query_first("SELECT COUNT(*) AS count FROM " TABLE_PREFIX "post AS post " iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' TABLE_PREFIX 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)'));


$newposts vb_number_format($newposts['count']);

echo
"<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$vbphrase[new_posts]</a>: $newposts<br />";


So i went and did a SQL query:


I have total posts commented out due to a similar problem - but don't need that feature anyway. However, the rest of the files works fine - avatar, pm's etc.

I am pretty sure i have all the correct includes and files/paths. So i can only assume there is either a problem in the query, or people are using different versions of SQL and in one of these MySQL updates, some function has been changed.

I am currently on MySQL version 4.1.21-standard.

Any ideas?
If you actually used that query in phpmyadmin or a similar client then it wouldn't have worked as you're trying to use php in it. i.e. variables like $vbulletin etc wouldn't work in phpmyadmin nor would ' . TABLE_PREFIX . ' you'd need to replace that block of code with whatever your forum's prefix is in the database i.e. f_users would have a prefix of f_ so for this example: AS count FROM " . TABLE_PREFIX . "post would become AS count FROM f_post

Hope that helps in at least finding out what your issue is.
Reply With Quote
  #338  
Old 06-17-2007, 12:27 PM
NetRover NetRover is offline
 
Join Date: Jul 2004
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi again, does anyone know what if statement I could use to display a message on my site which has this hack installed for users with a post cont of zero?

Also is it possible to redirect to certain url or forums based upon usergroup or post count for members logging in at my website with this hack rather than logging in at my forums.
Reply With Quote
  #339  
Old 07-05-2007, 10:49 PM
CP, CP, is offline
 
Join Date: Aug 2005
Location: UK London
Posts: 276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works fine! Just one last important vital thing missing i believe, we have the total number of users online? not the users them selves but the total members online in numbers? like "30" and also a sep for guests?

Cheers!
Reply With Quote
  #340  
Old 07-06-2007, 10:51 PM
CP, CP, is offline
 
Join Date: Aug 2005
Location: UK London
Posts: 276
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A new bug... the avatar dosent change when its changed on the forum..
Reply With Quote
  #341  
Old 07-08-2007, 02:49 PM
bluecat's Avatar
bluecat bluecat is offline
 
Join Date: Apr 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone tell me what I'm doing wrong, or if this is even possible. I'm trying to add the login on an .shtml page using php includes. Is this possible? Here's my php code placed in my shtml page:

PHP Code:
<?php include("/home/xxxmysite/public_html/forums/login_inc.php"); ?>
login_inc.php is in my forums root, and I created a test.php file with the code required in step 1 (with correct paths), also loaded my forums root. I've checked all the paths and they seem to be correct. Any advice is greatly appreciated.

Thank you
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:49 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.07921 seconds
  • Memory Usage 2,337KB
  • 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
  • (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
  • (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