From 29b005c9f4299e9935745b5cc208e4fb589a5c3d Mon Sep 17 00:00:00 2001 From: oldperl Date: Tue, 23 Aug 2011 14:08:57 +0000 Subject: [PATCH] images and localizing --- trunk/_psd/statzR_small_sfnet.psd | Bin 0 -> 45570 bytes trunk/_psd/statz_small.psd | Bin 0 -> 27632 bytes trunk/img/statzR.png | Bin 0 -> 6725 bytes trunk/includes/functions.semr.php | 473 +++++++++ trunk/includes/functions.semr_template.php | 267 +++++ trunk/semmelstatzR-options.php | 17 +- trunk/semmelstatzR.php | 1108 ++++---------------- trunk/semr_image.php | 25 + 8 files changed, 997 insertions(+), 893 deletions(-) create mode 100644 trunk/_psd/statzR_small_sfnet.psd create mode 100644 trunk/_psd/statz_small.psd create mode 100644 trunk/img/statzR.png create mode 100644 trunk/includes/functions.semr.php create mode 100644 trunk/includes/functions.semr_template.php create mode 100644 trunk/semr_image.php diff --git a/trunk/_psd/statzR_small_sfnet.psd b/trunk/_psd/statzR_small_sfnet.psd new file mode 100644 index 0000000000000000000000000000000000000000..b58221f53bd9d48ac3cc096ece54073bec989704 GIT binary patch literal 45570 zcmeIb2V4_b+dh1f&`anx6k|m|AaukwAYw&bu&%liNGKW-3_-fauDh$QZEb7sZFgY;$PSDd#*2&^nIz%`CykpJmNX}90M~Zt5Q9NOIb2~V&oO}$;}{;r7xP51 zEM9Eb;GV;RdgAB=ABc(Oi8-ufZn#g7e}F1O@C~+&6pLegoSoz2K;jtY#p&nt5 zVIHA8cMmt7OV|LmtpQ8jZca>KVEZM4f~X>+qj9M$)*uK74D|6AhQ&qm1maQtLzEih z3d5k-m`I^m7#k^!p(@}O9v=2r6&U3FL1xe_XRN{&?Si%{!$7T|VCSZbhO6_>Z=Va% zNXMVm^;umSX+R_4&%Nujx-`;&M#7(a*JpKUqydeDKliTB>e5I98VP^yU7yvZkp?sp z{@lAht4kvdXe9iv_AcOe)T|Is08~&sa6SmLMvO{|MlwYs;Y>qx^_gOn`ciRB>PQ`i zN)VMw%b4lmq`Sqz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fV`5xBVy^1{($9dNjA_e|KU%E<0*+qNBx zK--SUjW=$HbU;hAZX2%NjT@0(CR`uwwE^lX@puTOM=G&T9bny_K^J~5(lYhT1)qzw zjGVdPgSp^6`gD5;zvT$F{+1M5fon*O@p|lDu{T|0yZ`(M0aO}%LTKf{|2D5?`9?i2Bmh zd$9b$)K$DMeJZuIvby@R)P|@py(!gOUYA<$6@000BKXotqq}|S#0lU_b5h%g{NPJd z$6!x#WqMTp*{L;H{y?hpQsf`3FYQ17*aDm*E8?3k$^3&SJ^%HYGiOg7j_d^avE%&e z9GU;f@1veHavIBjByuzFNl!$+KKIpEUqv=WJ?W{)foJzc{`V%qlb${Wp7c*gx;^Qs mr@@obksU;S@T8IJu>2?9i^_jTq!r8mKau+`MgGBh(*FmzNM1?+ literal 0 HcmV?d00001 diff --git a/trunk/img/statzR.png b/trunk/img/statzR.png new file mode 100644 index 0000000000000000000000000000000000000000..5d867204ccb0bff49c40bd8d1aaa0fd7dbe370ab GIT binary patch literal 6725 zcmXY0c|26#|DG{3jGY)+ia~@ZvL@9S)YxjQ4WY4yEGsl@8@}+bMNBMp5f<_U~B7U*iAaU;N7jj=;-LR?NtyM_;s{nZh2;9 zWo5$FqB=A5+poc;%|AC|L%L#bwVcB;#$Q&qWVClbufFFG==2@dPGS3#iGjAb?C6?X zuJiU*z0?l*MCkdjy^0( za(8#%Szc}~y<2T>wD@)K#~QQl>$4BD?Jv)s9Bi){pgo)}EBtfbW_4uv=j^xjtNx4Y zzn)tdj1;7K`gnk>tj?L1O~U!CtgMddw>1@Us|0%>EDXH7n5%Owp69z}+p7BtuY?6` zEiaAcWd6`U{DOe1aWUI^*9OAEs^34U9WGr;j&EUPy_;gJMNwQ_ou_?>TLOGbnQ4ud zm>m!I0cTr?G^n;XP9P9KY%CZZ1yxnx^=sha0ivV9$_i+22lMlQOz!RN1q}^gXb9Z9 zS6NvJe*FUP-hqq^aP=x+54*a6yE_;e0l$BP4c-Vm(H$YBK z>_ZR`5HS1pO?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pu$3LZzkN1o0;PSMahPiIX1Wu6CLbD0oU5c@LI*Y*cFNeBBN^V zh+o(O01BjnY}P$nf-h&?&#jc!_MGw3_sAd0_7&Q|es$;Y z>B?B2{6^~GcNd|0g6XK~Lo1X7gz4&sMcd)n>|1xif8rr;f&}>m^|xVZM2E{=va@) zs1NEPNl&G-iv_ABpVxS7MbT!1~;zgHND~^^mir##mY_=MCl(1xp7Ad!u zF_6G-Iex5!smK;jbIL5Gu$C5s-Oo{g?fAoT%&!y;k0^$6#GX6`H~7RQXCd>+NL;HMz zL^+nvB01m1U2`-UCjE|k3C_W6LPbOI>(Q5^OElDvdbLEZK-7{r`6-myQYO&lSV#+7 z{D$&&mna zgNAL#_E?)eE?b~WVzEeZ)O1{kYs*EFU_p-K#q;?4McY2>O`vHwAV2;fIkvhIhhQoU zOwRcchz>`o;5Tc?U;OxT@xRw)X@iSa(8mrtA4N~D0#X1mDm0RA;^fc((kR!M_O$GA ztI&21Ui?)bPH9z6!O6FZ9W()o^>p1mc1%Jh_W#cqWKUX7Pe&f-hOJGa_x44+nt;VT zV}(y5j7wn)kB4OVP~^_>cEY0l5h6CxI~Q@T=bd3LVH}?>acUxT8v1#ac}|hFigwcQ zn;%(w2VF)G@%x1FMcIhmOrFxud4{}yn#rwSNcP0X8fQ6=!M%<5 zKm7(rU1viVpv|S4K07h68Y2G#O0FMEMaW0BRiIFXO{+#xCto}bRSmbe!-O~@xNerwbDn~{YI!MQcTyQou#$lFz zhTldA5JlcE_a0~`<_-0+cT`itZ5Ue&5%ZqZW$L`zT#fx#=N@t@z1g$6Na%c5r^nQ- z?>a>ie#cs3br$hc2Pz7vC=pV)7v+qE>%YQKR*6FN5<0y~|BCON<_qLw=jP^&L4;c* zJ>K}HY_58T&$v&%k8?8#onp>vZ!<)_^(sKqi58DNG>Y>ASWb;Mbzccz*$WL%VaRd& z700) { + return true; + } + else { + return false; + } + } + +### Auslesen der höchsten Post-ID + function sem_getMaxPostID() { + global $wpdb; + $maxpostid = $wpdb->get_var("SELECT MAX(ID) FROM ".$wpdb->posts." LIMIT 0,1"); + return $maxpostid; //Ganzzahl + } + +### Auslesen des User- bzw. Kommentarautornamen + function sem_getUsername() { + global $user_ID, $user_login, $isAdmin; + + get_currentuserinfo(); + + if($user_ID > 0) { + $useronline = $user_login; + + if(current_user_can('manage_options')) { + $isAdmin = 1; + } + else { + $isAdmin = 0; + } + } + elseif(isset($_COOKIE["comment_author_".COOKIEHASH])) { + $useronline = trim($_COOKIE["comment_author_".COOKIEHASH]); + $isAdmin = -1; + } + else { + $useronline = "Gast"; + $isAdmin = -1; + } + return $useronline; + } + +### Prüfen, ob Besucher ein Bot ist + function sem_AreYouBot($user_agent) { + global $isBot; + $bots = array( + 'aipbot', + 'amfibibot', + 'appie', + 'ask jeeves/teoma', + 'aspseek', + 'axadine', + 'baiduspider', + 'becomebot', + 'blogcorpuscrawler', + 'blogpulse', + 'blogsnowbot', + 'boitho.com', + 'bruinbot', + 'cerberian', + 'cfnetwork', + 'check_http', + 'cipinetbot', + 'claymont', + 'cometsearch@cometsystems.com', + 'converacrawler', + 'cydralspider', + 'digger', + 'es.net_crawler', + 'eventax', + 'everyfeed-spider', + 'exabot@exava.com', + 'faxobot', + 'findlinks', + 'fireball', + 'francis', + 'gaisbot', + 'gamekitbot', + 'gazz@nttr.co.jp', + 'geonabot', + 'getrax crawler', + 'gigabot', + 'girafa.com', + 'goforitbot', + 'googlebot', + 'grub-client', + 'holmes', + 'houxoucrawler', + 'http://www.almaden.ibm.com/cs/crawler', + 'http://www.istarthere.com', + 'http://www.relevantnoise.com', + 'httrack ?', + 'ia_archiver', + 'ichiro', + 'iltrovatore-setaccio', + 'inelabot', + 'infoseek', + 'inktomi.com', + 'irlbot', + 'jetbot', + 'jobspider_ba', + 'kazoombot', + 'larbin', + 'libwww', + 'linkwalker', + 'lmspider', + 'mackster', + 'mediapartners-google', + 'microsoft url control', + 'mj12bot', + 'moreoverbot', + 'mozdex', + 'msnbot', + 'msrbot', + 'naverbot', + 'netresearchserver', + 'ng/2.0', + 'np(bot)', + 'nutch', + 'objectssearch', + 'ocelli', + 'omniexplorer_bot', + 'openbot', + 'overture', + 'patwebbot', + 'php', + 'phpdig', + 'pilgrim html-crawler', + 'pipeliner', + 'pompos', + 'psbot', + 'python-urllib', + 'quepasacreep', + 'robozilla', + 'rpt-httpclient', + 'savvybot', + 'scooter', + 'search.ch', + 'seekbot', + 'semager', + 'seznambot', + 'sherlock', + 'shelob', + 'sitesearch', + 'snapbot', + 'snappreviewbot', + 'speedy spider', + 'sphere scout', + 'stackrambler', + 'steeler', + 'surveybot', + 'szukacz', + 'technoratibot', + 'telnet', + 'themiragorobot', + 'thesubot', + 'thumbshots-de-bot', + 'topicblogs', + 'turnitinbot', + 'tutorgigbot', + 'tutorial crawler', + 'twiceler', + 'vagabondo', + 'versus', + 'voilabot', + 'w3c_css_validator', + 'w3c_validator', + 'w3c-checklink', + 'web downloader', + 'webcopier', + 'webcrawler', + 'webfilter robot', + 'west wind internet protocols', + 'wget', + 'wwweasel robot', + 'wwwster', + 'xaldon webspider', + 'xenu', + 'yahoo! slurp', + 'yahoofeedseeker', + 'yahoo-mmcrawler', + 'zao', + 'zipppbot', + 'zyborg', + ); + foreach($bots as $bot) { + if(stristr($user_agent, $bot) !== false) { + return true; + } + } + return false; + } + +### Referer nach Suchmaschinen-Queries und interner Suche prüfen und Suchstring extrahieren + function sem_getKeyword($referer) { + $keyword = @parse_url($referer); + + if (preg_match("/google\./i", $keyword["host"])) { + if (preg_match("/imgurl/i", $keyword["query"])) { + parse_str($keyword["query"],$q); + $keyword = substr($q["prev"],10); + } + else if (preg_match("/translate\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + } + else { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + } + if($keyword == "") return; return "Google: ".$keyword; + } + elseif (preg_match("/search\.live\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "LiveSearch: ".$keyword; + } + elseif (preg_match("/bing\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "Bing: ".$keyword; + } + elseif (preg_match("/yahoo\./i", $keyword["host"])) { + if (preg_match("/images/i", $keyword["query"])) { + parse_str($keyword["query"],$q); + $keyword = $q["p"]; + } + else { + parse_str($keyword["query"],$q); + $keyword = $q["p"]; + } + if($keyword == "") return; return "Yahoo: ".$keyword; + } + elseif (preg_match("/aol\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "AOL: ".$keyword; + } + elseif (preg_match("/aolsvc\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "AOL: ".$keyword; + } + elseif (preg_match("/search\.msn\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "MSN: ".$keyword; + } + elseif (preg_match("/gmx\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["su"]; + if($keyword == "") return; return "GMX: ".$keyword; + } + elseif (preg_match("/\.bild\.t\-/i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["query"]; + if($keyword == "") return; return "BILD: ".$keyword; + } + elseif (preg_match("/t\-online\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "T-Online: ".$keyword; + } + elseif (preg_match("/suche\.web\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["su"]; + if($keyword == "") return; return "WEB.de: ".$keyword; + } + elseif (preg_match("/suche\.lycos\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["query"]; + if($keyword == "") return; return "Lycos: ".$keyword; + } + elseif (preg_match("/altavista\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "Altavista: ".$keyword; + } + elseif (preg_match("/alltheweb\./i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["q"]; + if($keyword == "") return; return "alltheweb: ".$keyword; + } + elseif (preg_match("/technorati\.com\/search\//", $referer)) { + $q = preg_split("/technorati\.com\/search\//", $referer,-1,PREG_SPLIT_NO_EMPTY); + $keyword = $q[1]; + if($keyword == "") return; return "Technorati: ".$keyword; + } + elseif (preg_match("/".$homehost."/i", $keyword["host"])) { + parse_str($keyword["query"],$q); + $keyword = $q["s"]; + if($keyword == "") return; return "Interne Suche: ".$keyword; + } + else { + return; + } + } + +### Anzahl der Datensätze in der statz-Tabelle + function sem_showNumStatzEntries() { + global $wpdb; + $numstatzentries = $wpdb->get_var("SELECT COUNT(id) FROM ".$wpdb->statz); + return $numstatzentries; // Zahl + } + +### Aufgezeichnete Tage in der statz-Tabelle + function sem_countDaysInStatzTable() { + global $wpdb; + $firstdate = $wpdb->get_var("SELECT MIN(time) FROM ".$wpdb->statz." LIMIT 0,1"); + if(!$firstdate) { + return 1; + } + else { + $firstdate = strtotime($firstdate); $now = time(); + $days = (int) (($now - $firstdate) / (60*60*24)+1); + return $days; // KOMPLETTE! Tage + } + } + +### Wenn Tage in statz-Tabelle kleiner als Tage in Daily-Statz, dann nimm Tage in Daily-Statz + function sem_compareLimitDays2DailyStatz () { + global $wpdb; + $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen + if (sem_countDaysInStatzTable() << $sem_options["statz_days_limit"]) { + $sem_options["statz_days_limit"] = sem_countDaysInStatzTable(); + update_option("semmelstatzR_options", $sem_options); + } + } + +### Zeigt Copyright-Notiz an + function sem_showCopyright() { + print ""; + } + +### statz-Tabelle leeren (NICHT LÖSCHEN!!!) + function sem_truncateStatzTable() { + global $wpdb, $userip; + $wpdb->query('TRUNCATE TABLE '.$wpdb->statz); + sem_optStatzTable(); + $wpdb->query("INSERT INTO `$wpdb->statz`(ip, time, referer, page, username) VALUES('127.0.0.1', NOW(),NULL,0,'statz-Tabelle geleert')"); + } + +### Obsolet, bleibt aber aus Kompatibilitätsgründen zu SEMMELSTATZ_DELETE + function sem_delOldRecords($days) { + return true; + } + +### simpleEncoding für die GoogleChartAPI + function sem_encodeChartData($values) { + + $maxValue = max($values); + $simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + $chartData = "s:"; + for ($i = 0; $i < count($values); $i++) { + $currentValue = $values[$i]; + + if ($currentValue > -1 && $maxValue <> 0) { + $chartData.=substr($simpleEncoding,61*($currentValue/$maxValue),1); + } + else { + $chartData.='_'; + } + } + return $chartData; + } + +### Datensätze älter als statz_recdays_limit-Tage löschen + function sem_delOutOfLimit() { + global $wpdb; + $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen + $today = time(); $days = $sem_options["statz_recdays_limit"]; + $enddatum = $today - ($days * 86400); + $enddatum = date("Y-m-d", $enddatum) . " 23:59:59"; + $wpdb->query("DELETE FROM ".$wpdb->statz." WHERE time <= '".$enddatum."'"); + sem_optStatzTable(); + } + +### Wenn AUTOMATISCHES LIMIT aktiviert, dann LIMITIERE und erhöhe NEXT_CRON + function sem_doCronStatzLimit() { + sem_delOutOfLimit(); + $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen + $statz_next_cron = $sem_options["statz_next_cron"] + 86400; + $sem_options["statz_next_cron"] = $statz_next_cron; + update_option("semmelstatzR_options", $sem_options); + } + +### Konvertiert Strings von utf-8 in ISO-8859 + function sem_encodeToIso($string) { + return mb_convert_encoding($string, "ISO-8859-1", mb_detect_encoding($string, "UTF-8, ISO-8859-1, ISO-8859-15", true)); + } + +### statz-Tabelle optimieren + function sem_optStatzTable() { + global $wpdb; + $wpdb->query("OPTIMIZE TABLE ".$wpdb->statz); + } + +### Unter bestimmten Voraussetzungen den Vortag in die statzhist-Tabelle schreiben + function sem_writeYesterdayToHist() { + global $wpdb; + if(!$wpdb->get_var("SELECT date FROM ".$wpdb->statzhist." WHERE substring(date,1,10) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)")) { + + if($wpdb->get_var("SELECT COUNT(ip) FROM ".$wpdb->statz." WHERE substring(time,1,10) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)")) { + + $yesterdays = $wpdb->get_results("SELECT COUNT(ip) AS hits, COUNT(DISTINCT ip) AS visitors, COUNT(DISTINCT referer) + AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE substring(time,1,10) = DATE_SUB(CURDATE(), + INTERVAL 1 DAY) GROUP BY date"); + + foreach ($yesterdays as $yesterday) { + $date = $yesterday->date; + $visitors = $yesterday->visitors; + $hits = $yesterday->hits; + $referers = $yesterday->referers; + } + + $sql = $wpdb->query("INSERT INTO ".$wpdb->statzhist." (date, referers, visitors, hits) + VALUES('$date', $referers, $visitors, $hits)"); + } + else { + $date = $wpdb->get_var("SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); + $sql = $wpdb->query("INSERT INTO ".$wpdb->statzhist." (date, referers, visitors, hits) VALUES('$date', 0, 0, 0)"); + } + } + } + +### Summen der vergangenen Tage in die statzhist schreiben */ + function sem_writeOldDaysToHist() { + global $wpdb; + if(!$wpdb->get_var("SELECT date FROM ".$wpdb->statzhist." WHERE substring(date,1,10) <= DATE_SUB(CURDATE(), INTERVAL 1 DAY)")) { + + $theolddays = $wpdb->get_results("SELECT COUNT(ip) AS hits, COUNT(DISTINCT ip) AS visitors, + COUNT(DISTINCT referer) AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE + substring(time,1,10) <= DATE_SUB(CURDATE(), INTERVAL 1 DAY) GROUP BY date ORDER BY time ASC"); + + foreach ($theolddays as $theoldday) { + $date = $theoldday->date; + $visitors = $theoldday->visitors; if(!$visitors) $visitors = 0; + $hits = $theoldday->hits; if(!$hits) $hits = 0; + $referers = $theoldday->referers; if(!$referers) $referers = 0; + $sql = $wpdb->query("INSERT INTO ".$wpdb->statzhist." (date, referers, visitors, hits) + VALUES('$date', $referers, $visitors, $hits)"); + } + } + } + + +function semr_e($sValue, $sDomain = "semmelstatzR") { + return __($sValue, $sDomain); +} +############################################## Ende SEMMELSTATZ-interne Funktionen +?> \ No newline at end of file diff --git a/trunk/includes/functions.semr_template.php b/trunk/includes/functions.semr_template.php new file mode 100644 index 0000000..ff5f77a --- /dev/null +++ b/trunk/includes/functions.semr_template.php @@ -0,0 +1,267 @@ +get_results("SELECT ID, post_title FROM ".$wpdb->posts." WHERE post_status = 'publish' + AND post_type = 'post' ORDER BY post_date DESC LIMIT 0, ".$num_posts); + print "
"; + if (empty($lastposts)) { + print "... noch keine Beiträge"; + } + else { + print "Die letzten ".$num_posts." Beiträge
"; + foreach ($lastposts as $lastpost) { + $posttitle = $lastpost->post_title; + $permalink = get_permalink($lastpost->ID); + $postdate = $lastpost->post_date; + print "".$posttitle."
\n"; + } + } + print "
"; + } + +### Zeigt die letzten $num_comments-Kommentare an: Autor und Post mit relativem Datum - CSS-id: #lastcomments + function sem_showLastComments($num_comments = 10) { + global $wpdb; + $comments = $wpdb->get_results("SELECT comment_author, comment_ID, comment_post_ID, comment_date + FROM ".$wpdb->comments." WHERE comment_approved = '1' ORDER BY comment_date DESC LIMIT 0, $num_comments"); + print "
"; + if (empty($comments)) { + print "Keine Kommentare"; + } + else { + print "Die letzten ".$num_comments." Kommentare
"; + foreach ($comments as $comment) { + $commentday = strtotime(substr($comment->comment_date,1,10)); + $today = time(); + $difference = ceil(($today - $commentday) / (60*60*24))-1; + if($difference == 0) { + $commentdate = "Heute um " . mysql2date("G:i", $comment->comment_date); + } + elseif($difference == 1) { + $commentdate = "Gestern um " . mysql2date("G:i", $comment->comment_date); + } + elseif($difference == 2) { + $commentdate = "Vorgestern um " . mysql2date("G:i", $comment->comment_date); + } + else { + $commentdate = mysql2date("j. F G:i", $comment->comment_date); + } + + print "$comment->comment_author@". get_the_title($comment->comment_post_ID) .", $commentdate
\n"; + } + } + print "
"; + } + +### Zeigt die $num_reads meist gelesenen Posts an - CSS-id: #mostreads + function sem_showMostReads($num_reads = 10) { + global $wpdb; + $mostreads = $wpdb->get_results("SELECT post_title AS posttitle, guid AS postid, hits AS hits FROM ".$wpdb->posts." WHERE hits != '0' GROUP BY postid ORDER BY hits DESC LIMIT 0, $num_reads"); + print "
"; + if (empty($mostreads)) { + print "... noch keine Einträge"; + } + else { + print "Die ".$num_reads." meist gelesenen Beiträge
"; + foreach ($mostreads as $mostread) { + $posttitle = $mostread->posttitle; + $postid = $mostread->postid; + //$permalink = get_permalink($mostread->postid); + $hits = $mostread->hits; + print "".$posttitle." (".$hits.")
\n"; + } + } + print "
"; + } + +### Zeigt die $num_reads meist gelesenen Posts an - CSS-id: #mostreads - ACHTUNG: Das Ergebnis der Funktion basiert auf der statz-Tabelle + function sem_showMostReadsOld($num_reads = 10) { + global $wpdb; + $mostreads = $wpdb->get_results("SELECT post_title AS posttitle, ".$wpdb->posts.".guid AS postid, + COUNT(".$wpdb->statz.".page) AS count FROM ".$wpdb->posts.", ".$wpdb->statz." WHERE + ".$wpdb->statz.".page = ".$wpdb->posts.".ID GROUP BY postid ORDER BY count DESC LIMIT 0, $num_reads"); + print "
"; + if (empty($mostreads)) { + print "... noch keine Einträge"; + } + else { + print "Die ".$num_reads." meist gelesenen Beiträge
"; + foreach ($mostreads as $mostread) { + $posttitle = $mostread->posttitle; + $postid = $mostread->postid; + //$permalink = get_permalink($mostread->postid); + $count = $mostread->count; + print "".$posttitle." (".$count.")
\n"; + } + } + print "
"; + } + +### Zeigt die $num_commented meist kommentierten Posts an - CSS-id: #mostcommented + function sem_showMostCommented($num_commented = 10) { + global $wpdb; + $mostcommented = $wpdb->get_results("SELECT guid, id, post_title, COUNT(*) AS count FROM ".$wpdb->comments.",". $wpdb->posts." WHERE + comment_approved = '1' AND comment_post_id = id GROUP BY id, post_title ORDER BY count DESC LIMIT 0, $num_commented"); + + print "
"; + if (empty($mostcommented)) { + print "... noch keine Einträge"; + } + else { + print "Die ".$num_commented." meist kommentierten Beiträge
"; + + foreach ($mostcommented as $key => $mostcommented) { + $posttitle = $mostcommented->post_title; + $count = $mostcommented->count; + $postid = $mostcommented->guid; + print "".$posttitle." (".$count.")
\n"; + } + } + print "
"; + } + +### Zeigt einen Zähler der Hits im jeweiligen Post. ACHTUNG: FUNKTIONIERT NUR IM LOOP (index.php, single.php) + function sem_showPostHitsInLoop($postid) { + global $wpdb; + $hits = $wpdb->get_var("SELECT hits FROM $wpdb->posts WHERE ID = $postid LIMIT 0,1"); + return $hits; + } + +### Anzahl aller Posts/Pages + function sem_showTotalPosts() { + global $wpdb; + $totalposts = $wpdb->get_var("SELECT COUNT(ID) AS num FROM ".$wpdb->posts." WHERE post_status = 'publish' LIMIT 0,1"); + return $totalposts; // Ganzzahl + } + +### Anzahl aller Kommentare + function sem_showTotalComments() { + global $wpdb; + $totalcomments = $wpdb->get_var("SELECT COUNT(comment_ID) AS num FROM ".$wpdb->comments." WHERE comment_approved = '1' LIMIT 0,1"); + return $totalcomments; // Ganzzahl + } + +### Anzahl aller User seit Beginn der Statzaufzeichnung + function sem_showTotalUsers() { + global $wpdb; + $totalusers = $wpdb->get_var("SELECT SUM(visitors) FROM ".$wpdb->statzhist." LIMIT 0,1"); + if(!$totalusers) $totalusers = 0; + return $totalusers; // Ganzzahl + } + +### Anzahl User pro Tag im Durchschnitt + function sem_showAverageUserPerDay() { + $averageuser = ceil(sem_showTotalUsers() / sem_showStatzDays()); + return $averageuser; + } + +### Datum des 1. Posts = Blogstart + function sem_showFirstPostDate() { + global $wpdb; + $firstpostdate = $wpdb->get_var("SELECT MIN(post_date) FROM ".$wpdb->posts." WHERE post_status = 'publish' AND post_date != '0000-00-00 00:00:00' LIMIT 0,1"); + $firstpostdate = mysql2date("j.n.Y", $firstpostdate); + return $firstpostdate; // String T.M.JJJJ + } + +### Datum des 1. Kommentars + function sem_showFirstCommentDate() { + global $wpdb; + $firstcommentdate = $wpdb->get_var("SELECT MIN(comment_date) FROM ".$wpdb->comments." WHERE comment_approved = '1' + AND comment_date != '0000-00-00 00:00:00' LIMIT 0,1"); + $firstcommentdate = mysql2date("j.n.Y", $firstcommentdate); + return $firstcommentdate; // String T.M.JJJJ + } + +### Anzahl der Kommentierer nach Nicknamen + function sem_showNumCommenters() { + global $wpdb; + $totalcommenters = $wpdb->get_var("SELECT COUNT(DISTINCT comment_author) FROM ".$wpdb->comments." WHERE comment_approved = '1' LIMIT 0,1"); + if(!$totalcommenters) $totalcommenters = 0; + return $totalcommenters; // Ganzzahl + } + +### Blog besteht seit x Tagen + function sem_showPostDays() { + global $wpdb; + $firstdate = $wpdb->get_var("SELECT MIN(post_date) AS date FROM ".$wpdb->posts." WHERE post_status = 'publish' AND post_date != '0000-00-00 00:00' LIMIT 0,1"); + $firstdate = strtotime($firstdate); $now = time(); + $blogdays = (int) (($now - $firstdate) / (60*60*24)); + $blogdays = $blogdays + 1; + return $blogdays; // Ganzzahl + } + +### Tage seit 1. Kommentar + function sem_showCommentDays() { + global $wpdb; + $firstdate = $wpdb->get_var("SELECT MIN(comment_date) AS date FROM ".$wpdb->comments." LIMIT 0,1"); + $firstdate = strtotime($firstdate); $now = time(); + $commentdays = (int) (($now - $firstdate) / (60*60*24)); + $commentdays = $commentdays + 1; + return $commentdays; // Ganzzahl + } + +### durchschn. Posts pro Tag + function sem_showPostsPerDay() { + global $wpdb; + $postsperday = (int) sem_showTotalPosts() / (int) sem_showPostDays(); + return $postsperday; // Ganzzahl + } + +### durchschn. Kommentare pro Tag + function sem_showCommentsPerDay() { + global $wpdb; + $commentsperday = (int) sem_showTotalComments() / (int) sem_showCommentDays(); + return $commentsperday; // Ganzzahl + } + +### Startdatum der Gesamtstatistik (Basis: statzhist) + function sem_showStatzStartDate() { + global $wpdb; + $statzhiststartdate = $wpdb->get_var("SELECT MIN(date) FROM ".$wpdb->statzhist." WHERE date != '0000-00-00 00:00' LIMIT 0,1"); + $statzhiststartdate = mysql2date("j.n.Y", $statzhiststartdate); + // if(!$statzhiststartdate) $statzhiststartdate= "xx.xx.xxxx"; + return $statzhiststartdate; // String T.M.JJJJ + } + +### Dauer der Statistikaufzeichnung in Tagen (Basis: statzhist) + function sem_showStatzDays() { + global $wpdb; + $firstdate = $wpdb->get_var("SELECT MIN(date) FROM ".$wpdb->statzhist." LIMIT 0,1"); + if(!$firstdate) { + return 1; + } + else { + $firstdate = strtotime($firstdate); $now = time(); + $statzdays = (int) (($now - $firstdate) / (60*60*24)); + return $statzdays; // Ganzzahl + } + } + +### Anzahl der Online-Besucher - Verweildauer in den Einstellungen + function sem_showNumUsersOnline() { + global $wpdb; + $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen + $onlinetime = $sem_options["statz_online_time"]; + $numonline = $wpdb->get_var("SELECT COUNT(DISTINCT ip) FROM ".$wpdb->statz." WHERE time > Now() - INTERVAL ".$onlinetime." SECOND"); + return $numonline; // Ganzzahl + } + +### Anzahl der heutigen Besucher + function sem_showUsersToday() { + global $wpdb; $today = date("Y-m-d"); + $todayusers = $wpdb->get_var("SELECT COUNT(DISTINCT ip) FROM ".$wpdb->statz." WHERE time >= '$today' LIMIT 0, 1"); + return $todayusers; + } + +### Anzahl der gestrigen Besucher + function sem_showUsersYesterday() { + global $wpdb; + $yesterdaysusers = $wpdb->get_var("SELECT visitors FROM ".$wpdb->statzhist." WHERE date = substr(DATE_SUB(NOW(), INTERVAL 1 DAY),1,10) LIMIT 0, 1"); + return $yesterdaysusers; + } + +##################################################### Ende TEMPLATE-Funktionen +?> \ No newline at end of file diff --git a/trunk/semmelstatzR-options.php b/trunk/semmelstatzR-options.php index 7414f3c..6c6b07f 100644 --- a/trunk/semmelstatzR-options.php +++ b/trunk/semmelstatzR-options.php @@ -42,14 +42,15 @@ if(!current_user_can('manage_statz')) { $sem_options['statz_show_todayusers'] = $_POST['statz_show_todayusers']; $sem_options['statz_on_dashboard'] = $_POST['statz_on_dashboard']; $sem_options['statz_datarecs_limit'] = $_POST['statz_datarecs_limit']; + $sem_options['statz_use_img'] = $_POST['statz_use_img']; update_option("semmelstatzR_options", $sem_options); - echo '

Einstellungen gespeichert

'; + echo '

'.semr_e('Options saved').'

'; } if(isset($_POST['trunc_save'])) { if ($result == sem_truncateStatzTable()) { - echo "

Die statz-Tabelle wurde erfolgreich geleert.

"; + echo "

".semr_e('statz-table emptied succesfully.')."

"; } } @@ -92,11 +93,19 @@ if(!current_user_can('manage_statz')) {

-

SemmelstatzR › Einstellungen

+

SemmelstatzR ›

-

+

+ + + + + + diff --git a/trunk/semmelstatzR.php b/trunk/semmelstatzR.php index 04db71c..7ba1382 100644 --- a/trunk/semmelstatzR.php +++ b/trunk/semmelstatzR.php @@ -1,8 +1,8 @@ query("DELETE FROM $wpdb->options WHERE option_name LIKE 'statz%';"); // Löschen der alten Optionen - } - - if(!get_option('semmelstatzR_options')) { - $sem_options = array( - "statz_comment_limit" => 10, - "statz_datarecs_limit" => 100, - "statz_days_limit" => 7, - "statz_do_cron" => false, - "statz_encode_ip" => false, - "statz_keyword_limit" =>10, - "statz_referer_limit" => 10, - "statz_mask_referer" => false, - "statz_on_dashboard" => false, - "statz_online_time" => 180, - "statz_recdays_limit" => 20, - "statz_show_commenters" => true, - "statz_show_dailystatz" => true, - "statz_show_keywords" => true, - "statz_show_reads" => true, - "statz_show_referers" => true, - "statz_show_todayreads" => true, - "statz_show_todayusers" => true, - "statz_show_topcommposts" => true, - "statz_show_useronline" => true, - "statz_topreads_limit" => 10, - "statz_write_admins" => false, - "statz_write_users" => false - ); - add_option( 'semmelstatzR_options', $sem_options ); - } +include_once SEMMELSTATZR_SRVPATH.'/includes/functions.semr.php'; +include_once SEMMELSTATZR_SRVPATH.'/includes/functions.semr_template.php'; + + +if(is_admin() == true) { + + /** + * add CSS + * + * @return void + */ + function semmelstatzR_css() { + print "\n"; } + add_action('admin_head', 'semmelstatzR_css'); + ### End add CSS + + /** + * add toplevel menu into admin + * + * @todo localization + * + * @return void + */ + function semmelstatzR_menu() { + if (function_exists('add_menu_page')) { + add_menu_page('SemmelstatzR','SemmelstatzR', 'manage_statz', 'semmelstatzR/semmelstatzR-statz.php', '', plugins_url('semmelstatzR/img/statz_small.png')); + } + if (function_exists('add_submenu_page')) { + add_submenu_page('semmelstatzR/semmelstatzR-statz.php', semr_e('Current Statz'), semr_e('Current Statz'), 'manage_statz', 'semmelstatzR/semmelstatzR-statz.php'); + add_submenu_page('semmelstatzR/semmelstatzR-statz.php', semr_e('History'), semr_e('History'), 'manage_statz', 'semmelstatzR/semmelstatzR-history.php'); + add_submenu_page('semmelstatzR/semmelstatzR-statz.php', semr_e('Log'), semr_e('Log'), 'manage_statz', 'semmelstatzR/semmelstatzR-log.php'); + add_submenu_page('semmelstatzR/semmelstatzR-statz.php', semr_e('Database'), semr_e('Database'), 'manage_statz', 'semmelstatzR/semmelstatzR-database.php'); + add_submenu_page('semmelstatzR/semmelstatzR-statz.php', semr_e('Templates'), semr_e('Templates'), 'manage_statz', 'semmelstatzR/semmelstatzR-templates.php'); + add_submenu_page('semmelstatzR/semmelstatzR-statz.php', semr_e('Options'), semr_e('Options'), 'manage_statz', 'semmelstatzR/semmelstatzR-options.php'); + } + } + add_action('admin_menu', 'semmelstatzR_menu'); + ### end add toplevel adminmenu + + + + /** + * write defaults to options-array + * + * @return void + */ + function sem_init_options() { + global $wpdb; + + if(get_option('statz_options')) { + $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'statz%';"); // Löschen der alten Optionen + } + + if(!get_option('semmelstatzR_options')) { + $sem_options = array( + "statz_comment_limit" => 10, + "statz_datarecs_limit" => 100, + "statz_days_limit" => 7, + "statz_do_cron" => false, + "statz_encode_ip" => false, + "statz_keyword_limit" =>10, + "statz_referer_limit" => 10, + "statz_mask_referer" => false, + "statz_on_dashboard" => false, + "statz_online_time" => 180, + "statz_recdays_limit" => 20, + "statz_show_commenters" => true, + "statz_show_dailystatz" => true, + "statz_show_keywords" => true, + "statz_show_reads" => true, + "statz_show_referers" => true, + "statz_show_todayreads" => true, + "statz_show_todayusers" => true, + "statz_show_topcommposts" => true, + "statz_show_useronline" => true, + "statz_topreads_limit" => 10, + "statz_write_admins" => false, + "statz_write_users" => false, + "statz_use_img" => true + ); + add_option( 'semmelstatzR_options', $sem_options ); + } + } + add_action('init', 'sem_init_options'); + ### End write defaults to options-array + +} else { + +} + ### Anlegen der Tabellen, Optionen schreiben - add_action('activate_semmelstatzR/semmelstatzR.php', 'sem_statzsetup'); - function sem_statzsetup() { - global $wpdb; - if(@is_file(ABSPATH.'/wp-admin/upgrade-functions.php')) { - include_once(ABSPATH.'/wp-admin/upgrade-functions.php'); - } elseif(@is_file(ABSPATH.'/wp-admin/includes/upgrade.php')) { - include_once(ABSPATH.'/wp-admin/includes/upgrade.php'); - } else { - die('Kann wp-admin/upgrade-functions.php und wp-admin/includes/upgrade.php nicht finden!'); - } - - $create_table = array(); - $create_table['statz'] = "CREATE TABLE $wpdb->statz ( - id int(11) unsigned NOT NULL auto_increment, - ip varchar(39) default NULL, - time datetime NOT NULL default '0000-00-00 00:00:00', - referer varchar(255) default NULL, - page int(11) unsigned NOT NULL default '0', - username varchar(255) default NULL, - PRIMARY KEY (`id`))"; - $create_table['statzhist'] = "CREATE TABLE $wpdb->statzhist ( - id int(10) unsigned NOT NULL auto_increment, - date datetime NOT NULL default '0000-00-00 00:00:00', - visitors int(10) unsigned NOT NULL default '0', - hits int(10) unsigned NOT NULL default '0', - referers int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id`))"; - - maybe_create_table($wpdb->statz, $create_table['statz']); - maybe_create_table($wpdb->statzhist, $create_table['statzhist']); - - $sql = $wpdb->query("SELECT host FROM $wpdb->statz"); - if($sql) { $wpdb->query("ALTER TABLE $wpdb->statz DROP host"); } - - $sql = $wpdb->query("SELECT keyword FROM $wpdb->statz"); - if($sql) { $wpdb->query("ALTER TABLE $wpdb->statz DROP keyword"); } - - maybe_add_column($wpdb->posts, 'hits', "ALTER TABLE $wpdb->posts ADD hits bigint(20) NOT NULL DEFAULT '0';"); // ab 3.2 - - $wpdb->query("ALTER TABLE $wpdb->statz CHANGE ip ip VARCHAR(39) NULL DEFAULT NULL;"); - - sem_init_options(); - sem_writeOldDaysToHist(); - - $role = get_role('administrator'); - if(!$role->has_cap('manage_statz')) { - $role->add_cap('manage_statz'); - } +add_action('activate_semmelstatzR/semmelstatzR.php', 'sem_statzsetup'); +function sem_statzsetup() { + global $wpdb; + if(@is_file(ABSPATH.'/wp-admin/upgrade-functions.php')) { + include_once(ABSPATH.'/wp-admin/upgrade-functions.php'); + } elseif(@is_file(ABSPATH.'/wp-admin/includes/upgrade.php')) { + include_once(ABSPATH.'/wp-admin/includes/upgrade.php'); + } else { + die('Kann wp-admin/upgrade-functions.php und wp-admin/includes/upgrade.php nicht finden!'); } + $create_table = array(); + $create_table['statz'] = "CREATE TABLE $wpdb->statz ( + id int(11) unsigned NOT NULL auto_increment, + ip varchar(39) default NULL, + time datetime NOT NULL default '0000-00-00 00:00:00', + referer varchar(255) default NULL, + page int(11) unsigned NOT NULL default '0', + username varchar(255) default NULL, + PRIMARY KEY (`id`))"; + $create_table['statzhist'] = "CREATE TABLE $wpdb->statzhist ( + id int(10) unsigned NOT NULL auto_increment, + date datetime NOT NULL default '0000-00-00 00:00:00', + visitors int(10) unsigned NOT NULL default '0', + hits int(10) unsigned NOT NULL default '0', + referers int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`))"; + + maybe_create_table($wpdb->statz, $create_table['statz']); + maybe_create_table($wpdb->statzhist, $create_table['statzhist']); + + $sql = $wpdb->query("SELECT host FROM $wpdb->statz"); + if($sql) { $wpdb->query("ALTER TABLE $wpdb->statz DROP host"); } + + $sql = $wpdb->query("SELECT keyword FROM $wpdb->statz"); + if($sql) { $wpdb->query("ALTER TABLE $wpdb->statz DROP keyword"); } + + maybe_add_column($wpdb->posts, 'hits', "ALTER TABLE $wpdb->posts ADD hits bigint(20) NOT NULL DEFAULT '0';"); // ab 3.2 + + $wpdb->query("ALTER TABLE $wpdb->statz CHANGE ip ip VARCHAR(39) NULL DEFAULT NULL;"); + + sem_init_options(); + sem_writeOldDaysToHist(); + + $role = get_role('administrator'); + if(!$role->has_cap('manage_statz')) { + $role->add_cap('manage_statz'); + } +} + ### Zugriff analysieren und in statz-Tabelle schreiben - add_action('wp_head', 'sem_writeStatz'); - function sem_writeStatz() { - global $wpdb, $wp_query, $isBot, $isAdmin, $page; - $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen - - sem_writeYesterdayToHist(); - $useragent = $wpdb->escape($_SERVER['HTTP_USER_AGENT']); - $isBot = sem_AreYouBot($useragent); - $username = sem_getUsername(); - - if(($isBot == true) - || ($isAdmin == 0 && $sem_options['statz_write_users'] == false) - || ($isAdmin == 1 && $sem_options['statz_write_admins'] == false) - || is_404() - ) return; - - $userip = $wpdb->escape($_SERVER['REMOTE_ADDR']); - if($sem_options['statz_encode_ip'] == true) $userip = sem_encodeIP($userip); - - $referer = $wpdb->escape(urldecode($_SERVER['HTTP_REFERER'])); - $blogtime = gmdate('Y-m-d H:i:s', current_time('timestamp')); - - if (!empty($referer)) { - if(get_option('blog_charset') == 'iso-8859-1') $referer = utf8_decode($referer); - $referer = "'".$referer."'"; - } - else { - $referer = 'NULL'; - } +add_action('wp_footer', 'sem_writeStatz'); +function sem_writeStatz() { + global $wpdb, $wp_query, $isBot, $isAdmin, $page; + $plugin_dir = basename(dirname(__FILE__)); + $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen - $readingnow = wp_title('', false); - if(empty($readingnow)) { - $page = 0; - } else { - $page = $wp_query->post->ID; - } - - $wpdb->query("INSERT INTO $wpdb->statz (ip, time, referer, page, username) - VALUES('$userip', '$blogtime', $referer, $page, '$username')"); - - if($wpdb->query("SELECT COUNT(hits) FROM $wpdb->posts")) { - $wpdb->query("UPDATE $wpdb->posts SET hits = hits + 1 WHERE ID = $page"); // neu ab 3.2 - } + // true === $sem_options['statz_use_img'] && + if(true == $sem_options['statz_use_img'] && !defined('SEMMELSTATZR_STATZIMG')) { + print ''; + return; ### nothing todo if stat image is used } + + sem_writeYesterdayToHist(); + $useragent = $wpdb->escape($_SERVER['HTTP_USER_AGENT']); + $isBot = sem_AreYouBot($useragent); + $username = sem_getUsername(); + + if(($isBot == true) + || ($isAdmin == 0 && $sem_options['statz_write_users'] == false) + || ($isAdmin == 1 && $sem_options['statz_write_admins'] == false) + || is_404() + ) return; + + $userip = $wpdb->escape($_SERVER['REMOTE_ADDR']); + if($sem_options['statz_encode_ip'] == true) $userip = sem_encodeIP($userip); + +$referer = $wpdb->escape(urldecode($_SERVER['HTTP_REFERER'])); + $blogtime = gmdate('Y-m-d H:i:s', current_time('timestamp')); + + if (!empty($referer)) { + if(get_option('blog_charset') == 'iso-8859-1') $referer = utf8_decode($referer); +$referer = "'".$referer."'"; + } +else { +$referer = 'NULL'; +} + + $readingnow = wp_title('', false); + if(empty($readingnow)) { + $page = 0; + } else { + $page = $wp_query->post->ID; + } + +$wpdb->query("INSERT INTO $wpdb->statz (ip, time, referer, page, username) + VALUES('$userip', '$blogtime', $referer, $page, '$username')"); + + if($wpdb->query("SELECT COUNT(hits) FROM $wpdb->posts")) { + $wpdb->query("UPDATE $wpdb->posts SET hits = hits + 1 WHERE ID = $page"); // neu ab 3.2 + } +} ### Zeitgesteuertes Limitieren der statz-Tabelle // Wenn semmelKron JA UND statz_next_cron älter JETZT, dann... @@ -221,15 +266,11 @@ add_action('init', 'sem_init_options'); if($sem_options['statz_do_cron'] == true && $sem_options['statz_next_cron'] < time()) { add_action('shutdown', 'sem_doCronStatzLimit'); // ...limitiere statz-Tabelle auf vorgegebenen Wert } - -### CSS für den SEMMELSTATZ-Admin-Bereich -add_action('admin_head', 'semmelstatzR_css'); -function semmelstatzR_css() { - print "\n"; -} ### Rendert eine Mini-STATZ. Idee: René Tauchnitz -function sem_dashboardStatz() { +function sem_dashboardStatz_show() { + + $widgets = get_option( 'dashboard_widget_options' ); echo '

'; printf(_n("%d Visitor online", "%d Visitors online", sem_showNumUsersOnline(), "semmelstatzR"), sem_showNumUsersOnline()); echo ' - '; @@ -237,14 +278,36 @@ function sem_dashboardStatz() { echo ' »»'; echo '

'; } + +function sem_dashboardStatz_control() { + if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) + $widget_options = array(); + + if ( !isset($widget_options['dashboard_sem_dashboardStatz']) ) + $widget_options['dashboard_sem_dashboardStatz'] = array(); + + if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['dashboard-sem-dashboardStatz']) ) { + $number = absint( $_POST['dashboard-sem-dashboardStatz']['items'] ); + $widget_options['dashboard_sem_dashboardStatz']['items'] = $number; + update_option( 'dashboard_widget_options', $widget_options ); + } + + $number = isset( $widget_options['dashboard_sem_dashboardStatz']['items'] ) ? (int) $widget_options['dashboard_sem_dashboardStatz']['items'] : ''; + + echo '

'; + echo '

'; + + print_r($widget_options['dashboard_sem_dashboardStatz']); +} ### Widget für die Mini-STATZ add_action('wp_dashboard_setup', 'sem_dashboardStatz_setup'); + function sem_dashboardStatz_setup() { $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen if(!current_user_can('manage_statz')) return; if($sem_options['statz_on_dashboard'] != true) return; - wp_add_dashboard_widget( 'sem_dashboardStatz', 'SemmelstatzR', 'sem_dashboardStatz' ); + wp_add_dashboard_widget( 'sem_dashboardStatz', 'SemmelstatzR', 'sem_dashboardStatz_show', 'sem_dashboardStatz_control' ); } ### Mini-Statz für Dashboard-Widget & AKTUELL-Anzeige @@ -252,7 +315,7 @@ function sem_dashboardStatz_setup() { global $wpdb; $thedays = $wpdb->get_results("SELECT COUNT(ip) AS hits, COUNT(DISTINCT ip) AS visitors, COUNT(DISTINCT referer) AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE time >= CURDATE() GROUP BY date"); - $thedays = array(array('hits' => 33)); + //$thedays = array(array('hits' => 33)); if (empty($thedays)) { return "".__("... no entries", "semmelstatzR").""; } @@ -266,737 +329,4 @@ function sem_dashboardStatz_setup() { .sprintf(_n("%d Hit","%d Hits",$hits, "semmelstatzR"),$hits)." - " .sprintf(_n("%d Referrer","%d Referrers",$referer, "semmelstatzR"),$referers); } - -### Encodierung der IP-Adresse durch simple arithmetische Operation - function sem_encodeIP($ip) { - $ip_parts = split("[.]", $ip); - $new_ip = ($ip_parts[0]+700) . "." . ($ip_parts[1]*2) . "." . ($ip_parts[2]+600) . "." . ($ip_parts[3]*3); - return $new_ip; - } - -### Decodierung der IP-Adresse durch simple arithmetische Operation - function sem_decodeIP($ip) { - $ip_parts = split("[.]", $ip); - $new_ip = ($ip_parts[0]-700) . "." . ($ip_parts[1] / 2) . "." . ($ip_parts[2]-600) . "." . ($ip_parts[3]/3); - return $new_ip; - } - -### Ist IP-Adresse codiert? - function sem_checkIfIPisEncoded($ip) { - $ip_parts = split("[.]", $ip); - if($ip_parts[0]>700) { - return true; - } - else { - return false; - } - } - -### Auslesen der höchsten Post-ID - function sem_getMaxPostID() { - global $wpdb; - $maxpostid = $wpdb->get_var("SELECT MAX(ID) FROM ".$wpdb->posts." LIMIT 0,1"); - return $maxpostid; //Ganzzahl - } - -### Auslesen des User- bzw. Kommentarautornamen - function sem_getUsername() { - global $user_ID, $user_login, $isAdmin; - - get_currentuserinfo(); - - if($user_ID > 0) { - $useronline = $user_login; - - if(current_user_can('manage_options')) { - $isAdmin = 1; - } - else { - $isAdmin = 0; - } - } - elseif(isset($_COOKIE["comment_author_".COOKIEHASH])) { - $useronline = trim($_COOKIE["comment_author_".COOKIEHASH]); - $isAdmin = -1; - } - else { - $useronline = "Gast"; - $isAdmin = -1; - } - return $useronline; - } - -### Prüfen, ob Besucher ein Bot ist - function sem_AreYouBot($user_agent) { - global $isBot; - $bots = array( - 'aipbot', - 'amfibibot', - 'appie', - 'ask jeeves/teoma', - 'aspseek', - 'axadine', - 'baiduspider', - 'becomebot', - 'blogcorpuscrawler', - 'blogpulse', - 'blogsnowbot', - 'boitho.com', - 'bruinbot', - 'cerberian', - 'cfnetwork', - 'check_http', - 'cipinetbot', - 'claymont', - 'cometsearch@cometsystems.com', - 'converacrawler', - 'cydralspider', - 'digger', - 'es.net_crawler', - 'eventax', - 'everyfeed-spider', - 'exabot@exava.com', - 'faxobot', - 'findlinks', - 'fireball', - 'francis', - 'gaisbot', - 'gamekitbot', - 'gazz@nttr.co.jp', - 'geonabot', - 'getrax crawler', - 'gigabot', - 'girafa.com', - 'goforitbot', - 'googlebot', - 'grub-client', - 'holmes', - 'houxoucrawler', - 'http://www.almaden.ibm.com/cs/crawler', - 'http://www.istarthere.com', - 'http://www.relevantnoise.com', - 'httrack ?', - 'ia_archiver', - 'ichiro', - 'iltrovatore-setaccio', - 'inelabot', - 'infoseek', - 'inktomi.com', - 'irlbot', - 'jetbot', - 'jobspider_ba', - 'kazoombot', - 'larbin', - 'libwww', - 'linkwalker', - 'lmspider', - 'mackster', - 'mediapartners-google', - 'microsoft url control', - 'mj12bot', - 'moreoverbot', - 'mozdex', - 'msnbot', - 'msrbot', - 'naverbot', - 'netresearchserver', - 'ng/2.0', - 'np(bot)', - 'nutch', - 'objectssearch', - 'ocelli', - 'omniexplorer_bot', - 'openbot', - 'overture', - 'patwebbot', - 'php', - 'phpdig', - 'pilgrim html-crawler', - 'pipeliner', - 'pompos', - 'psbot', - 'python-urllib', - 'quepasacreep', - 'robozilla', - 'rpt-httpclient', - 'savvybot', - 'scooter', - 'search.ch', - 'seekbot', - 'semager', - 'seznambot', - 'sherlock', - 'shelob', - 'sitesearch', - 'snapbot', - 'snappreviewbot', - 'speedy spider', - 'sphere scout', - 'stackrambler', - 'steeler', - 'surveybot', - 'szukacz', - 'technoratibot', - 'telnet', - 'themiragorobot', - 'thesubot', - 'thumbshots-de-bot', - 'topicblogs', - 'turnitinbot', - 'tutorgigbot', - 'tutorial crawler', - 'twiceler', - 'vagabondo', - 'versus', - 'voilabot', - 'w3c_css_validator', - 'w3c_validator', - 'w3c-checklink', - 'web downloader', - 'webcopier', - 'webcrawler', - 'webfilter robot', - 'west wind internet protocols', - 'wget', - 'wwweasel robot', - 'wwwster', - 'xaldon webspider', - 'xenu', - 'yahoo! slurp', - 'yahoofeedseeker', - 'yahoo-mmcrawler', - 'zao', - 'zipppbot', - 'zyborg', - ); - foreach($bots as $bot) { - if(stristr($user_agent, $bot) !== false) { - return true; - } - } - return false; - } - -### Referer nach Suchmaschinen-Queries und interner Suche prüfen und Suchstring extrahieren - function sem_getKeyword($referer) { - $keyword = @parse_url($referer); - - if (preg_match("/google\./i", $keyword["host"])) { - if (preg_match("/imgurl/i", $keyword["query"])) { - parse_str($keyword["query"],$q); - $keyword = substr($q["prev"],10); - } - else if (preg_match("/translate\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - } - else { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - } - if($keyword == "") return; return "Google: ".$keyword; - } - elseif (preg_match("/search\.live\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "LiveSearch: ".$keyword; - } - elseif (preg_match("/bing\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "Bing: ".$keyword; - } - elseif (preg_match("/yahoo\./i", $keyword["host"])) { - if (preg_match("/images/i", $keyword["query"])) { - parse_str($keyword["query"],$q); - $keyword = $q["p"]; - } - else { - parse_str($keyword["query"],$q); - $keyword = $q["p"]; - } - if($keyword == "") return; return "Yahoo: ".$keyword; - } - elseif (preg_match("/aol\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "AOL: ".$keyword; - } - elseif (preg_match("/aolsvc\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "AOL: ".$keyword; - } - elseif (preg_match("/search\.msn\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "MSN: ".$keyword; - } - elseif (preg_match("/gmx\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["su"]; - if($keyword == "") return; return "GMX: ".$keyword; - } - elseif (preg_match("/\.bild\.t\-/i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["query"]; - if($keyword == "") return; return "BILD: ".$keyword; - } - elseif (preg_match("/t\-online\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "T-Online: ".$keyword; - } - elseif (preg_match("/suche\.web\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["su"]; - if($keyword == "") return; return "WEB.de: ".$keyword; - } - elseif (preg_match("/suche\.lycos\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["query"]; - if($keyword == "") return; return "Lycos: ".$keyword; - } - elseif (preg_match("/altavista\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "Altavista: ".$keyword; - } - elseif (preg_match("/alltheweb\./i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["q"]; - if($keyword == "") return; return "alltheweb: ".$keyword; - } - elseif (preg_match("/technorati\.com\/search\//", $referer)) { - $q = preg_split("/technorati\.com\/search\//", $referer,-1,PREG_SPLIT_NO_EMPTY); - $keyword = $q[1]; - if($keyword == "") return; return "Technorati: ".$keyword; - } - elseif (preg_match("/".$homehost."/i", $keyword["host"])) { - parse_str($keyword["query"],$q); - $keyword = $q["s"]; - if($keyword == "") return; return "Interne Suche: ".$keyword; - } - else { - return; - } - } - -### Anzahl der Datensätze in der statz-Tabelle - function sem_showNumStatzEntries() { - global $wpdb; - $numstatzentries = $wpdb->get_var("SELECT COUNT(id) FROM ".$wpdb->statz); - return $numstatzentries; // Zahl - } - -### Aufgezeichnete Tage in der statz-Tabelle - function sem_countDaysInStatzTable() { - global $wpdb; - $firstdate = $wpdb->get_var("SELECT MIN(time) FROM ".$wpdb->statz." LIMIT 0,1"); - if(!$firstdate) { - return 1; - } - else { - $firstdate = strtotime($firstdate); $now = time(); - $days = (int) (($now - $firstdate) / (60*60*24)+1); - return $days; // KOMPLETTE! Tage - } - } - -### Wenn Tage in statz-Tabelle kleiner als Tage in Daily-Statz, dann nimm Tage in Daily-Statz - function sem_compareLimitDays2DailyStatz () { - global $wpdb; - $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen - if (sem_countDaysInStatzTable() << $sem_options["statz_days_limit"]) { - $sem_options["statz_days_limit"] = sem_countDaysInStatzTable(); - update_option("semmelstatzR_options", $sem_options); - } - } - -### Zeigt Copyright-Notiz an - function sem_showCopyright() { - print ""; - } - -### statz-Tabelle leeren (NICHT LÖSCHEN!!!) - function sem_truncateStatzTable() { - global $wpdb, $userip; - $wpdb->query('TRUNCATE TABLE '.$wpdb->statz); - sem_optStatzTable(); - $wpdb->query("INSERT INTO `$wpdb->statz`(ip, time, referer, page, username) VALUES('127.0.0.1', NOW(),NULL,0,'statz-Tabelle geleert')"); - } - -### Obsolet, bleibt aber aus Kompatibilitätsgründen zu SEMMELSTATZ_DELETE - function sem_delOldRecords($days) { - return true; - } - -### simpleEncoding für die GoogleChartAPI - function sem_encodeChartData($values) { - - $maxValue = max($values); - $simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - $chartData = "s:"; - for ($i = 0; $i < count($values); $i++) { - $currentValue = $values[$i]; - - if ($currentValue > -1) { - $chartData.=substr($simpleEncoding,61*($currentValue/$maxValue),1); - } - else { - $chartData.='_'; - } - } - return $chartData; - } - -### Datensätze älter als statz_recdays_limit-Tage löschen - function sem_delOutOfLimit() { - global $wpdb; - $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen - $today = time(); $days = $sem_options["statz_recdays_limit"]; - $enddatum = $today - ($days * 86400); - $enddatum = date("Y-m-d", $enddatum) . " 23:59:59"; - $wpdb->query("DELETE FROM ".$wpdb->statz." WHERE time <= '".$enddatum."'"); - sem_optStatzTable(); - } - -### Wenn AUTOMATISCHES LIMIT aktiviert, dann LIMITIERE und erhöhe NEXT_CRON - function sem_doCronStatzLimit() { - sem_delOutOfLimit(); - $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen - $statz_next_cron = $sem_options["statz_next_cron"] + 86400; - $sem_options["statz_next_cron"] = $statz_next_cron; - update_option("semmelstatzR_options", $sem_options); - } - -### Konvertiert Strings von utf-8 in ISO-8859 - function sem_encodeToIso($string) { - return mb_convert_encoding($string, "ISO-8859-1", mb_detect_encoding($string, "UTF-8, ISO-8859-1, ISO-8859-15", true)); - } - -### statz-Tabelle optimieren - function sem_optStatzTable() { - global $wpdb; - $wpdb->query("OPTIMIZE TABLE ".$wpdb->statz); - } - -### Unter bestimmten Voraussetzungen den Vortag in die statzhist-Tabelle schreiben - function sem_writeYesterdayToHist() { - global $wpdb; - if(!$wpdb->get_var("SELECT date FROM ".$wpdb->statzhist." WHERE substring(date,1,10) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)")) { - - if($wpdb->get_var("SELECT COUNT(ip) FROM ".$wpdb->statz." WHERE substring(time,1,10) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)")) { - - $yesterdays = $wpdb->get_results("SELECT COUNT(ip) AS hits, COUNT(DISTINCT ip) AS visitors, COUNT(DISTINCT referer) - AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE substring(time,1,10) = DATE_SUB(CURDATE(), - INTERVAL 1 DAY) GROUP BY date"); - - foreach ($yesterdays as $yesterday) { - $date = $yesterday->date; - $visitors = $yesterday->visitors; - $hits = $yesterday->hits; - $referers = $yesterday->referers; - } - - $sql = $wpdb->query("INSERT INTO ".$wpdb->statzhist." (date, referers, visitors, hits) - VALUES('$date', $referers, $visitors, $hits)"); - } - else { - $date = $wpdb->get_var("SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); - $sql = $wpdb->query("INSERT INTO ".$wpdb->statzhist." (date, referers, visitors, hits) VALUES('$date', 0, 0, 0)"); - } - } - } - -### Summen der vergangenen Tage in die statzhist schreiben */ - function sem_writeOldDaysToHist() { - global $wpdb; - if(!$wpdb->get_var("SELECT date FROM ".$wpdb->statzhist." WHERE substring(date,1,10) <= DATE_SUB(CURDATE(), INTERVAL 1 DAY)")) { - - $theolddays = $wpdb->get_results("SELECT COUNT(ip) AS hits, COUNT(DISTINCT ip) AS visitors, - COUNT(DISTINCT referer) AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE - substring(time,1,10) <= DATE_SUB(CURDATE(), INTERVAL 1 DAY) GROUP BY date ORDER BY time ASC"); - - foreach ($theolddays as $theoldday) { - $date = $theoldday->date; - $visitors = $theoldday->visitors; if(!$visitors) $visitors = 0; - $hits = $theoldday->hits; if(!$hits) $hits = 0; - $referers = $theoldday->referers; if(!$referers) $referers = 0; - $sql = $wpdb->query("INSERT INTO ".$wpdb->statzhist." (date, referers, visitors, hits) - VALUES('$date', $referers, $visitors, $hits)"); - } - } - } - -############################################## Ende SEMMELSTATZ-interne Funktionen - -############################################## Beginn TEMPLATE-Funktionen - -### Zeigt die letzten $num_posts-Posts an: Titel und absolutes Datum - CSS-id: #lastposts - function sem_showLastPosts($num_posts = 10) { - global $wpdb; - $lastposts = $wpdb->get_results("SELECT ID, post_title FROM ".$wpdb->posts." WHERE post_status = 'publish' - AND post_type = 'post' ORDER BY post_date DESC LIMIT 0, ".$num_posts); - print "
"; - if (empty($lastposts)) { - print "... noch keine Beiträge"; - } - else { - print "Die letzten ".$num_posts." Beiträge
"; - foreach ($lastposts as $lastpost) { - $posttitle = $lastpost->post_title; - $permalink = get_permalink($lastpost->ID); - $postdate = $lastpost->post_date; - print "".$posttitle."
\n"; - } - } - print "
"; - } - -### Zeigt die letzten $num_comments-Kommentare an: Autor und Post mit relativem Datum - CSS-id: #lastcomments - function sem_showLastComments($num_comments = 10) { - global $wpdb; - $comments = $wpdb->get_results("SELECT comment_author, comment_ID, comment_post_ID, comment_date - FROM ".$wpdb->comments." WHERE comment_approved = '1' ORDER BY comment_date DESC LIMIT 0, $num_comments"); - print "
"; - if (empty($comments)) { - print "Keine Kommentare"; - } - else { - print "Die letzten ".$num_comments." Kommentare
"; - foreach ($comments as $comment) { - $commentday = strtotime(substr($comment->comment_date,1,10)); - $today = time(); - $difference = ceil(($today - $commentday) / (60*60*24))-1; - if($difference == 0) { - $commentdate = "Heute um " . mysql2date("G:i", $comment->comment_date); - } - elseif($difference == 1) { - $commentdate = "Gestern um " . mysql2date("G:i", $comment->comment_date); - } - elseif($difference == 2) { - $commentdate = "Vorgestern um " . mysql2date("G:i", $comment->comment_date); - } - else { - $commentdate = mysql2date("j. F G:i", $comment->comment_date); - } - - print "$comment->comment_author@". get_the_title($comment->comment_post_ID) .", $commentdate
\n"; - } - } - print "
"; - } - -### Zeigt die $num_reads meist gelesenen Posts an - CSS-id: #mostreads - function sem_showMostReads($num_reads = 10) { - global $wpdb; - $mostreads = $wpdb->get_results("SELECT post_title AS posttitle, guid AS postid, hits AS hits FROM ".$wpdb->posts." WHERE hits != '0' GROUP BY postid ORDER BY hits DESC LIMIT 0, $num_reads"); - print "
"; - if (empty($mostreads)) { - print "... noch keine Einträge"; - } - else { - print "Die ".$num_reads." meist gelesenen Beiträge
"; - foreach ($mostreads as $mostread) { - $posttitle = $mostread->posttitle; - $postid = $mostread->postid; - //$permalink = get_permalink($mostread->postid); - $hits = $mostread->hits; - print "".$posttitle." (".$hits.")
\n"; - } - } - print "
"; - } - -### Zeigt die $num_reads meist gelesenen Posts an - CSS-id: #mostreads - ACHTUNG: Das Ergebnis der Funktion basiert auf der statz-Tabelle - function sem_showMostReadsOld($num_reads = 10) { - global $wpdb; - $mostreads = $wpdb->get_results("SELECT post_title AS posttitle, ".$wpdb->posts.".guid AS postid, - COUNT(".$wpdb->statz.".page) AS count FROM ".$wpdb->posts.", ".$wpdb->statz." WHERE - ".$wpdb->statz.".page = ".$wpdb->posts.".ID GROUP BY postid ORDER BY count DESC LIMIT 0, $num_reads"); - print "
"; - if (empty($mostreads)) { - print "... noch keine Einträge"; - } - else { - print "Die ".$num_reads." meist gelesenen Beiträge
"; - foreach ($mostreads as $mostread) { - $posttitle = $mostread->posttitle; - $postid = $mostread->postid; - //$permalink = get_permalink($mostread->postid); - $count = $mostread->count; - print "".$posttitle." (".$count.")
\n"; - } - } - print "
"; - } - -### Zeigt die $num_commented meist kommentierten Posts an - CSS-id: #mostcommented - function sem_showMostCommented($num_commented = 10) { - global $wpdb; - $mostcommented = $wpdb->get_results("SELECT guid, id, post_title, COUNT(*) AS count FROM ".$wpdb->comments.",". $wpdb->posts." WHERE - comment_approved = '1' AND comment_post_id = id GROUP BY id, post_title ORDER BY count DESC LIMIT 0, $num_commented"); - - print "
"; - if (empty($mostcommented)) { - print "... noch keine Einträge"; - } - else { - print "Die ".$num_commented." meist kommentierten Beiträge
"; - - foreach ($mostcommented as $key => $mostcommented) { - $posttitle = $mostcommented->post_title; - $count = $mostcommented->count; - $postid = $mostcommented->guid; - print "".$posttitle." (".$count.")
\n"; - } - } - print "
"; - } - -### Zeigt einen Zähler der Hits im jeweiligen Post. ACHTUNG: FUNKTIONIERT NUR IM LOOP (index.php, single.php) - function sem_showPostHitsInLoop($postid) { - global $wpdb; - $hits = $wpdb->get_var("SELECT hits FROM $wpdb->posts WHERE ID = $postid LIMIT 0,1"); - return $hits; - } - -### Anzahl aller Posts/Pages - function sem_showTotalPosts() { - global $wpdb; - $totalposts = $wpdb->get_var("SELECT COUNT(ID) AS num FROM ".$wpdb->posts." WHERE post_status = 'publish' LIMIT 0,1"); - return $totalposts; // Ganzzahl - } - -### Anzahl aller Kommentare - function sem_showTotalComments() { - global $wpdb; - $totalcomments = $wpdb->get_var("SELECT COUNT(comment_ID) AS num FROM ".$wpdb->comments." WHERE comment_approved = '1' LIMIT 0,1"); - return $totalcomments; // Ganzzahl - } - -### Anzahl aller User seit Beginn der Statzaufzeichnung - function sem_showTotalUsers() { - global $wpdb; - $totalusers = $wpdb->get_var("SELECT SUM(visitors) FROM ".$wpdb->statzhist." LIMIT 0,1"); - if(!$totalusers) $totalusers = 0; - return $totalusers; // Ganzzahl - } - -### Anzahl User pro Tag im Durchschnitt - function sem_showAverageUserPerDay() { - $averageuser = ceil(sem_showTotalUsers() / sem_showStatzDays()); - return $averageuser; - } - -### Datum des 1. Posts = Blogstart - function sem_showFirstPostDate() { - global $wpdb; - $firstpostdate = $wpdb->get_var("SELECT MIN(post_date) FROM ".$wpdb->posts." WHERE post_status = 'publish' AND post_date != '0000-00-00 00:00:00' LIMIT 0,1"); - $firstpostdate = mysql2date("j.n.Y", $firstpostdate); - return $firstpostdate; // String T.M.JJJJ - } - -### Datum des 1. Kommentars - function sem_showFirstCommentDate() { - global $wpdb; - $firstcommentdate = $wpdb->get_var("SELECT MIN(comment_date) FROM ".$wpdb->comments." WHERE comment_approved = '1' - AND comment_date != '0000-00-00 00:00:00' LIMIT 0,1"); - $firstcommentdate = mysql2date("j.n.Y", $firstcommentdate); - return $firstcommentdate; // String T.M.JJJJ - } - -### Anzahl der Kommentierer nach Nicknamen - function sem_showNumCommenters() { - global $wpdb; - $totalcommenters = $wpdb->get_var("SELECT COUNT(DISTINCT comment_author) FROM ".$wpdb->comments." WHERE comment_approved = '1' LIMIT 0,1"); - if(!$totalcommenters) $totalcommenters = 0; - return $totalcommenters; // Ganzzahl - } - -### Blog besteht seit x Tagen - function sem_showPostDays() { - global $wpdb; - $firstdate = $wpdb->get_var("SELECT MIN(post_date) AS date FROM ".$wpdb->posts." WHERE post_status = 'publish' AND post_date != '0000-00-00 00:00' LIMIT 0,1"); - $firstdate = strtotime($firstdate); $now = time(); - $blogdays = (int) (($now - $firstdate) / (60*60*24)); - $blogdays = $blogdays + 1; - return $blogdays; // Ganzzahl - } - -### Tage seit 1. Kommentar - function sem_showCommentDays() { - global $wpdb; - $firstdate = $wpdb->get_var("SELECT MIN(comment_date) AS date FROM ".$wpdb->comments." LIMIT 0,1"); - $firstdate = strtotime($firstdate); $now = time(); - $commentdays = (int) (($now - $firstdate) / (60*60*24)); - $commentdays = $commentdays + 1; - return $commentdays; // Ganzzahl - } - -### durchschn. Posts pro Tag - function sem_showPostsPerDay() { - global $wpdb; - $postsperday = (int) sem_showTotalPosts() / (int) sem_showPostDays(); - return $postsperday; // Ganzzahl - } - -### durchschn. Kommentare pro Tag - function sem_showCommentsPerDay() { - global $wpdb; - $commentsperday = (int) sem_showTotalComments() / (int) sem_showCommentDays(); - return $commentsperday; // Ganzzahl - } - -### Startdatum der Gesamtstatistik (Basis: statzhist) - function sem_showStatzStartDate() { - global $wpdb; - $statzhiststartdate = $wpdb->get_var("SELECT MIN(date) FROM ".$wpdb->statzhist." WHERE date != '0000-00-00 00:00' LIMIT 0,1"); - $statzhiststartdate = mysql2date("j.n.Y", $statzhiststartdate); - // if(!$statzhiststartdate) $statzhiststartdate= "xx.xx.xxxx"; - return $statzhiststartdate; // String T.M.JJJJ - } - -### Dauer der Statistikaufzeichnung in Tagen (Basis: statzhist) - function sem_showStatzDays() { - global $wpdb; - $firstdate = $wpdb->get_var("SELECT MIN(date) FROM ".$wpdb->statzhist." LIMIT 0,1"); - if(!$firstdate) { - return 1; - } - else { - $firstdate = strtotime($firstdate); $now = time(); - $statzdays = (int) (($now - $firstdate) / (60*60*24)); - return $statzdays; // Ganzzahl - } - } - -### Anzahl der Online-Besucher - Verweildauer in den Einstellungen - function sem_showNumUsersOnline() { - global $wpdb; - $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen - $onlinetime = $sem_options["statz_online_time"]; - $numonline = $wpdb->get_var("SELECT COUNT(DISTINCT ip) FROM ".$wpdb->statz." WHERE time > Now() - INTERVAL ".$onlinetime." SECOND"); - return $numonline; // Ganzzahl - } - -### Anzahl der heutigen Besucher - function sem_showUsersToday() { - global $wpdb; $today = date("Y-m-d"); - $todayusers = $wpdb->get_var("SELECT COUNT(DISTINCT ip) FROM ".$wpdb->statz." WHERE time >= '$today' LIMIT 0, 1"); - return $todayusers; - } - -### Anzahl der gestrigen Besucher - function sem_showUsersYesterday() { - global $wpdb; - $yesterdaysusers = $wpdb->get_var("SELECT visitors FROM ".$wpdb->statzhist." WHERE date = substr(DATE_SUB(NOW(), INTERVAL 1 DAY),1,10) LIMIT 0, 1"); - return $yesterdaysusers; - } - -##################################################### Ende TEMPLATE-Funktionen - ?> \ No newline at end of file diff --git a/trunk/semr_image.php b/trunk/semr_image.php new file mode 100644 index 0000000..485558c --- /dev/null +++ b/trunk/semr_image.php @@ -0,0 +1,25 @@ +"; +print_r($_SERVER); +echo ""; +*/ +header('Cache-Control: no-cache'); +header("X-Robots-Tag: noindex, nofollow", true); + +require '../../../wp-load.php'; +sem_writeStatz(); + + +// Output transparent gif + +header('Content-type: image/gif'); +header('Content-length: 43'); + +echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); +?> \ No newline at end of file
checked="checked" /> +
Blog-Administratoren aufzeichnen