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

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

[piwecard] modify ecard with new variables + replace table by div/span and css

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