source: extensions/Piwecard/maintain.inc.php @ 19923

Last change on this file since 19923 was 19732, checked in by julien1311, 11 years ago

Compatible 2.4 mais pas encore top...

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1<?php
2/*
3 * Plugin Name: Piwecard
4 * File :  maintain.inc.php 
5 */
6
7if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
8
9
10function plugin_install() {
11        global $prefixeTable, $conf;
12
13        $query = 'SHOW TABLES LIKE "' . $prefixeTable . 'ecard"';
14        $result = pwg_query($query);
15        if (!mysql_fetch_row($result)) {
16
17        // ecard description
18                $q = 'CREATE TABLE `' . $prefixeTable . 'ecard` (
19                                          `numero` CHAR(15) not null,
20                                          `nomexp` CHAR(100) not null,
21                                          `nomdest` CHAR(100) not null,
22                                          `adrexp` CHAR(100) not null,
23                                          `adrdest` CHAR(100) not null,
24                                          `sujet` CHAR(100) not null,
25                                          `message` TEXT not null,
26                                          `image` smallint(5) not null,
27                                          `date` datetime NOT NULL,
28                                          `duration` smallint(5) not null default 10,
29                                          PRIMARY KEY (`numero`),
30                                          UNIQUE (`numero`)
31                                        ) DEFAULT CHARSET=utf8;';
32                pwg_query($q);
33
34    $q = '
35    INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
36    VALUES ("ecard","","Configuration ecard")
37    ;';
38
39    pwg_query($q);
40        }
41}
42
43function plugin_activate() {
44 
45}
46
47function plugin_uninstall() {
48    global $prefixeTable;
49
50        $q = 'DROP TABLE ' . $prefixeTable . 'ecard;';
51    pwg_query($q);
52
53    $q = '
54      DELETE FROM '.CONFIG_TABLE.'
55      WHERE param="ecard" LIMIT 1
56    ;';
57    pwg_query($q);
58}
59?>
Note: See TracBrowser for help on using the repository browser.