vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   Step by Step guide to speed up your VB4 OR VB3 (https://vborg.vbsupport.ru/showthread.php?t=267588)

final kaoss 02-23-2012 08:15 PM

Which chat box are you using?

w8baby 02-24-2012 11:05 AM

Quote:

Originally Posted by extreme-gaming (Post 2302776)
Which chat box are you using?

the most common one
vsa-chatbox +chatbox addon

the chatbox become stuck at updating... without showing any message after .htaccess update

final kaoss 04-06-2012 01:02 PM

Message me a link and I'll check it out. Anyways I have provided a fix to the login issue when using these htaccess rules. Changes may not show immediately but they will show they are working after some time. Check the first & 3rd post.

Brandon Sheley 04-06-2012 02:11 PM

Nice article but I wouldn't suggest doing everything you mentioned, in particular adding cloudflare..
Research what works for you and what doesn't, I've seen reports of users not being able to access a site after CF was enabled.

final kaoss 04-06-2012 02:29 PM

Give me some posts about CF conflicting with vbulletin. I'd like to look into that.
Quote:

Originally Posted by Brandon Sheley (Post 2317381)
Nice article but I wouldn't suggest doing everything you mentioned, in particular adding cloudflare..
Research what works for you and what doesn't, I've seen reports of users not being able to access a site after CF was enabled.


Brandon Sheley 04-08-2012 12:42 PM

Quote:

Originally Posted by extreme-gaming (Post 2317388)
Give me some posts about CF conflicting with vbulletin. I'd like to look into that.

I (and you) linked directly to my source in the reply already ;) :up:

doileloi 05-24-2012 02:11 AM

I use 4.1.5 did what you told on page but right now all my forum log in problem /

here my code in

PHP Code:

# Author: Final Koass (aka: Extreme-Gaming)
# Version 2.6
RewriteEngine on

# This file is only needed if you have set the Forum Component URL in your admincp and you are 
# using the mod_rewrite option for friendly urls.  If this is the case, copy this file
# to your forum component stub directory.

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.
# RewriteBase /vbtest/

# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
# Options -MultiViews

RewriteCond %{REQUEST_FILENAME} -[OR]
RewriteCond %{REQUEST_FILENAME} -[OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule 
^.*$ - [NC,L]

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]


#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
    
AddType text/css .css
    AddType text
/richtext .rtf .rtx
    AddType image
/svg+xml .svg .svgz
    AddType text
/plain .txt
    AddType text
/xsd .xsd
    AddType text
/xsl .xsl
    AddType video
/asf .asf .asx .wax .wmv .wmx
    AddType video
/avi .avi
    AddType image
/bmp .bmp
    AddType application
/java .class
    
AddType video/divx .divx
    AddType application
/msword .doc .docx
    AddType application
/x-msdownload .exe
    AddType image
/gif .gif
    AddType application
/x-gzip .gz .gzip
    AddType image
/x-icon .ico
    AddType image
/jpeg .jpg .jpeg .jpe
    AddType application
/vnd.ms-access .mdb
    AddType audio
/midi .mid .midi
    AddType video
/quicktime .mov .qt
    AddType audio
/mpeg .mp3 .m4a
    AddType video
/mp4 .mp4 .m4v
    AddType video
/mpeg .mpeg .mpg .mpe
    AddType application
/vnd.ms-project .mpp
    AddType application
/vnd.oasis.opendocument.database .odb
    AddType application
/vnd.oasis.opendocument.chart .odc
    AddType application
/vnd.oasis.opendocument.formula .odf
    AddType application
/vnd.oasis.opendocument.graphics .odg
    AddType application
/vnd.oasis.opendocument.presentation .odp
    AddType application
/vnd.oasis.opendocument.spreadsheet .ods
    AddType application
/vnd.oasis.opendocument.text .odt
    AddType audio
/ogg .ogg
    AddType application
/pdf .pdf
    AddType image
/png .png
    AddType application
/vnd.ms-powerpoint .pot .pps .ppt .pptx
    AddType audio
/x-realaudio .ra .ram
    AddType application
/x-shockwave-flash .swf
    AddType application
/x-tar .tar
    AddType image
/tiff .tif .tiff
    AddType audio
/wav .wav
    AddType audio
/wma .wma
    AddType application
/vnd.ms-write .wri
    AddType application
/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
    AddType application
/zip .zip
</IfModule>
<
IfModule mod_expires.c>
    
ExpiresActive On
    ExpiresByType text
/css A2628000
    ExpiresByType text
/richtext A3600
    ExpiresByType image
/svg+xml A3600
    ExpiresByType text
/plain A3600
    ExpiresByType text
/xsd A3600
    ExpiresByType text
/xsl A3600
    ExpiresByType video
/asf A2628000
    ExpiresByType video
/avi A2628000
    ExpiresByType image
/bmp A2628000
    ExpiresByType application
/java A2628000
    ExpiresByType video
/divx A2628000
    ExpiresByType application
/msword A2628000
    ExpiresByType application
/x-msdownload A2628000
    ExpiresByType image
/gif A2628000
    ExpiresByType application
/x-gzip A2628000
    ExpiresByType image
/x-icon A2628000
    ExpiresByType image
/jpeg A2628000
    ExpiresByType application
/vnd.ms-access A2628000
    ExpiresByType audio
/midi A2628000
    ExpiresByType video
/quicktime A2628000
    ExpiresByType audio
/mpeg A2628000
    ExpiresByType video
/mp4 A2628000
    ExpiresByType video
/mpeg A2628000
    ExpiresByType application
/vnd.ms-project A2628000
    ExpiresByType application
/vnd.oasis.opendocument.database A2628000
    ExpiresByType application
/vnd.oasis.opendocument.chart A2628000
    ExpiresByType application
/vnd.oasis.opendocument.formula A2628000
    ExpiresByType application
/vnd.oasis.opendocument.graphics A2628000
    ExpiresByType application
/vnd.oasis.opendocument.presentation A2628000
    ExpiresByType application
/vnd.oasis.opendocument.spreadsheet A2628000
    ExpiresByType application
/vnd.oasis.opendocument.text A2628000
    ExpiresByType audio
/ogg A2628000
    ExpiresByType application
/pdf A2628000
    ExpiresByType image
/png A2628000
    ExpiresByType application
/vnd.ms-powerpoint A2628000
    ExpiresByType audio
/x-realaudio A2628000
    ExpiresByType application
/x-shockwave-flash A2628000
    ExpiresByType application
/x-tar A2628000
    ExpiresByType image
/tiff A2628000
    ExpiresByType audio
/wav A2628000
    ExpiresByType audio
/wma A2628000
    ExpiresByType application
/vnd.ms-write A2628000
    ExpiresByType application
/vnd.ms-excel A2628000
    ExpiresByType application
/zip A2628000
</IfModule>
<
IfModule mod_deflate.c>
    <
IfModule mod_setenvif.c>
        
BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch 
^Mozilla/4\.0[678no-gzip
        BrowserMatch 
\bMSIE !no-gzip !gzip-only-text/html
        BrowserMatch 
\bMSI[E] !no-gzip !gzip-only-text/html
    
</IfModule>
    <
IfModule mod_headers.c>
        
Header append Vary User-Agent env=!dont-vary
    
</IfModule>
    <
IfModule mod_filter.c>
        
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
    
</IfModule>
</
IfModule>
<
FilesMatch "\.(css|CSS|)$">
    <
IfModule mod_headers.c>
        
Header set Pragma "public"
        
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    
</IfModule>
    
FileETag MTime Size
    
<IfModule mod_headers.c>
         
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    
</IfModule>
</
FilesMatch>
<
FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
    <
IfModule mod_headers.c>
        
Header set Pragma "public"
        
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    
</IfModule>
    
FileETag MTime Size
    
<IfModule mod_headers.c>
         
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    
</IfModule>
</
FilesMatch>
<
FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WRI|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
    <
IfModule mod_headers.c>
        
Header set Pragma "public"
        
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    
</IfModule>
    
FileETag MTime Size
    
<IfModule mod_headers.c>
         
Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    
</IfModule>
</
FilesMatch>
# End Browser Caching/Headers 

Please help me on this thank you

final kaoss 05-24-2012 01:21 PM

Hi, since you are using vbseo, you should make the following changes to your htaccess file.

Code:

# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /

#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301]

RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
RewriteRule ^(.*\.php(/.*)?)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif)$
RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]


# Author: Final Kaoss (aka: Extreme-Gaming)
# Version 2.6


#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# BEGIN Browser Caching/Headers
<IfModule mod_mime.c>
    AddType text/css .css
    AddType text/richtext .rtf .rtx
    AddType image/svg+xml .svg .svgz
    AddType text/plain .txt
    AddType text/xsd .xsd
    AddType text/xsl .xsl
    AddType video/asf .asf .asx .wax .wmv .wmx
    AddType video/avi .avi
    AddType image/bmp .bmp
    AddType application/java .class
    AddType video/divx .divx
    AddType application/msword .doc .docx
    AddType application/x-msdownload .exe
    AddType image/gif .gif
    AddType application/x-gzip .gz .gzip
    AddType image/x-icon .ico
    AddType image/jpeg .jpg .jpeg .jpe
    AddType application/vnd.ms-access .mdb
    AddType audio/midi .mid .midi
    AddType video/quicktime .mov .qt
    AddType audio/mpeg .mp3 .m4a
    AddType video/mp4 .mp4 .m4v
    AddType video/mpeg .mpeg .mpg .mpe
    AddType application/vnd.ms-project .mpp
    AddType application/vnd.oasis.opendocument.database .odb
    AddType application/vnd.oasis.opendocument.chart .odc
    AddType application/vnd.oasis.opendocument.formula .odf
    AddType application/vnd.oasis.opendocument.graphics .odg
    AddType application/vnd.oasis.opendocument.presentation .odp
    AddType application/vnd.oasis.opendocument.spreadsheet .ods
    AddType application/vnd.oasis.opendocument.text .odt
    AddType audio/ogg .ogg
    AddType application/pdf .pdf
    AddType image/png .png
    AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
    AddType audio/x-realaudio .ra .ram
    AddType application/x-shockwave-flash .swf
    AddType application/x-tar .tar
    AddType image/tiff .tif .tiff
    AddType audio/wav .wav
    AddType audio/wma .wma
    AddType application/vnd.ms-write .wri
    AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
    AddType application/zip .zip
</IfModule>
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css A2628000
    ExpiresByType text/richtext A3600
    ExpiresByType image/svg+xml A3600
    ExpiresByType text/plain A3600
    ExpiresByType text/xsd A3600
    ExpiresByType text/xsl A3600
    ExpiresByType video/asf A2628000
    ExpiresByType video/avi A2628000
    ExpiresByType image/bmp A2628000
    ExpiresByType application/java A2628000
    ExpiresByType video/divx A2628000
    ExpiresByType application/msword A2628000
    ExpiresByType application/x-msdownload A2628000
    ExpiresByType image/gif A2628000
    ExpiresByType application/x-gzip A2628000
    ExpiresByType image/x-icon A2628000
    ExpiresByType image/jpeg A2628000
    ExpiresByType application/vnd.ms-access A2628000
    ExpiresByType audio/midi A2628000
    ExpiresByType video/quicktime A2628000
    ExpiresByType audio/mpeg A2628000
    ExpiresByType video/mp4 A2628000
    ExpiresByType video/mpeg A2628000
    ExpiresByType application/vnd.ms-project A2628000
    ExpiresByType application/vnd.oasis.opendocument.database A2628000
    ExpiresByType application/vnd.oasis.opendocument.chart A2628000
    ExpiresByType application/vnd.oasis.opendocument.formula A2628000
    ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
    ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
    ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
    ExpiresByType application/vnd.oasis.opendocument.text A2628000
    ExpiresByType audio/ogg A2628000
    ExpiresByType application/pdf A2628000
    ExpiresByType image/png A2628000
    ExpiresByType application/vnd.ms-powerpoint A2628000
    ExpiresByType audio/x-realaudio A2628000
    ExpiresByType application/x-shockwave-flash A2628000
    ExpiresByType application/x-tar A2628000
    ExpiresByType image/tiff A2628000
    ExpiresByType audio/wav A2628000
    ExpiresByType audio/wma A2628000
    ExpiresByType application/vnd.ms-write A2628000
    ExpiresByType application/vnd.ms-excel A2628000
    ExpiresByType application/zip A2628000
</IfModule>
<IfModule mod_deflate.c>
    <IfModule mod_setenvif.c>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    </IfModule>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
    </IfModule>
</IfModule>
<FilesMatch "\.(css|CSS|)$">
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag MTime Size
    <IfModule mod_headers.c>
        Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>
</FilesMatch>
<FilesMatch "\.(rtf|rtx|svg|svgz|txt|xsd|xsl|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|)$">
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag MTime Size
    <IfModule mod_headers.c>
        Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SWF|TAR|TIF|TIFF|WAV|WMA|WRI|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag MTime Size
    <IfModule mod_headers.c>
        Header set X-Powered-By "Step by Step guide to speed up your VB4 (forum only)"
    </IfModule>
</FilesMatch>
# End Browser Caching/Headers

After that, you should also do the tip provided in post 3 here.

Quote:

Fixing login issues with vbulletin 4.



Disable vbulletin content caching (since apache is handling that now)

AdminCP > Options > Server Settings and Optimization Options > Disable Content Caching: Set to yes

*Note these changes did not show immediately for me but they did show that they were working for me after roughly 15 minutes.

final kaoss 05-25-2012 11:05 PM

Well for those of you using vb supercharged, I've managed to make it load async which means even faster!

Go to your AdminCP --> Plugins & Products --> Plugin Manager

Find Product vB4: SuperCharged

Open JS Optimiser

Replace all of the code in there with this, then save.

Code:

if($vbulletin->options['vbsc_js_enable'] == 1){

      $c_vbsc = file_exists(DIR."/clientscript/vbsc.js");
      $c_vbscsize = $c_vbsc && filesize(DIR."/clientscript/vbsc.js") > 10;
      $c_global = $c_vbsc && filemtime(DIR."/clientscript/vbulletin-core.js") < filemtime(DIR."/clientscript/vbsc.js");
     
    if((!$c_vbsc || !$c_vbscsize || !$c_global) && $vbulletin->options['vbsc_js_common'] == 1){
       
        $err = "<strong style='font-size:13px;background-color:#000;padding:5px;color:#ff9000;font-weight:bold;text-align:center;width:100%;display:block;'>";
        if(!$c_vbsc){
            $err .= "The file ".DIR."/clientscript/vbsc.js is missing. Ensure the file exists (download and extract vbsc.zip again if not) and that you have the file chmodded as per the installation instructions, then run the Compress Javascript under vB4: SuperCharged in your Admin CP. Report any errors you encounter when running Compress Javascript.<br /><br />";
        } else if(!$c_vbscsize){
            $err .= "The file ".DIR."/clientscript/vbsc.js is empty. Ensure you have the file chmodded as per the installation instructions and run the Compress Javascript under vB4: SuperCharged in your Admin CP. Report any errors you encounter when running Compress Javascript.<br /><br />";
        } else if(!$c_global){
            $err .= "The ".DIR."/clientscript/vbsc.js cache has a modification time of before ".DIR."/clientscript/vbulletin-core.js. Your cache is almost certainly out of date. Please run Compress Javascript under vB4: SuperCharged in your Admin CP.<br />If you recently updated vBulletin, you should of course run Compress CSS also :) <br />";
        }
        $err .= "To prevent issues, your forum is currently running without optimised Javascript as a fallback.<br /><br />As a last resort if you cannot get this message to disappear, disable the Javascript Optimiser.</strong>";
        $output = $err.$output;
       
    } else {
       
        /*function vbsc_removejs($var){
            //return strpos($var, "threadlist") === false;
            return true;
        }*/
       
        //eval($vbulletin->options['vbsc_js_files']);
        //$GLOBALS['js_files'] = array_filter($GLOBALS['js_files'], 'vbsc_removejs');
require_once (DIR . '/includes/vbsc_global.php');
        $GLOBALS['js_uncached'] = '';
       

        function in_arrayi( $needle, $haystack ) {
            $found = false;
            foreach( $haystack as $value ) {
                if( strtolower( $value ) == strtolower( $needle ) ) {
                    $found = true;
                }
            } 
            return $found;
        }
       
        function vbsc_jsleave($match){
            return (/*stripos($match, "FeatureLoader.js.php") !== false ||*/ stripos($match, "google_ad") !== false || stripos($match, "show_ad") !== false || stripos($match, "_google") !== false || stripos($match, "recaptcha") !== false/* || strpos($match, "treeview.css") !== false || strpos($match, "initVbTreeMenus") !== false || strpos($match, "treeview-min.js") !== false || strpos($match, "SHOW_ALL_TREE_ELEMENTS_THRESHOLD") !== false*/);
        }
       
        function vbsc_jsinline($matches){
           
            /*if(strpos($matches[0], "google_ad") !== false || strpos($matches[0], "show_ad") !== false){
                return $matches[0];
            }*/
           
            // workaround for cms sections and pm new window thing
            if(stripos($matches[0], "loadVbCss") === false && stripos($matches[0], "getBaseUrl") === false){
                if(vbsc_jsleave($matches[0]))
                    return $matches[0];
                   
                // whitelist specific terms, otherwise leave the javascript where it is as it's likely an embedded script such as ads, custom search etc.
                if(stripos($matches[0], "YAHOO") === false && stripos($matches[0], "vbulletin") === false && stripos($matches[0], "forum") === false && stripos($matches[0], "vbphrase") === false && stripos($matches[0], "vB_") === false && stripos($matches[0], "inlinemod") === false && stripos($matches[0], "vbseo") === false && stripos($matches[0], "vsa") === false)
                    return $matches[0];
            }
           
           
            if(strpos($matches[0], "SESSIONURL =") === false){
                $GLOBALS['js_uncached'] .= $matches[0];
                return '';
            } else {
                return $matches[0];
            }
        }
        //var_dump($GLOBALS["js_files"]);
       
        function vbsc_jscached($matches){
            global $vbulletin;
            //var_dump($matches);
            //$ret = "";
            //var_dump($matches);
            if(in_arrayi($matches[2], $GLOBALS["js_files"]) && strpos($matches[1], "<!--") === false && $vbulletin->options['vbsc_js_common'] == 1){
                //return "";
            } else {
                //return $matches[0];
                $GLOBALS["js_uncached"] .= $matches[0];
               
                if(strpos($matches[1], "<!--") !== false){
                    // handle IE conditional comments and normal comments
                    if(strpos($matches[1], "[if ") === false){               
                        $GLOBALS["js_uncached"] .= " -->";
                    } else {
                        $GLOBALS["js_uncached"] .= " <![endif]-->";
                    }
                }
                   
            }
           
            if(vbsc_jsleave($matches[0]))
                return $matches[0];
           
           
           
            //return strpos($matches[1], "if") !== false ? $matches[1] : $ret;
            // leave original comment opener in place as closing comment is not covered by the regex
            return $matches[1];
        }
       
        $output = str_replace(array("<!-- Editor Scripts -->", "<!-- scripts for quick reply and quick edit -->", "<!-- / ajax errors table -->", "<!-- ajax errors table -->", "<!-- lightbox scripts -->
", "<!-- / lightbox scripts -->"), "", $output);
       
        //type="text\/javascript"
        // handle potentially cached vBulletin javascript code
        $output = preg_replace_callback('/(<!--.*?]>\s+)?<script [^>]*?src=".*?clientscript\/([^?"]+).*?">\s*?<\/script>?/i', 'vbsc_jscached', $output);
       
        // handle YUI treeview code amongst other things
        $output = preg_replace_callback('/<script[^>]*?type=[\'"]text\/javascript[\'"] src="http:\/\/yui.yahooapis.com\/.*?">\s*?<\/script>/is', 'vbsc_jsinline', $output);

        // handle inline javascript code
        $output = preg_replace_callback('/<script[^>]*?type=[\'"]text\/javascript[\'"]>.*?<\/script>/is', 'vbsc_jsinline', $output);
       
        $readyfix = "";
        if($vbulletin->options['vbsc_js_common'] != 1){
            $readyfix = '<script type="text/javascript">YAHOO.util.Event.onDOMReady(function() {if(YAHOO.vBulletin.vB_XHTML_Ready) return; console.log("Fire vB_XHTML_Ready");vB_XHTML_Ready.fire();YAHOO.vBulletin.vB_XHTML_Ready = true;});</script>';
        }
     
        // append vbsc.js
        $output = preg_replace('/(<\/body>)/i', ($vbulletin->options['vbsc_js_common'] == 1 ? '<script type="text/javascript" src="clientscript/vbsc.js" async="async"></script>' : '').$GLOBALS["js_uncached"].$readyfix.'$1', $output, 1);
       
       


        //$output = preg_replace('/<script type="text\/javascript">\s+<!--\s+\/\/ Main vBulletin Javascript Initialization/', '<script type="text/javascript" src="/clientscript/vbsc.js"></script>'.$GLOBALS["js_uncached"].'$1', $output, 1);

        //$output = str_replace('SECURITYTOKEN', 'vbsc_SECURITYTOKEN', $output);   
    }
}

It will now defer the parsing of the vbsc.js file, saving a few hundred KB and increasing your page load time!

apokphp 05-30-2012 05:56 AM

I'm having trouble getting the mod rewrite to work properly on a clean 4.2 suite install.

http://www.forgeofreason.com/forum/forum.php

It's set to mod rewrite.
vb is installed in the /forum/ directory.
Currently, there is nothing in the root directory, but I'd like to have the CMS at the root.
All the links (forum, what's new, usercp, blogs, etc...) work fine w/ the mod rewrite. However, it is only the Articles (or CMS) that doesn't work, and it returns a 404 page not found error. It's url is http://www.forgeofreason.com/forum/content.php

Did I do something wrong?

I did edit your sample htaccess by uncommenting 2 lines (but am not sure if I should have):

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.
RewriteBase /forum/

# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
Options -MultiViews


All times are GMT. The time now is 12:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01652 seconds
  • Memory Usage 1,922KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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