vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Lock out non-vb pages? (https://vborg.vbsupport.ru/showthread.php?t=176183)

Tact7626 04-15-2008 04:01 AM

Lock out non-vb pages?
 
Hello. I was wondering if it was possible to use vbulletin to control viewing permissions on a completely non-vbulletin html page? (just a regular page i made myself in html)

i'm a little familiar with if conditionals. and i think this idea would require it. i might have to make my pages .php which is fine. also wondering that if it is possible, what i need to paste into my pages for it to work.

would preffer a method that relies on usergroups cause i'm trying to create multi-tier lvls' of permission for my members. (like rewards based on pst count giving them access to certain pages)

also. i think i would like to avoid using vbulletin powered pages. since they require me to create a template for each page. and i need to make a couple hundred of these. PLUS, i would then need to copy them over to each of my parent styles! >.<

unless there is some way to make a new template that applies to all styles and make vbpowerd pages like that, that'd be good.

thanks in advance.

Dismounted 04-15-2008 06:54 AM

PHP Code:

$cwd getcwd();
chdir('./forums');
require_once(
'./global.php');
chdir($cwd);

if (!
is_member_of($vbulletin->userinfoX))
{
    
print_no_permission();


Where "X" is the ID of the usergroup allowed to access.

Tact7626 04-15-2008 05:57 PM

awesome. thank you so much.





edit:

ok. i'm trying to get this to work. and was wondering if you can tell me what i'm doing wrong here.

i kinda need to keep these files seperate from the forum. i don't mind if they HAVE to be inside /forum but i will still need them to be in their own folders. so i tried to change some of the relative patsh to absolute but still have trouble. any ideas?

Code:

<?php
$cwd = getcwd();
chdir('http://www.legionofangels.net/forum');
require_once('http://www.legionofangels.net/forum/global.php');
chdir($cwd);

if (!is_member_of(http://www.legionofangels.net/forum/$vbulletin->userinfo, 6))
{
    print_no_permission();


?>


the page i'm working on is located here

http://legionofangels.net/flasharcad...rcadetest1.php

Dismounted 04-16-2008 09:43 AM

Change:
PHP Code:

chdir('./forums'); 

To reflect your server path, eg.
PHP Code:

chdir('/home/site/public_html/forums'); 


Tact7626 04-17-2008 07:06 PM

Quote:

Originally Posted by Dismounted (Post 1491978)
Change:
PHP Code:

chdir('./forums'); 

To reflect your server path, eg.
PHP Code:

chdir('/home/site/public_html/forums'); 


absolutely awesome. i just tested it out right now. i never knew server paths like that were more powerful than absolute links. (or at least i think that's what happend)

ty so much yet again. i'm doing some more testing by asking some of my staff to post and making it only work for admins. :p

btw if i wanted more than one group i just put a comma and a space right?

6, 7, 9?

if so. great.


thanks again so very much. :)

toonysnn 04-17-2008 10:00 PM

Correct. Just separating the IDs by a comma will do the trick. :)

OffT: Haha, I remember seeing you over at vB.com :p

Tact7626 04-18-2008 02:10 PM

Quote:

Originally Posted by toonysnn (Post 1493328)
Correct. Just separating the IDs by a comma will do the trick. :)

OffT: Haha, I remember seeing you over at vB.com :p

hehe. hi again. :p


i was testing things out again today. and i get this now from my page.

Quote:

Unable to add cookies, header already sent.
File: /homepages/26/d196297218/htdocs/flashgames/flasharcadetest1.php
Line: 6
something tells me this'll be related to cookie handling and whatnot. (i remember seeing some options regarding this) and on two occasions i had to check it's settings because something else wasn't working. and each time i saw that it was set to what is mostly required of it.

/ for the path. and "blank" for the domain.

line 6 in my editor is the following

Code:

<?php
full page here if you'd like.

Code:

<html>
<head>

<title>Flash Arcade 1</title>
</head>
<?php
$cwd = getcwd();
chdir('/kunden/homepages/26/d196297218/htdocs/forum');
require_once('./global.php');
chdir($cwd);

if (!is_member_of($vbulletin->userinfo, 6))
{
    print_no_permission();

?>
<body>
the most basic template you ever did see! :p
<br><br>
add stuff here



<br><br><br>
<div class="js-kit-comments" permalink=""></div>
<script src="http://js-kit.com/comments.js"></script>


</body>
</html>

since i'm still testing i still don't have things like meta tags and stuff. but that shouldn't be the prob should it? o_o


thanks in advance for the help.



edit: it went away on it's own. O_o

well that makes me happy at least. haha. and i'm hoping it was only me and not the site. so then i can put this aside and finally work on what i gotta do.

but if anyone would like to explain what maybe happend, feel free. :p

Dismounted 04-19-2008 06:35 AM

You need to put the PHP I gave you at the top of the page, before any HTML is present.


All times are GMT. The time now is 11:39 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.00993 seconds
  • Memory Usage 1,742KB
  • 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
  • (3)bbcode_code_printable
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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