source: extensions/header_manager/include/install.inc.php @ 17644

Last change on this file since 17644 was 17644, checked in by mistic100, 12 years ago

improve upgrade process (for manual upgrades and piwigo.com upgrades)
improve delete button visibility

File size: 917 bytes
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4function 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',
15      'display' => 'image_only'
16      ));
17   
18    conf_update_param('header_manager', $header_manager_default_config);
19  }
20
21  // banners directory
22  if (!file_exists(PWG_LOCAL_DIR . 'banners/')) 
23  {
24    mkdir(PWG_LOCAL_DIR . 'banners/', 0755);
25  }
26
27  // banners table
28  $query = '
29CREATE TABLE IF NOT EXISTS `' .$prefixeTable . 'category_banner` (
30  `category_id` smallint(5) unsigned NOT NULL,
31  `image` varchar(255) NOT NULL,
32  `deep` tinyint(1) DEFAULT 1,
33  PRIMARY KEY (`category_id`)
34) ENGINE=MyISAM DEFAULT CHARSET=utf8
35;';
36  pwg_query($query);
37}
38
39?>
Note: See TracBrowser for help on using the repository browser.