What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Nov 30, 2007 by lukescammell
Labels: Extension, Phase-Deploy, Featured
LowCalVanilla  

Low-Cal Vanilla

Installation

In order for Vanilla to recognize an extension, it must be contained within it's own directory within the extensions directory. So, once you have downloaded and unzipped the extension files, you can then place the folder containing the default.php file into your installation of Vanilla. The path to your extension's default.php file should look like this:

/path/to/vanilla/extensions/LowCalVanilla/default.php

Once this is complete, you can enable the extension through the "Manage Extensions" form on the settings tab in Vanilla.

To serve your compressed version of JavaScript files, you also need to copy .htaccess from LowCalVanilla/htaccess to the root folder of your forum

NB: you should check that your server doesn't already compress your pages before enabling this extension.

Settings:

// Enable/disable gzip content when possible:
$Configuration['LOWCALVANILLA_GZIP_ALLOWED']	= '1';

// Enable/disable gzip content when possible:
$Configuration['LOWCALVANILLA_PACKER_ENABLE']	= '1';

// Seconds before browser check for a new version of a js file:
$Configuration['LOWCALVANILLA_EXPIRE']		= '30758400';

// Version of the extension (last version that required Configuration changes):
// Changing it will force the browser to download again the packed files.
$Configuration['LOWCALVANILLA_VERSION']		= '0.4.0';

// Path to the cache directory:
// The extension will not delete outdated cache version of the packed files
// (Should be added in version 0.5.0).
$Configuration['LOWCALVANILLA_CACHE_DIR']	= '/path/to/vanilla/extensions/LowCalVanilla/cache/';


// Path to Low-Cal Vanilla utilities:
// Used by developers to add their scripts to the packer.
$Configuration['LOWCALVANILLA_TOOLS_PATH']	= '/path/to/vanilla/extensions/LowCalVanilla/tools/utilities.php';

Low-Cal Vanilla developer utilities:

Example:

// Check the Low-Cal Vanilla is installed
if ($Configuration['LOWCALVANILLA_TOOLS_PATH']) {
	// Include Low-Cal Vanilla.
	// Important: Use require_once or include_once to not load it again if it is already done.
	require_once($Configuration['LOWCALVANILLA_TOOLS_PATH']);

	// Add your script
	LowCalVanilla_AddScript($Context, $Head, 'extensions/MyExtension/script.js');

	// Add a library
	// Use the position argument (300 by default) to be sure it will be added first
	LowCalVanilla_AddScript($Context, $Head, 'extensions/MyExtension/jQuery-min.js', 100);
} else {
	$Head->AddScript('extensions/MyExtension/jQuery-min.js');
	$Head->AddScript('extensions/MyExtension/script.js');
}

You do not need to use any special method to add prototype or any other core files to the packer!!!

Development

Developers

Damien Lebrun (aka Dinoboff - lead developer).

How to help

You can report bugs - and submit patch - on the Vanilla Forum or with the issue tracker


Sign in to add a comment