source: extensions/linked_pages/maintain.inc.php @ 28772

Last change on this file since 28772 was 27042, checked in by mistic100, 11 years ago

update for Piwigo 2.6 + use underscore for admin

File size: 871 bytes
Line 
1<?php
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4class linked_pages_maintain extends PluginMaintain
5{
6  private $installed = false;
7
8  function install($plugin_version, &$errors=array())
9  {
10    global $prefixeTable;
11
12    pwg_query('
13CREATE TABLE IF NOT EXISTS `'.$prefixeTable.'linked_pages` (
14  `page_id` smallint(5) unsigned NOT NULL,
15  `category_id` smallint(5) unsigned NOT NULL,
16  `pos` smallint(5) unsigned NOT NULL,
17  UNIQUE KEY `UNIQUE`(`page_id`,`category_id`)
18) ENGINE=MyISAM DEFAULT CHARSET=utf8
19;');
20
21    $this->installed = true;
22  }
23
24  function activate($plugin_version, &$errors=array())
25  {
26    if (!$this->installed)
27    {
28      $this->install($plugin_version, $errors);
29    }
30  }
31
32  function deactivate()
33  {
34  }
35
36  function uninstall()
37  {
38    global $prefixeTable;
39   
40    pwg_query('DROP TABLE `'.$prefixeTable.'linked_pages`;');
41  }
42}
Note: See TracBrowser for help on using the repository browser.