-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.inc.php
More file actions
42 lines (35 loc) · 1.43 KB
/
Copy pathmain.inc.php
File metadata and controls
42 lines (35 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/*
Version: auto
Plugin Name: Example plugin
Plugin URI: auto
Author: Linty
Author URI: https://github.com/LintyDev
Description: Piwigo plugin starter
Has Settings: true
*/
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
// check root directory
if (basename(dirname(__FILE__)) != 'example_plugin')
{
add_event_handler('init', 'example_plugin_error');
function example_plugin_error()
{
global $page;
$page['errors'][] = 'Example plugin folder name is incorrect, uninstall the plugin and rename it to "example_plugin"';
}
return;
}
// +-----------------------------------------------------------------------+
// | Define plugin constants |
// +-----------------------------------------------------------------------+
global $prefixeTable;
define('EXAMPLE_PLUGIN_ID', basename(dirname(__FILE__)));
define('EXAMPLE_PLUGIN_PATH', PHPWG_PLUGINS_PATH . EXAMPLE_PLUGIN_ID . '/');
define('EXAMPLE_PLUGIN_REALPATH', realpath(EXAMPLE_PLUGIN_PATH));
define('EXAMPLE_PLUGIN_ADMIN', get_root_url() . 'admin.php?page=plugin-' . EXAMPLE_PLUGIN_ID);
// +-----------------------------------------------------------------------+
// | Init Example Plugin |
// +-----------------------------------------------------------------------+
include_once(EXAMPLE_PLUGIN_PATH . 'include/functions.inc.php');
add_event_handler('init', 'example_plugin_init');