Changeset 3706 for extensions/AStat
- Timestamp:
- Jul 30, 2009, 7:36:50 PM (15 years ago)
- Location:
- extensions/AStat
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/admin/astat_by_ip.tpl
r3394 r3706 10 10 {foreach from=$datarows key=name item=data} 11 11 <tr class="StatTableRow"> 12 <td style="white-space: nowrap"> {$data.ASTAT_IP_GEOLOCALISATION} {$data.ASTAT_IP_ADRESS}</td>12 <td style="white-space: nowrap"><a href="">{$data.ASTAT_IP_BLACKLIST} {$data.ASTAT_IP_GEOLOCALISATION} {$data.ASTAT_IP_ADRESS}</td> 13 13 <td class="number">{$data.PAGES}</td> 14 14 <td class="number">{$data.PICTURES}</td> -
extensions/AStat/admin/astat_config.tpl
r3394 r3706 20 20 } 21 21 22 function isAValidIP(ip, strict) 23 { 24 returnedip=ip; 25 re = /^(\d{1,3}){1}(\.\d{1,3}){0,3}$/i; 26 if(re.test(ip)) 27 { 28 num = ip.split('.'); 29 for(i=0;i<num.length;i++) 30 { 31 if(num[i]>255) return(false); 32 } 33 if(!strict) 34 { 35 returnedip+="%"; 36 } 37 for(j=4-i;j>0;j--) 38 { 39 returnedip+=".%"; 40 } 41 return(returnedip); 42 } 43 else 44 { 45 return(false); 46 } 47 } 48 49 function makeOptionsFromList(list, options) 50 { 51 if(list=="") 52 { 53 return(false); 54 } 55 56 items=list.split(","); 57 for(i=0;i<items.length;i++) 58 { 59 opt = document.createElement("option"); 60 opt.value=items[i]; 61 opt.text=items[i]; 62 options.appendChild(opt); 63 } 64 } 65 66 function makeListFromOptions(options) 67 { 68 list=""; 69 for(i=0;i<options.length;i++) 70 { 71 (i!=0)?list+=",":""; 72 list+=options[i].value; 73 } 74 return(list); 75 } 76 77 function addIP() 78 { 79 ip=isAValidIP($("#iaddblackip").val(), true); 80 81 if(ip==false) return(false); 82 83 list = $("#iblacklistedip").val()+","; 84 if(list.indexOf(ip+",")==-1) 85 { 86 opt = document.createElement("option"); 87 opt.value=ip; 88 opt.text=ip; 89 $("#iblacklistip")[0].appendChild(opt); 90 $("#iblacklistedip").val(makeListFromOptions($("#iblacklistip")[0].options)); 91 } 92 $("#iaddblackip").val(""); 93 checkButtons(); 94 } 95 96 function delIP() 97 { 98 opt = $("#iblacklistip")[0]; 99 100 i=0; 101 while(i<opt.options.length) 102 { 103 if(opt.options[i].selected) 104 { 105 opt.removeChild(opt.options[i]); 106 } 107 else 108 { 109 i++; 110 } 111 } 112 $("#iblacklistedip").val(makeListFromOptions(opt.options)); 113 checkButtons(); 114 } 115 116 function checkButtons() 117 { 118 $("#idelipbutton").attr('disabled', !($("#iblacklistip")[0].selectedIndex!=-1)); 119 $("#iaddipbutton").attr('disabled', (isAValidIP($('#iaddblackip').val(),true)==false) ); 120 } 121 122 function init() 123 { 124 makeOptionsFromList($("#iblacklistedip").val(), $("#iblacklistip")[0]); 125 126 $("#iaddblackip").bind("keyup focus", getIPList).bind("blur", hideIPList); 127 p = $("#iaddblackip").offset() 128 $("#iplist").css({ 129 left:p.left+1, 130 top:p.top+$("#iaddblackip").outerHeight()-1 131 }); 132 $("#iblacklistip").bind("change", checkButtons); 133 checkButtons(); 134 } 135 136 function getIPList() 137 { 138 /*if($("#iaddblackip").val()=="") 139 { 140 ip="%"; 141 } 142 else 143 { 144 ip=isAValidIP($("#iaddblackip").val(),false); 145 } 146 if(ip==false) return(false);*/ 147 ip=$("#iaddblackip").val()+"%"; 148 149 checkButtons(); 150 $("html,input").css({cursor:"progress"}); 151 $.get("{/literal}{$datas.ajaxurl}{literal}", { 152 ajaxfct:"astat_listip", 153 ipfilter:ip, 154 exclude:$("#iblacklistedip").val() 155 }, 156 function (data) 157 { 158 $("#iplist").html(data).css({visibility:"visible"}); 159 $("#iipsellist") 160 .bind("mouseover", function (event) { 161 $("#iaddblackip").unbind("blur"); 162 } ) 163 .bind("mouseout", function (event) { 164 $("#iaddblackip").bind("blur", hideIPList); 165 } ) 166 .bind("blur", hideIPList) 167 .bind("change", function (event) { 168 $("#iaddblackip").val($("#iipsellist").val()); 169 $("#iipsellist").trigger("blur").attr("selectedIndex", -1); 170 checkButtons(); 171 hideIPList(); 172 } ) ; 173 $("html,input").css({cursor:"default"}); 174 $("input:text").css({cursor:"text"}); 175 } 176 ); 177 } 178 179 function hideIPList() 180 { 181 $("#iplist").css({visibility:"hidden"}); 182 } 183 22 184 </script> 23 185 {/literal} … … 112 274 <tr> 113 275 <td>{'AStat_NbIPPerPages'|@translate}</td> 114 <td ><input type="text" name="f_AStat_NpIPPerPages" value="{$datas.f_AStat_NpIPPerPages}" maxlength=4/></td>276 <td colspan="2"><input type="text" name="f_AStat_NpIPPerPages" value="{$datas.f_AStat_NpIPPerPages}" maxlength=4/></td> 115 277 </tr> 116 278 117 279 <tr> 118 280 <td>{'AStat_DefaultSortIP'|@translate}</td> 119 <td >281 <td colspan="2"> 120 282 <select name="f_AStat_DefaultSortIP"> 121 283 {html_options values=$AStat_defaultsortip_list_values output=$AStat_defaultsortip_list_labels selected=$datas.AStat_defaultsortip_selected} … … 123 285 </td> 124 286 </tr> 287 288 <tr> 289 <td>{'AStat_BlackListedIP'|@translate}</td> 290 <td> 291 <input type="text" size="15" id="iaddblackip" style="width:200px;" autocomplete="off"/> 292 <input type="hidden" id="iblacklistedip" name="f_AStat_BlackListedIP" value="{$datas.f_AStat_BlackListedIP}"/> 293 <div id="iplist"></div> 294 </td> 295 <td> 296 <input type="button" value="{'AStat_AddIP'|@translate}" id="iaddipbutton" onclick="addIP();"/> 297 </td> 298 </tr> 299 <tr> 300 <td> </td> 301 <td> 302 <select multiple size="4" id="iblacklistip" style="width:200px;height:150px;"> 303 </select> 304 </td> 305 <td> 306 <input type="button" value="{'AStat_DelIP'|@translate}" id="idelipbutton" onclick="delIP();"/> 307 </td> 308 </tr> 309 310 311 125 312 </table> 126 313 </fieldset> … … 190 377 </form> 191 378 192 193 379 <script type="text/javascript"> 380 init(); 381 </script> 382 -
extensions/AStat/admin/astat_tools.tpl
r3394 r3706 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"} 2 {known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.datepicker.packed.js"} 3 {assign var="datepicker_language" value="template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"} 4 5 {if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists} 6 {known_script id="jquery.ui.datepicker-$lang_info.code" src=$ROOT_URL|@cat:$datepicker_language} 7 {/if} 8 9 {html_head} 10 <link rel="stylesheet" type="text/css" href="{$ROOT_URL}template-common/lib/ui/ui.datepicker.css"> 11 {/html_head} 12 1 13 {literal} 2 14 <script type="text/javascript"> 3 15 4 16 function enabled_purge() 5 17 { 6 var objconfirm = document.getElementById('purge_history_confirm'); 7 var objdate = document.getElementById('purge_history_date'); 8 var objbutton = document.getElementById('purge_history_button'); 9 var objtype0 = document.getElementById('purge_history_type0'); 10 18 re = /\d{2}/\d{2}/\d{4}/i; 11 19 12 if(((objconfirm.checked==true)&&(objtype0.checked==true)&&(objdate.value.length==10))|| 13 ((objconfirm.checked==true)&&(objtype0.checked==false))) 14 { objbutton.disabled=false; } else { objbutton.disabled=true; } 20 if(($('#purge_history_confirm').attr('checked')&&$('#purge_history_type0').attr('checked')&&re.test($('#purge_history_date').val()))|| 21 ($('#purge_history_confirm').attr('checked')&&!('#purge_history_type0').attr('checked'))) 22 { 23 $('#purge_history_button').attr('disabled', true); 24 } 25 else 26 { 27 $('#purge_history_button').attr('disabled', false); 28 } 15 29 } 16 30 17 31 function enabled_deleted_picture() 18 32 { 19 20 33 var objconfirm = document.getElementById('deleted_picture_confirm_resync'); 34 var objbutton = document.getElementById('deleted_picture_resync_button'); 21 35 22 if(objconfirm.checked==true) 23 { objbutton.disabled=false; } else { objbutton.disabled=true; } 36 if($('#deleted_picture_confirm_resync').attr('checked')) 37 { 38 $('deleted_picture_resync_button').attr('disabled', false); 39 } 40 else 41 { 42 $('deleted_picture_resync_button').attr('disabled', true); 43 } 44 } 45 46 function init() 47 { 48 $("#purge_history_date").datepicker({ 49 dateFormat: 'dd/mm/yy', 50 constrainInput: true, 51 defaultDate:"-12m", 52 maxDate:0, 53 minDate:new Date({/literal}"{$datas.ASTAT_MINDATE}"{literal}) 54 }); 24 55 } 25 56 … … 27 58 {/literal} 28 59 29 {$datas.ASTAT_RESULT_OK} 60 {$datas.ASTAT_RESULT_OK} 30 61 31 62 <fieldset class='formtable'> 32 33 63 <legend>{'AStat_tools_general_nfo'|@translate}</legend> 64 <p>{$datas.ASTAT_GENERAL_NFO}</p> 34 65 </fieldset> 35 66 … … 51 82 52 83 <fieldset class='formtable'> 53 54 55 56 57 84 <legend>{'AStat_tools_deleted_picture'|@translate}</legend> 85 <p>{'AStat_tools_deleted_picture_nfo0'|@translate}</p> 86 <p>{$datas.ASTAT_DELETED_PICTURE_NFO}</p> 87 <form method="post" action="" class="general"> 88 { if isset($datas.AStat_deleted_picture_submit0) and $datas.AStat_deleted_picture_submit0 == 'yes'} 58 89 <p class='formtable'> 59 90 <input type="submit" value="{'AStat_tools_deleted_picture_apply'|@translate}" name="apply_tool_deleted_picture"/> 60 91 </p> 61 62 63 64 65 66 67 92 {/if} 93 </form> 94 <hr/> 95 <p>{'AStat_tools_deleted_picture_nfo3'|@translate}</p> 96 97 <form method="post" action="" class="general"> 98 <p> 68 99 <label> 69 100 <input type="radio" value="prepare" name="fAStat_tools_deleted_picture_action" id="deleted_picture0" {$datas.ASTAT_DELETED_PICTURE_PREPARE} > 70 101 {'AStat_tools_deleted_picture_prepare_action'|@translate} 71 102 </label><br> 72 103 <label> 73 104 <input type="radio" value="apply" name="fAStat_tools_deleted_picture_action" id="deleted_picture1" {$datas.ASTAT_DELETED_PICTURE_DO_ACTION} > 74 105 {'AStat_tools_deleted_picture_do_action'|@translate}{$datas.ASTAT_DELETED_PICTURE_NFO_NB} 75 106 </label> 76 107 </p> 77 78 79 80 81 108 <p class='formtable'> 109 <input type="checkbox" id="deleted_picture_confirm_resync" onclick="enabled_deleted_picture();"/> 110 <input type="submit" value="{'AStat_tools_deleted_picture_do'|@translate}" name="apply_tool_deleted_picture_resync" id="deleted_picture_resync_button" disabled /> 111 </p> 112 </form> 82 113 </fieldset> 83 114 84 115 85 116 <fieldset class='formtable'> 86 87 88 89 90 91 92 93 94 95 117 <legend>{'AStat_tools_deleted_category'|@translate}</legend> 118 <p>{'AStat_tools_deleted_category_nfo0'|@translate}</p> 119 <p>{$datas.ASTAT_DELETED_CATEGORY_NFO}</p> 120 <form method="post" action="" class="general"> 121 {if isset($datas.AStat_deleted_category_submit0) and $datas.AStat_deleted_category_submit0=='yes'} 122 <p class='formtable'> 123 <input type="submit" value="{'AStat_tools_deleted_category_apply'|@translate}" name="apply_tool_deleted_category"/> 124 </p> 125 {/if} 126 </form> 96 127 </fieldset> 97 128 98 129 99 130 <fieldset class='formtable'> 100 101 102 103 131 <legend>{'AStat_tools_purge_history'|@translate}</legend> 132 <p>{'AStat_tools_purge_history_nfo'|@translate}</p> 133 <form method="post" action="" class="general"> 134 <p> 104 135 <label> 105 136 <input type="radio" value="bydate" name="fAStat_purge_history_type" id="purge_history_type0" checked onclick="enabled_purge();"> … … 107 138 </label> 108 139 109 <input type="text" id="purge_history_date" name="fAStat_purge_history_date" value="" maxlength=10onchange="enabled_purge();"/><br>140 <input type="text" id="purge_history_date" name="fAStat_purge_history_date" size="10" onchange="enabled_purge();"/><br> 110 141 111 142 <label> … … 113 144 {$datas.ASTAT_PURGE_HISTORY_IMAGE_NFO} 114 145 </label> 115 <br >146 <br/> 116 147 117 148 <label> 118 149 <input type="radio" value="bycategoryid0" name="fAStat_purge_history_type" id="purge_history_type2" onclick="enabled_purge();" {$datas.ASTAT_PURGE_HISTORY_CATEGORY_DISABLED}> 119 150 {$datas.ASTAT_PURGE_HISTORY_CATEGORY_NFO} 151 </label> 152 <br/> 153 154 <label> 155 <input type="radio" value="byipid0" name="fAStat_purge_history_type" id="purge_history_type3" onclick="enabled_purge();" {$datas.ASTAT_PURGE_HISTORY_IP_DISABLED}> 156 {$datas.ASTAT_PURGE_HISTORY_IP_NFO} 120 157 </label> 121 158 </p> … … 126 163 </p> 127 164 128 165 </form> 129 166 </fieldset> 130 167 168 <script type="text/javascript"> 169 init(); 170 </script> -
extensions/AStat/astat_aim.class.inc.php
r3394 r3706 20 20 21 21 class AStat_AIM extends common_plugin 22 { 22 { 23 23 protected $css = null; 24 24 … … 61 61 'AStat_BarColor_Cat' => 'fff966', 62 62 'AStat_DefaultSortIP' => 'page', //page, ip, picture 63 'AStat_SeeTimeRequests' => 'false' 63 'AStat_SeeTimeRequests' => 'false', 64 'AStat_BlackListedIP' => '' // ip blacklisted (separator : ",") 64 65 ); 65 66 … … 96 97 function generate_CSS() 97 98 { 98 $text = ".AStatBar1, .AStatBar2, .AStatBar3, .AStatBar4, .AStatBarX { 99 border:0px; 99 $text = ".AStatBar1, .AStatBar2, .AStatBar3, .AStatBar4, .AStatBarX { 100 border:0px; 100 101 height:8px; 101 102 display: block; … … 105 106 position:relative; 106 107 } 107 .MiniSquare1, .MiniSquare2, .MiniSquare3, .MiniSquare4 { 108 border:0px; 108 .MiniSquare1, .MiniSquare2, .MiniSquare3, .MiniSquare4 { 109 border:0px; 109 110 height:8px; 110 111 width:8px; … … 119 120 .MiniSquare1 { color:#".$this->my_config['AStat_BarColor_Pages']."; } 120 121 .MiniSquare2 { color:#".$this->my_config['AStat_BarColor_Img']."; } 121 .MiniSquare3 { color:#".$this->my_config['AStat_BarColor_IP']."; } 122 .MiniSquare4 { color:#".$this->my_config['AStat_BarColor_Cat']."; } 122 .MiniSquare3 { color:#".$this->my_config['AStat_BarColor_IP']."; } 123 .MiniSquare4 { color:#".$this->my_config['AStat_BarColor_Cat']."; } 123 124 .StatTableRow:hover { background-color:#".$this->my_config['AStat_MouseOverColor']."; } 124 .formtable, .formtable P { text-align:left; display:block; } 125 .formtable, .formtable P { text-align:left; display:block; } 126 .formtable tr { vertical-align:top; } 125 127 .window_thumb { 126 128 position:absolute; … … 133 135 z-index:100; 134 136 overflow:hidden; 135 visibility:hidden; } 137 visibility:hidden; } 136 138 .img_thumb { 137 139 border: solid 3px #ffffff; 138 140 background: #000000; 139 141 margin:0px; 140 padding:0px; } 142 padding:0px; } 141 143 .time_request { 142 144 font-size:83%; … … 146 148 table.littlefont th { padding:3px; } 147 149 table.littlefont td { padding:0px;padding-left:3px;padding-right:3px; } 150 #iplist { visibility:hidden; position:absolute; width:200px; z-index:1000; } 151 .iipsellistitem { float:right; } 152 #iipsellist { width:100%; font-family:monospace; } 148 153 "; 149 154 -
extensions/AStat/astat_aip.class.inc.php
r3543 r3706 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 20 20 21 class AStat_AIP extends AStat_AIM 21 { 22 protected $tabsheet; 22 { 23 protected $tabsheet; 23 24 protected $list_periods = array('global', 'all', 'year', 'month', 'day'); 24 25 protected $list_sortcat = array('page', 'picture', 'nbpicture'); 25 26 protected $list_sortimg = array('picture', 'catname'); 26 27 protected $list_sortip = array('page', 'picture', 'ip'); 28 protected $ajax; 27 29 28 30 protected $catfilter; //filter on categories … … 56 58 l10n('AStat_tools'), 57 59 $this->page_link.'&fAStat_tabsheet=tools'); 60 61 $this->ajax = new Ajax(); 58 62 } 59 63 … … 78 82 { 79 83 global $template; 84 85 $this->return_ajax_content(); 80 86 81 87 $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/astat_admin.tpl"); … … 102 108 elseif($_REQUEST['fAStat_tabsheet']=='stats_by_ip') 103 109 { 110 if(isset($_REQUEST['fAStat_IP_BL'])) 111 { 112 $this->add_ip_to_filter($_REQUEST['fAStat_IP_BL']); 113 } 114 104 115 $this->display_stats_by_ip( 105 116 $_REQUEST['fAStat_year'], … … 167 178 --------------------------------------------------------------------------- */ 168 179 180 /* 181 return ajax content 182 */ 183 protected function return_ajax_content() 184 { 185 global $ajax, $template; 186 187 if(isset($_REQUEST['ajaxfct'])) 188 { 189 //$this->debug("AJAXFCT:".$_REQUEST['ajaxfct']); 190 $result="<p class='errors'>An error has occured</p>"; 191 switch($_REQUEST['ajaxfct']) 192 { 193 case 'astat_listip': 194 if(!isset($_REQUEST['ipfilter'])) $_REQUEST['ipfilter']=""; 195 if(!isset($_REQUEST['exclude'])) $_REQUEST['exclude']=""; 196 $result=$this->ajax_listip($_REQUEST['ipfilter'], $_REQUEST['exclude']); 197 break; 198 } 199 //$template-> 200 $this->ajax->return_result($result); 201 } 202 } 203 204 205 206 207 208 209 169 210 private function init_request() 170 211 { … … 292 333 293 334 if($day!="") 294 { 335 { 295 336 $sql_groupdef="HOUR(time) as GId,"; 296 337 $sql_select="select HOUR(time) as GId, "; … … 299 340 $sql_order=" order by GId asc"; 300 341 301 for($i=0;$i<24;$i++) 342 for($i=0;$i<24;$i++) 302 343 { 303 344 $returned[$i] = array( … … 313 354 } 314 355 } 315 elseif($month!="") 316 { 356 elseif($month!="") 357 { 317 358 $sql_groupdef="DAY(date) as GId,"; 318 359 $sql_select="select DAY(date) as GId, "; … … 323 364 $delta = 1; 324 365 $NbDays = strftime('%d', mktime(0,0,0,$month+1,0,$year)); 325 for($i=0;$i<$NbDays;$i++) 366 for($i=0;$i<$NbDays;$i++) 326 367 { 327 368 $returned[$i] = array( … … 337 378 } 338 379 } 339 elseif($year!="") 340 { 380 elseif($year!="") 381 { 341 382 $sql_groupdef="MONTH(date) as GId,"; 342 383 $sql_select="select MONTH(date) as GId, "; … … 346 387 347 388 $delta = 1; 348 for($i=0;$i<12;$i++) 389 for($i=0;$i<12;$i++) 349 390 { 350 391 $returned[$i] = array( … … 360 401 } 361 402 } 362 elseif($total!="Y") 403 elseif($total!="Y") 363 404 { 364 405 $sql_groupdef="YEAR(date) as GId,"; … … 379 420 } 380 421 422 if($this->my_config['AStat_BlackListedIP']!="") 423 { 424 ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 425 $sql_where .= " NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 426 } 427 381 428 $sql_max=", (select max(n.MaxPages) as MaxPages, max(n.MaxIP) as MaxIP, max(n.MaxImg) as MaxImg 382 429 from (select ".$sql_groupdef." count(id) as MaxPages, count(distinct IP) as MaxIP, count(image_id) as MaxImg 383 from ".HISTORY_TABLE.$sql_where.$sql_group.") as n) as n "; 430 from ".HISTORY_TABLE.$sql_where.$sql_group.") as n) as n "; 384 431 $sql=$sql_select.$sql.$sql_nfomax.$sql_from.$sql_max.$sql_where.$sql_group.$sql_order; 385 432 … … 394 441 { $returned[$row["GId"]-$delta] = $row; } 395 442 } 396 443 397 444 return($returned); 398 445 } //stat by period … … 423 470 $sql_where = ""; 424 471 $sql_group=" group by IP_USER "; 425 $sql_order=" order by ".$sortlist[$sortip]." "; 472 $sql_order=" order by ".$sortlist[$sortip]." "; 426 473 $sql_limit=" limit ".(($pagenumber-1)* $nbipperpage).", ".$nbipperpage; 427 474 428 475 429 if($day!="") 430 { 476 if($day!="") 477 { 431 478 $sql_where=" where YEAR(date) = $year and MONTH(date) = $month and DAY(date) = $day "; 432 479 } 433 elseif($month!="") 434 { 480 elseif($month!="") 481 { 435 482 $sql_where=" where YEAR(date) = $year and MONTH(date) = $month "; 436 483 } 437 elseif($year!="") 438 { 484 elseif($year!="") 485 { 439 486 $sql_where=" where YEAR(date) = $year "; 440 487 } … … 451 498 } 452 499 500 if($this->my_config['AStat_BlackListedIP']!="") 501 { 502 ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 503 $sql_where .= " NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 504 } 505 453 506 $sql_max=", (select max(n.MaxPages) as MaxPages, max(n.MaxImg) as MaxImg 454 from (select if(".HISTORY_TABLE.".user_id = 2, IP, if(".USERS_TABLE.".username is null, '[".l10n("AStat_deleted_user")."]', ".USERS_TABLE.".username)) as IP_USER, count(".HISTORY_TABLE.".id) as MaxPages, count(image_id) as MaxImg 455 from ".HISTORY_TABLE." LEFT JOIN ".USERS_TABLE." ON ".HISTORY_TABLE.".user_id = ".USERS_TABLE.".id ".$sql_where.$sql_group.") as n) as n "; 507 from (select if(".HISTORY_TABLE.".user_id = 2, IP, if(".USERS_TABLE.".username is null, '[".l10n("AStat_deleted_user")."]', ".USERS_TABLE.".username)) as IP_USER, count(".HISTORY_TABLE.".id) as MaxPages, count(image_id) as MaxImg 508 from ".HISTORY_TABLE." LEFT JOIN ".USERS_TABLE." ON ".HISTORY_TABLE.".user_id = ".USERS_TABLE.".id ".$sql_where.$sql_group.") as n) as n "; 456 509 $sql=$sql_select.$sql.$sql_nfomax.$sql_from.$sql_max.$sql_where.$sql_group.$sql_order.$sql_limit; 457 510 … … 475 528 $returned[1] = -1; 476 529 } 477 530 478 531 return($returned); 479 532 } //stat by ip … … 483 536 %Pages 484 537 %Images 485 by : 538 by : 486 539 Categories 487 540 Categories/years … … 505 558 506 559 if($show_thumb=='true') 507 { 560 { 508 561 $sql_thumb = ', '.IMAGES_TABLE.'.path as ThumbPath, '.IMAGES_TABLE.'.file as ThumbFile, '.IMAGES_TABLE.'.tn_ext as Extension'; 509 562 $sql_fromthumb = "LEFT JOIN ".IMAGES_TABLE." ON ic2.representative_picture_id = ".IMAGES_TABLE.".id "; … … 514 567 $sql_fromthumb = ""; 515 568 } 516 569 517 570 $sql_from = " from (".HISTORY_TABLE." LEFT JOIN ".CATEGORIES_TABLE." ON ".CATEGORIES_TABLE.".id = ".HISTORY_TABLE.".category_id), 518 (select category_id as catid, count(image_id) as nb_images, representative_picture_id 571 (select category_id as catid, count(image_id) as nb_images, representative_picture_id 519 572 from ".IMAGE_CATEGORY_TABLE.", ".CATEGORIES_TABLE." 520 573 where ".CATEGORIES_TABLE.".id = ".IMAGE_CATEGORY_TABLE.".category_id group by category_id) as ic2 "; … … 522 575 $sql_group=" group by category_id, section "; 523 576 $sql_group2=""; 524 $sql_order=" order by ".$sortlist[$sortcat]; 577 $sql_order=" order by ".$sortlist[$sortcat]; 525 578 $sql_limit=" limit ".(($pagenumber-1)* $nbipperpage).", ".$nbipperpage; 526 579 527 if($day!="") 528 { 580 if($day!="") 581 { 529 582 $sql_where=" where YEAR(date) = $year and MONTH(date) = $month and DAY(date)= $day "; 530 583 } 531 elseif($month!="") 532 { 584 elseif($month!="") 585 { 533 586 $sql_where=" where YEAR(date) = $year and MONTH(date) = $month "; 534 587 } 535 elseif($year!="") 536 { 588 elseif($year!="") 589 { 537 590 $sql_where=" where YEAR(date) = $year "; 538 591 } … … 552 605 $sql_where .= " ic2.catid = ".HISTORY_TABLE.".category_id "; 553 606 607 if($this->my_config['AStat_BlackListedIP']!="") 608 { 609 $sql_where .= " AND NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 610 } 554 611 555 612 $sql=$sql_select.$sql.$sql_thumb.$sql_from.$sql_fromthumb.$sql_max.$sql_where.$sql_group.$sql_order.$sql_limit; … … 574 631 $returned[1] = -1; 575 632 } 576 633 577 634 return($returned); 578 635 } // stats per categories … … 582 639 Num of view per image 583 640 %view on period 584 by : 641 by : 585 642 Images 586 643 Images/years … … 605 662 ".IMAGES_TABLE.".path as ThumbPath, ".IMAGES_TABLE.".file as ThumbFile, 606 663 MaxImg2.somme as NbVuesMax, ".IMAGES_TABLE.".tn_ext as Extension "; 607 664 608 665 $sql_from = " from ((".HISTORY_TABLE." LEFT JOIN ".IMAGES_TABLE." ON 609 666 ".IMAGES_TABLE.".id = ".HISTORY_TABLE.".image_id) LEFT JOIN ".CATEGORIES_TABLE." … … 613 670 $sql_where = " where ".HISTORY_TABLE.".image_id is not null "; 614 671 $sql_group=" group by image_id, category_id "; 615 $sql_order=" order by ".$sortlist[$sortimg]; 672 $sql_order=" order by ".$sortlist[$sortimg]; 616 673 $sql_limit=" limit ".(($pagenumber-1)* $nbipperpage).", ".$nbipperpage; 617 674 618 if($day!="") 619 { 675 if($day!="") 676 { 620 677 $sql_where.=" and YEAR(date) = $year and MONTH(date) = $month and DAY(date)= $day "; 621 678 } 622 elseif($month!="") 623 { 679 elseif($month!="") 680 { 624 681 $sql_where.=" and YEAR(date) = $year and MONTH(date) = $month "; 625 682 } 626 elseif($year!="") 627 { 683 elseif($year!="") 684 { 628 685 $sql_where.=" and YEAR(date) = $year "; 629 686 } … … 631 688 632 689 if($ip!="") 633 { 690 { 634 691 $sql_where.=" and ( ((IP = '$ip') and ( user_id = 2 )) or (".USERS_TABLE.".username = '$ip') )"; 635 $sql_from_ip=" LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".id = ".HISTORY_TABLE.".user_id "; 636 } 637 692 $sql_from_ip=" LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".id = ".HISTORY_TABLE.".user_id "; 693 } 694 638 695 if($this->catfilter!="") 639 696 { … … 643 700 } 644 701 702 if($this->my_config['AStat_BlackListedIP']!="") 703 { 704 ($sql_where=="")?$sql_where=" where ":$sql_where.=" AND "; 705 $sql_where .= " NOT ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 706 } 707 708 645 709 $sql_max=", (select count(image_id) as somme from ".HISTORY_TABLE.$sql_from_ip.$sql_where.") as MaxImg, (select count(image_id) as somme from ".HISTORY_TABLE.$sql_from_ip.$sql_where." and ".HISTORY_TABLE.".image_id is not null group by image_id order by somme desc limit 0,1) as MaxImg2 "; 646 710 … … 666 730 $returned[1] = -1; 667 731 } 668 732 669 733 return($returned); 670 734 } //stat by images … … 719 783 720 784 /* period label + navigation links */ 721 if($day!="") 722 { 785 if($day!="") 786 { 723 787 $template_datas["PERIOD_LABEL"] = l10n("AStat_period_label_hours"); 724 788 $template_datas["L_STAT_TITLE"] = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".$this->format_link(l10n("AStat_month_of_year_".$month), $a_links["month"])." / ".l10n("AStat_day_of_week_".date("w",mktime(0, 0, 0, $month, $day, $year)))." $day"; 725 789 } 726 elseif($month!="") 727 { 790 elseif($month!="") 791 { 728 792 $template_datas["PERIOD_LABEL"] = l10n("AStat_period_label_days"); 729 793 $template_datas["L_STAT_TITLE"] = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".l10n("AStat_month_of_year_".$month); 730 794 } 731 elseif($year!="") 732 { 795 elseif($year!="") 796 { 733 797 $template_datas["PERIOD_LABEL"] = l10n("AStat_period_label_months"); 734 798 $template_datas["L_STAT_TITLE"] = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$year; 735 799 } 736 elseif($total!="Y") 737 { 800 elseif($total!="Y") 801 { 738 802 $template_datas["PERIOD_LABEL"] = l10n("AStat_period_label_years"); 739 803 $template_datas["L_STAT_TITLE"] = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".l10n("AStat_period_label_all"); 740 804 } 741 else 742 { 805 else 806 { 743 807 $template_datas["PERIOD_LABEL"] = l10n("AStat_period_label_all"); 744 808 $template_datas["L_STAT_TITLE"] = l10n("AStat_period_label_global"); 745 } 809 } 746 810 $template_datas["MAX_WIDTH"] = $max_width+10; 747 811 $template_datas["ASTAT_NFO_STAT"] = l10n("AStat_Nfo_Period"); … … 763 827 } 764 828 else 765 { 766 $width_pages = 0; 829 { 830 $width_pages = 0; 767 831 $width_img = 0; 768 832 $width_ip = 0; … … 770 834 } 771 835 772 836 773 837 if($day!="") 774 838 { // si jours sélectionné, heures affichées … … 787 851 $value_img=$img_links["day"].$stats[$i]["GId"]; 788 852 } 789 elseif($year!="") 853 elseif($year!="") 790 854 { // si année sélectionnée, mois affichés 791 855 $value = l10n("AStat_month_of_year_".$stats[$i]["GId"]); … … 803 867 $value_img=$img_links["year"].$stats[$i]["GId"]; 804 868 } 805 else 806 { 807 $value=l10n("AStat_period_label_all"); 869 else 870 { 871 $value=l10n("AStat_period_label_all"); 808 872 $link=$this->page_link."&fAStat_defper=N&fAStat_all=N"; 809 873 $value_ip=$ip_links["all"]; … … 897 961 898 962 /* periode label + navigation links */ 899 if($day!="") 900 { 963 if($day!="") 964 { 901 965 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".$this->format_link(l10n("AStat_month_of_year_".$month), $a_links["month"])." / ".l10n("AStat_day_of_week_".date("w",mktime(0, 0, 0, $month, $day, $year)))." $day"; 902 966 $page_link=$ip_links["day"]; 903 967 $img_link=$img_links["day"]; 904 968 } 905 elseif($month!="") 906 { 969 elseif($month!="") 970 { 907 971 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".l10n("AStat_month_of_year_".$month); 908 972 $page_link=$ip_links["month"]; 909 973 $img_link=$img_links["month"]; 910 974 } 911 elseif($year!="") 912 { 975 elseif($year!="") 976 { 913 977 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$year; 914 978 $page_link=$ip_links["year"]; 915 979 $img_link=$img_links["year"]; 916 980 } 917 else 918 { 981 else 982 { 919 983 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".l10n("AStat_period_label_all"); 920 984 $page_link=$ip_links["all"]; 921 985 $img_link=$img_links["all"]; 922 986 } 923 987 924 988 925 989 if($nbpages>1) { $plural="s"; } else { $plural=""; } … … 927 991 for($i=1;$i<=$nbpages;$i++) 928 992 { 929 if($i==$pagenumber) 930 { $pages_links.=" $i "; } 993 if($i==$pagenumber) 994 { $pages_links.=" $i "; } 931 995 else 932 996 { … … 934 998 } 935 999 } 936 1000 937 1001 $template_datas["L_STAT_TITLE"] = $dir_links; 938 1002 $template_datas["MAX_WIDTH"]=$max_width+10; … … 955 1019 { 956 1020 if($stats[$i]["MaxPages"] > 0) 957 { 958 $width_pages = ceil(($stats[$i]["NbPages"] * $max_width) / $stats[$i]["MaxPages"] ); 1021 { 1022 $width_pages = ceil(($stats[$i]["NbPages"] * $max_width) / $stats[$i]["MaxPages"] ); 959 1023 $width_img = ceil(($stats[$i]["NbImg"] * $max_width) / $stats[$i]["MaxPages"] ); 960 1024 } 961 1025 else 962 { 963 $width_pages = 0; 1026 { 1027 $width_pages = 0; 964 1028 $width_img = 0; 965 1029 } … … 970 1034 $ip_geolocalisation='<a href="http://www.geoiptool.com/fr/?IP='.$stats[$i]["IP_USER"].'" title="Geo IP localisation" target="_blank">['.l10n('AStat_IP_geolocalisation').'] </a>'; 971 1035 $ip_adress='<a href="http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext='.$stats[$i]["IP_USER"].'+&do_search=Search" title="Ripe Whois" target="_blank">'.$stats[$i]["IP_USER"].'</a>'; 972 } 973 else 1036 $ip_blacklist=$page_link."&fAStat_IP_BL=".$stats[$i]["IP_USER"]; 1037 1038 if($pagenumber>1) 1039 { 1040 $ip_blacklist.="&fAStat_page_number=$pagenumber"; 1041 } 1042 1043 if($sortip!="page") 1044 { 1045 $ip_blacklist.="&fAStat_SortIP=$sortip"; 1046 } 1047 1048 $ip_blacklist=$this->format_link("[".l10n('AStat_IP_blacklist')."]", $ip_blacklist); 1049 } 1050 else 974 1051 { 975 1052 $ip_geolocalisation=''; 976 1053 $ip_adress=$stats[$i]["IP_USER"]; 977 } 1054 $ip_blacklist=''; 1055 } 1056 978 1057 979 1058 980 1059 $template_datarows[]=array( 1060 'ASTAT_IP_BLACKLIST' => $ip_blacklist, 981 1061 'ASTAT_IP_GEOLOCALISATION' => $ip_geolocalisation, 982 1062 'ASTAT_IP_ADRESS' => $ip_adress, … … 1030 1110 1031 1111 /* make navigation links */ 1032 if($day!="") 1033 { 1112 if($day!="") 1113 { 1034 1114 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".$this->format_link(l10n("AStat_month_of_year_".$month), $a_links["month"])." / ".l10n("AStat_day_of_week_".date("w",mktime(0, 0, 0, $month, $day, $year)))." $day"; 1035 1115 $page_link=$cat_links["day"]; 1036 1116 } 1037 elseif($month!="") 1038 { 1117 elseif($month!="") 1118 { 1039 1119 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".l10n("AStat_month_of_year_".$month); 1040 1120 $page_link=$cat_links["month"]; 1041 1121 } 1042 elseif($year!="") 1043 { 1122 elseif($year!="") 1123 { 1044 1124 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$year; 1045 1125 $page_link=$cat_links["year"]; 1046 1126 } 1047 else 1048 { 1127 else 1128 { 1049 1129 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".l10n("AStat_period_label_all"); 1050 1130 $page_link=$cat_links["all"]; 1051 1131 } 1052 1132 1053 1133 1054 1134 if($nbpages>1) … … 1064 1144 for($i=1;$i<=$nbpages;$i++) 1065 1145 { 1066 if($i==$pagenumber) 1146 if($i==$pagenumber) 1067 1147 { 1068 1148 $pages_links.=" $i "; … … 1096 1176 $width_pages = ceil(($stats[$i]["PctPages"] * $max_width)/100); 1097 1177 $width_img = ceil(($stats[$i]["PctImg"] * $max_width)/100 ); 1098 1178 1099 1179 if($showthumb=='true') 1100 { 1180 { 1101 1181 $filethumb=$this->change_file_ext($stats[$i]["ThumbFile"], $stats[$i]["Extension"]); 1102 1182 $filethumb=str_replace($stats[$i]["ThumbFile"],"thumbnail/".$conf['prefix_thumbnail'].$filethumb,$stats[$i]["ThumbPath"]); } … … 1109 1189 { $category = $this->format_link($stats[$i]["IdCat"], PHPWG_ROOT_PATH."index.php?/category/".$stats[$i]["category_id"]); } 1110 1190 else 1111 { 1191 { 1112 1192 $category = "<i>".l10n('AStat_section_label').' : '; 1113 1193 if(l10n('AStat_section_'.$stats[$i]["IdCat"])!='AStat_section_'.$stats[$i]["IdCat"]) … … 1142 1222 1143 1223 /* ------------------------------------------------------------------------------------------ 1144 display stats for images 1224 display stats for images 1145 1225 ------------------------------------------------------------------------------------------ */ 1146 1226 function display_stats_by_image($year, $month, $day, $max_width, $nbipperpage, $pagenumber,$showthumb, $sortimg, $ip, $seetimerequest) … … 1176 1256 1177 1257 /* navigation links */ 1178 if($day!="") 1179 { 1258 if($day!="") 1259 { 1180 1260 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".$this->format_link(l10n("AStat_month_of_year_".$month), $a_links["month"])." / ".l10n("AStat_day_of_week_".date("w",mktime(0, 0, 0, $month, $day, $year)))." $day"; 1181 1261 $page_link=$img_links["day"]; 1182 1262 } 1183 elseif($month!="") 1184 { 1263 elseif($month!="") 1264 { 1185 1265 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$this->format_link($year, $a_links["year"])." / ".l10n("AStat_month_of_year_".$month); 1186 1266 $page_link=$img_links["month"]; 1187 1267 } 1188 elseif($year!="") 1189 { 1268 elseif($year!="") 1269 { 1190 1270 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".$this->format_link(l10n("AStat_period_label_all"), $a_links["all"])." / ".$year; 1191 1271 $page_link=$img_links["year"]; 1192 1272 } 1193 else 1194 { 1273 else 1274 { 1195 1275 $dir_links = $this->format_link(l10n("AStat_period_label_global"), $a_links["global"])." / ".l10n("AStat_period_label_all"); 1196 1276 $page_link=$img_links["all"]; … … 1201 1281 $dir_links.= " [IP : $ip]"; 1202 1282 } 1203 1283 1204 1284 1205 1285 if($nbpages>1) { $plural="s"; } else { $plural=""; } … … 1207 1287 for($i=1;$i<=$nbpages;$i++) 1208 1288 { 1209 if($i==$pagenumber) 1210 { $pages_links.=" $i "; } 1289 if($i==$pagenumber) 1290 { $pages_links.=" $i "; } 1211 1291 else 1212 1292 { … … 1236 1316 for($i=0;$i<count($stats);$i++) 1237 1317 { 1238 $width_pages = ceil(($stats[$i]["NbVues"] * $max_width)/$stats[$i]["NbVuesMax"] ); 1318 $width_pages = ceil(($stats[$i]["NbVues"] * $max_width)/$stats[$i]["NbVuesMax"] ); 1239 1319 $width_img = ceil(($stats[$i]["PctImg"] * $max_width)/100 ); 1240 1320 1241 1321 if($showthumb=='true') 1242 1322 { 1243 1323 $filethumb=$this->change_file_ext($stats[$i]["ThumbFile"], $stats[$i]["Extension"]); 1244 $filethumb=str_replace($stats[$i]["ThumbFile"],"thumbnail/".$conf['prefix_thumbnail'].$filethumb,$stats[$i]["ThumbPath"]); 1324 $filethumb=str_replace($stats[$i]["ThumbFile"],"thumbnail/".$conf['prefix_thumbnail'].$filethumb,$stats[$i]["ThumbPath"]); 1245 1325 } 1246 1326 else … … 1258 1338 } 1259 1339 else 1260 { 1340 { 1261 1341 if($stats[$i]["ThumbFile"]!="") 1262 1342 { … … 1270 1350 } 1271 1351 else 1272 { 1352 { 1273 1353 $image_links = "<i>".l10n('AStat_section_label').' : '; 1274 1354 if(l10n('AStat_section_'.$stats[$i]["CatName"])!='AStat_section_'.$stats[$i]["CatName"]) … … 1281 1361 } 1282 1362 1283 $image_links.="</i> / "; 1363 $image_links.="</i> / "; 1284 1364 1285 1365 if($stats[$i]["ImgName"]!="") … … 1288 1368 } 1289 1369 else 1290 { 1370 { 1291 1371 if($stats[$i]["ThumbFile"]!="") 1292 1372 { … … 1320 1400 1321 1401 1402 private function add_ip_to_filter($ip) 1403 { 1404 if(strpos($this->my_config['AStat_BlackListedIP'].",", $ip.",")===false) 1405 { 1406 ($this->my_config['AStat_BlackListedIP']!='')?$this->my_config['AStat_BlackListedIP'].=",":""; 1407 $this->my_config['AStat_BlackListedIP'].=$ip; 1408 $this->save_config(); 1409 } 1410 } 1411 1322 1412 1323 1413 /* … … 1330 1420 $save_status=false; 1331 1421 1332 if(isset($_POST['submit'])) 1422 if(isset($_POST['submit'])) 1333 1423 { 1334 1424 if(!is_adviser()) 1335 1425 { 1336 reset($this->my_config); 1337 while (list($key, $val) = each($this->my_config)) 1426 reset($this->my_config); 1427 while (list($key, $val) = each($this->my_config)) 1338 1428 { 1339 1429 if(isset($_POST['f_'.$key])) … … 1364 1454 1365 1455 //standards inputs zones 1366 reset($this->my_config); 1367 while (list($key, $val) = each($this->my_config)) 1456 reset($this->my_config); 1457 while (list($key, $val) = each($this->my_config)) 1368 1458 { 1369 1459 $template_datas["f_".$key]=$val; 1370 1460 } 1461 1462 // 1463 $template_datas['ajaxurl']=$this->page_link; 1371 1464 1372 1465 // define selected item for lists zones … … 1395 1488 } 1396 1489 // default ip order 1397 reset($this->list_sortip); 1398 while (list($key, $val) = each($this->list_sortip)) 1490 reset($this->list_sortip); 1491 while (list($key, $val) = each($this->list_sortip)) 1399 1492 { 1400 1493 $template_list_values['sortip'][]=$val; … … 1434 1527 1435 1528 1436 /* 1529 /* 1437 1530 display tools page 1438 1531 */ … … 1448 1541 1449 1542 // >> PURGE HISTORY -------------------------------------------------------- 1450 if(isset($_POST['apply_tool_purge_history'])) 1543 if(isset($_POST['apply_tool_purge_history'])) 1451 1544 { 1452 1545 if(!is_adviser()) 1453 1546 { 1454 $action_result['action']='AStat_tools_purge_history'; 1455 $action_result['result']='false'; 1547 $action_result['action']='AStat_tools_purge_history'; 1548 $action_result['result']='false'; 1456 1549 $action_result['msg']='AStat_tools_result_ko'; 1457 1550 1458 1551 $ok_to_purge=true; 1459 1552 if($_REQUEST['fAStat_purge_history_type']=='bydate') … … 1466 1559 1467 1560 $purge_date=mktime(0,0,0,$date[1],$date[0],$date[2]); 1468 $f date=date("Y-m-d", mktime(0,0,0,$date[1],$date[0],$date[2]));1561 $fparam=date("Y-m-d", mktime(0,0,0,$date[1],$date[0],$date[2])); 1469 1562 1470 1563 if(date("d/m/Y", $purge_date)!=$_REQUEST['fAStat_purge_history_date']) 1471 { 1472 $action_result['nfo']='AStat_tools_invalid_date'; 1564 { 1565 $action_result['nfo']='AStat_tools_invalid_date'; 1473 1566 $ok_to_purge=false; 1474 1567 } 1475 1568 elseif(date("Ymd", $purge_date)>=date("Ymd")) 1476 1569 { 1477 $action_result['nfo']='AStat_tools_invalid_date2'; 1570 $action_result['nfo']='AStat_tools_invalid_date2'; 1478 1571 $ok_to_purge=false; 1479 1572 } 1480 1573 } 1574 elseif($_REQUEST['fAStat_purge_history_type']=='byipid0') 1575 { 1576 $fparam=$this->my_config['AStat_BlackListedIP']; 1577 } 1481 1578 else 1482 1579 { 1483 $f date="";1580 $fparam=""; 1484 1581 } 1485 1582 1486 1583 if($ok_to_purge) 1487 1584 { 1488 $result=$this->do_purge_history( $f date, $_REQUEST['fAStat_purge_history_type']);1585 $result=$this->do_purge_history( $fparam, $_REQUEST['fAStat_purge_history_type']); 1489 1586 if($result) 1490 1587 { … … 1542 1639 } 1543 1640 } 1544 // 1641 // 1545 1642 elseif(isset($_POST['apply_tool_deleted_picture'])) 1546 1643 { … … 1566 1663 1567 1664 // >> DELETED_CATEGORY ----------------------------------------------------- 1568 elseif(isset($_POST['apply_tool_deleted_category'])) 1665 elseif(isset($_POST['apply_tool_deleted_category'])) 1569 1666 { 1570 1667 if(!is_adviser()) … … 1587 1684 } 1588 1685 // << DELETED_CATEGORY ----------------------------------------------------- 1589 1686 1590 1687 // >> DELETED USER --------------------------------------------------------- 1591 elseif(isset($_POST['apply_tool_deleted_user'])) 1688 elseif(isset($_POST['apply_tool_deleted_user'])) 1592 1689 { 1593 1690 if(!is_adviser()) … … 1615 1712 $table_exists=$this->verify_AStat_picture_table_status(); 1616 1713 if($table_exists==true) 1617 { 1714 { 1618 1715 $template_datas["ASTAT_DELETED_PICTURE_DO_ACTION"] = "checked"; 1619 1716 $template_datas["ASTAT_DELETED_PICTURE_PREPARE"] = "disabled"; 1620 1717 } 1621 1718 else 1622 { 1719 { 1623 1720 $template_datas["ASTAT_DELETED_PICTURE_PREPARE"]="checked"; 1624 1721 $template_datas["ASTAT_DELETED_PICTURE_DO_ACTION"]="disabled"; … … 1632 1729 { 1633 1730 $list=''; 1634 for($i=0;$i<count($nfo[2]);$i++) 1635 { 1731 for($i=0;$i<count($nfo[2]);$i++) 1732 { 1636 1733 if($nfo[2][$i][0]>1) { $s='s'; } else { $s=''; } 1637 $list.="<li>image_id #".$nfo[2][$i][1]." : ".$nfo[2][$i][0]." ".l10n("AStat_event$s")."</li>"; 1734 $list.="<li>image_id #".$nfo[2][$i][1]." : ".$nfo[2][$i][0]." ".l10n("AStat_event$s")."</li>"; 1638 1735 } 1639 1736 $template_datas["ASTAT_DELETED_PICTURE_NFO"] = sprintf(l10n('AStat_tools_deleted_picture_nfo1'), $nfo[0], $nfo[1], $list); … … 1644 1741 { 1645 1742 $template_datas["ASTAT_DELETED_PICTURE_NFO"] = l10n('AStat_tools_deleted_picture_nfo2'); 1646 } 1743 } 1647 1744 // << DISPLAY DELETED_PICTURE NFO ------------------------------------------ 1648 1745 … … 1672 1769 { 1673 1770 $list=''; 1674 for($i=0;$i<count($nfo[2]);$i++) 1675 { 1771 for($i=0;$i<count($nfo[2]);$i++) 1772 { 1676 1773 if($nfo[2][$i][0]>1) { $s='s'; } else { $s=''; } 1677 $list.="<li>user_id #".$nfo[2][$i][1]." : ".$nfo[2][$i][0]." ".l10n("AStat_event$s")."</li>"; 1774 $list.="<li>user_id #".$nfo[2][$i][1]." : ".$nfo[2][$i][0]." ".l10n("AStat_event$s")."</li>"; 1678 1775 } 1679 1776 $template_datas["ASTAT_DELETED_USER_NFO"] = sprintf(l10n('AStat_tools_deleted_user_nfo1'), $nfo[0], $nfo[1], $list); … … 1683 1780 { 1684 1781 $template_datas["ASTAT_DELETED_USER_NFO"] = l10n('AStat_tools_deleted_user_nfo2'); 1685 } 1782 } 1686 1783 // << DISPLAY DELETED USER NFO --------------------------------------------- 1687 1784 … … 1692 1789 { 1693 1790 $template_datas["ASTAT_GENERAL_NFO"] = sprintf(l10n('AStat_tools_general_nfo_nfo'), 1694 $nfo[0], 1791 $nfo[0], 1695 1792 $this->formatoctet($nfo[3]+$nfo[4], "A", " ", 2, true), 1696 1793 $this->formatoctet($nfo[3], "A", " ", 2, true), 1697 1794 $this->formatoctet($nfo[4], "A", " ", 2, true), 1698 date(l10n('AStat_date_time_format'), strtotime($nfo[2])), 1795 date(l10n('AStat_date_time_format'), strtotime($nfo[2])), 1699 1796 date(l10n('AStat_date_time_format'), strtotime($nfo[1])) ); 1797 $template_datas["ASTAT_MINDATE"]=date("m/d/Y",strtotime($nfo[2])); 1700 1798 } 1701 1799 1702 1800 $nfo=$this->purge_history_count_imageid0(); 1703 1801 $template_datas["ASTAT_PURGE_HISTORY_IMAGE_NFO"] = sprintf(l10n('AStat_tools_purge_history_imageid0'), $nfo); 1704 if($nfo==0) 1705 { 1802 if($nfo==0) 1803 { 1706 1804 $template_datas["ASTAT_PURGE_HISTORY_IMAGE_DISABLED"] = " disabled "; 1707 1805 } 1708 1806 $nfo=$this->purge_history_count_categoryid0(); 1709 1807 $template_datas["ASTAT_PURGE_HISTORY_CATEGORY_NFO"] = sprintf(l10n('AStat_tools_purge_history_categoryid0'), $nfo); 1710 if($nfo==0) 1711 { 1808 if($nfo==0) 1809 { 1712 1810 $template_datas["ASTAT_PURGE_HISTORY_CATEGORY_DISABLED"] = " disabled "; 1811 } 1812 $nfo=$this->purge_history_count_ipid0(); 1813 $template_datas["ASTAT_PURGE_HISTORY_IP_NFO"] = sprintf(l10n('AStat_tools_purge_history_ipid0'), $nfo[1], $nfo[0]); 1814 if($nfo[0]==0) 1815 { 1816 $template_datas["ASTAT_PURGE_HISTORY_IP_DISABLED"] = " disabled "; 1713 1817 } 1714 1818 // << GENERAL NFO ---------------------------------------------------------- … … 1752 1856 allow to force HISTORY_TABLE.user_id at 2 (guest) for records with user ident 1753 1857 doesn't exist anymore in the USERS_TABLE 1754 1858 1755 1859 Two usages : 1756 - analyse : return infos about records wich need to be updated 1860 - analyse : return infos about records wich need to be updated 1757 1861 * number of users 1758 1862 * number of records in HISTORY_TABLE … … 1763 1867 { 1764 1868 $returned = array(-1,0,''); 1765 1869 1766 1870 if($mode=='analyse') 1767 1871 { … … 1781 1885 $returned[1]+=$row[0]; 1782 1886 } 1783 1887 1784 1888 } 1785 1889 } … … 1797 1901 1798 1902 /* 1799 tools : deleted_picture 1903 tools : deleted_picture 1800 1904 analyse history to find deleted pictures 1801 1905 Two functions : … … 1809 1913 { 1810 1914 $returned = array(-1,0,''); 1811 1915 1812 1916 if($mode=='analyse') 1813 1917 { … … 1828 1932 $returned[1]+=$row[0]; 1829 1933 } 1830 1934 1831 1935 } 1832 1936 } … … 1834 1938 { 1835 1939 $sql="UPDATE ".HISTORY_TABLE." 1836 SET image_id = 0 1837 WHERE ".HISTORY_TABLE.".image_id > 0 1940 SET image_id = 0 1941 WHERE ".HISTORY_TABLE.".image_id > 0 1838 1942 AND ".HISTORY_TABLE.".image_id NOT IN (SELECT id FROM ".IMAGES_TABLE.")"; 1839 1943 $result=pwg_query($sql); … … 1861 1965 { 1862 1966 $returned = array(-1,0,''); 1863 1967 1864 1968 if($mode=='analyse') 1865 1969 { … … 1880 1984 $returned[1]+=$row[0]; 1881 1985 } 1882 1986 1883 1987 } 1884 1988 } … … 1886 1990 { 1887 1991 $sql="UPDATE ".HISTORY_TABLE." 1888 SET category_id = NULL, section = 'deleted_cat' 1889 WHERE ".HISTORY_TABLE.".category_id > 0 1992 SET category_id = NULL, section = 'deleted_cat' 1993 WHERE ".HISTORY_TABLE.".category_id > 0 1890 1994 AND ".HISTORY_TABLE.".category_id NOT IN (SELECT id FROM ".CATEGORIES_TABLE.")"; 1891 1995 $result=pwg_query($sql); … … 1901 2005 1902 2006 /* 1903 tools : general_nfo 2007 tools : general_nfo 1904 2008 return infos about historic 1905 2009 0 : nulber of records … … 1912 2016 { 1913 2017 $returned = array(-1,'','',0,0); 1914 2018 1915 2019 $sql="SELECT count(id) AS NbRecord, MAX(concat(date,' ', time)) AS LastDate, MIN(concat(date,' ', time)) AS FirstDate "; 1916 2020 $sql.=" FROM ".HISTORY_TABLE; … … 1919 2023 { 1920 2024 $row = mysql_fetch_array($result); 1921 if(is_array($row)) 1922 { 1923 $returned = $row; 2025 if(is_array($row)) 2026 { 2027 $returned = $row; 1924 2028 $sql="SHOW TABLE STATUS LIKE '".HISTORY_TABLE."';"; 1925 2029 $result=pwg_query($sql); … … 1936 2040 1937 2041 /* 1938 tools : do_purge_history 2042 tools : do_purge_history 1939 2043 do a purge of history table : 1940 2044 - $purgetype='bydate' : purge all record wich date is less than given date 1941 2045 - $purgetype='byimageid0' : with and image_id = 0 1942 2046 ------------------------------------------------------------------------------------ */ 1943 private function do_purge_history($ date, $purgetype)2047 private function do_purge_history($param, $purgetype) 1944 2048 { 1945 2049 if($purgetype=='bydate') 1946 2050 { 1947 $sql="DELETE FROM ".HISTORY_TABLE." WHERE date < '$ date'";2051 $sql="DELETE FROM ".HISTORY_TABLE." WHERE date < '$param'"; 1948 2052 } 1949 2053 elseif($purgetype=='byimageid0') … … 1955 2059 $sql="DELETE FROM ".HISTORY_TABLE." WHERE category_id is null and section='deleted_cat'"; 1956 2060 } 1957 else 1958 { 2061 elseif($purgetype=='byipid0') 2062 { 2063 $sql="DELETE FROM ".HISTORY_TABLE." WHERE ".$this->make_IP_where_clause($param); 2064 } 2065 else 2066 { 1959 2067 return(false); 1960 2068 } … … 1965 2073 $sql="OPTIMIZE TABLE ".HISTORY_TABLE; 1966 2074 $result=pwg_query($sql); 1967 return($result); 2075 return($result); 1968 2076 } 1969 2077 return(false); … … 1994 2102 } 1995 2103 1996 1997 /* 1998 tools : deleted_picture 1999 > verify_AStat_picture_table_status : 2000 > prepare_AStat_picture_table : 2104 private function purge_history_count_ipid0() 2105 { 2106 if($this->my_config['AStat_BlackListedIP']!="") 2107 { 2108 $list=explode(',', $this->my_config['AStat_BlackListedIP']); 2109 } 2110 else 2111 { 2112 $list=array(); 2113 } 2114 2115 $returned=array(0,count($list)); 2116 2117 if($this->my_config['AStat_BlackListedIP']!='') 2118 { 2119 $sql="SELECT COUNT(id) 2120 FROM ".HISTORY_TABLE." 2121 WHERE ".$this->make_IP_where_clause($this->my_config['AStat_BlackListedIP']); 2122 $result=pwg_query($sql); 2123 if($result) 2124 { 2125 $row=mysql_fetch_array($result); 2126 $returned[0]=$row[0]; 2127 } 2128 } 2129 return($returned); 2130 } 2131 2132 2133 /* 2134 tools : deleted_picture 2135 > verify_AStat_picture_table_status : 2136 > prepare_AStat_picture_table : 2001 2137 */ 2002 2138 private function verify_AStat_picture_table_status() … … 2020 2156 global $prefixeTable; 2021 2157 2022 $sql="CREATE TABLE ".$prefixeTable."AStat_picture (PRIMARY KEY (id), KEY ifile(file)) 2023 SELECT id, file 2158 $sql="CREATE TABLE ".$prefixeTable."AStat_picture (PRIMARY KEY (id), KEY ifile(file)) 2159 SELECT id, file 2024 2160 FROM ".IMAGES_TABLE; 2025 2161 $result=pwg_query($sql); … … 2027 2163 { 2028 2164 return(true); 2029 } 2165 } 2030 2166 return(false); 2031 2167 } … … 2035 2171 global $prefixeTable; 2036 2172 $returned=array(false,0,0); 2037 2173 2038 2174 if($this->verify_AStat_picture_table_status()) 2039 2175 { 2040 2176 $sql="SELECT count(DISTINCT ".$prefixeTable."AStat_picture.id), count(".HISTORY_TABLE.".id) 2041 FROM ".HISTORY_TABLE.", ".$prefixeTable."AStat_picture 2042 WHERE ".HISTORY_TABLE.".image_id = ".$prefixeTable."AStat_picture.id 2177 FROM ".HISTORY_TABLE.", ".$prefixeTable."AStat_picture 2178 WHERE ".HISTORY_TABLE.".image_id = ".$prefixeTable."AStat_picture.id 2043 2179 AND ".HISTORY_TABLE.".image_id NOT IN (SELECT id FROM ".IMAGES_TABLE.") 2044 2180 ORDER BY ".$prefixeTable."AStat_picture.id"; … … 2064 2200 2065 2201 $sql="CREATE TABLE ".$prefixeTable."AStat_picture2 (PRIMARY KEY (OldId)) 2066 SELECT AStat_tmp.id as OldId , ".IMAGES_TABLE.".id as NewId, ".IMAGES_TABLE.".storage_category_id as NewCatId 2202 SELECT AStat_tmp.id as OldId , ".IMAGES_TABLE.".id as NewId, ".IMAGES_TABLE.".storage_category_id as NewCatId 2067 2203 FROM (SELECT DISTINCT ".$prefixeTable."AStat_picture.* 2068 FROM ".HISTORY_TABLE.", ".$prefixeTable."AStat_picture 2069 WHERE ".HISTORY_TABLE.".image_id = ".$prefixeTable."AStat_picture.id 2204 FROM ".HISTORY_TABLE.", ".$prefixeTable."AStat_picture 2205 WHERE ".HISTORY_TABLE.".image_id = ".$prefixeTable."AStat_picture.id 2070 2206 AND ".HISTORY_TABLE.".image_id NOT IN (SELECT id FROM ".IMAGES_TABLE.") 2071 2207 ORDER BY ".$prefixeTable."AStat_picture.id … … 2077 2213 $sql="UPDATE ".HISTORY_TABLE.", ".$prefixeTable."AStat_picture2, ".IMAGES_TABLE." 2078 2214 SET ".HISTORY_TABLE.".image_id = ".$prefixeTable."AStat_picture2.NewId, 2079 ".HISTORY_TABLE.".category_id = ".$prefixeTable."AStat_picture2.NewCatId 2215 ".HISTORY_TABLE.".category_id = ".$prefixeTable."AStat_picture2.NewCatId 2080 2216 WHERE ".$prefixeTable."AStat_picture2.OldId = ".HISTORY_TABLE.".image_id"; 2081 2217 $result=pwg_query($sql); … … 2088 2224 $sql="DROP TABLE IF EXISTS ".$prefixeTable."AStat_picture"; 2089 2225 $result=pwg_query($sql); 2090 } 2226 } 2091 2227 return($returned); 2092 2228 } … … 2146 2282 2147 2283 2148 /* 2284 /* 2149 2285 this function make SELECT "WHERE" clause for filter list 2150 2286 … … 2173 2309 2174 2310 2175 /* 2311 /* 2176 2312 format text : <a href="$link">$value</a> 2177 2313 */ … … 2187 2323 { //basic test, maybe a pcre will be more appropriate... 2188 2324 $tmp=explode('.', $ip); 2189 if(count($tmp)!=4) 2325 if(count($tmp)!=4) 2190 2326 { return (false); } 2191 2327 2192 for($i=0;$i<4;$i++) 2193 { 2194 if(!is_numeric($tmp[$i])) { return (false); } 2328 for($i=0;$i<4;$i++) 2329 { 2330 if(!is_numeric($tmp[$i])) { return (false); } 2195 2331 } 2196 2332 return (true); … … 2203 2339 { //filename can be <filename.truc.jpeg> for example 2204 2340 $tmp = explode('.', $file); 2205 if(count($tmp)>1) { $tmp[count($tmp)-1] = $newext; } 2206 return implode('.', $tmp); 2341 if(count($tmp)>1) { $tmp[count($tmp)-1] = $newext; } 2342 return implode('.', $tmp); 2207 2343 } 2208 2344 2209 /* 2345 /* 2210 2346 format number $octets with unit 2211 2347 $format = "A" : auto … … 2229 2365 { $format="M"; } 2230 2366 else 2231 { $format="G"; } 2367 { $format="G"; } 2232 2368 } 2233 2369 switch($format) … … 2244 2380 case "G": 2245 2381 $unite="Go"; $div=1024000000; 2246 break; 2247 } 2248 2382 break; 2383 } 2384 2249 2385 $retour=number_format($octets/$div, $prec, '.', $thsep); 2250 2386 if($unitevis) … … 2253 2389 } 2254 2390 2391 private function make_IP_where_clause($list) 2392 { 2393 $returned=""; 2394 2395 $tmp=explode(",", $list); 2396 foreach($tmp as $key=>$val) 2397 { 2398 if($returned!="") { $returned.=" OR "; } 2399 $returned.=" IP LIKE '".$val."' "; 2400 } 2401 if($returned!="") 2402 { 2403 $returned ="(".$returned.")"; 2404 } 2405 return($returned); 2406 } 2407 2408 /* --------------------------------------------------------------------------- 2409 * AJAX functions 2410 * ------------------------------------------------------------------------- */ 2411 protected function ajax_listip($filter, $exclude) 2412 { 2413 $sql="SELECT IP, COUNT(id) as NbEvents FROM ".HISTORY_TABLE; 2414 2415 $where=array(); 2416 if($filter!="") 2417 { 2418 $where[]=" IP LIKE '".$filter."' "; 2419 } 2420 if($exclude!="") 2421 { 2422 $where[]=" NOT ".$this->make_IP_where_clause($exclude); 2423 } 2424 if(count($where)>0) 2425 { 2426 $sql.=" WHERE ".implode(" AND ", $where); 2427 } 2428 $sql.=" GROUP BY IP ORDER BY NbEvents desc, IP asc LIMIT 0,100"; 2429 2430 $list="<select multiple id='iipsellist'>"; 2431 $result=pwg_query($sql); 2432 if($result) 2433 { 2434 while($row=mysql_fetch_array($result)) 2435 { 2436 $list.="<option value='".$row['IP']."'>".$row['IP'].str_repeat(" ", 15-strlen($row['IP']))." (".$row['NbEvents'].")</option>"; 2437 } 2438 } 2439 $list.="</select>"; 2440 2441 return($list); 2442 } 2443 2444 2255 2445 } // AStat_AI class 2256 2446 -
extensions/AStat/language/en_UK/plugin.lang.php
r3394 r3706 108 108 $lang['AStat_sortip_page'] = 'Number of pages seen'; 109 109 $lang['AStat_RefIPLabel'] = 'User / IP Adress'; 110 $lang['AStat_DefaultSortIP'] = 'Default sort'; 110 $lang['AStat_DefaultSortIP'] = 'Default sort'; 111 111 $lang['AStat_general_config'] = 'Global settings'; 112 112 $lang['AStat_SeeTimeRequests'] = 'Show time execution of requests'; … … 162 162 $lang['AStat_tools_purge_history_nfo'] = "This function will clean the history from all past event from a given date and will optimize the table.<br><b>Operation cannot be reversed</b>."; 163 163 $lang['AStat_tools_purge_history_apply'] = "Clean"; 164 $lang['AStat_tools_purge_history_date'] = "To purge all events prior (DD/MM/AAAA)";165 $lang['AStat_tools_purge_history_imageid0'] = "To purge all events associated to deleted images (%s events in history)"; 166 $lang['AStat_tools_purge_history_categoryid0'] = "To purge events associated to deleted categories (%s events in history)"; 164 $lang['AStat_tools_purge_history_date'] = "To purge all events prior "; 165 $lang['AStat_tools_purge_history_imageid0'] = "To purge all events associated to deleted images (%s events in history)"; 166 $lang['AStat_tools_purge_history_categoryid0'] = "To purge events associated to deleted categories (%s events in history)"; 167 167 $lang['AStat_tools_result_ko'] = "An error has occurred. Action has not been correctly performed"; 168 $lang['AStat_tools_invalid_date'] = "Given date is not valid !"; 169 $lang['AStat_tools_invalid_date2'] = "Given date is upper or equal to date of the day"; 170 $lang['AStat_tools_deleted_picture_error0'] = "Priming has failed"; 168 $lang['AStat_tools_invalid_date'] = "Given date is not valid !"; 169 $lang['AStat_tools_invalid_date2'] = "Given date is upper or equal to date of the day"; 170 $lang['AStat_tools_deleted_picture_error0'] = "Priming has failed"; 171 171 $lang['AStat_tools_deleted_picture_error1'] = "New association of events in the history has failed"; 172 172 $lang['AStat_tools_deleted_picture_ok0'] = "Priming of the table succeeded, files can be reorganized on the server"; … … 204 204 $lang['AStat_gpc2_not_installed'] = "Plugin 'Grum Plugins Classes 2' (release >= %s) is needed to install AStat"; 205 205 206 //--- >> v2.1.0 >> 207 $lang['AStat_BlackListedIP'] = "Blacklisted IP"; 208 $lang['AStat_AddIP'] = "Add to the blacklist"; 209 $lang['AStat_DelIP'] = "Delete from the blacklist"; 210 $lang['AStat_tools_purge_history_ipid0'] = "To purge events associated with IP from the blacklist (%s items in the blacklist, %s events in history)" 211 $lang['AStat_IP_blacklist'] = "Add to the blacklist"; 206 212 207 213 ?> -
extensions/AStat/language/es_ES/plugin.lang.php
r3631 r3706 110 110 $lang['AStat_sortip_page'] = 'Número de páginas vistas'; 111 111 $lang['AStat_RefIPLabel'] = 'Utilizador / Dirección IP'; 112 $lang['AStat_DefaultSortIP'] = 'Selección por defecto'; 112 $lang['AStat_DefaultSortIP'] = 'Selección por defecto'; 113 113 $lang['AStat_general_config'] = 'Configuración general'; 114 114 $lang['AStat_SeeTimeRequests'] = 'Ver la duración de ejecución de las demandas'; … … 158 158 $lang['AStat_section_old_deleted_cat'] = 'Antigua categoría que no ha podido ser importada'; 159 159 $lang['AStat_tools_general_nfo_nfo'] = "<ul><li>%s acontecimientos están presentes en la reseña histórica</li> 160 161 162 160 <li>La mesa pesa %s (Mesa: %s ; Índice: %s)</li> 161 <li>Data del primer acontecimiento : %s</li> 162 <li>Data del último acontecimiento : %s</li>"; 163 163 $lang['AStat_tools_purge_history'] = "Purga de la reseña histórica"; 164 164 $lang['AStat_tools_purge_history_nfo'] = "Esta función efectúa sobre la reseña histórica una purga de todos los acontecimientos anteriores a una fecha dada y optimiza la mesa. <br><b>Esta acción irreversible</b>."; 165 165 $lang['AStat_tools_purge_history_apply'] = "Aplicar la purga"; 166 $lang['AStat_tools_purge_history_date'] = "Purgar los acontecimientos anteriores a (JJ/MM/AAAA) "; 167 $lang['AStat_tools_purge_history_imageid0'] = "Purgar los acontecimientos asociados con imágenes suprimidas (%s acontecimientos en la reseña histórica)";168 $lang['AStat_tools_purge_history_categoryid0'] = "Purg er les évènements associés à des catégories supprimées (%s acontecimientos en la reseña histórica)";166 $lang['AStat_tools_purge_history_date'] = "Purgar los acontecimientos anteriores a (JJ/MM/AAAA) "; 167 $lang['AStat_tools_purge_history_imageid0'] = "Purgar los acontecimientos asociados con imágenes suprimidas (%s acontecimientos en la reseña histórica)"; 168 $lang['AStat_tools_purge_history_categoryid0'] = "Purgar los acontecimientos asociados con categorías suprimidas (%s acontecimientos en la reseña histórica)"; 169 169 $lang['AStat_tools_result_ko'] = "Un error sobrevino, la acción no pudo ser correctamente llevada"; 170 $lang['AStat_tools_invalid_date'] = "La fecha informada es inválida !"; 171 $lang['AStat_tools_invalid_date2'] = "¡ La fecha informada es superior o igual a la fecha del día!"; 172 $lang['AStat_tools_deleted_picture_error0'] = "La preparación fue suspendido"; 173 $lang['AStat_tools_deleted_picture_error1'] = "El réassocation de los acontecimientos de la reseña histórica fue suspendido"; 174 $lang['AStat_tools_deleted_picture_ok0'] = "La preparación de la mesa tuvo éxito, usted puede proceder a la reorganización de los ficheros sobre el servidor"; 175 $lang['AStat_tools_deleted_picture_ok1'] = "El réassocation de los acontecimientos de la reseña histórica tuvo éxito"; 170 $lang['AStat_tools_invalid_date'] = "La fecha informada es inválida !"; 171 $lang['AStat_tools_invalid_date2'] = "¡ La fecha informada es superior o igual a la fecha del día!"; 172 $lang['AStat_tools_deleted_picture_error0'] = "La preparación fue suspendido"; 173 $lang['AStat_tools_deleted_picture_error1'] = "El réassocation de los acontecimientos de la reseña histórica fue suspendido"; 174 $lang['AStat_tools_deleted_picture_ok0'] = "La preparación de la mesa tuvo éxito, usted puede proceder a la reorganización de los ficheros sobre el servidor"; 175 $lang['AStat_tools_deleted_picture_ok1'] = "El réassocation de los acontecimientos de la reseña histórica tuvo éxito"; 176 176 177 177 $lang['AStat_tools_deleted_picture_nfo3'] = "Cuando imágenes son desplazadas físicamente por un repertorio, la sincronización suprime las imágenes de la base y las reinserta con una nueva referencia. Una imagen trasladada deja pues en los acontecimientos de la reseña histórica un rastro con referencias que no existen más.</p><p><i>AStat</i> Permite :<ul><li>de memorizar las referencias de imágenes <u><i>delantera</i></u> De proceder a la sincronización </li><li>de reasociar en los acontecimientos de la reseña histórica las buenas referencias de una imagen <u><i>Después</i></u> haber procedido a una sincronización</li></ul></p><p><b>Atención !</b><br><ul><li> si imágenes diferentes tienen los mismos nombres de ficheros, el resultado es imprevisible</li><li>este carácter funcional no puede tratar las imágenes para las cuales el fichero sobre el servidor fue renomé</li></ul>"; … … 183 183 184 184 185 $lang['AStat_tools_deleted_category'] = 'Poner al día en la reseña histórica las referencias de categorías'; 185 $lang['AStat_tools_deleted_category'] = 'Poner al día en la reseña histórica las referencias de categorías'; 186 186 $lang['AStat_tools_deleted_category_nfo0'] = "Afecta para los acontecimientos de la reseña histórica référencants categorías que no existen más, la sección <i>Categoría suprimida</i>."; // v1.3.0 187 187 $lang['AStat_tools_deleted_category_nfo1'] = "%s categorías inexistentes son presentes en los acontecimientos de la reseña histórica e impactent %s acontecimientos : <ul>%s</ul>"; … … 205 205 $lang['AStat_gpc2_not_installed'] = "El plugin ' Grum Plugins Classes 2' (version >= %s) es necesario para que AStat pueda estar instalado"; 206 206 207 207 //--- >> v2.1.0 >> 208 $lang['AStat_BlackListedIP'] = "Lista negra de direcciones IP"; 209 $lang['AStat_AddIP'] = "Añadir a la lista negra"; 210 $lang['AStat_DelIP'] = "Eliminar de la lista negra"; 211 $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)"; 212 $lang['AStat_IP_blacklist'] = "Poner en lista negra"; 208 213 ?> -
extensions/AStat/language/fr_FR/plugin.lang.php
r3394 r3706 110 110 $lang['AStat_sortip_page'] = 'Nombre de pages vues'; 111 111 $lang['AStat_RefIPLabel'] = 'Utilisateur / Adresse IP'; 112 $lang['AStat_DefaultSortIP'] = 'Tri par défaut'; 112 $lang['AStat_DefaultSortIP'] = 'Tri par défaut'; 113 113 $lang['AStat_general_config'] = 'Configuration générale'; 114 114 $lang['AStat_SeeTimeRequests'] = 'Voir la durée d\'exécution des requêtes'; … … 158 158 $lang['AStat_section_old_deleted_cat'] = 'Ancienne catégorie n\'ayant pu être importée'; 159 159 $lang['AStat_tools_general_nfo_nfo'] = "<ul><li>%s évènements sont présents dans l'historique</li> 160 161 162 160 <li>La table pèse %s (Table: %s ; Index: %s)</li> 161 <li>Date du premier évènement : %s</li> 162 <li>Date du dernier évènement : %s</li>"; 163 163 $lang['AStat_tools_purge_history'] = "Purge de l'historique"; 164 164 $lang['AStat_tools_purge_history_nfo'] = "Cette fonction effectue sur l'historique une purge de tous les évènements antérieurs à une date donnée et optimise la table. <br><b>Cette action irréversible</b>."; 165 165 $lang['AStat_tools_purge_history_apply'] = "Appliquer la purge"; 166 $lang['AStat_tools_purge_history_date'] = "Purger les évènements antérieurs à (JJ/MM/AAAA) ";167 $lang['AStat_tools_purge_history_imageid0'] = "Purger les évènements associés à des images supprimées (%s évènements dans l'historique)"; 168 $lang['AStat_tools_purge_history_categoryid0'] = "Purger les évènements associés à des catégories supprimées (%s évènements dans l'historique)"; 166 $lang['AStat_tools_purge_history_date'] = "Purger les évènements antérieurs à "; 167 $lang['AStat_tools_purge_history_imageid0'] = "Purger les évènements associés à des images supprimées (%s évènements dans l'historique)"; 168 $lang['AStat_tools_purge_history_categoryid0'] = "Purger les évènements associés à des catégories supprimées (%s évènements dans l'historique)"; 169 169 $lang['AStat_tools_result_ko'] = "Une erreur est survenue, l'action n'a pu être correctement menée"; 170 $lang['AStat_tools_invalid_date'] = "La date renseignée est invalide !"; 171 $lang['AStat_tools_invalid_date2'] = "La date renseignée est supérieure ou égale à la date du jour !"; 172 $lang['AStat_tools_deleted_picture_error0'] = "La préparation a échouée"; 173 $lang['AStat_tools_deleted_picture_error1'] = "La réassocation des évènements de l'historique a échouée"; 174 $lang['AStat_tools_deleted_picture_ok0'] = "La préparation de la table a réussie, vous pouvez procéder à la réorganisation des fichiers sur le serveur"; 175 $lang['AStat_tools_deleted_picture_ok1'] = "La réassocation des évènements de l'historique a réussie"; 170 $lang['AStat_tools_invalid_date'] = "La date renseignée est invalide !"; 171 $lang['AStat_tools_invalid_date2'] = "La date renseignée est supérieure ou égale à la date du jour !"; 172 $lang['AStat_tools_deleted_picture_error0'] = "La préparation a échouée"; 173 $lang['AStat_tools_deleted_picture_error1'] = "La réassocation des évènements de l'historique a échouée"; 174 $lang['AStat_tools_deleted_picture_ok0'] = "La préparation de la table a réussie, vous pouvez procéder à la réorganisation des fichiers sur le serveur"; 175 $lang['AStat_tools_deleted_picture_ok1'] = "La réassocation des évènements de l'historique a réussie"; 176 176 177 177 $lang['AStat_tools_deleted_picture_nfo3'] = "Lorsque des images sont déplacées physiquement d'un répertoire, la synchronisation supprime les images de la base et les réinsère avec une nouvelle référence. Une image déplacée laisse donc dans les évènements de l'historique une trace avec des références qui n'existent plus.</p><p><i>AStat</i> permet :<ul><li>de mémoriser les références d'images <u><i>avant</i></u> de procéder à la synchronisation </li><li>de réassocier dans les évènements de l'historique les bonnes références d'une image <u><i>après</i></u> avoir procédé à une synchronisation</li></ul></p><p><b>Attention !</b><br><ul><li>si des images différentes ont les mêmes noms de fichiers, le résultat est imprévisible</li><li>cette fonctionnalité ne peut pas traiter les images pour lesquelles le fichier sur le serveur a été renomé</li></ul>"; … … 183 183 184 184 185 $lang['AStat_tools_deleted_category'] = 'Mettre à jour dans l\'historique les références de catégories'; 185 $lang['AStat_tools_deleted_category'] = 'Mettre à jour dans l\'historique les références de catégories'; 186 186 $lang['AStat_tools_deleted_category_nfo0'] = "Affecte pour les évènements de l'historique référencants des catégories qui n'existent plus, la section <i>Catégorie supprimée</i>."; // v1.3.0 187 187 $lang['AStat_tools_deleted_category_nfo1'] = "%s catégories inexistantes sont présentes dans les évènements de l'historique et impactent %s évènements : <ul>%s</ul>"; … … 205 205 $lang['AStat_gpc2_not_installed'] = "Le plugin 'Grum Plugins Classes 2' (version >= %s) est nécessaire pour que AStat puisse être installé"; 206 206 207 //--- >> v2.1.0 >> 208 $lang['AStat_BlackListedIP'] = "Liste noire des adresses IP"; 209 $lang['AStat_AddIP'] = "Ajouter à la liste"; 210 $lang['AStat_DelIP'] = "Supprimer de la liste"; 211 $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)"; 212 $lang['AStat_IP_blacklist'] = "Mettre sur liste noire"; 207 213 208 214 ?> -
extensions/AStat/main.inc.php
r3543 r3706 2 2 /* 3 3 Plugin Name: AStat.2 4 Version: 2. 0.54 Version: 2.1.0 5 5 Description: Statistiques avancées / Advanced statistics 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=172 … … 21 21 :: HISTORY 22 22 23 2.0.0 - 13/05/07 - release for piwigo 2.0 24 2.0.1 - 09/03/01 - bug corrected (can't open file because plugin directory 25 was hardcoded...) 26 2.0.2 - 09/03/08 - bug referenced 27 english forum : http://piwigo.org/forum/viewtopic.php?pid=105990#p105990 28 french forum : http://fr.piwigo.org/forum/viewtopic.php?pid=107205#p107205 29 SQL request for stat by categories works with mySQL 4.1.22 and not with mySQL 5 30 2.0.3 - 28/03/08 - bug referenced 31 french forum : http://fr.piwigo.org/forum/viewtopic.php?pid=107236#p107236 32 SQL request for stat by categories works with mySQL 4.1.22 and not with mySQL 5 33 2.0.4 - 21/05/09 - bug on tools 34 it was not possible to use tools to manage deleted items 35 2.0.5 - 07/07/09 - bug in code - invalid character on line 2194 23 24 | release | date | 25 | 2.0.0 | 2007/05/07 | * release for piwigo 2.0 26 | 2.0.1 | 2008/03/01 | * bug corrected (can't open file because plugin directory 27 | | | was hardcoded...) 28 | 2.0.2 | 2008/03/09 | * bug referenced 29 | | | english forum : http://piwigo.org/forum/viewtopic.php?pid=105990#p105990 30 | | | french forum : http://fr.piwigo.org/forum/viewtopic.php?pid=107205#p107205 31 | | | SQL request for stat by categories works with mySQL 4.1.22 and not with mySQL 5 32 | 2.0.3 | 2008/03/28 | * bug referenced 33 | | | french forum : http://fr.piwigo.org/forum/viewtopic.php?pid=107236#p107236 34 | | | SQL request for stat by categories works with mySQL 4.1.22 and not with mySQL 5 35 | 2.0.4 | 2009/05/21 | * bug on tools 36 | | | it was not possible to use tools to manage deleted items 37 | 2.0.5 | 2009/07/07 | * bug in code - invalid character on line 2194 38 | 2.1.0 | 2009/07/28 | * add a blacklist for IP and use it for stats 39 | | | * new tools 40 | | | - possibility to purge history on blacklisted IP address 41 | | | - use of jQuery datepicker for purge date 42 | | | 43 | | | 44 | | | 45 | | | 46 | | | 47 | | | 48 | | | 49 50 36 51 37 52 :: TO DO … … 55 70 define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/'); 56 71 57 define('ASTAT_VERSION' , '2. 0.5'); // => ne pas oublier la version dans l'entête !!72 define('ASTAT_VERSION' , '2.1.0'); // => ne pas oublier la version dans l'entête !! 58 73 59 74 global $prefixeTable;
Note: See TracChangeset
for help on using the changeset viewer.