Ignore:
Timestamp:
07/28/09 21:33:06 (10 years ago)
Author:
vdigital
Message:

Minor release: 2009-07-28 2.0.j

Minor changes in Config management
Additionnal flags (Ireland, Armenia, Estonia, Kazakhstan, Belarus,
Andorra, Turkey, Albania, Bosnia and Herzegovina, Azerbaijan, Iceland, European Union,
Israel, Morocco, New Caledonia and some other revised)
Search Engine trapping

File:
1 edited

Legend:

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

    r3319 r3695  
    88function plugin_activate() 
    99{ 
    10         global $user; 
     10        global $user,$conf; 
    1111        $query = "CREATE TABLE IF NOT EXISTS ". WHOIS_ONLINE_TABLE ." ( 
    12   `IP` varchar(39) NOT NULL default '', 
    13   `hidden_IP` enum('true','false') NOT NULL default 'false', 
     12  `IP` varchar(39) NOT NULL DEFAULT '', 
     13  `hidden_IP` enum('true','false') NOT NULL DEFAULT 'false', 
    1414  `session_id` varchar(40) NOT NULL, 
    15   `user_id` smallint(5) NOT NULL default '0', 
    16   `username` varchar(100) character set utf8 collate utf8_bin NOT NULL default '', 
    17   `lang` char(2) character set utf8 collate utf8_bin NOT NULL default 'en', 
    18   `country` VARCHAR( 256 ) NOT NULL default '', 
    19   `permanent` enum('true','false') NOT NULL default 'false', 
    20   `last_access` varchar(12) NOT NULL default '', 
    21   `last_elm_ids` varchar(75) NOT NULL default '', 
    22   `last_cat_ids` varchar(75) NOT NULL default '', 
    23   `last_tag_ids` varchar(75) NOT NULL default '', 
    24   `last_sch_ids` varchar(75) NOT NULL default '', 
    25   `first_access_date` varchar(45) NOT NULL default '', 
    26   `last_dates` varchar(110) character set utf8 collate utf8_bin NOT NULL default '', 
    27   `elm_hits` int(10) unsigned NOT NULL default '0', 
    28   `pag_hits` int(10) unsigned NOT NULL default '0', 
    29   `db_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, 
     15  `user_id` smallint(5) NOT NULL DEFAULT '0', 
     16  `username` varchar(100) character set utf8 collate utf8_bin NOT NULL DEFAULT '', 
     17  `lang` char(2) character set utf8 collate utf8_bin NOT NULL DEFAULT 'en', 
     18  `country` VARCHAR( 256 ) NOT NULL DEFAULT '', 
     19  `user_agent` VARCHAR( 160 ) NOT NULL DEFAULT '', 
     20  `any_previous` VARCHAR( 256 ) NOT NULL DEFAULT '', 
     21  `same_previous` VARCHAR( 256 ) NOT NULL DEFAULT '', 
     22  `permanent` enum('true','false') NOT NULL DEFAULT 'false', 
     23  `last_access` varchar(12) NOT NULL DEFAULT '', 
     24  `last_elm_ids` varchar(75) NOT NULL DEFAULT '', 
     25  `last_cat_ids` varchar(75) NOT NULL DEFAULT '', 
     26  `last_tag_ids` varchar(75) NOT NULL DEFAULT '', 
     27  `last_sch_ids` varchar(75) NOT NULL DEFAULT '', 
     28  `first_access_date` varchar(45) NOT NULL DEFAULT '', 
     29  `last_dates` varchar(110) character set utf8 collate utf8_bin NOT NULL DEFAULT '', 
     30  `elm_hits` int(10) unsigned NOT NULL DEFAULT '0', 
     31  `pag_hits` int(10) unsigned NOT NULL DEFAULT '0', 
     32  `db_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, 
    3033  PRIMARY KEY  (`session_id`) 
    3134) ENGINE=MyISAM  DEFAULT CHARSET=utf8; 
    3235"; 
    3336        $result = pwg_query($query); 
    34         if (isset($conf['Whois Online'])) { 
    35                 $conf_whois = unserialize($conf['Whois Online']); 
    36                 if (!isset($conf_whois['Active'])) $conf_whois['Active'] = true; 
    37                 if (!isset($conf_whois['Delete level'])) $conf_whois['Delete level'] = 20; 
    38                 if (!isset($conf_whois['Radar limit'])) $conf_whois['Radar limit'] = 25; 
    39                 if (!isset($conf_whois['Webmasters'])) $conf_whois['Webmasters'] = 2; 
    40                 if (!isset($conf_whois['Administrators'])) $conf_whois['Administrators'] = 2; 
    41                 if (!isset($conf_whois['Obsolete limit'])) $conf_whois['Obsolete limit'] = 20; 
    42                 if (!isset($conf_whois['Add to Plugins menu'])) $conf_whois['Add to Plugins menu'] = false; 
    43                 if (!isset($conf_whois['Add icon to History'])) $conf_whois['Add icon to History'] = true; 
    44                 if (!isset($conf_whois['Keep data'])) $conf_whois['Keep data'] = true; 
    45                 if (!isset($conf_whois['Default display'])) $conf_whois['Default display'] = true; 
    46                 if (!isset($conf_whois['Search id'])) $conf_whois['Search id'] = 0; 
    47                 if (!isset($conf_whois['Users']))  
    48                         $conf_whois['Users'] = Array('max' => 0, 'When' => date('Y-m-d'), 'count' => 0); 
    49                 $conf['Whois Online'] = serialize($conf_whois); 
     37        if (!isset($conf['Whois Online'])) { 
     38                $conf['Whois Online'] = serialize(Array()); 
     39                pwg_query('REPLACE INTO ' . CONFIG_TABLE . " (param,value,comment) 
     40                VALUES ('Whois Online','". $conf['Whois Online'] ."','Whois Online configuration');"); 
    5041        } 
    51         else { 
    52                 $conf['Whois Online'] = serialize(Array( 
    53                         'Active' => true, 
    54                         'Delete level' => 20, 
    55                         'Radar limit' => 25, 
    56                         'Obsolete limit' => 20, 
    57                         'Webmasters' => 2, 
    58                         'Administrators' => 2, 
    59                         'Search id' => 0, 
    60                         'Users' => Array('max' => 0, 'When' => date('Y-m-d'), 'count' => 0), 
    61                         'Add to Plugins menu' => false, 
    62                         'Add icon to History' => true, 
    63                         'Keep data' => true, 
    64                         'Default display' => true, 
    65                 )); 
    66         } 
    67         pwg_query('REPLACE INTO ' . CONFIG_TABLE . " (param,value,comment) 
    68         VALUES ('Whois Online','". $conf['Whois Online'] ."','Whois Online configuration');"); 
    69         $conf_whois = unserialize($conf['Whois Online']); 
    7042        if (isset($conf_whois['Keep data']) and !$conf_whois['Keep data']) { 
    7143                pwg_query('DELETE FROM ' . WHOIS_ONLINE_TABLE); 
Note: See TracChangeset for help on using the changeset viewer.