vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   non vb page wit vb permissions (https://vborg.vbsupport.ru/showthread.php?t=103842)

PuntoPower 12-27-2005 06:06 PM

non vb page wit vb permissions
 
i have a non vb page that i only want registered users to see. how can i do this?

many thanks

Michael Morris 12-27-2005 06:34 PM

A quick search for vb powered pages should turn up more precise info on this, but in brief you'd need to include the global.php file of vbulletin to initialize the vb engine. Once that's done the rest of your file can run a permissions check. How this is done though varies significantly between vb 3.0.x and 3.5.x and I'm not familiar with the process under vb 3.5.x

gizmo4321 12-27-2005 07:13 PM

If you want to do it based on groups, then something like this should work; I use it myself:

define ("FORUM_HOME_DIR", "WhereverForumHomeIs");
define("MY_APP_HOME_DIR", "WhereverMyAppHomeIs");
define("REGISTERED_USER_GROUP", "RegisteredGroupId");
chdir(FORUM_HOME_DIR);
include_once('./global.php');
include_once('./includes/functions.php');
chdir(MY_APP_HOME_DIR);
if(is_member_of($vbulletin->userinfo, REGISTERED_USER_GROUP))
{
Do registered stuff here;
}
else
{
Do not registered stuff here;
}

The above code is for vB 3.5.x

For vB 3.0.x you would change $vBulletin->userinfo to $bbuserinfo.

Hope this helps.

PuntoPower 12-27-2005 08:02 PM

after a bit of trying a few things i have made a non vb page that calls a custome made templete in vb. this templete calls the header and footer and in the middle has the following

<p align=center>
<iframe src="http://www.mywebsite.com/chat/chat/index.php3" style="height:500px;width:800px;"></iframe>
</p>

what variables are used to make a if statment so i can set what groups can see this iframe?

thx

gizmo4321 12-27-2005 08:07 PM

The Display Group Id will be $vBulletin->userinfo['usergroupid'].

The Group Membership list will be $vBulletin->userinfo['membergroupids'], and will be a comma delimited string of all groups the user is a member of.

Would it not be easier just to go into your Admin Control Panel, go to the group settings, and see what group id the group you're interested in has? (Sorry, I'm beginning to think I may not be fully understanding what you are trying to do?)

PuntoPower 12-27-2005 08:18 PM

sry if im not been clear. this non vb page is a chatroom so i dont want non registered users to see it. so was wondering can someone put an if statment together that i will put in the templete so that if a non registered member views the page they get a message sayin that they need to register to view the page, but if they have registered the iframe code is called and they see the chat room

hope that helps

usergroups that i want to see the chatroom code are 2,3,5, 6, 9, 11

citricguy 12-27-2005 08:58 PM

I use this $5 script called FlashChat for my site. It integrates with vBulletin very well and already has everything you need.

check out http://www.tufat.com/s_flash_chat_chatroom.htm

PuntoPower 12-27-2005 09:06 PM

ive tried flashchat already but my members prefer phpmychat. thx tho

gizmo4321 12-27-2005 09:41 PM

I think I'm beginning to understand.

The code I gave you only works if they are currently logged into vBulletin. Then, when they go to your non-vB page, you can check to see if they are real users or not.

However, if I understand this aright, what you want is to know if they are registered users in your forum without actually having them login to it, right?

PuntoPower 12-27-2005 10:01 PM

Quote:

Originally Posted by gizmo4321
I think I'm beginning to understand.

The code I gave you only works if they are currently logged into vBulletin. Then, when they go to your non-vB page, you can check to see if they are real users or not.

However, if I understand this aright, what you want is to know if they are registered users in your forum without actually having them login to it, right?

you are right the first time but that code doesnt work in templetes, "if" statements have to be done like below


<if condition=" user a member of either of the following groups 2,3,5, 6, 9, 11 " >
show chat room in iframe

else

dont show chatroom in iframe

</if>


All times are GMT. The time now is 11:16 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.02335 seconds
  • Memory Usage 1,737KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete