Gallery2:Modules:refine - Gallery Codex
Personal tools

Gallery2:Modules:refine

From Gallery Codex

HTML Refine Module
Refines Gallery2 HTML output and caches the result if required
Author: Dayo Akanji
Download the module files here.
Visit the Support Site for enquiries and support requests.

Description

  • This module allows the Administrator to refine Gallery2 HTML output (strip out white space, prettify or minify).
  • It is derived from work done for gallery3 by Niklas Dougherty as set out in this forum post
  • Niklas Dougherty's work was based on the WP-Beautify plugin for wordpress by Till Krüss

Requirements

  • Gallery2 (v2.3.0 and above)

Installation

The package contains two zip files: refine.zip and events.zip. The installation steps required are:

  • Unpack events.zip into the gallery2 "lib" folder

Around Line 100 of gallery2/main.php is ...

function GalleryMain($embedded=false) {

global $gallery;


Add the following lines after:

/* Added Event: BeforeProcess */
include(dirname(__FILE__) . '/lib/events/Gallery_BeforeProcess.event');

Around Line 530 of gallery2/main.php is ...

/*
* Session: Find out whether we need to send a cookie & need a new session (only if
* we don't have one yet)
*/
$session =& $gallery->getSession();
$ret = $session->start();
if ($ret) {
return array($ret, null);
}


Add the following lines after:

/* Added Event: BeforeOutput */
include(dirname(__FILE__) . '/lib/events/Gallery_BeforeOutput.event');

  • Unpack refine.zip into the Gallery2 modules folder.
  • Install, configure and activate in the admin interface.

Notes

  • This module cannot be activated if either the JoomG2 or G2Drupal modules are active