[17655] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | function header_manager_install() |
---|
| 5 | { |
---|
| 6 | global $conf, $prefixeTable; |
---|
| 7 | |
---|
| 8 | // configuration |
---|
| 9 | if (empty($conf['header_manager'])) |
---|
| 10 | { |
---|
| 11 | $header_manager_default_config = serialize(array( |
---|
| 12 | 'width' => 1000, |
---|
| 13 | 'height' => 150, |
---|
| 14 | 'image' => 'random', |
---|
[17734] | 15 | 'display' => 'image_only', |
---|
| 16 | 'banner_on_picture' => true, |
---|
[17655] | 17 | )); |
---|
| 18 | |
---|
| 19 | conf_update_param('header_manager', $header_manager_default_config); |
---|
| 20 | $conf['header_manager'] = $header_manager_default_config; |
---|
| 21 | } |
---|
[17734] | 22 | else |
---|
| 23 | { |
---|
[18474] | 24 | $new_conf = is_string($conf['header_manager']) ? unserialize($conf['header_manager']) : $conf['header_manager']; |
---|
[17734] | 25 | if (!isset($new_conf['banner_on_picture'])) |
---|
| 26 | { |
---|
| 27 | $new_conf['banner_on_picture'] = true; |
---|
| 28 | $conf['header_manager'] = serialize($new_conf); |
---|
| 29 | conf_update_param('header_manager', $conf['header_manager']); |
---|
| 30 | } |
---|
| 31 | } |
---|
[17655] | 32 | |
---|
| 33 | // banners directory |
---|
[19841] | 34 | if (!file_exists(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners/')) |
---|
[17655] | 35 | { |
---|
[19841] | 36 | mkdir(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners/', 0755); |
---|
[17655] | 37 | } |
---|
| 38 | |
---|
| 39 | // banners table |
---|
| 40 | $query = ' |
---|
| 41 | CREATE TABLE IF NOT EXISTS `' .$prefixeTable . 'category_banner` ( |
---|
| 42 | `category_id` smallint(5) unsigned NOT NULL, |
---|
| 43 | `image` varchar(255) NOT NULL, |
---|
| 44 | `deep` tinyint(1) DEFAULT 1, |
---|
| 45 | PRIMARY KEY (`category_id`) |
---|
| 46 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
---|
| 47 | ;'; |
---|
| 48 | pwg_query($query); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | ?> |
---|