View Full Version : Lock out non-vb pages?
Tact7626
04-15-2008, 04:01 AM
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
$cwd = getcwd();
chdir('./forums');
require_once('./global.php');
chdir($cwd);
if (!is_member_of($vbulletin->userinfo, X))
{
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?
<?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/flasharcade/flasharcadetest1.php
Dismounted
04-16-2008, 09:43 AM
Change:
chdir('./forums');
To reflect your server path, eg.
chdir('/home/site/public_html/forums');
Tact7626
04-17-2008, 07:06 PM
Change:
chdir('./forums');
To reflect your server path, eg.
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
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.
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
<?php
full page here if you'd like.
<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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.