From 760545c58c8cd325f3f7e763bda92d47377a16bc Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Tue, 24 Jul 2007 12:59:01 +0000 Subject: [PATCH] backport --- .../UTF-8/lang_bg.inc.php | 4 +- .../UTF-8/lang_de.inc.php | 7 +- .../lang_bg.inc.php | 4 +- .../lang_de.inc.php | 7 +- .../lang_en.inc.php | 6 +- .../serendipity_event_statistics.php | 77 +++++++++---------- 6 files changed, 55 insertions(+), 50 deletions(-) diff --git a/plugins/serendipity_event_statistics/UTF-8/lang_bg.inc.php b/plugins/serendipity_event_statistics/UTF-8/lang_bg.inc.php index 170701e..b207c78 100644 --- a/plugins/serendipity_event_statistics/UTF-8/lang_bg.inc.php +++ b/plugins/serendipity_event_statistics/UTF-8/lang_bg.inc.php @@ -61,8 +61,8 @@ @define('PLUGIN_EVENT_STATISTICS_EXT_OPT1', ' Не'); @define('PLUGIN_EVENT_STATISTICS_EXT_OPT2', 'Да, долу на страницата'); @define('PLUGIN_EVENT_STATISTICS_EXT_OPT3', 'Да, горе на страницата'); - @define('PLUGIN_EVENT_STATISTICS_EXT_ALL', 'Показване на пълна статистика?'); - @define('PLUGIN_EVENT_STATISTICS_EXT_ALL_DESC', 'Установете \'не\' за да показвате само статистиката за посетителите'); + @define('PLUGIN_EVENT_STATISTICS_EXT_ALL', 'Установете \'не\' за да показвате само статистиката за посетителите'); + @define('PLUGIN_EVENT_STATISTICS_EXT_ALL_DESC', 'Показване на всичко? (по подразбиране: не)'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL1', 'Не, скриване на всичко освен броячите'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL2', 'Пълна статистика'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISITORS', 'Брой на посетителите'); diff --git a/plugins/serendipity_event_statistics/UTF-8/lang_de.inc.php b/plugins/serendipity_event_statistics/UTF-8/lang_de.inc.php index a3cb206..95637de 100644 --- a/plugins/serendipity_event_statistics/UTF-8/lang_de.inc.php +++ b/plugins/serendipity_event_statistics/UTF-8/lang_de.inc.php @@ -61,12 +61,17 @@ @define('PLUGIN_EVENT_STATISTICS_EXT_ALL1', 'Nein, alles außer dem Zähler verbergen.'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL2', 'Ja, alle Statistiken anzeigen!'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISITORS', 'Anzahl der Besucher'); - @define('PLUGIN_EVENT_STATISTICS_EXT_VISTODAY', 'Anzahl der Besucher heute'); + @define('PLUGIN_EVENT_STATISTICS_EXT_HITSTODAY', 'Aufrufe heute'); + @define('PLUGIN_EVENT_STATISTICS_EXT_HITSTOTAL', 'Aufrufe gesamt'); + @define('PLUGIN_EVENT_STATISTICS_EXT_VISTODAY', 'Besucher heute'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISTOTAL', 'Besucher gesamt'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISSINCE', 'Die erweiterte Besucherstatistik hat seit folgendem Zeitpunkt Daten gesammelt:'); + @define('PLUGIN_EVENT_STATISTICS_EXT_COUNTDESC','Die Zahl der Aufrufe kann sehr groß werden, liefert jedoch einen Wert bezüglich der einzelnen Seitenanfragen. Diese Zahl erhöht sich deshalb mit JEDEM Seitenaufruf sowie jeder Aktualisierung der Seite und kann damit NICHT als Besucherzähler verstanden werden.'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISLATEST', 'Letzte Besucher'); @define('PLUGIN_EVENT_STATISTICS_EXT_TOPREFS', 'Top-Referrer'); @define('PLUGIN_EVENT_STATISTICS_EXT_TOPREFS_NONE', 'Bisher wurden keine Referrer registriert.'); + @define('PLUGIN_EVENT_STATISTICS_EXT_DAYGRAPH', 'Aufrufe, auf den Tag bezogen'); + @define('PLUGIN_EVENT_STATISTICS_EXT_MONTHGRAPH', 'Aufrufe, auf den Monat bezogen'); @define('PLUGIN_EVENT_STATISTICS_OUT_EXT_STATISTICS', 'Erweiterte Besucherstatistik'); @define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS1', 'Aktivieren, keine Robots zählen'); @define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS2', 'Nein, Robots bitte mitzählen'); diff --git a/plugins/serendipity_event_statistics/lang_bg.inc.php b/plugins/serendipity_event_statistics/lang_bg.inc.php index d1059a4..929aef4 100644 --- a/plugins/serendipity_event_statistics/lang_bg.inc.php +++ b/plugins/serendipity_event_statistics/lang_bg.inc.php @@ -61,8 +61,8 @@ @define('PLUGIN_EVENT_STATISTICS_EXT_OPT1', ' Íå'); @define('PLUGIN_EVENT_STATISTICS_EXT_OPT2', 'Äà, äîëó íà ñòðàíèöàòà'); @define('PLUGIN_EVENT_STATISTICS_EXT_OPT3', 'Äà, ãîðå íà ñòðàíèöàòà'); - @define('PLUGIN_EVENT_STATISTICS_EXT_ALL', 'Ïîêàçâàíå íà ïúëíà ñòàòèñòèêà?'); - @define('PLUGIN_EVENT_STATISTICS_EXT_ALL_DESC', 'Óñòàíîâåòå \'íå\' çà äà ïîêàçâàòå ñàìî ñòàòèñòèêàòà çà ïîñåòèòåëèòå'); + @define('PLUGIN_EVENT_STATISTICS_EXT_ALL', 'Óñòàíîâåòå \'íå\' çà äà ïîêàçâàòå ñàìî ñòàòèñòèêàòà çà ïîñåòèòåëèòå'); + @define('PLUGIN_EVENT_STATISTICS_EXT_ALL_DESC', 'Ïîêàçâàíå íà âñè÷êî? (ïî ïîäðàçáèðàíå: íå)'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL1', 'Íå, ñêðèâàíå íà âñè÷êî îñâåí áðîÿ÷èòå'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL2', 'Ïúëíà ñòàòèñòèêà'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISITORS', 'Áðîé íà ïîñåòèòåëèòå'); diff --git a/plugins/serendipity_event_statistics/lang_de.inc.php b/plugins/serendipity_event_statistics/lang_de.inc.php index 2ad08d9..2f587f7 100644 --- a/plugins/serendipity_event_statistics/lang_de.inc.php +++ b/plugins/serendipity_event_statistics/lang_de.inc.php @@ -61,12 +61,17 @@ @define('PLUGIN_EVENT_STATISTICS_EXT_ALL1', 'Nein, alles außer dem Zähler verbergen.'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL2', 'Ja, alle Statistiken anzeigen!'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISITORS', 'Anzahl der Besucher'); - @define('PLUGIN_EVENT_STATISTICS_EXT_VISTODAY', 'Anzahl der Besucher heute'); + @define('PLUGIN_EVENT_STATISTICS_EXT_HITSTODAY', 'Aufrufe heute'); + @define('PLUGIN_EVENT_STATISTICS_EXT_HITSTOTAL', 'Aufrufe gesamt'); + @define('PLUGIN_EVENT_STATISTICS_EXT_VISTODAY', 'Besucher heute'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISTOTAL', 'Besucher gesamt'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISSINCE', 'Die erweiterte Besucherstatistik hat seit folgendem Zeitpunkt Daten gesammelt:'); + @define('PLUGIN_EVENT_STATISTICS_EXT_COUNTDESC','Die Zahl der Aufrufe kann sehr groß werden, liefert jedoch einen Wert bezüglich der einzelnen Seitenanfragen. Diese Zahl erhöht sich deshalb mit JEDEM Seitenaufruf sowie jeder Aktualisierung der Seite und kann damit NICHT als Besucherzähler verstanden werden.'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISLATEST', 'Letzte Besucher'); @define('PLUGIN_EVENT_STATISTICS_EXT_TOPREFS', 'Top-Referrer'); @define('PLUGIN_EVENT_STATISTICS_EXT_TOPREFS_NONE', 'Bisher wurden keine Referrer registriert.'); + @define('PLUGIN_EVENT_STATISTICS_EXT_DAYGRAPH', 'Aufrufe, auf den Tag bezogen'); + @define('PLUGIN_EVENT_STATISTICS_EXT_MONTHGRAPH', 'Aufrufe, auf den Monat bezogen'); @define('PLUGIN_EVENT_STATISTICS_OUT_EXT_STATISTICS', 'Erweiterte Besucherstatistik'); @define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS1', 'Aktivieren, keine Robots zählen'); @define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS2', 'Nein, Robots bitte mitzählen'); diff --git a/plugins/serendipity_event_statistics/lang_en.inc.php b/plugins/serendipity_event_statistics/lang_en.inc.php index cbbdc16..3eaec3e 100644 --- a/plugins/serendipity_event_statistics/lang_en.inc.php +++ b/plugins/serendipity_event_statistics/lang_en.inc.php @@ -62,8 +62,8 @@ @define('PLUGIN_EVENT_STATISTICS_EXT_OPT1', 'No!'); @define('PLUGIN_EVENT_STATISTICS_EXT_OPT2', 'Yes, at the bottom of the page'); @define('PLUGIN_EVENT_STATISTICS_EXT_OPT3', 'Yes, at the top of the page'); -@define('PLUGIN_EVENT_STATISTICS_EXT_ALL', 'Show all statistics?'); -@define('PLUGIN_EVENT_STATISTICS_EXT_ALL_DESC', 'Set to \'no\' to only show visitor stats'); +@define('PLUGIN_EVENT_STATISTICS_EXT_ALL', 'Set to \'no\' to show only visitor stats'); +@define('PLUGIN_EVENT_STATISTICS_EXT_ALL_DESC', 'Show everything? (default: no)'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL1', 'No, hide everything but the counter.'); @define('PLUGIN_EVENT_STATISTICS_EXT_ALL2', 'Yes, show me all statistics!'); @define('PLUGIN_EVENT_STATISTICS_EXT_VISITORS', 'Individual counters'); @@ -82,7 +82,7 @@ @define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS1', 'Enable, do not count bots'); @define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS2', 'Disable, please count bots'); @define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS', 'Robot count protection'); -@define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS_DESC', 'Set to \'yes\' to not count robots. Set to \'no\' to count robots. Currently over 25 bots are banned.'); +@define('PLUGIN_EVENT_STATISTICS_BANNED_HOSTS_DESC', 'Set to \'yes\' to not count robots. set to \'no\' to count robots. Currently over 25 bots are banned.'); @define('PLUGIN_EVENT_STATISTICS_SHOW_LASTENTRY', 'Show date of last entry'); @define('PLUGIN_EVENT_STATISTICS_SHOW_ENTRYCOUNT', 'Show number of entries'); diff --git a/plugins/serendipity_event_statistics/serendipity_event_statistics.php b/plugins/serendipity_event_statistics/serendipity_event_statistics.php index 4e07692..0ec5990 100644 --- a/plugins/serendipity_event_statistics/serendipity_event_statistics.php +++ b/plugins/serendipity_event_statistics/serendipity_event_statistics.php @@ -4,7 +4,6 @@ if (IN_serendipity !== true) { die ("Don't hack!"); } - // Probe for a language include with constants. Still include defines later on, if some constants were missing $probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php'; if (file_exists($probelang)) { @@ -24,8 +23,8 @@ class serendipity_event_statistics extends serendipity_event $propbag->add('name', PLUGIN_EVENT_STATISTICS_NAME); $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.47'); + $propbag->add('author', 'Arnan de Gans, Garvin Hicking, Fredrik Sandberg, kalkin'); + $propbag->add('version', '1.48'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -144,7 +143,7 @@ class serendipity_event_statistics extends serendipity_event // excludelist botagents $banned_array = array( '1' => "unknown", - '2' => "Yahoo! Slurp", + '2' => "bot", '3' => "slurpy", '4' => "agent 007", '5' => "ichiro", @@ -170,39 +169,31 @@ class serendipity_event_statistics extends serendipity_event '25' => "Dumbot", '26' => "GeoBot", '27' => "DigExt", - '28' => "Feedfetcher-Google", + '28' => "Jeeves/Teoma", '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", - '44' => "Mozilla 5.0(BlogCorpusReader 1.4142)", - '45' => "libwww-perl/5.76", - '46' => "Mozilla 5.0(BlogCorpusReader 1.4142)", - '48' => "WordPress/2.0.5", - '49' => "Incutio XML-RPC -- WordPress/2.0.5", - '50' => "-- WordPress/2.1-alpha3", - '51' => "WordPress/2.1.1", - '52' => "WordPress/2.1", - '53' => "ping.wordblog.de/ping/1.0", - '54' => "PEAR HTTP_Request class (http://pear.php.net/ )", - '55' => "Java/1.5.0_07", - '56' => "Mozilla 5.0(BlogCorpusReader 1.4142)", - '57' => "BlogPulseLive(support@blogpulse.com)" + '30' => "Technorati", + '31' => "Java/1.5.0_10", + '32' => "Java/1.5.0_06", + '33' => "MarsEdit", + '34' => "Blogslive", + '35' => "XMLRPCCocoa", + '36' => "Google", + '37' => "MagpieRSS", + '38' => "Sphere Scout", + '39' => "BlogCorpusReader", + '41' => "libwww-perl", + '42' => "WordPress", + '43' => "ping.wordblog.de", + '44' => "PEAR HTTP_Request", + '45' => "Java/1.5.0_07", + '46' => "BlogPulseLive(support@blogpulse.com)", + '47' => "TrackBack", + '48' => "Blogdimension", + '49' => "Yahoo" ); foreach($banned_array AS $ban) { - if (stristr($useragent, $ban)) { + if (stripos($useragent, $ban) !== false) { $found = 1; break; } @@ -797,17 +788,19 @@ class serendipity_event_statistics extends serendipity_event } $num = $this->statistics_getmonthlystats($i, $visitors_count[0]); + $rep = $num; + rsort($rep); + $maxVisHeigh = 100/$rep[0]*2; echo '' . $num[$i]; - $num[$i] = ($num[$i] / 100) * 20 + 1; echo '
'; + echo '" width="8" alt="" align="bottom" height="'.round($num[$i]*$maxVisHeigh).'" />'; echo '
'; } ?> @@ -840,17 +833,19 @@ class serendipity_event_statistics extends serendipity_event } $num = $this->statistics_getdailystats($i, $visitors_count[0]); + $rep = $num; + rsort($rep); + $maxVisHeigh = 100/$rep[0]*2; echo '' . $num[$i]; - $num[$i] = ($num[$i] / 100) * 40 + 1; echo '
'; + echo '" width="8" alt="" align="bottom" height="'.round($num[$i]*$maxVisHeigh).'" />'; echo '
'; } ?> -- 2.39.5