Changeset 7445 for extensions/Statistics/maintain.inc.php
- Timestamp:
- Oct 28, 2010, 12:19:44 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Statistics/maintain.inc.php
r3438 r7445 1 1 <?php 2 2 3 3 function plugin_activate() 4 { 5 $query = ' 6 SELECT 7 value 8 FROM '.CONFIG_TABLE.' 9 WHERE param=\'statistics\' 10 ;'; 11 $result = pwg_query($query); 12 if ($row = pwg_db_fetch_assoc($result)) 13 { 14 if (!preg_match('/^a:/', $row['value'])) 15 { 16 $old_conf = explode("," , $row['value']); 17 18 $conf_statistics = array( 19 'content' => $old_conf[2], 20 'header' => ($old_conf[0] == 'on'), 21 'tail' => ($old_conf[1] == 'on'), 22 'exclude_admin' => ($old_conf[3] == 'on'), 23 'exclude_guest' => ($old_conf[4] == 'on'), 24 ); 4 25 5 function plugin_install() 26 $query = ' 27 UPDATE '.CONFIG_TABLE.' 28 SET value = \''.pwg_db_real_escape_string(serialize($conf_statistics)).'\' 29 WHERE param=\'statistics\' 30 ;'; 31 pwg_query($query); 32 } 33 } 34 } 6 35 7 { 36 function plugin_install() 37 { 38 $conf_statistics = array( 39 'content' => '', 40 'header' => false, 41 'tail' => true, 42 'exclude_admin' => false, 43 'exclude_guest' => false, 44 ); 45 46 $query = ' 47 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 48 VALUES ( 49 \'statistics\', 50 \''.pwg_db_real_escape_string(serialize($conf_statistics)).'\', 51 \'Parameters of Statistics plugin\' 52 ) 53 ;'; 54 pwg_query($query); 55 } 8 56 9 global $prefixeTable; 10 11 $q = ' 12 13 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 14 15 VALUES ("statistics","off,on, ,off,off","Parameters of Statistics plugin"); 16 17 '; 18 19 20 21 pwg_query($q); 22 23 24 25 } 26 27 28 29 function plugin_uninstall() 30 31 { 32 33 global $prefixeTable; 34 35 $q = ' 36 37 DELETE FROM '.CONFIG_TABLE.' 38 39 WHERE param="statistics" LIMIT 1; 40 41 '; 42 43 44 45 pwg_query($q); 46 47 48 49 } 50 57 function plugin_uninstall() 58 { 59 $query = ' 60 DELETE FROM '.CONFIG_TABLE.' 61 WHERE param=\'statistics\' 62 ;'; 63 pwg_query($query); 64 } 51 65 ?>
Note: See TracChangeset
for help on using the changeset viewer.