Changeset 5546 for extensions/AStat
- Timestamp:
- Apr 1, 2010, 9:04:16 PM (14 years ago)
- Location:
- extensions/AStat
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/admin/plugin_admin.php
r3394 r5546 22 22 $main_plugin_object = get_plugin_data($plugin_id); 23 23 24 $plugin_ai = new AStat_AIP($prefixeTable, $main_plugin_object->get _filelocation());24 $plugin_ai = new AStat_AIP($prefixeTable, $main_plugin_object->getFileLocation()); 25 25 $plugin_ai->manage(); 26 26 -
extensions/AStat/astat_aim.class.inc.php
r5423 r5546 16 16 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } 17 17 18 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/common_plugin.class.inc.php');19 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/css.class.inc.php');20 21 class AStat_AIM extends common_plugin18 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php'); 20 21 class AStat_AIM extends CommonPlugin 22 22 { 23 23 protected $css = null; … … 25 25 function AStat_AIM($prefixeTable, $filelocation) 26 26 { 27 $this-> plugin_name="AStat.2";28 $this-> plugin_name_files="astat";27 $this->setPluginName("AStat.2"); 28 $this->setPluginNameFiles("astat"); 29 29 parent::__construct($prefixeTable, $filelocation); 30 $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css");30 $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css"); 31 31 } 32 32 … … 34 34 initialize events call for the plugin 35 35 */ 36 function init _events()37 { 38 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin _admin_menu') );36 function initEvents() 37 { 38 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') ); 39 39 } 40 40 … … 43 43 initialization of config properties 44 44 */ 45 function init _config()46 { 47 $this-> my_config=array(45 function initConfig() 46 { 47 $this->config=array( 48 48 'AStat_BarColor_Pages' => '6666ff', 49 49 'AStat_BarColor_Img' => '66ff66', … … 69 69 70 70 /* 71 surchage of common_plugin->save_config function72 */ 73 function load _config()74 { 75 parent::load _config();76 if(!$this->css-> css_file_exists())77 { 78 $this->css->make _CSS($this->generate_CSS());79 } 80 } 81 82 /* 83 surchage of common_plugin->save_config function84 */ 85 function save _config()86 { 87 if(parent::save _config())88 { 89 $this->css->make _CSS($this->generate_CSS());71 surchage of CommonPlugin->saveConfig function 72 */ 73 function loadConfig() 74 { 75 parent::loadConfig(); 76 if(!$this->css->fileExists()) 77 { 78 $this->css->makeCSS($this->generate_CSS()); 79 } 80 } 81 82 /* 83 surchage of CommonPlugin->saveConfig function 84 */ 85 function saveConfig() 86 { 87 if(parent::saveConfig()) 88 { 89 $this->css->makeCSS($this->generate_CSS()); 90 90 return(true); 91 91 } … … 114 114 padding:0px; 115 115 } 116 .AStatBar1 { background-color:#".$this-> my_config['AStat_BarColor_Pages']."; top:5px; }117 .AStatBar2 { background-color:#".$this-> my_config['AStat_BarColor_Img']."; top:-3px; }118 .AStatBar3 { background-color:#".$this-> my_config['AStat_BarColor_IP']."; top:-3px;}119 .AStatBar4 { background-color:#".$this-> my_config['AStat_BarColor_Cat']."; top:-3px;}116 .AStatBar1 { background-color:#".$this->config['AStat_BarColor_Pages']."; top:5px; } 117 .AStatBar2 { background-color:#".$this->config['AStat_BarColor_Img']."; top:-3px; } 118 .AStatBar3 { background-color:#".$this->config['AStat_BarColor_IP']."; top:-3px;} 119 .AStatBar4 { background-color:#".$this->config['AStat_BarColor_Cat']."; top:-3px;} 120 120 .AStatBarX { background-color:transparent; top:-3px; height:1px; } 121 .MiniSquare1 { color:#".$this-> my_config['AStat_BarColor_Pages']."; }122 .MiniSquare2 { color:#".$this-> my_config['AStat_BarColor_Img']."; }123 .MiniSquare3 { color:#".$this-> my_config['AStat_BarColor_IP']."; }124 .MiniSquare4 { color:#".$this-> my_config['AStat_BarColor_Cat']."; }125 .StatTableRow:hover { background-color:#".$this-> my_config['AStat_MouseOverColor']."; }121 .MiniSquare1 { color:#".$this->config['AStat_BarColor_Pages']."; } 122 .MiniSquare2 { color:#".$this->config['AStat_BarColor_Img']."; } 123 .MiniSquare3 { color:#".$this->config['AStat_BarColor_IP']."; } 124 .MiniSquare4 { color:#".$this->config['AStat_BarColor_Cat']."; } 125 .StatTableRow:hover { background-color:#".$this->config['AStat_MouseOverColor']."; } 126 126 .formtable, .formtable P { text-align:left; display:block; } 127 127 .formtable tr { vertical-align:top; } -
extensions/AStat/astat_aip.class.inc.php
r5423 r5546 17 17 include_once('astat_aim.class.inc.php'); 18 18 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 19 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/ajax.class.inc.php');19 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); 20 20 21 21 class AStat_AIP extends AStat_AIM … … 26 26 protected $list_sortimg = array('picture', 'catname'); 27 27 protected $list_sortip = array('page', 'picture', 'ip'); 28 protected $ajax;29 28 30 29 protected $catfilter; //filter on categories … … 36 35 parent::__construct($prefixeTable, $filelocation); 37 36 38 $this->load _config();39 $this->init _events();37 $this->loadConfig(); 38 $this->initEvents(); 40 39 41 40 $this->tabsheet = new tabsheet(); 42 41 $this->tabsheet->add('stats_by_period', 43 42 l10n('AStat_by_period'), 44 $this-> page_link.'&fAStat_tabsheet=stats_by_period');43 $this->getAdminLink().'&fAStat_tabsheet=stats_by_period'); 45 44 $this->tabsheet->add('stats_by_ip', 46 45 l10n('AStat_by_ip'), 47 $this-> page_link.'&fAStat_tabsheet=stats_by_ip');46 $this->getAdminLink().'&fAStat_tabsheet=stats_by_ip'); 48 47 $this->tabsheet->add('stats_by_category', 49 48 l10n('AStat_by_category'), 50 $this-> page_link.'&fAStat_tabsheet=stats_by_category');49 $this->getAdminLink().'&fAStat_tabsheet=stats_by_category'); 51 50 $this->tabsheet->add('stats_by_image', 52 51 l10n('AStat_by_image'), 53 $this-> page_link.'&fAStat_tabsheet=stats_by_image');52 $this->getAdminLink().'&fAStat_tabsheet=stats_by_image'); 54 53 $this->tabsheet->add('config', 55 54 l10n('AStat_config'), 56 $this-> page_link.'&fAStat_tabsheet=config');55 $this->getAdminLink().'&fAStat_tabsheet=config'); 57 56 $this->tabsheet->add('tools', 58 57 l10n('AStat_tools'), 59 $this->page_link.'&fAStat_tabsheet=tools'); 60 61 $this->ajax = new Ajax(); 58 $this->getAdminLink().'&fAStat_tabsheet=tools'); 59 62 60 } 63 61 … … 65 63 initialize events call for the plugin 66 64 */ 67 function init _events()68 { 69 add_event_handler('loc_end_page_header', array(&$this->css, 'apply _CSS'));65 function initEvents() 66 { 67 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 70 68 } 71 69 … … 92 90 if($_REQUEST['fAStat_catfilter']!="") 93 91 { 94 $this-> page_link.="&fAStat_catfilter=".$_REQUEST['fAStat_catfilter'];92 $this->setAdminLink($this->getAdminLink()."&fAStat_catfilter=".$_REQUEST['fAStat_catfilter']); 95 93 } 96 94 … … 102 100 $_REQUEST['fAStat_month'], 103 101 $_REQUEST['fAStat_day'], 104 $this-> my_config['AStat_MaxBarWidth'],105 $this-> my_config['AStat_SeeTimeRequests']102 $this->config['AStat_MaxBarWidth'], 103 $this->config['AStat_SeeTimeRequests'] 106 104 ); 107 105 } … … 117 115 $_REQUEST['fAStat_month'], 118 116 $_REQUEST['fAStat_day'], 119 $this-> my_config['AStat_MaxBarWidth'],120 $this-> my_config['AStat_NpIPPerPages'],117 $this->config['AStat_MaxBarWidth'], 118 $this->config['AStat_NpIPPerPages'], 121 119 $_REQUEST['fAStat_page_number'], 122 120 $_REQUEST['fAStat_SortIP'], 123 $this-> my_config['AStat_SeeTimeRequests']121 $this->config['AStat_SeeTimeRequests'] 124 122 ); 125 123 } … … 130 128 $_REQUEST['fAStat_month'], 131 129 $_REQUEST['fAStat_day'], 132 $this-> my_config['AStat_MaxBarWidth'],133 $this-> my_config['AStat_NpCatPerPages'],130 $this->config['AStat_MaxBarWidth'], 131 $this->config['AStat_NpCatPerPages'], 134 132 $_REQUEST['fAStat_page_number'], 135 $this-> my_config['AStat_ShowThumbCat'],133 $this->config['AStat_ShowThumbCat'], 136 134 $_REQUEST['fAStat_SortCat'], 137 $this-> my_config['AStat_SeeTimeRequests']135 $this->config['AStat_SeeTimeRequests'] 138 136 ); 139 137 } … … 144 142 $_REQUEST['fAStat_month'], 145 143 $_REQUEST['fAStat_day'], 146 $this-> my_config['AStat_MaxBarWidth'],147 $this-> my_config['AStat_NbImgPerPages'],144 $this->config['AStat_MaxBarWidth'], 145 $this->config['AStat_NbImgPerPages'], 148 146 $_REQUEST['fAStat_page_number'], 149 $this-> my_config['AStat_ShowThumbImg'],147 $this->config['AStat_ShowThumbImg'], 150 148 $_REQUEST['fAStat_SortImg'], 151 149 $_REQUEST['fAStat_IP'], 152 $this-> my_config['AStat_SeeTimeRequests']150 $this->config['AStat_SeeTimeRequests'] 153 151 ); 154 152 } … … 197 195 break; 198 196 } 199 //$template-> 200 $this->ajax->return_result($result); 197 GPCAjax::returnResult($result); 201 198 } 202 199 } … … 223 220 if(!array_key_exists('fAStat_SortCat', $_REQUEST)) 224 221 { 225 $_REQUEST['fAStat_SortCat']=$this-> my_config['AStat_DefaultSortCat'];222 $_REQUEST['fAStat_SortCat']=$this->config['AStat_DefaultSortCat']; 226 223 } 227 224 if(!array_key_exists('fAStat_SortImg', $_REQUEST)) 228 225 { 229 $_REQUEST['fAStat_SortImg']=$this-> my_config['AStat_DefaultSortImg'];226 $_REQUEST['fAStat_SortImg']=$this->config['AStat_DefaultSortImg']; 230 227 } 231 228 if(!array_key_exists('fAStat_SortIP', $_REQUEST)) 232 229 { 233 $_REQUEST['fAStat_SortIP']=$this-> my_config['AStat_DefaultSortIP'];230 $_REQUEST['fAStat_SortIP']=$this->config['AStat_DefaultSortIP']; 234 231 } 235 232 if(!array_key_exists('fAStat_page_number', $_REQUEST)) … … 252 249 if(($_REQUEST['fAStat_tabsheet']=='stats_by_period')&&($_REQUEST['fAStat_defper']=='Y')) 253 250 { 254 if($this-> my_config['AStat_default_period']!='global')251 if($this->config['AStat_default_period']!='global') 255 252 { 256 253 $default_request['all'] = 'N'; 257 254 } 258 255 259 if(($this-> my_config['AStat_default_period']=='year')||260 ($this-> my_config['AStat_default_period']=='month')||261 ($this-> my_config['AStat_default_period']=='day'))256 if(($this->config['AStat_default_period']=='year')|| 257 ($this->config['AStat_default_period']=='month')|| 258 ($this->config['AStat_default_period']=='day')) 262 259 { 263 260 $default_request['year'] = date('Y'); 264 261 } 265 262 266 if(($this-> my_config['AStat_default_period']=='month')||267 ($this-> my_config['AStat_default_period']=='day'))263 if(($this->config['AStat_default_period']=='month')|| 264 ($this->config['AStat_default_period']=='day')) 268 265 { 269 266 $default_request['month'] = date('n'); 270 267 } 271 268 272 if($this-> my_config['AStat_default_period']=='day')269 if($this->config['AStat_default_period']=='day') 273 270 { 274 271 $default_request['day'] = date('j'); … … 420 417 } 421 418 422 if(($this-> my_config['AStat_UseBlackList']!="false")&&($this->my_config['AStat_BlackListedIP']!=""))419 if(($this->config['AStat_UseBlackList']!="false")&&($this->config['AStat_BlackListedIP']!="")) 423 420 { 424 421 ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 425 ($this-> my_config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":"";426 $sql_where .= $this->make_IP_where_clause($this-> my_config['AStat_BlackListedIP']);422 ($this->config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":""; 423 $sql_where .= $this->make_IP_where_clause($this->config['AStat_BlackListedIP']); 427 424 } 428 425 … … 499 496 } 500 497 501 if(($this-> my_config['AStat_UseBlackList']!="false")&&($this->my_config['AStat_BlackListedIP']!=""))498 if(($this->config['AStat_UseBlackList']!="false")&&($this->config['AStat_BlackListedIP']!="")) 502 499 { 503 500 ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 504 ($this-> my_config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":"";505 $sql_where .= $this->make_IP_where_clause($this-> my_config['AStat_BlackListedIP']);501 ($this->config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":""; 502 $sql_where .= $this->make_IP_where_clause($this->config['AStat_BlackListedIP']); 506 503 $sql.=" , 'N' AS blacklist"; 507 504 } 508 505 else 509 506 { 510 if($this-> my_config['AStat_BlackListedIP']=='')507 if($this->config['AStat_BlackListedIP']=='') 511 508 { 512 509 $sql.=" , 'N' AS blacklist"; … … 515 512 { 516 513 $sql.=" , (CASE "; 517 $tmp=explode(',', $this-> my_config['AStat_BlackListedIP']);514 $tmp=explode(',', $this->config['AStat_BlackListedIP']); 518 515 foreach($tmp as $key=>$val) 519 516 { … … 626 623 $sql_where .= " ic2.catid = ".HISTORY_TABLE.".category_id "; 627 624 628 if(($this-> my_config['AStat_UseBlackList']!="false")&&($this->my_config['AStat_BlackListedIP']!=""))629 { 630 ($this-> my_config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":"";631 $sql_where .= $this->make_IP_where_clause($this-> my_config['AStat_BlackListedIP']);625 if(($this->config['AStat_UseBlackList']!="false")&&($this->config['AStat_BlackListedIP']!="")) 626 { 627 ($this->config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":""; 628 $sql_where .= $this->make_IP_where_clause($this->config['AStat_BlackListedIP']); 632 629 } 633 630 … … 722 719 } 723 720 724 if(($this-> my_config['AStat_UseBlackList']!="false")&&($this->my_config['AStat_BlackListedIP']!=""))721 if(($this->config['AStat_UseBlackList']!="false")&&($this->config['AStat_BlackListedIP']!="")) 725 722 { 726 723 ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 727 ($this-> my_config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":"";728 $sql_where .= $this->make_IP_where_clause($this-> my_config['AStat_BlackListedIP']);724 ($this->config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":""; 725 $sql_where .= $this->make_IP_where_clause($this->config['AStat_BlackListedIP']); 729 726 } 730 727 … … 783 780 784 781 $dir_links = ""; 785 $a_links=array("global" => $this-> page_link."&fAStat_defper=N&fAStat_all=Y",786 "all" => $this-> page_link."&fAStat_defper=N&fAStat_all=N",787 "year" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year",788 "month" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month",789 "day" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");790 791 $ip_links=array("all" => $this-> page_link."&fAStat_tabsheet=stats_by_ip",792 "year" => $this-> page_link."&fAStat_tabsheet=stats_by_ip&fAStat_year=",793 "month" => $this-> page_link."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=",794 "day" => $this-> page_link."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=$month&fAStat_day=");795 796 $cat_links=array("all" => $this-> page_link."&fAStat_tabsheet=stats_by_category",797 "year" => $this-> page_link."&fAStat_tabsheet=stats_by_category&fAStat_year=",798 "month" => $this-> page_link."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=",799 "day" => $this-> page_link."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=$month&fAStat_day=");800 801 $img_links=array("all" => $this-> page_link."&fAStat_tabsheet=stats_by_image",802 "year" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=",803 "month" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=",804 "day" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month&fAStat_day=");782 $a_links=array("global" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=Y", 783 "all" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N", 784 "year" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year", 785 "month" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month", 786 "day" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 787 788 $ip_links=array("all" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip", 789 "year" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip&fAStat_year=", 790 "month" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=", 791 "day" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=$month&fAStat_day="); 792 793 $cat_links=array("all" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category", 794 "year" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category&fAStat_year=", 795 "month" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=", 796 "day" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=$month&fAStat_day="); 797 798 $img_links=array("all" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image", 799 "year" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=", 800 "month" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=", 801 "day" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month&fAStat_day="); 805 802 806 803 … … 869 866 { // si mois sélectionné, jours affichés 870 867 $value = $stats[$i]["GId"]." (".l10n("AStat_day_of_week_".date("w",mktime(0, 0, 0, $month, $stats[$i]["GId"], $year))).")"; 871 $link=$this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=".$stats[$i]["GId"];868 $link=$this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=".$stats[$i]["GId"]; 872 869 $value_ip=$ip_links["day"].$stats[$i]["GId"]; 873 870 $value_cat=$cat_links["day"].$stats[$i]["GId"]; … … 877 874 { // si année sélectionnée, mois affichés 878 875 $value = l10n("AStat_month_of_year_".$stats[$i]["GId"]); 879 $link=$this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=".$stats[$i]["GId"];876 $link=$this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=".$stats[$i]["GId"]; 880 877 $value_ip=$ip_links["month"].$stats[$i]["GId"]; 881 878 $value_cat=$cat_links["month"].$stats[$i]["GId"]; … … 885 882 { // si total sélectionné, années affichées 886 883 $value = $stats[$i]["GId"]; 887 $link=$this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=".$stats[$i]["GId"];884 $link=$this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=".$stats[$i]["GId"]; 888 885 $value_ip=$ip_links["year"].$stats[$i]["GId"]; 889 886 $value_cat=$cat_links["year"].$stats[$i]["GId"]; … … 893 890 { 894 891 $value=l10n("AStat_period_label_all"); 895 $link=$this-> page_link."&fAStat_defper=N&fAStat_all=N";892 $link=$this->getAdminLink()."&fAStat_defper=N&fAStat_all=N"; 896 893 $value_ip=$ip_links["all"]; 897 894 $value_cat=$cat_links["all"]; … … 966 963 $dir_links = ""; 967 964 $page_link = ""; 968 $a_links=array("global" => $this-> page_link."&fAStat_defper=N&fAStat_all=Y",969 "all" => $this-> page_link."&fAStat_defper=N&fAStat_all=N",970 "year" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year",971 "month" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month",972 "day" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");973 974 $ip_links=array("all" => $this-> page_link."&fAStat_tabsheet=stats_by_ip",975 "year" => $this-> page_link."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year",976 "month" => $this-> page_link."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=$month",977 "day" => $this-> page_link."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");978 979 $img_links=array("all" => $this-> page_link."&fAStat_tabsheet=stats_by_image",980 "year" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year",981 "month" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month",982 "day" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");965 $a_links=array("global" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=Y", 966 "all" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N", 967 "year" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year", 968 "month" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month", 969 "day" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 970 971 $ip_links=array("all" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip", 972 "year" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year", 973 "month" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=$month", 974 "day" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_ip&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 975 976 $img_links=array("all" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image", 977 "year" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year", 978 "month" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month", 979 "day" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 983 980 984 981 … … 1130 1127 $dir_links = ""; 1131 1128 $page_link = ""; 1132 $a_links=array("global" => $this-> page_link."&fAStat_defper=N&fAStat_all=Y",1133 "all" => $this-> page_link."&fAStat_defper=N&fAStat_all=N",1134 "year" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year",1135 "month" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month",1136 "day" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");1137 1138 $cat_links=array("all" => $this-> page_link."&fAStat_tabsheet=stats_by_category",1139 "year" => $this-> page_link."&fAStat_tabsheet=stats_by_category&fAStat_year=$year",1140 "month" => $this-> page_link."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=$month",1141 "day" => $this-> page_link."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");1129 $a_links=array("global" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=Y", 1130 "all" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N", 1131 "year" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year", 1132 "month" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month", 1133 "day" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 1134 1135 $cat_links=array("all" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category", 1136 "year" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category&fAStat_year=$year", 1137 "month" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=$month", 1138 "day" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_category&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 1142 1139 1143 1140 /* make navigation links */ … … 1276 1273 $dir_links = ""; 1277 1274 $page_link = ""; 1278 $a_links=array("global" => $this-> page_link."&fAStat_defper=N&fAStat_all=Y",1279 "all" => $this-> page_link."&fAStat_defper=N&fAStat_all=N",1280 "year" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year",1281 "month" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month",1282 "day" => $this-> page_link."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");1283 1284 $img_links=array("all" => $this-> page_link."&fAStat_tabsheet=stats_by_image",1285 "year" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year",1286 "month" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month",1287 "day" => $this-> page_link."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day");1275 $a_links=array("global" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=Y", 1276 "all" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N", 1277 "year" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year", 1278 "month" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month", 1279 "day" => $this->getAdminLink()."&fAStat_defper=N&fAStat_all=N&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 1280 1281 $img_links=array("all" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image", 1282 "year" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year", 1283 "month" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month", 1284 "day" => $this->getAdminLink()."&fAStat_tabsheet=stats_by_image&fAStat_year=$year&fAStat_month=$month&fAStat_day=$day"); 1288 1285 1289 1286 /* navigation links */ … … 1434 1431 private function add_ip_to_filter($ip) 1435 1432 { 1436 if(strpos($this-> my_config['AStat_BlackListedIP'].",", $ip.",")===false)1437 { 1438 ($this-> my_config['AStat_BlackListedIP']!='')?$this->my_config['AStat_BlackListedIP'].=",":"";1439 $this-> my_config['AStat_BlackListedIP'].=$ip;1440 $this->save _config();1433 if(strpos($this->config['AStat_BlackListedIP'].",", $ip.",")===false) 1434 { 1435 ($this->config['AStat_BlackListedIP']!='')?$this->config['AStat_BlackListedIP'].=",":""; 1436 $this->config['AStat_BlackListedIP'].=$ip; 1437 $this->saveConfig(); 1441 1438 } 1442 1439 } … … 1456 1453 if(!is_adviser()) 1457 1454 { 1458 reset($this-> my_config);1459 while (list($key, $val) = each($this-> my_config))1455 reset($this->config); 1456 while (list($key, $val) = each($this->config)) 1460 1457 { 1461 1458 if(isset($_POST['f_'.$key])) 1462 1459 { 1463 $this-> my_config[$key] = $_POST['f_'.$key];1460 $this->config[$key] = $_POST['f_'.$key]; 1464 1461 } 1465 1462 } 1466 if($this->save _config())1463 if($this->saveConfig()) 1467 1464 { 1468 1465 array_push($page['infos'], l10n('AStat_config_saved')); … … 1486 1483 1487 1484 //standards inputs zones 1488 reset($this-> my_config);1489 while (list($key, $val) = each($this-> my_config))1485 reset($this->config); 1486 while (list($key, $val) = each($this->config)) 1490 1487 { 1491 1488 $template_datas["f_".$key]=$val; … … 1493 1490 1494 1491 // 1495 $template_datas['ajaxurl']=$this-> page_link;1492 $template_datas['ajaxurl']=$this->getAdminLink(); 1496 1493 1497 1494 // define selected item for lists zones 1498 $template_datas['AStat_periods_selected']=$this-> my_config['AStat_default_period'];1499 $template_datas['AStat_defaultsortcat_selected']=$this-> my_config['AStat_DefaultSortCat'];1500 $template_datas['AStat_defaultsortip_selected']=$this-> my_config['AStat_DefaultSortIP'];1501 $template_datas['AStat_defaultsortimg_selected']=$this-> my_config['AStat_DefaultSortImg'];1502 1503 $template_datas['AStat_showthumbcat_selected']=$this-> my_config['AStat_ShowThumbCat'];1504 $template_datas['AStat_showthumbimg_selected']=$this-> my_config['AStat_ShowThumbImg'];1505 $template_datas['AStat_UseBlackList_selected']=$this-> my_config['AStat_UseBlackList'];1495 $template_datas['AStat_periods_selected']=$this->config['AStat_default_period']; 1496 $template_datas['AStat_defaultsortcat_selected']=$this->config['AStat_DefaultSortCat']; 1497 $template_datas['AStat_defaultsortip_selected']=$this->config['AStat_DefaultSortIP']; 1498 $template_datas['AStat_defaultsortimg_selected']=$this->config['AStat_DefaultSortImg']; 1499 1500 $template_datas['AStat_showthumbcat_selected']=$this->config['AStat_ShowThumbCat']; 1501 $template_datas['AStat_showthumbimg_selected']=$this->config['AStat_ShowThumbImg']; 1502 $template_datas['AStat_UseBlackList_selected']=$this->config['AStat_UseBlackList']; 1506 1503 1507 1504 // making lists zones … … 1616 1613 elseif($_REQUEST['fAStat_purge_history_type']=='byipid0') 1617 1614 { 1618 $fparam=$this-> my_config['AStat_BlackListedIP'];1615 $fparam=$this->config['AStat_BlackListedIP']; 1619 1616 } 1620 1617 else … … 2146 2143 private function purge_history_count_ipid0() 2147 2144 { 2148 if($this-> my_config['AStat_BlackListedIP']!="")2149 { 2150 $list=explode(',', $this-> my_config['AStat_BlackListedIP']);2145 if($this->config['AStat_BlackListedIP']!="") 2146 { 2147 $list=explode(',', $this->config['AStat_BlackListedIP']); 2151 2148 } 2152 2149 else … … 2157 2154 $returned=array(0,count($list)); 2158 2155 2159 if($this-> my_config['AStat_BlackListedIP']!='')2156 if($this->config['AStat_BlackListedIP']!='') 2160 2157 { 2161 2158 $sql="SELECT COUNT(id) 2162 2159 FROM ".HISTORY_TABLE." 2163 WHERE ".$this->make_IP_where_clause($this-> my_config['AStat_BlackListedIP']);2160 WHERE ".$this->make_IP_where_clause($this->config['AStat_BlackListedIP']); 2164 2161 $result=pwg_query($sql); 2165 2162 if($result) -
extensions/AStat/language/fr_FR/plugin.lang.php
r3707 r5546 216 216 $lang['AStat_enableddisabled_invert'] = "Filtre inversé"; 217 217 218 //--- > 2.2.0 219 $lang['To install this plugin, you need to install Grum Plugin Classes %s before'] = 'Pour installer ce plugin, vous devez au préalable, installer le plugin Grum Plugin Classes %s'; 220 221 218 222 ?> -
extensions/AStat/main.inc.php
r5423 r5546 81 81 define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/'); 82 82 83 define('ASTAT_VERSION' , '2.2.0'); // => ne pas oublier la version dans l'entête !!83 include_once('astat_version.inc.php'); // => Don't forget to update this file !! 84 84 85 85 global $prefixeTable; … … 91 91 92 92 $obj = new AStat_AIM($prefixeTable, __FILE__); 93 $obj->init _events();93 $obj->initEvents(); 94 94 set_plugin_data($plugin['id'], $obj); 95 95 } -
extensions/AStat/maintain.inc.php
r5425 r5546 17 17 if(!defined('ASTAT_PATH')) define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/'); 18 18 19 include_once('astat_version.inc.php'); 20 19 21 //ini_set('error_reporting', E_ALL); 20 22 //ini_set('display_errors', true); 21 23 22 global $gpc_installed, $ lang; //needed for plugin manager compatibility24 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 23 25 24 26 /* ----------------------------------------------------------------------------- … … 26 28 ----------------------------------------------------------------------------- */ 27 29 $gpc_installed=false; 28 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 30 $gpcNeeded="3.0.0"; 31 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 29 32 { 30 @include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/main.inc.php');31 // need GPC release greater or equal than 2.0.532 if( checkGPCRelease(2,0,5))33 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 34 // need GPC release greater or equal than 3.0.0 35 if(CommonPlugin::checkGPCRelease(3,0,0)) 33 36 { 34 37 @include_once("astat_aim.class.inc.php"); … … 39 42 function gpcMsgError(&$errors) 40 43 { 41 array_push($errors, sprintf(l10n('AStat_gpc2_not_installed'), "2.0.5")); 44 global $gpcNeeded; 45 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 46 if(is_array($errors)) 47 { 48 array_push($errors, $msg); 49 } 50 else 51 { 52 $errors=Array($msg); 53 } 42 54 } 43 55 // ----------------------------------------------------------------------------- … … 48 60 function plugin_install($plugin_id, $plugin_version, &$errors) 49 61 { 50 global $prefixeTable, $gpc_installed ;62 global $prefixeTable, $gpc_installed, $gpcNeeded; 51 63 if($gpc_installed) 52 64 { 53 65 $obj = new AStat_AIM($prefixeTable, __FILE__); 54 $obj->delete_config(); 55 $obj->init_config(); 56 $obj->save_config(); 66 $obj->deleteConfig(); 67 $obj->initConfig(); 68 $obj->my_config['installed']=ASTAT_VERSION2; 69 $obj->saveConfig(); 70 GPCCore::register($obj->getPluginName(), ASTAT_VERSION, $gpcNeeded); 57 71 } 58 72 else … … 68 82 { 69 83 $obj = new AStat_AIM($prefixeTable, __FILE__); 70 $obj->init_config(); 71 $obj->load_config(); 72 $obj->save_config(); 84 $obj->initConfig(); 85 $obj->loadConfig(); 86 $obj->my_config['installed']=ASTAT_VERSION2; 87 $obj->saveConfig(); 73 88 $obj->alter_history_section_enum('deleted_cat'); 74 89 } … … 89 104 { 90 105 $obj = new AStat_AIM($prefixeTable, __FILE__); 91 $obj->delete_config(); 106 $obj->deleteConfig(); 107 GPCCore::unregister($obj->getPluginName()); 92 108 } 93 109 else
Note: See TracChangeset
for help on using the changeset viewer.