Ignore:
Timestamp:
Jan 29, 2014, 9:31:33 PM (10 years ago)
Author:
mistic100
Message:

update for Piwigo 2.6 + use underscore for admin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/linked_pages/maintain.inc.php

    r17927 r27042  
    11<?php
    2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    33
    4 defined('LINKEDPAGES_ID') or define('LINKEDPAGES_ID', basename(dirname(__FILE__)));
    5 include_once(PHPWG_PLUGINS_PATH . LINKEDPAGES_ID . '/include/install.inc.php');
     4class linked_pages_maintain extends PluginMaintain
     5{
     6  private $installed = false;
    67
     8  function install($plugin_version, &$errors=array())
     9  {
     10    global $prefixeTable;
    711
    8 function plugin_install()
    9 {
    10   linked_pages_install();
    11   define('linked_pages_installed', true);
    12 }
     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;');
    1320
     21    $this->installed = true;
     22  }
    1423
    15 function plugin_activate()
    16 {
    17   if (!defined('linked_pages_installed'))
     24  function activate($plugin_version, &$errors=array())
    1825  {
    19     linked_pages_install();
     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`;');
    2041  }
    2142}
    22 
    23 
    24 function plugin_uninstall()
    25 {
    26   global $prefixeTable;
    27  
    28   pwg_query('DROP TABLE `'.$prefixeTable.'linked_pages`;');
    29 }
    30 
    31 ?>
Note: See TracChangeset for help on using the changeset viewer.