Line | |
---|
1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | function plugin_install() { |
---|
5 | global $prefixeTable; |
---|
6 | |
---|
7 | pwg_query("CREATE TABLE `" . $prefixeTable . "image_verso` ( |
---|
8 | `image_id` mediumint(8) unsigned NOT NULL DEFAULT '0', |
---|
9 | `verso_id` smallint(8) unsigned NOT NULL DEFAULT '0', |
---|
10 | `old_level` tinyint unsigned NOT NULL DEFAULT '0', |
---|
11 | PRIMARY KEY (`image_id`,`verso_id`) |
---|
12 | ) DEFAULT CHARSET=utf8;"); |
---|
13 | } |
---|
14 | |
---|
15 | function plugin_activate(){ |
---|
16 | global $conf, $prefixeTable; |
---|
17 | |
---|
18 | } |
---|
19 | |
---|
20 | function plugin_uninstall() { |
---|
21 | global $prefixeTable; |
---|
22 | |
---|
23 | $query = "SELECT * FROM `" . $prefixeTable . "image_verso`;"; |
---|
24 | $result = pwg_query($query); |
---|
25 | while ($item = pwg_db_fetch_assoc($result)) |
---|
26 | { |
---|
27 | pwg_query("UPDATE ".IMAGES_TABLE." SET level = ".$item['old_level']." WHERE id = ".$item['verso_id'].";"); |
---|
28 | } |
---|
29 | |
---|
30 | pwg_query("DROP TABLE `" . $prefixeTable . "image_verso`;"); |
---|
31 | } |
---|
32 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.