Skip to content

Commit

Permalink
make sure plugin directory is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
plegall committed Mar 25, 2024
1 parent 78eca2a commit cef7165
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion main.inc.php
Expand Up @@ -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);
Expand All @@ -22,4 +35,4 @@ function lightbox_plugin($tpl_thumbnails_var, $pictures)
if (script_basename() == 'admin')
include(dirname(__FILE__).'/admin/functions.inc.php');

?>
?>

0 comments on commit cef7165

Please sign in to comment.