vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Unnecessary query? (https://vborg.vbsupport.ru/showthread.php?t=60965)

Andreas 02-11-2004 01:31 PM

http://www.vbulletin.com/forum/bugs....iew&bugid=2224

Status: Closed (Fixed)

But no reply :( So I guess i'll have to wait for the next RC ...

Xenon 02-11-2004 01:43 PM

yes you have...

btw, you're showing up unlicensed now...

Andreas 02-11-2004 02:15 PM

I do? I don't get that "You're unlicensed remider"
Anyway, that's bollox :)

I've had problems to get rid of that "you're unlicensed" at vB-germany.com and they suggested to remove my email from the member area and afterwards add it again.
I did so ... that could be the reason.

NTLDR 02-11-2004 02:23 PM

Either way its worked and you appear licenced again. Good to see this nasty bug fixed too :)

Xenon 02-11-2004 02:40 PM

yes, that would explain the short unlicensed period ;)

Natch 02-11-2004 02:52 PM

To confirm, does the bug report showing fixed in RC4 mean that it was reported under RC4 ? or fixed for RC4 ?

Freddie Bingham 02-11-2004 02:56 PM

Quote:

Originally Posted by Natch
To confirm, does the bug report showing fixed in RC4 mean that it was reported under RC4 ? or fixed for RC4 ?

Fixed for Gold. Try this:
PHP Code:

        else
        { 
// imodcache is not set - do a query

            
if (isset($modcache["$userid"]))
            {
                return 
$modcache["$userid"];
            }

            
$modcache["$userid"] = 0;

            
DEVDEBUG('QUERY: is the user a moderator (any forum)?');
            
$ismod_all $DB_site->query("SELECT moderatorid, permissions FROM " TABLE_PREFIX "moderator WHERE userid = $userid");
            while (
$ismod $DB_site->fetch_array($ismod_all))
            {
                if (
$do)
                {
                    if (
$ismod['permissions'] & $_BITFIELD['moderatorpermissions']["$do"])
                    {
                        
$modcache["$userid"] = 1;
                        break;
                    }
                }
                else
                {
                    
$modcache["$userid"] = 1;
                    break;
                }
            }

            return 
$modcache["$userid"];
        } 

As for can_moderate generating a query on many pages for non admins/supermods, I didn't even realize that was happening. I don't think that is really acceptable so we will see what we can do about it.

Freddie Bingham 02-11-2004 02:58 PM

Quote:

Originally Posted by freddie
Fixed for Gold. Try this:
PHP Code:

        else
        { 
// imodcache is not set - do a query

            
if (isset($modcache["$userid"]))
            {
                return 
$modcache["$userid"];
            }

            
$modcache["$userid"] = 0;

            
DEVDEBUG('QUERY: is the user a moderator (any forum)?');
            
$ismod_all $DB_site->query("SELECT moderatorid, permissions FROM " TABLE_PREFIX "moderator WHERE userid = $userid");
            while (
$ismod $DB_site->fetch_array($ismod_all))
            {
                if (
$do)
                {
                    if (
$ismod['permissions'] & $_BITFIELD['moderatorpermissions']["$do"])
                    {
                        
$modcache["$userid"] = 1;
                        break;
                    }
                }
                else
                {
                    
$modcache["$userid"] = 1;
                    break;
                }
            }

            return 
$modcache["$userid"];
        } 

As for can_moderate generating a query on many pages for non admins/supermods, I didn't even realize that was happening. I don't think that is really acceptable so we will see what we can do about it.

Oops I see that could have a problem if you call can_moderate() on the same user using different 'do' actions. I'll have to fix that one but this should get you by.

filburt1 02-12-2004 01:55 AM

Good thing it was fixed...I relied on this function for a lot of stuff in custom templates I develop.

Boofo 02-12-2004 02:01 AM

Where would you add that code at?


All times are GMT. The time now is 12:22 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.01149 seconds
  • Memory Usage 1,771KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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