Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2008, 04:01 AM
Tact7626 Tact7626 is offline
 
Join Date: Feb 2007
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 04-15-2008, 06:54 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-15-2008, 05:57 PM
Tact7626 Tact7626 is offline
 
Join Date: Feb 2007
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 04-16-2008, 09:43 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change:
PHP Code:
chdir('./forums'); 
To reflect your server path, eg.
PHP Code:
chdir('/home/site/public_html/forums'); 
Reply With Quote
  #5  
Old 04-17-2008, 07:06 PM
Tact7626 Tact7626 is offline
 
Join Date: Feb 2007
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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.

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.
Reply With Quote
  #6  
Old 04-17-2008, 10:00 PM
toonysnn toonysnn is offline
 
Join Date: Sep 2006
Location: Texas
Posts: 511
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

OffT: Haha, I remember seeing you over at vB.com
Reply With Quote
  #7  
Old 04-18-2008, 02:10 PM
Tact7626 Tact7626 is offline
 
Join Date: Feb 2007
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by toonysnn View Post
Correct. Just separating the IDs by a comma will do the trick.

OffT: Haha, I remember seeing you over at vB.com
hehe. hi again.


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.
Reply With Quote
  #8  
Old 04-19-2008, 06:35 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to put the PHP I gave you at the top of the page, before any HTML is present.
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 11:11 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.04451 seconds
  • Memory Usage 2,243KB
  • 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
  • (3)bbcode_code
  • (5)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete