User Tools

Site Tools


plugins:tips

This is an old revision of the document!


Tips & Tricks for Developers

Determining the GetSimple Version

Determining the GetSimple version is not as straight forward as it could be, as the only available function in 2.03 - return_site_ver() - outputs the version in 2.03 and returns it in 3.0b (deprecated here). The easiest way to find out, if a plugin is installed on GetSimple 2.03 or 3.0+ seems to be

$isV3 = function_exists('get_site_version');

The probably most correct one is (only use within function, in order not to pollute the global name space!)

include(GSADMININCPATH.'configuration.php');
$version = GSVERSION;

Working around the Lack of a Page-Delete Hook in 2.03

To trigger a function myplugin_function on page deletes in GetSimple 2.03 and 3.0+ use the following code:

// GetSimple 3.0+
add_action('page-delete', 'myplugin_function'); 

// GetSimple 2.03
if (!function_exists('get_site_version') && basename($_SERVER['PHP_SELF']) == 'deletefile.php') {
  myplugin_function();
}
plugins/tips.1300619910.txt.gz · Last modified: 2013/04/19 14:57 (external edit)