Back to vBulletin 3.0 Add-Ons

Kill 1 Query In BBCode Manager (ACP)
Mod Version: 1.00, by Zero Tolerance

This modification is in the archives.
vB Version: 3.0.7 Rating: (1 vote - 5.00 average) Installs: 8
Released: 01 Mar 2005 Last Update: Never Downloads: 0
Not Supported  

While looking through bbcode.php in admincp/, i noticed that a global query was executed on all of it's pages, however only 2 actions need this query to be executed, so its a useless query on other pages within the BBCode Manager.

In admincp/bbcode.php
Find:
PHP Code:
$bbcodes $DB_site->query("SELECT bbcodetag, bbcodereplacement, twoparams FROM " TABLE_PREFIX "bbcode");
$searcharray = array();
$replacementarray = array();
$doubleRegex "/(\[)(%s)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/%s\])/siU";
$singleRegex "/(\[)(%s)(])(.*)(\[\/%s\])/siU";

while (
$bbcode $DB_site->fetch_array($bbcodes))
{
    if (
$bbcode['twoparams'])
    {
        
$regex sprintf($doubleRegex$bbcode['bbcodetag'], $bbcode['bbcodetag']);
    }
    else
    {
        
$regex sprintf($singleRegex$bbcode['bbcodetag'], $bbcode['bbcodetag']);
    }
    
$searcharray[] = $regex;
    
$replacementarray[] = $bbcode['bbcodereplacement'];

Replace It With:
PHP Code:
if($_REQUEST['do'] == "test" || $_REQUEST['do'] == "modify"){

    
$bbcodes $DB_site->query("SELECT bbcodetag, bbcodereplacement, twoparams FROM " TABLE_PREFIX "bbcode");
    
$searcharray = array();
    
$replacementarray = array();
    
$doubleRegex "/(\[)(%s)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/%s\])/siU";
    
$singleRegex "/(\[)(%s)(])(.*)(\[\/%s\])/siU";

    while (
$bbcode $DB_site->fetch_array($bbcodes))
    {
        if (
$bbcode['twoparams'])
        {
            
$regex sprintf($doubleRegex$bbcode['bbcodetag'], $bbcode['bbcodetag']);
        }
        else
        {
            
$regex sprintf($singleRegex$bbcode['bbcodetag'], $bbcode['bbcodetag']);
        }
        
$searcharray[] = $regex;
        
$replacementarray[] = $bbcode['bbcodereplacement'];
    }

I know it's not much, but every little helps!

- Zero Tolerance

Download

No files for download.

Similar Mods

Show Thread Enhancements BBcode Manager 1.32 : New looks for your quote, html, php and code bbcodes ! Modification Graveyard

vblts.ru supports vBulletin®, 2022-2024