View Single Post
  #90  
Old 03-15-2006, 12:55 PM
MentaL's Avatar
MentaL MentaL is offline
 
Join Date: Jan 2003
Posts: 550
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

those wanting to sort global.php back to original

search

Code:
($hook = vBulletinHook::fetch_hook('cache_templates')) ? eval($hook) : false;
below , delete

Code:
// now get all the templates we have specified
/**
 * @author Dusty Burns (Trigunflame@charter.net)
 * @copyright 2006-2007 Dusty Burns
 * @package Vbulletin Template Cache
 * @version 2.5.0.0
 * @todo Add Shared Memory Support
 */

/*
 * Is this actually necessary? 
 * 
 * Probably not, but right now I don't want hacks 
 * whos authors did not copy the define() for 
 * THIS_SCRIPT and change it; causing us to get
 * the wrong cache and screwing the page up.
 * 
 * This basically makes sure that THE_SCRIPT does 
 * correspond to the actual filename being requested.
 * 
 * PS. You can change .php down below this to whatever 
 * file ext you use for Your PHP files: ie .php4,.php5
 */
if (THIS_SCRIPT == basename($vbulletin->script, '.php'))
{
    // Cache Templates
    $vbulletin->cache_templates = true;
    
    /*
     * It is nice to have some sort of function 
     * for locking while writing data. We could 
     * just use flock, but for the sake of 
     * conforming to how jelsoft does some things.
     * 
     * Begin Generic Lock
     */
    function tpl_cache_lock()
    {
        global $db;
        $lock_attempts = 5;
        while ($lock_attempts >= 1)
        {
            $result = $db->query_write(
                'UPDATE ' . TABLE_PREFIX . 'adminutil SET ' .
                'text = UNIX_TIMESTAMP() ' .
                "WHERE title = 'datastorelock' " . 
                'AND text < UNIX_TIMESTAMP() - 15'
            );
            if ($db->affected_rows() > 0) { return true; } else { $lock_attempts--; sleep(1); }
        }
        return false;
    }
    
    function tpl_cache_unlock()
    {
        global $db;
        $db->query_write(
            'UPDATE ' . TABLE_PREFIX . 'adminutil ' . 
            "SET text = 0 WHERE title = 'datastorelock'"
        );
    }
    /*
     * End Generic Lock
     */

    // Check Existance
    $tpl_cache_name = DIR . '/template_cache/' . THIS_SCRIPT . '_' . STYLEID . '.php';
                        
    // Look For Cached File
    if (@include($tpl_cache_name))
    {
        // Fake Cached Templates & Update Style
        cache_templates(array(), $style['templatelist']);
    }
    // Write Cache
    else
    {
        // Build Template Cache
        cache_templates($globaltemplates, $style['templatelist']);
        
        // Get File Lock
        if (tpl_cache_lock())
        {
            $tpl_cache = "<?php\r\n" . '$vbulletin->templatecache = ' . 
            var_export($vbulletin->templatecache, true) . ';' . "\r\n?>";

            // Debugging Purposes
            if ($fp = @fopen($tpl_cache_name, 'w+'))
            {
                @fwrite($fp, $tpl_cache);
                @fclose($fp);
                unset($tpl_cache);
                tpl_cache_unlock();
            }
            // Could Not Create File
            else
            {
              tpl_cache_unlock();
              exit("Could not cache template file. The template_cache dir must be writable (CHMOD 777).");
            }
        }
    }
}
// Vbulletin Default
else
{
    // now get all the templates we have specified
    cache_templates($globaltemplates, $style['templatelist']);
}
unset($globaltemplates, $actiontemplates, $_get_edit_templates, $_templatedo);
replace with

Code:
// now get all the templates we have specified
cache_templates($globaltemplates, $style['templatelist']);
unset($globaltemplates, $actiontemplates, $_get_edit_templates, $_templatedo);
i believe thats original
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01273 seconds
  • Memory Usage 1,779KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete