Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Closed Board - Mod & Admin Access Details »»
Closed Board - Mod & Admin Access
Version: , by NTLDR (Coder) NTLDR is offline
Developer Last Online: Oct 2004 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-08-2002 Last Update: Never Installs: 0
 
No support by the author.

My board is currently closed when while I hack up 2.2.7 and finish off the new style for it, by default only admins can access a closed board, but I want a supermod to as well, I changed:

PHP Code:
// check that board is active - if not admin, then display error
if (!$bbactive) {
  if (!
$permissions['cancontrolpanel']) {
    eval(
"standarderror(\"".str_replace("\'""'"addslashes($bbclosedreason))."\");");
    exit;
  }

in global.php to:

PHP Code:
// check that board is active - if not admin, then display error
if (!$bbactive) {
  if ((!
$permissions['cancontrolpanel']) or (!$permissions['ismoderator'])) {
    eval(
"dooutput(\"".gettemplate("classic_bbclosed")."\");");
    exit;
  }

classic_bbclosed is a template with the entire page to be displayed instead of the standard error, now this worked for a few days then suddenly stoped, I didn't do anything to change it and have tried every way I can think of. ismoderator is set to 1 for the usergroup (the default sup mod group).

Any ideas?

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-08-2002, 08:31 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NTLDR try this code...

PHP Code:
// check that board is active - if not admin, then display error
if (!$bbactive) {
  if (!
$permissions['cancontrolpanel']) {
    if (!
$permissions['ismoderator']) {
      eval(
"dooutput(\"".gettemplate("classic_bbclosed")."\");");
      exit;
    }
  }

regards...

g-force2k2
Reply With Quote
  #3  
Old 09-08-2002, 08:38 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you g-force2k2, that seems to be doing the trick its been a nightmare trying to get that to work. Thanks once again
Reply With Quote
  #4  
Old 09-08-2002, 08:42 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

np NTLDR... it was very perplexing to me as well O_o i was trying to short hand it into one line... but the statement that you had stated...

if they can't access the control panel 'or' they aren't a moderator

see the thing is moderators can't access the control panel so no matter what that part will always return false meaning it wont work...

how my works is

if they can't access the control panel... then

if they aren't a moderator... then...

hope that helps you see the light regards...

g-force2k2
Reply With Quote
  #5  
Old 09-08-2002, 08:53 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After a little confusion I see now that my code would never work and how yours does.

I hade:

PHP Code:
if (!$permissions['cancontrolpanel'] or !$permissions['ismoderator']) { 
origional which I know worked for a couple of days which is why I couldn't see what was wrong. Do the extra set of brackets around each !$permissions bit have any effect or just make the statment clearer?

Thanks for the explanation though, I helped me see what was obviously wrong
Reply With Quote
  #6  
Old 09-08-2002, 08:58 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah i see what you mean about the brackets i guess we both learn something out of it... glad to see the one liner working again regards...

g-force2k2
Reply With Quote
  #7  
Old 09-08-2002, 09:08 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think I explained very well *lol*

The one liner just suddenly stopped working. Anyway your code works a treat and I'm not going to play and break it again
Reply With Quote
  #8  
Old 09-09-2002, 07:14 AM
Scott MacVicar Scott MacVicar is offline
 
Join Date: Oct 2001
Location: Glasgow, Scotland
Posts: 1,199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if (!$permissions['cancontrolpanel'] or !$permissions['ismoderator']) { 
that should be

PHP Code:
if (!$permissions['cancontrolpanel'] and !$permissions['ismoderator']) { 
because a mod will match the ismoderator but not cancontrol panel and since one of them will return true they get the error.
Reply With Quote
  #9  
Old 09-09-2002, 11:58 AM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I realise how stupid I've been now, not taking the fact that each one was negated so 'and' would work
Reply With Quote
  #10  
Old 09-09-2002, 02:01 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah thanks PPN

im been toasting my brain

g-force2k2
Reply With Quote
Reply

Thread Tools

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 06:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09997 seconds
  • Memory Usage 2,301KB
  • Queries Executed 23 (?)
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
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete