Changeset 3707


Ignore:
Timestamp:
07/30/09 21:21:36 (11 years ago)
Author:
grum
Message:

Update AStat 2.1.0 - add some features to new features

Location:
extensions/AStat
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/AStat/admin/astat_by_ip.tpl

    r3706 r3707  
    1010    {foreach from=$datarows key=name item=data} 
    1111      <tr class="StatTableRow"> 
    12         <td style="white-space: nowrap"><a href="">{$data.ASTAT_IP_BLACKLIST} {$data.ASTAT_IP_GEOLOCALISATION} {$data.ASTAT_IP_ADRESS}</td> 
     12        <td style="white-space: nowrap">{$data.ASTAT_IP_BLACKLIST} {$data.ASTAT_IP_GEOLOCALISATION} {$data.ASTAT_IP_ADRESS}</td> 
    1313        <td class="number">{$data.PAGES}</td> 
    1414        <td class="number">{$data.PICTURES}</td> 
  • extensions/AStat/admin/astat_config.tpl

    r3706 r3707  
    307307        </td> 
    308308      </tr> 
     309      <tr> 
     310        <td>&nbsp;</td> 
     311        <td colspan="2"> 
     312          <select name="f_AStat_UseBlackList"> 
     313            {html_options values=$AStat_enableddisabled_list_values output=$AStat_enableddisabled_list_labels selected=$datas.AStat_UseBlackList_selected} 
     314          </select> 
     315        </td> 
     316      </tr> 
    309317 
    310318 
  • extensions/AStat/astat_aim.class.inc.php

    r3706 r3707  
    6262      'AStat_DefaultSortIP' => 'page',    //page, ip, picture 
    6363      'AStat_SeeTimeRequests' => 'false', 
    64       'AStat_BlackListedIP' => ''    // ip blacklisted (separator : ",") 
     64      'AStat_BlackListedIP' => '',    // ip blacklisted (separator : ",") 
     65      'AStat_UseBlackList' => 'false'    // if false, blacklist usage is disabled, if "invert" then result are inverted 
    6566      ); 
    6667 
  • extensions/AStat/astat_aip.class.inc.php

    r3706 r3707  
    420420    } 
    421421 
    422     if($this->my_config['AStat_BlackListedIP']!="") 
     422    if(($this->my_config['AStat_UseBlackList']!="false")&&($this->my_config['AStat_BlackListedIP']!="")) 
    423423    { 
    424424      ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 
    425       $sql_where .= " NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 
     425      ($this->my_config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":""; 
     426      $sql_where .= $this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 
    426427    } 
    427428 
     
    498499    } 
    499500 
    500     if($this->my_config['AStat_BlackListedIP']!="") 
     501    if(($this->my_config['AStat_UseBlackList']!="false")&&($this->my_config['AStat_BlackListedIP']!="")) 
    501502    { 
    502503      ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 
    503       $sql_where .= " NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 
     504      ($this->my_config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":""; 
     505      $sql_where .= $this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 
     506      $sql.=" , 'N' AS blacklist"; 
     507    } 
     508    else 
     509    { 
     510      if($this->my_config['AStat_BlackListedIP']=='') 
     511      { 
     512        $sql.=" , 'N' AS blacklist"; 
     513      } 
     514      else 
     515      { 
     516        $sql.=" , (CASE "; 
     517        $tmp=explode(',', $this->my_config['AStat_BlackListedIP']); 
     518        foreach($tmp as $key=>$val) 
     519        { 
     520          $sql.=" WHEN IP LIKE '".$val."' THEN 'Y' "; 
     521        } 
     522        $sql.="ELSE 'N' END) AS blacklist "; 
     523      } 
    504524    } 
    505525 
     
    508528            from ".HISTORY_TABLE." LEFT JOIN ".USERS_TABLE." ON ".HISTORY_TABLE.".user_id = ".USERS_TABLE.".id ".$sql_where.$sql_group.") as n) as n "; 
    509529    $sql=$sql_select.$sql.$sql_nfomax.$sql_from.$sql_max.$sql_where.$sql_group.$sql_order.$sql_limit; 
     530 
    510531 
    511532    $result = pwg_query($sql); 
     
    605626    $sql_where .= "  ic2.catid = ".HISTORY_TABLE.".category_id "; 
    606627 
    607     if($this->my_config['AStat_BlackListedIP']!="") 
    608     { 
    609       $sql_where .= " AND NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 
     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']); 
    610632    } 
    611633 
     
    700722    } 
    701723 
    702     if($this->my_config['AStat_BlackListedIP']!="") 
     724    if(($this->my_config['AStat_UseBlackList']!="false")&&($this->my_config['AStat_BlackListedIP']!="")) 
    703725    { 
    704726      ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 
    705       $sql_where .= " NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 
     727      ($this->my_config['AStat_UseBlackList']=="true")?$sql_where .= " NOT ":""; 
     728      $sql_where .= $this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 
    706729    } 
    707730 
     
    10461069        } 
    10471070 
    1048         $ip_blacklist=$this->format_link("[".l10n('AStat_IP_blacklist')."]", $ip_blacklist); 
     1071        if($stats[$i]["blacklist"]=='Y') 
     1072        { 
     1073          $ip_blacklist="[".l10n('AStat_IP_blacklist')."]"; 
     1074        } 
     1075        else 
     1076        { 
     1077          $ip_blacklist=$this->format_link("[".l10n('AStat_IP_blacklist')."]", $ip_blacklist); 
     1078        } 
    10491079      } 
    10501080      else 
     
    14711501    $template_datas['AStat_showthumbcat_selected']=$this->my_config['AStat_ShowThumbCat']; 
    14721502    $template_datas['AStat_showthumbimg_selected']=$this->my_config['AStat_ShowThumbImg']; 
     1503    $template_datas['AStat_UseBlackList_selected']=$this->my_config['AStat_UseBlackList']; 
    14731504 
    14741505    // making lists zones 
     
    15071538    $template_list_values['yesno'][]='false'; 
    15081539    $template_list_labels['yesno'][]=l10n('AStat_yesno_false'); 
     1540 
     1541    $template_list_values['enableddisabled'][]='true'; 
     1542    $template_list_values['enableddisabled'][]='false'; 
     1543    $template_list_values['enableddisabled'][]='invert'; 
     1544    $template_list_labels['enableddisabled'][]=l10n('AStat_enableddisabled_true'); 
     1545    $template_list_labels['enableddisabled'][]=l10n('AStat_enableddisabled_false'); 
     1546    $template_list_labels['enableddisabled'][]=l10n('AStat_enableddisabled_invert'); 
    15091547 
    15101548    $template_datas["L_STAT_TITLE"]=l10n('AStat_config_title'); 
     
    15211559    $template->assign("AStat_yesno_list_values", $template_list_values['yesno']); 
    15221560    $template->assign("AStat_yesno_list_labels", $template_list_labels['yesno']); 
     1561    $template->assign("AStat_enableddisabled_list_values", $template_list_values['enableddisabled']); 
     1562    $template->assign("AStat_enableddisabled_list_labels", $template_list_labels['enableddisabled']); 
    15231563 
    15241564    $template->assign_var_from_handle('ASTAT_BODY_PAGE', 'body_page'); 
     
    24062446  } 
    24072447 
     2448 
    24082449  /* --------------------------------------------------------------------------- 
    24092450   * AJAX functions 
  • extensions/AStat/language/en_UK/plugin.lang.php

    r3706 r3707  
    210210$lang['AStat_tools_purge_history_ipid0'] = "To purge events associated with IP from the blacklist (%s items in the blacklist, %s events in history)" 
    211211$lang['AStat_IP_blacklist'] = "Add to the blacklist"; 
     212$lang['AStat_enableddisabled_true'] = "Filter enabled"; 
     213$lang['AStat_enableddisabled_false'] = "Filter disabled"; 
     214$lang['AStat_enableddisabled_invert'] = "Filtre inverted"; 
     215 
    212216 
    213217?> 
  • extensions/AStat/language/es_ES/plugin.lang.php

    r3706 r3707  
    211211$lang['AStat_tools_purge_history_ipid0'] = "Para purgar los acontecimientos asociados con la IP de la lista negra (%s elementos en la lista negra, %s acontecimientos en la reseña histórica)"; 
    212212$lang['AStat_IP_blacklist'] = "Poner en lista negra"; 
     213$lang['AStat_enableddisabled_true'] = "Filtro activado"; 
     214$lang['AStat_enableddisabled_false'] = "Filtro discapacitados"; 
     215$lang['AStat_enableddisabled_invert'] = "Filtro invertida"; 
     216 
     217 
    213218?> 
  • extensions/AStat/language/fr_FR/plugin.lang.php

    r3706 r3707  
    211211$lang['AStat_tools_purge_history_ipid0'] = "Purger les évènements associés aux IP de la liste noire (%s éléments dans la liste noire, %s évènements dans l'historique)"; 
    212212$lang['AStat_IP_blacklist'] = "Mettre sur liste noire"; 
     213$lang['AStat_IP_blacklist'] = "Mettre sur liste noire"; 
     214$lang['AStat_enableddisabled_true'] = "Filtre activé"; 
     215$lang['AStat_enableddisabled_false'] = "Filtre désactivé"; 
     216$lang['AStat_enableddisabled_invert'] = "Filtre inversé"; 
    213217 
    214218?> 
Note: See TracChangeset for help on using the changeset viewer.