Мастер
Join Date: Jun 2007
Posts: 4,372
Версия vB: 3.8.x
Пол: 
Reputation:
Мастер 3744
Репутация в разделе: 2346
|
vB4: SuperCharged 0.6 - Huge speed boost for vB4
Quote:
A number of optimisations to help vBulletin to score highly in Google Page Speed and to actually FEEL incredibly fast.
________________________________________________________________
Features:
CSS Optimiser:
Minifies all CSS files.
Creates a common, easily cached CSS file based on a preset selection of common CSS files that can be added to easily.
Creates .gz files usable by nginx etc.
JS Optimiser:
Optimises Javascript with Google Closure Compiler (API version) for a slightly reduced filesize and increased performance.
Defers Javascript loading by intelligently moving all inline and external code to before the closing body tag and ordering it for correct execution. This is where most of the speed comes from.
Creates a common JS file - same idea as the CSS optimiser.
Creates a .gz file for the common JS, usable by nginx etc.
HTML Optimiser:
Based on HELLCAT's Realtime Page Compressor, and adds:
Removal of whitespace around block and meta elements.
Working removal of non-conditional comments
Attachment Optimiser:
Intended for FastCGI users only - prevents long periods of locked FastCGI when serving multiple inline image attachments. Disabled by default.
________________________________________________________________
Installation:
Ensure you have CSS stored on the filesystem and not your database. To check this, go to Settings > Options > Style & Language Settings > Store CSS Stylesheets as Files? and ensure it is set to "Yes".
Disable Remote YUI if you have it enabled. To check this, go to Settings > Options > Server Settings and Optimization Options > Use Remote YUI and ensure it is set to "None".
For each style you wish to use, go to any stylevar and hit save to ensure the latest CSS is flushed to disk. (Styles & Templates > (Your style(s)) Stylevars > Select any stylevar in the list > Save)
Upload the contents of vbsc.zip to your forum root directory via FTP.
Ensure the files vbsc.js and vbsc.js.gz in /clientscript/ are writable. You may need to create these first, or simply chmod the whole /clientscript/ directory to be writable. Not all servers will need this, but if you encounter errors in Compress JS, this is most likely why.
Install product-vbsc.xml as a Product. (Plugins & Products > Manage Products > Add/Import Product)
Run Compress JS and Compress CSS under the vB4: SuperCharged Admin CP section.
Check to ensure that all the settings are correct (although usually the defaults are just fine). (vB4: SuperCharged > Options)
________________________________________________________________
Upgrading:
Uninstall the vB4: SuperCharged product. (Plugins & Products > Manage Products)
Upload the contents of vbsc.zip to your forum root via FTP. (Overwrite the existing files.)
Install the new product-vbsc.xml. (Plugins & Products > Manage Products > Add/Import Product)
For each style you wish to use, go to any stylevar and hit save to ensure the latest CSS is flushed to disk. (Styles & Templates > (Your style(s)) Stylevars > Select any stylevar in the list > Save)
Run Compress JS and Compress CSS under the vB4: SuperCharged Admin CP section.
Check to ensure that all the settings are correct (although usually the defaults are just fine). (vB4: SuperCharged > Options)
________________________________________________________________
Changelog:
0.7:
Changes made to vbsc.php - don't forget vbsc.zip when updating.
Fixed CMS sections widget not working with JS Optimiser enabled. The fix for this will probably also fix other YUI-related issues.
Fixed visitor messages being too wide with CSS Optimiser enabled.
0.6:
Several changes made to vbsc.php - don't forget vbsc.zip when updating.
Added a number of additional Javascript and CSS files - please uninstall vB4:SC before installing 0.6.
Compress JS now makes a small modification to the actual code to workaround a bug which can break a lot of things (most notably inlinemod) and generally screw things up.
Fixed links to compressed code in the admin cp.
Fixed /clientscript/ -> clientscript/ in the JS optimiser.
Closure Compiler is now optional, and defaults to off because it really provides little gain other than download size and takes ages to run. Standard JSMin is now the default form of compression.
Added error messages for both compressors.
Fixed vbulletin_textedit.js not being filtered out properly due to nearby HTML comments.
Tested compatibility with GCBOS and additional_css mods.
0.5:
Fixed any prefix to css.php not being removed properly and being displayed as text in the header.
0.4:
Fixed references to /clientscript/ instead of clientscript/, which broke support for forums not running in the root of a domain.
Fixed incompatibility with new css.php URLs in RC2.
Fixed conditional comments around IE Javascript being removed.
Fixed weird inlinemod issue.
Added popuplist.css - please uninstall before upgrading or add this to your CSS Files list manually.
Fixed incompatibility with Google Adsense. Fixes for other ad providers and other inline Javascript will be added on request.
0.3:
Added HTML Optimiser
Fixed @charset spam in vbsc.css
Fixed vbsc_ files not being used due to a regression during release.
cpnav_vbsc.xml was accidentally left out in 0.2 :P
CSS is now automatically compressed when the files are updated through the StyleVar system, or otherwise. This also fixes the random deletion of vbsc.css and other vbsc_ css files.
0.2:
Added JS optimiser
________________________________________________________________
ONLY if you wish to use the Attachment Optimiser, something similar to this is needed in your server config (nginx):
Code:
location /customattachments {
Code:
if ($request_uri ~* \.(png)) {
add_header Content-Type image/png;
}
if ($request_uri ~* \.(jpg|jpeg)) {
add_header Content-Type image/jpeg;
}
if ($request_uri ~* \.(gif)) {
add_header Content-Type image/gif;
}
}
(although some browsers will probably be happy enough without these headers)
|
vLaTeX - Math parsing with LaTeX
Quote:
vLaTeX allows your users to include mathematical equations written in LaTeX into their posts, rendered in high quality graphic files (either png or gif). Such ability is instrumental in scientific or educational oriented forums. When I started in vb two years ago, there ware a number of solutions available, but none of them suited my needs completely, so I developed my own integration between (a modified version of) Benjamin Zeiss' LatexRender and vBulletin. With the new vbulletin 4.0, I decided to improve some of the features of this product, and to release it with the hope that it turns out to be useful to any of you.
What is LaTeX?
LaTeX is a set of macros for the TeX typesetting system. It is the defacto standard of communication within the scientific and mathematical community. It works pretty much like a programing language: you write a text source file, and the latex executable compiles it in a DeVice Indepentent file (DVI), which can be later converted to the desired format (postscript, pdf, etc.).
This mod (thanks to a modified version of the LatexRender class) does all this work in the background. It takes the formula code, inserts it in a source file, compiles it and converts the output in a high quality image file (png or gif, depends on your settings) to show in the post.
Requirements
This mod relies on your server having available the following external programs. They are pretty standard in most linux distributions, so hosts can install them easily (if they want to, some don't). Please, check your server meets this requirements (or ask your host to install the programs) before trying to use vLaTeX:
- latex: the LaTeX compiler. Check the TeXlive distribution (http://www.tug.org/texlive/).
- dvips: converts the DVI file to PS. Usually included in all latex distributions.
- convert: as it name suggests, converts between a large number of graphic files. Belongs to the ImageMagick package. Needs ghostscript.
- identify: among other things, measures the size of image files. Also belongs to ImageMagick
- Ghostscript: PostScript and PDF language interpreter and previewer. Is called by convert in order to handle ps files.
Features
Creates a new BBcode, usually [TEX] (thought the tag name is configurable via the admin cp), which contents are processed thought LaTeX to generate image files. There are four calling modes:
- [TEX]E= mc^2[/TEX] in-line mode. The image is included in the middle of the text, without line breaks. It tries to adjust the baseline of the formula by adjusting the vertical-align CSS property; the results aren't always perfect, but it does its best.
- [TEX=null]E = m c^2[/TEX] displayed mode: The formula is displayed (usually centered) between two paragraphs.
- [TEX=*]E = m c^2[/TEX] autonumbering mode: The formula is displayed (usually centered), and numbered.
NOTE: The auto-numbering depends on the CSS counter system, so some old browsers (most notably ie 7 and older) will show these equations untaged, like [TEX=null]. Don't blame me, blame non-standar compilant browsers.
- [TEX=tag]E = m c^2[/TEX] displayed with tag: The formula is displayed (usually centered) between two paragraphs, and tagged with the specific tag.
In the last two modes, the tags are displayed at the right (left if you use RTL) between brackets, in a (configurable) color.
This mod also introduces a second BBcode, [EQREF]tag[/EQREF], which outputs (tag), with the same style of the equation tags. It's useful to let users make reference their formulas.
Admin features
Image files are cached, so every unique formula is only processed once.
Fully configurable via Style Variables and templates.
It doesn't change any vb default template, so upgrading should be easy.
Includes a list of blacklisted latex commands for security (configurable in the admin cp).
The admin can customize the preamble of the latex file in the admin cp. This is useful to define new commands that your community uses often, or to include packages.
Error messages can be customized in the phrase system.
Installation / Upgrade
1.- Unzip the mod files.
2.- Upload the vLaTeX directory to your forum root. The generated folder structure should look like this:
vLaTeX/
vLaTeX/index.htm
vLaTeX/class_vlatex.php
vLaTeX/functions_vlatex.php
vLaTeX/pics/
vLaTeX/pics/index.htm
vLaTeX/temp/
vLaTeX/temp/index.htm
3.- Change the permissions of the pics and temp folders so the web server can write on them.
4.- Import the product XML in your admin control panel. If you're upgrading, set "Allow Overwrite" to yes.
5.- Go to Admin CP > Settings > Options > vLaTeX - Math Parsing
6.- Make sure the path to latex, dvips, convert and identify executables is correct. Those settings default to the most common values in most linux distributions, but every host is a different world.
If you have shell access, you can check the location of the executables with the following commands:
which latex
which dvips
which convert
which identify
7.- Make sure the path to the Images and Temporal directory are correct. You can change them if you don't like the default value, but the directories must exist and the server must have permissions to write on them.
For extra safety, you could move the temp folder out of the public accessible directory three, thought it should not be needed, since files are deleted in matter of milliseconds.
8.- Set the rest of options as you wish.
9.- Test the product in some posts.
10.- If you wish to add a button in the advanced editor toolbar for this mod, you can add it using the admin cp section Custom BB Codes (write anything you want in Replacement, this mod will overwrite it). You can use the tex.gif file included in this post (but you can't modify it, sorry, It's not made by me).
Planned features
- Drop down menu with the most used LaTeX commands in the advanced editor.
- Improve error handling (prevent PHP errors if writting permissions are not set correctly).
Disclaimer
This mod is in beta phase, if you find bugs, please tell me how to reproduce them so I can improve it. It is distributed as is, with the hope that it is useful for someone, but without any warranty. Nor will I accept any responsibility or liability if it doesn't work as expected, or even if it breaks something.
This mod is mainly developed for personal usage. I will listen to good ideas, but I can't guaranty that I will be implemented requested features.
License
This mod is distributed under the LGPL.(http://www.gnu.org/copyleft/lesser.html). As is, you can freely distribute it or any derivative work provided that: 1) you acknowledge the work of the previous coders (like myself and Zeiss), 2) you release it under the same license (or GPL).
The editor button tex.gif file is property of my moderator movsia, who gives you permission to use it for any purpose, but not to modify it.
Acknowledgments
This mod (in particular, the class_vlatex.php file) is strongly based on the LatexRender class by Benjamin Zeiss (http://www.mayer.dial.pipex.com/tex.htm).
The baseline hack by the work of Maarten Sneep (http://mactextoolbox.sourceforge.net.../baseline.html).
History
2009 / 12 / 19 - First (beta) release
2009 / 12 / 20 - version 0.2
Fixed baseline problem of inline formulas in CMS articles.
Improved error handling.
Included spanish translation
|
|