vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Checking if user is member of a certain forum (https://vborg.vbsupport.ru/showthread.php?t=66279)

Boofo 06-18-2004 02:57 PM

Checking if user is member of a certain forum
 
Does anyone know the if conditioon to check if a user has access to a certain forum? I know this is simple, but for some reason it is escaping me right now. Sorry. :(

And also, does anyone know how to set up a link to turn on access to a certain forum? And turn it off?

Boofo 06-19-2004 04:45 AM

Nobody knows how to do this? Hmmmm....

Sylvus 06-19-2004 03:33 PM

I can only help you with the first question and even then, it might not be what you're looking for.

Create a new field that is not editable by the user. For all of those users you want to be able to read the posts in this particular forum, put the word "Allowed" (without the quote) in the new field you created.

Open up showthread.php

PHP Code:

// USER SPECIFIC CODE VIEW

if ($thread['forumid'] == xx) {

if (
$bbuserinfo['fieldxx'] != "Allowed")
{
 eval(
"standarderror(\"".gettemplate("error_notenouoghposts")."\");");


}
// END 

Create a new template called error_notenouoghposts and in it, put

You do not have access to read the posts in this particular forum.

Replace ['forumid'] == xx with the # for that particular forum.

Replace fieldxx with the # of the particular new field you just created.

Everyone will be able to enter the forum but only those with the "Allowed" field will be able to read the posts in that forum.

Syl...

Boofo 06-19-2004 04:25 PM

Thanks for the reply. ;)

That's not quite was I was looking for, though. Sorry. :(

What I want to do is say if this user has access to a certain forum, then do this boardwide. If they don't have access, do something else. I want to check for this from the postbit.


All times are GMT. The time now is 12:30 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.01029 seconds
  • Memory Usage 1,715KB
  • 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
  • (4)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