Hey guys,
Does anybody know what the development status is of the statistics module? There are currently three pretty critical bugs logged in the forge, and as such the module is pretty much unusable...Shame cos it looks so promising!
Statistics module
Statistics module
Last edited by djprozac on Sun Sep 23, 2007 2:33 pm, edited 1 time in total.
- Silmarillion
- Dev Team Member
- Posts: 483
- Joined: Sun Jan 02, 2005 9:10 pm
- Location: Denmark
Re: Statistics module
wow... hadn't checked the bugs in the forge for some time... I will soon! Actually the current state is quite promising, and I have it running myself succesfully, and to customers approval, at several sites.
Sorry for not keeping in touch with the forge-bugs. I will now!
sil.
Sorry for not keeping in touch with the forge-bugs. I will now!
sil.
Re: Statistics module
I know this is feature request but would it be possible to have some php javascript detection that would print statistics that how many browsers does have js on or off. I think this would be important to know for designers when designing pages like javascript navigation etc.
I'm thinking something like this... http://llamasery.com/forums/showthread.php?p=47006 and then print statistics on module.
Statistics looks very promising!
K
I'm thinking something like this... http://llamasery.com/forums/showthread.php?p=47006 and then print statistics on module.
Statistics looks very promising!
K
- Silmarillion
- Dev Team Member
- Posts: 483
- Joined: Sun Jan 02, 2005 9:10 pm
- Location: Denmark
Re: Statistics module
Thats a really good idea! Would be useful! I'll have a look at it...
sil.
sil.
Re: Statistics module
Thanks for the quick reply! I'll keep checking for updates to the module. Keep up the good work!
Re: Statistics module
I remember testing it a while ago. I will post here my findings. First I think the current version 0.8.0b1 breaks the ajax functions in the admin panel. (Try to put a page down in the listcontent.php file and see what happens.) Maybe a whitespace error, but I did not investigate this one good.
The other thing, I think you introduced a ; separated ip-address blocker. I searched on the internet for a standard blocker class/function which supported ranges and wild-cards. I know it must be out there, and it can be done using a few regular expressions, but until I find that one I wrote one myself. This support things like:
You do the math. Maybe some extra testing is required but I think the next class will just do that.
Here the code:
Sorry I post it here and not in the features project page, but I think the code is better represented in this forum. I hope you like it.
Benjamin
The other thing, I think you introduced a ; separated ip-address blocker. I searched on the internet for a standard blocker class/function which supported ranges and wild-cards. I know it must be out there, and it can be done using a few regular expressions, but until I find that one I wrote one myself. This support things like:
Code: Select all
10;192.168;80.122.77.22/74;190.*.*.33/44
Here the code:
Code: Select all
class IpTester{
/** Test if a given ip address matches a certain criterion. This criterion can be
* an array of ip specifications or a string with ip specifications separated by the separator.
* default ;
* use it like: $iptest = new IpTester('10.0;192.168;');
* if($iptest->test($_SERVER['REMOTE_ADDR'])) return 'you are banned!';
*/
var $separator = ';';
var $aMatch = array(); // Array for non transformed match criteria
var $matcher = array(); // Array for transformed match criteria
function __construct($match_ips=$_SERVER['REMOTE_ADDR']){
if(is_array($match_ips))$this->aMatch=$match_ips;
else{
$str=trim($match_ips,' '.$this->separator);
$a=explode($this->separator,$str);
foreach($a as $ip){
$this->aMatch[]=trim($ip,' .');
}
}
foreach($this->aMatch as $matcher){
$aMatch=array();
$aSubIp=explode('.',$matcher);
foreach($aSubIp as $subIp){
if($subIp=='*') $aMatch[]=true;
elseif(is_numeric($subIp))$aMatch[]=$subIp;
elseif(strpos($subIp,'/')!==false)$aMatch[]=explode('/',$subIp);
else $aMatch[]=false;
}
$this->matcher[]=$aMatch;
}
}
function test($ip){
$aIp = explode('.',$ip);
foreach($this->matcher as $match){
for($i=0;$i<count($match);$i++){
if(is_numeric($match[$i])&& $match[$i]!=$aIp[$i])break;
if(is_array($match[$i]) && ($aIp[$i]<$match[$i][0] || $aIp[$i]>$match[$i][1]))break;
if(!$match[$i]) break;
}
if($i==count($match)) return true;
}
return false;
}
}
Benjamin