diff --git a/main.inc.php b/main.inc.php index 31aa92f..d84451d 100644 --- a/main.inc.php +++ b/main.inc.php @@ -9,6 +9,19 @@ Has Settings: webmaster */ +defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); + +if (basename(dirname(__FILE__)) != 'lightbox') +{ + add_event_handler('init', 'lightbox_error'); + function lightbox_error() + { + global $page; + $page['errors'][] = 'Lightbox folder name is incorrect, uninstall the plugin and rename it to "lightbox"'; + } + return; +} + define('LIGHTBOX_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); add_event_handler('loc_end_index_thumbnails', 'lightbox_plugin', 40, 2); @@ -22,4 +35,4 @@ function lightbox_plugin($tpl_thumbnails_var, $pictures) if (script_basename() == 'admin') include(dirname(__FILE__).'/admin/functions.inc.php'); -?> \ No newline at end of file +?>