Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 05-04-2003, 05:32 PM
Radgam Radgam is offline
 
Join Date: Jan 2003
Location: Scotland! :)
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Going to write a hack...

Probably just for use at my own board but who knows, if it turns out good i may release here.

Basically, i'm looking to create a section of my site that only register members of certain user groups can access. It's not a forum, but actually website (of sorts) with files and other extras that members of the forum will be able to access (no one else).

Just wondered if anyone could help me get started and offer any tips. If someone tries to access the section of the site i'd like it to check if they are logged in, and then to decided what to do based on their user group. If they are not, it'll post the login code.

I'm guessing all i need to do is add this at the begining of my php file and it will check the rest?

require('./global.php');
if ($bbuserinfo['userid']=0) {
// Some sort of login code here
}

is that an okay start and am i on the right track? I wanted to more or less integrated with vb, but my concern is that by using the above code when people access the website section it will update when they last visited the forum (even though it's not a visit).

Hope i made sense somewhere in there
Reply With Quote
  #2  
Old 05-04-2003, 07:51 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If global.php is included, I believe it WILL update their last visit, but i'm not 100% sure on that.
Reply With Quote
  #3  
Old 05-04-2003, 08:16 PM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Something like this should get you started...

(If the page isn't in your forums directory, you will need this first chdir line. If not then it's not necessary )
PHP Code:
chdir('/home/path/to/your/forums');
require(
'./global.php');
if (
$bbuserinfo['userid']=='0') {
show_nopermission();

And yes, if global.php is included it will update their last visit as well. Personally though I like that since it keeps track of where visitors are anywhere on your site, plus you can add who's online locations so they show up on the WOL.
Reply With Quote
  #4  
Old 05-05-2003, 09:29 AM
Radgam Radgam is offline
 
Join Date: Jan 2003
Location: Scotland! :)
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks very much for the information
It's a great start and after looking over my idea for the site i agree that it would be better for the last visit and WOL list to be updated so the code you listed is perfect

Thanks again,
~Rad
Reply With Quote
  #5  
Old 05-05-2003, 10:16 AM
Tigga's Avatar
Tigga Tigga is offline
 
Join Date: Dec 2001
Location: Atlanta
Posts: 1,061
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem.
One thing though - Take the trailing slash off the end in that code. Just looked at it again and noticed that was there.
Reply With Quote
  #6  
Old 05-06-2003, 01:40 PM
Radgam Radgam is offline
 
Join Date: Jan 2003
Location: Scotland! :)
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks again
I've already got around 90% of the hack done but i might re-write part of it so it actually uses a database
It's easier to integrate things into vb than i thought it would be !
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:56 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.04215 seconds
  • Memory Usage 2,206KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete