Changeset 27042 for extensions/linked_pages/maintain.inc.php
- Timestamp:
- Jan 29, 2014, 9:31:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/linked_pages/maintain.inc.php
r17927 r27042 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 defined('LINKEDPAGES_ID') or define('LINKEDPAGES_ID', basename(dirname(__FILE__))); 5 include_once(PHPWG_PLUGINS_PATH . LINKEDPAGES_ID . '/include/install.inc.php'); 4 class linked_pages_maintain extends PluginMaintain 5 { 6 private $installed = false; 6 7 8 function install($plugin_version, &$errors=array()) 9 { 10 global $prefixeTable; 7 11 8 function plugin_install() 9 { 10 linked_pages_install(); 11 define('linked_pages_installed', true); 12 } 12 pwg_query(' 13 CREATE 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 ;'); 13 20 21 $this->installed = true; 22 } 14 23 15 function plugin_activate() 16 { 17 if (!defined('linked_pages_installed')) 24 function activate($plugin_version, &$errors=array()) 18 25 { 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`;'); 20 41 } 21 42 } 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.