plugins/calendar/sql/mysql_install.php
author Dirk Haun <dirk@haun-online.de>
Sat, 07 Nov 2009 18:45:37 +0100
branchHEAD
changeset 7454 b52c72b9844c
parent 7344 3e03947c0624
child 7568 07c5fd64f7ea
permissions -rw-r--r--
Set the default blockorder in steps of 10 and ensure that the blocks provided by the Calendar and Polls plugins are the last block on either side
     1 <?php
     2 
     3 /* Reminder: always indent with 4 spaces (no tabs). */
     4 // +---------------------------------------------------------------------------+
     5 // | Calendar Plugin 1.1                                                       |
     6 // +---------------------------------------------------------------------------+
     7 // | mysql_install.php                                                         |
     8 // +---------------------------------------------------------------------------+
     9 // | Copyright (C) 2000-2009 by the following authors:                         |
    10 // |                                                                           |
    11 // | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
    12 // |          Mark Limburg      - mlimburg AT users DOT sourceforge DOT net    |
    13 // |          Jason Whittenburg - jwhitten AT securitygeeks DOT com            |
    14 // |          Dirk Haun         - dirk AT haun-online DOT de                   |
    15 // |          Trinity Bays      - trinity93 AT gmail DOT com                   |
    16 // +---------------------------------------------------------------------------+
    17 // |                                                                           |
    18 // | This program is licensed under the terms of the GNU General Public License|
    19 // | as published by the Free Software Foundation; either version 2            |
    20 // | of the License, or (at your option) any later version.                    |
    21 // |                                                                           |
    22 // | This program is distributed in the hope that it will be useful,           |
    23 // | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
    24 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                      |
    25 // | See the GNU General Public License for more details.                      |
    26 // |                                                                           |
    27 // | You should have received a copy of the GNU General Public License         |
    28 // | along with this program; if not, write to the Free Software Foundation,   |
    29 // | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
    30 // |                                                                           |
    31 // +---------------------------------------------------------------------------+
    32 
    33 $_SQL[] = "
    34 CREATE TABLE {$_TABLES['events']} (
    35   eid varchar(20) NOT NULL default '',
    36   title varchar(128) default NULL,
    37   description text,
    38   postmode varchar(10) NOT NULL default 'plaintext',
    39   datestart date default NULL,
    40   dateend date default NULL,
    41   url varchar(255) default NULL,
    42   hits mediumint(8) unsigned NOT NULL default '0',
    43   owner_id mediumint(8) unsigned NOT NULL default '1',
    44   group_id mediumint(8) unsigned NOT NULL default '1',
    45   perm_owner tinyint(1) unsigned NOT NULL default '3',
    46   perm_group tinyint(1) unsigned NOT NULL default '3',
    47   perm_members tinyint(1) unsigned NOT NULL default '2',
    48   perm_anon tinyint(1) unsigned NOT NULL default '2',
    49   address1 varchar(40) default NULL,
    50   address2 varchar(40) default NULL,
    51   city varchar(60) default NULL,
    52   state varchar(40) default NULL,
    53   zipcode varchar(5) default NULL,
    54   allday tinyint(1) NOT NULL default '0',
    55   event_type varchar(40) NOT NULL default '',
    56   location varchar(128) default NULL,
    57   timestart time default NULL,
    58   timeend time default NULL,
    59   INDEX events_eid(eid),
    60   INDEX events_event_type(event_type),
    61   INDEX events_datestart(datestart),
    62   INDEX events_dateend(dateend),
    63   PRIMARY KEY  (eid)
    64 ) TYPE=MyISAM
    65 ";
    66 
    67 $_SQL[] = "
    68 CREATE TABLE {$_TABLES['eventsubmission']} (
    69   eid varchar(20) NOT NULL default '',
    70   title varchar(128) default NULL,
    71   description text,
    72   location varchar(128) default NULL,
    73   datestart date default NULL,
    74   dateend date default NULL,
    75   url varchar(255) default NULL,
    76   allday tinyint(1) NOT NULL default '0',
    77   zipcode varchar(5) default NULL,
    78   state varchar(40) default NULL,
    79   city varchar(60) default NULL,
    80   address2 varchar(40) default NULL,
    81   address1 varchar(40) default NULL,
    82   event_type varchar(40) NOT NULL default '',
    83   timestart time default NULL,
    84   timeend time default NULL,
    85   owner_id mediumint(8) unsigned NOT NULL default '1',
    86   PRIMARY KEY  (eid)
    87 ) TYPE=MyISAM
    88 ";
    89 
    90 $_SQL[] = "
    91 CREATE TABLE {$_TABLES['personal_events']} (
    92   eid varchar(20) NOT NULL default '',
    93   title varchar(128) default NULL,
    94   event_type varchar(40) NOT NULL default '',
    95   datestart date default NULL,
    96   dateend date default NULL,
    97   address1 varchar(40) default NULL,
    98   address2 varchar(40) default NULL,
    99   city varchar(60) default NULL,
   100   state varchar(40) default NULL,
   101   zipcode varchar(5) default NULL,
   102   allday tinyint(1) NOT NULL default '0',
   103   url varchar(255) default NULL,
   104   description text,
   105   postmode varchar(10) NOT NULL default 'plaintext',
   106   owner_id mediumint(8) unsigned NOT NULL default '1',
   107   group_id mediumint(8) unsigned NOT NULL default '1',
   108   perm_owner tinyint(1) unsigned NOT NULL default '3',
   109   perm_group tinyint(1) unsigned NOT NULL default '3',
   110   perm_members tinyint(1) unsigned NOT NULL default '2',
   111   perm_anon tinyint(1) unsigned NOT NULL default '2',
   112   uid mediumint(8) NOT NULL default '0',
   113   location varchar(128) default NULL,
   114   timestart time default NULL,
   115   timeend time default NULL,
   116   PRIMARY KEY  (eid,uid)
   117 ) TYPE=MyISAM
   118 ";
   119 
   120 $_SQL[] = "INSERT INTO {$_TABLES['eventsubmission']} (eid, title, description, location, datestart, dateend, url, allday, zipcode, state, city, address2, address1, event_type, timestart, timeend, owner_id) VALUES ('2008050110130162','Installed the Calendar plugin','Today, you successfully installed the Calendar plugin.','Your webserver',CURDATE(),CURDATE(),'http://www.geeklog.net/',1,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,1)";
   121 
   122 $_SQL[] = "INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, tid, blockorder, content, onleft, phpblockfn, owner_id, group_id, perm_owner, perm_group) VALUES (1,'events_block','phpblock','Events','all',100,'',1,'phpblock_calendar',{$_USER['uid']},#group#,3,3)";
   123 
   124 ?>