vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Going to write a hack... (https://vborg.vbsupport.ru/showthread.php?t=52567)

Radgam 05-04-2003 05:32 PM

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 ;)

N9ne 05-04-2003 07:51 PM

If global.php is included, I believe it WILL update their last visit, but i'm not 100% sure on that.

Tigga 05-04-2003 08:16 PM

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. :)

Radgam 05-05-2003 09:29 AM

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 :D

Thanks again,
~Rad

Tigga 05-05-2003 10:16 AM

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.

Radgam 05-06-2003 01:40 PM

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 :D
It's easier to integrate things into vb than i thought it would be !


All times are GMT. The time now is 10:11 AM.

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.01057 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete