Changeset 23037 for extensions/community/maintain.inc.php
- Timestamp:
- Jun 4, 2013, 12:55:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/maintain.inc.php
r21289 r23037 1 1 <?php 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 2 3 3 4 if (!defined("COMMUNITY_PATH")) … … 6 7 } 7 8 9 include_once(COMMUNITY_PATH.'/include/install.inc.php'); 10 8 11 function plugin_install() 9 12 { 10 global $conf, $prefixeTable; 11 12 $query = ' 13 CREATE TABLE '.$prefixeTable.'community_permissions ( 14 id int(11) NOT NULL AUTO_INCREMENT, 15 type varchar(255) NOT NULL, 16 group_id smallint(5) unsigned DEFAULT NULL, 17 user_id smallint(5) DEFAULT NULL, 18 category_id smallint(5) unsigned DEFAULT NULL, 19 recursive enum(\'true\',\'false\') NOT NULL DEFAULT \'true\', 20 create_subcategories enum(\'true\',\'false\') NOT NULL DEFAULT \'false\', 21 moderated enum(\'true\',\'false\') NOT NULL DEFAULT \'true\', 22 PRIMARY KEY (id) 23 ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 24 ;'; 25 pwg_query($query); 26 27 $query = ' 28 CREATE TABLE '.$prefixeTable.'community_pendings ( 29 image_id mediumint(8) unsigned NOT NULL, 30 state varchar(255) NOT NULL, 31 added_on datetime NOT NULL, 32 validated_by smallint(5) DEFAULT NULL 33 ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 34 ;'; 35 pwg_query($query); 13 community_install(); 14 define('community_installed', true); 36 15 } 37 16 … … 50 29 { 51 30 global $prefixeTable; 52 53 $are_new_tables_installed = false; 54 55 $query = 'SHOW TABLES;'; 56 $result = pwg_query($query); 57 while ($row = pwg_db_fetch_row($result)) 58 { 59 if ($prefixeTable.'community_permissions' == $row[0]) 60 { 61 $are_new_tables_installed = true; 62 } 63 } 64 65 if (!$are_new_tables_installed) 66 { 67 plugin_install(); 31 32 if (!defined('community_installed')) // a plugin is activated just after its installation 33 { 34 community_install(); 68 35 } 69 36
Note: See TracChangeset
for help on using the changeset viewer.