Statistics plugin update by Blase16, see http://board.s9y.org/viewtopic.php?t=8561
This commit is contained in:
parent
8fe0772f84
commit
94db99efe6
@ -25,7 +25,7 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$propbag->add('description', PLUGIN_EVENT_STATISTICS_DESC);
|
||||
$propbag->add('stackable', false);
|
||||
$propbag->add('author', 'Arnan de Gans, Garvin Hicking, Fredrik Sandberg');
|
||||
$propbag->add('version', '1.44');
|
||||
$propbag->add('version', '1.45');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'smarty' => '2.6.7',
|
||||
@ -169,7 +169,23 @@ class serendipity_event_statistics extends serendipity_event
|
||||
'24' => "Wells Search II",
|
||||
'25' => "Dumbot",
|
||||
'26' => "GeoBot",
|
||||
'27' => "DigExt"
|
||||
'27' => "DigExt",
|
||||
'28' => "Feedfetcher-Google",
|
||||
'29' => "FeedBurner",
|
||||
'30' => "Jeeves/Teoma",
|
||||
'31' => "FeedBurner/1.0(http://www.FeedBurner.com)",
|
||||
'32' => "Technorati Feed Engine/0.01 (Java 1.4.2_07 Sun Microsystems Inc./Linux 2.6.9-22.0.1.ELsmp)",
|
||||
'33' => "Java/1.5.0_10",
|
||||
'34' => "Java/1.5.0_06",
|
||||
'35' => "MarsEdit",
|
||||
'36' => "Blogslive (info@blogslive.com)",
|
||||
'37' => "XMLRPCCocoa",
|
||||
'38' => "Feedfetcher-Google; (+www.google.com/feedfetcher.html)",
|
||||
'39' => "YahooFeedSeeker/2.0 (compatible; Mozilla 4.0; MSIE 5.5; http://publisher.yahoo.com/rssguide)",
|
||||
'40' => "Mediapartners-Google/2.1",
|
||||
'41' => "MagpieRSS/0.61 (+http://magpierss.sf.net)",
|
||||
'42' => "www.google.com/feedfetcher.html)",
|
||||
'43' => "Sphere Scout&v4.0 (beta)- scout at sphere dot com"
|
||||
);
|
||||
|
||||
foreach($banned_array AS $ban) {
|
||||
@ -559,7 +575,11 @@ class serendipity_event_statistics extends serendipity_event
|
||||
$sql_day_update = "UPDATE {$serendipity['dbPrefix']}visitors_count SET visits = visits+1, hits = hits+1 WHERE year='$year' AND month='$month' AND day='$day'";
|
||||
switch($action) {
|
||||
case "update":
|
||||
serendipity_db_query($sql_hit_update);
|
||||
if($sql['result'] >= 1) {
|
||||
serendipity_db_query($sql_hit_update);
|
||||
} else {
|
||||
serendipity_db_query($sql_day_new);
|
||||
}
|
||||
break;
|
||||
case "new":
|
||||
if($sql['result'] >= 1) {
|
||||
@ -583,10 +603,15 @@ class serendipity_event_statistics extends serendipity_event
|
||||
|
||||
function countVisitor($useragent, $remoteaddr, $referer){
|
||||
global $serendipity;
|
||||
|
||||
$this->updatestats('new');
|
||||
|
||||
$thedate = date('Y-m-d');
|
||||
$ip=strip_tags($remoteaddr);
|
||||
$ip_how_often = serendipity_db_query("SELECT COUNT(ip) AS result FROM {$serendipity['dbPrefix']}visitors WHERE ip ='$ip' and day='$thedate'", true);
|
||||
|
||||
if($ip_how_often['result'] >=1){
|
||||
$this->updatestats('update');
|
||||
} else {
|
||||
$this->updatestats('new');
|
||||
}
|
||||
$values = array(
|
||||
'sessID' => strip_tags(session_id()),
|
||||
'day' => $thedate,
|
||||
@ -846,8 +871,14 @@ class serendipity_event_statistics extends serendipity_event
|
||||
if ($color == "col1"){$color ="col2";}else{$color ="col1";}
|
||||
echo "<tr>";
|
||||
echo "<td class = \"".$color."\">".$row['day']." ".$row['time']."</td>\n";
|
||||
echo "<td class = \"".$color."\">".wordwrap($row['ref'], 25, "\n", 1)."</td>\n";
|
||||
echo "<td class = \"".$color."\">".wordwrap($row['browser'], 25, "\n", 1)."</td>\n";
|
||||
if($row['ref']!='unknown'){
|
||||
echo "<td class = \"".$color."\"><a
|
||||
href=\"".$row['ref']."\">".wordwrap($row['ref'], 25, "<br />", 1)."</a></td>\n";
|
||||
}
|
||||
if($row['ref']=='unknown'){
|
||||
echo "<td class = \"".$color."\">".wordwrap($row['ref'], 25, "<br />", 1)."</td>\n";
|
||||
}
|
||||
echo "<td class = \"".$color."\">".wordwrap($row['browser'], 25, "<br />", 1)."</td>\n";
|
||||
echo "<td class = \"".$color."\">";
|
||||
if ($row['ip']){
|
||||
echo wordwrap(gethostbyaddr($row['ip']), 25, "\n", 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user