vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Fetching forum permissions (https://vborg.vbsupport.ru/showthread.php?t=92198)

Chris M 07-14-2005 08:27 PM

Fetching forum permissions
 
This is driving me mad :p

It will not set the $limitfids variable, and I cannot for the life of me figure out why :(

PHP Code:

// #################### PROCESS LATEST THREADS #######################
// fetch the permissions for each forum
global $vbulletin;

$forumperms = array();
foreach(
$vbulletin->forumcache AS $forum) {

    
$forumperms[$forum["forumid"]] = fetch_permissions($forum['forumid']);

    
// ## HIDE FORUMS WITHOUT THE CANVIEW PERMISSION ##
    
if ((!$forumperms[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) {
        
$limitfids .= ','.$forum['forumid'];
    }
}
unset(
$forum); 

Satan

Marco van Herwaarden 07-14-2005 08:41 PM

PHP Code:

    if ((!$forumperms[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) { 

Try:
PHP Code:

    if (!($forumperms[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND !$vbulletin->options['showprivateforums']) { 


Chris M 07-14-2005 08:51 PM

You're a genius :p

I've been trying every combination of code I can think of relating to permissions, and it comes down to the placement of the ! and the bracket -.-

Cheers Marco :)

Satan

Marco van Herwaarden 07-14-2005 08:59 PM

That is why it helps if you show it to someone 'fresh'.

You get blind for the obvious after staring at code for a while.

Marco van Herwaarden 07-14-2005 09:00 PM

Now you can go help me with my tri-state checkbox. :D

Chris M 07-14-2005 09:00 PM

Yeh - I figured it couldn't hurt for a fresh pair of eyes to take a look at something ;)

Usually you look so hard you ignore the tiniest mistakes and are thinking it must be something wrong with the whole chunk of code :)

Anyway, thanks again :)

Edit: I've taken a look at that thread actually ;)

I'm not sure what help I can be but I'll start googling for solutions :p

Satan

Marco van Herwaarden 07-14-2005 09:12 PM

Google didn't brought me the solution.

Chris M 07-14-2005 09:46 PM

Nor me :(

Satan


All times are GMT. The time now is 01:12 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.01270 seconds
  • Memory Usage 1,730KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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