Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2005, 10:29 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default what does shutdown_query do?

PHP Code:
$DB_site->shutdown_query(
just wondering what this does as opposed to ->query_first and ->query
Reply With Quote
  #2  
Old 01-27-2005, 11:45 AM
Creative Suite's Avatar
Creative Suite Creative Suite is offline
 
Join Date: May 2004
Location: Kuwait :)
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
    function shutdown_query($query_string$arraykey 0)
    {
        global 
$shutdownqueries;

        if (
NOSHUTDOWNFUNC AND !$arraykey)
        {
            return 
$this->query($query_string);
        }
        elseif (
$arraykey)
        {
            
$shutdownqueries["$arraykey"] = $query_string;
        }
        else
        {
            
$shutdownqueries[] = $query_string;
        }
    } 
Reply With Quote
  #3  
Old 01-27-2005, 11:52 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that went right over my head.

let's simplify

->query( // you'd use for a loop
->query_first( // standard query
->shutdown_query( // ???
Reply With Quote
  #4  
Old 01-27-2005, 12:15 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You know what, I have absolutely no idea. It appears that it's a feature designed to run queries after the page has rendered. All the queries in shutdown queries are not run at that particular part of the script I can tell you that. If you look at exec_shut_down() in functions.php you'll see what happens. However, I can't find any reference to that function being run anywhere in any of the vB files

Who knows... maybe I'm overlooking something
Reply With Quote
  #5  
Old 01-27-2005, 12:20 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lol, you should read the how-to's

https://vborg.vbsupport.ru/showthread.php?t=75207

With great thanks to Bruce.Lee
Reply With Quote
  #6  
Old 01-27-2005, 12:25 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just checked again, and that function is not being called anywhere according to ultraedit!
Reply With Quote
  #7  
Old 01-27-2005, 12:34 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And I thought UltraEdit was a good software ^.^

admincp/global.php
PHP Code:
    if (!empty($cpsession))
    {
        
$DB_site->shutdown_query("
            UPDATE LOW_PRIORITY " 
TABLE_PREFIX "cpsession
            SET dateline = " 
TIMENOW "
            WHERE userid = 
$bbuserinfo[userid]
                AND hash = '" 
addslashes($_COOKIE[COOKIE_PREFIX 'cpsession']) . "'
        "
); 
announcement.php
PHP Code:
if ($anncids)
{
    
$DB_site->shutdown_query("
        UPDATE " 
TABLE_PREFIX "announcement
        SET views = views + 1
        WHERE announcementid IN (
$anncids)
    "
);

attachment.php
PHP Code:
        // doing it as they happen
        
$DB_site->shutdown_query("
            UPDATE " 
TABLE_PREFIX "attachment
            SET counter = counter + 1
            WHERE attachmentid = 
$attachmentinfo[attachmentid]
        "
); 
and so on.

Or did you mean exec_shut_down?

functions.php
PHP Code:
if (!NOSHUTDOWNFUNC)
{
    
register_shutdown_function('exec_shut_down');

PHP Code:
    if (NOSHUTDOWNFUNC)
    {
        
exec_shut_down();
    } 
Reply With Quote
  #8  
Old 01-27-2005, 12:39 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No no no no....

Ok those queries are passed to the method with db_mysql.php, and either ran at that exact time or stored in an array. This array is then released by the method with a global call and acn be used anywhere else in the script. There is then no reference to where-else these queries are ran. So they must be run at that exact point in the script. Do a search for $shutdownqueries and you tell me where they are run, in exec_shut_down. Ok then tell me where this function is ran

Follow?
Reply With Quote
  #9  
Old 01-27-2005, 12:40 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Revised my last post to include the references for exec_shut_down
Reply With Quote
  #10  
Old 01-27-2005, 12:57 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Weird I don't have those lines in my functions.php?
Reply With Quote
Reply


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 05:26 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.04501 seconds
  • Memory Usage 2,272KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)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
  • (10)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