Rev | Line | |
---|
[15854] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | define('HEADER_MANAGER_DIR', PWG_LOCAL_DIR . 'banners/'); |
---|
| 5 | |
---|
| 6 | define( |
---|
| 7 | 'header_manager_default_config', |
---|
| 8 | serialize(array( |
---|
| 9 | 'width' => 1000, |
---|
| 10 | 'height' => 150, |
---|
| 11 | 'image' => 'random', |
---|
| 12 | 'display' => 'image_only' |
---|
| 13 | )) |
---|
| 14 | ); |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | function plugin_install() |
---|
| 18 | { |
---|
| 19 | conf_update_param('header_manager', header_manager_default_config); |
---|
| 20 | mkdir(HEADER_MANAGER_DIR, 0755); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | function plugin_activate() |
---|
| 24 | { |
---|
| 25 | global $conf; |
---|
| 26 | |
---|
| 27 | if (empty($conf['header_manager'])) |
---|
| 28 | { |
---|
| 29 | conf_update_param('header_manager', header_manager_default_config); |
---|
| 30 | } |
---|
| 31 | if (!file_exists(HEADER_MANAGER_DIR)) |
---|
| 32 | { |
---|
| 33 | mkdir(HEADER_MANAGER_DIR, 0755); |
---|
| 34 | } |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | function plugin_uninstall() |
---|
| 38 | { |
---|
| 39 | pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "header_manager" LIMIT 1;'); |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.