Ignore:
Timestamp:
02/26/11 16:28:24 (9 years ago)
Author:
patdenice
Message:

Add display option. Optimizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/admin/upgrade.inc.php

    r9369 r9383  
    9292  $query = 'ALTER TABLE ' . $prefixeTable . 'stuffs 
    9393CHANGE `type` `path` VARCHAR( 255 ) NULL DEFAULT NULL, 
    94 ADD `parent` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `path` 
     94ADD `parent` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `path`, 
     95ADD `level` TINYINT( 3 ) NOT NULL default "0" AFTER `groups`, 
     96ADD `on_root` enum(\'true\',\'false\') NOT NULL AFTER `on_home` 
     97;'; 
     98  pwg_query($query); 
     99 
     100  $query = 'UPDATE ' . $prefixeTable . 'stuffs 
     101SET on_root = "false" 
     102WHERE on_cats = "false" 
    95103;'; 
    96104  pwg_query($query); 
     
    107115;'; 
    108116  pwg_query($query); 
     117 
     118  $conf['Stuffs'] = array('level_perm' => false); 
     119 
     120  $query = 'SELECT id 
     121FROM '.$prefixeTable.'stuffs 
     122WHERE users <> "guest,generic,normal,admin,webmaster" 
     123;'; 
     124  $ids = array_from_query($query, 'id'); 
     125  $conf['Stuffs']['user_perm'] = !empty($ids); 
     126 
     127  $query = 'SELECT id 
     128FROM '.$prefixeTable.'stuffs 
     129WHERE groups IS NOT NULL 
     130;'; 
     131  $ids = array_from_query($query, 'id'); 
     132  $conf['Stuffs']['group_perm'] = !empty($ids); 
     133 
     134  $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 
     135VALUES ("PWG_Stuffs" , "'.pwg_db_real_escape_string(serialize($conf['Stuffs'])).'" , "PWG Stuffs configuration");'; 
     136  pwg_query($query);   
    109137} 
    110138 
    111 $query = ' 
    112 UPDATE ' . PLUGINS_TABLE . ' 
    113 SET version=\''.STUFFS_VERSION.'\' 
    114 WHERE id=\'PWG_Stuffs\''; 
    115 pwg_query($query); 
    116  
    117139?> 
Note: See TracChangeset for help on using the changeset viewer.