vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vbdevelopers: Can you help me on this? (https://vborg.vbsupport.ru/showthread.php?t=14780)

Mas*Mind 04-21-2001 10:44 AM

I'm working on my vbextern hack and need a routine to make one big array with the 'canview' permissions for each forum....I'm chewing on this for a couple of days now, but it's hard to understand someone else's code.

What I want is that you end up with a cached array for all forums:

$forumpermissions[$forumid][$canview]

so it might be something like this:

$forumpermission[1][1]
$forumpermission[2][1]
$forumpermission[3][0]
$forumpermission[4][1]
$forumpermission[5][0]
$forumpermission[6][1]
$forumpermission[7][0]

right now I call the getpermissions() function every time when I wanna know if a users is permitted to view the particular forum and that takes alot of query's. It would be better to make one array in the beginning and cache it.
So you can do something like this:

if($forumpermissions[$forumid])
{ etc();
}
else
{ continue;
}

Thanks in advance :)

Mike Sullivan 04-21-2001 03:23 PM

You have to loop through logically like index.php/forumjump. If you don't, inheritance doesn't work.

Mas*Mind 04-21-2001 08:03 PM

That's the way I currently do it, only I do it multiple times, so wouldn't it be possible to make one while loop and make such an array instead calling this while-loop over and over again?


All times are GMT. The time now is 03:52 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.01011 seconds
  • Memory Usage 1,706KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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