Statistics module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
djprozac

Statistics module

Post by djprozac »

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!
Last edited by djprozac on Sun Sep 23, 2007 2:33 pm, edited 1 time in total.
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

Re: Statistics module

Post by Silmarillion »

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.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm
Location: Helsinki, Finland

Re: Statistics module

Post by KO »

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
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

Re: Statistics module

Post by Silmarillion »

Thats a really good idea! Would be useful! I'll have a look at it...

sil.
djprozac

Re: Statistics module

Post by djprozac »

Thanks for the quick reply! I'll keep checking for updates to the module. Keep up the good work!
bterkuile
Forum Members
Forum Members
Posts: 97
Joined: Sun Jul 22, 2007 11:48 am
Location: Netherlands

Re: Statistics module

Post by bterkuile »

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:

Code: Select all

10;192.168;80.122.77.22/74;190.*.*.33/44
You do the math. Maybe some extra testing is required but I think the next class will just do that.
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;
   }
}
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
Locked

Return to “Modules/Add-Ons”