2011-05-02 09:17:45 +00:00
|
|
|
<?php
|
2011-05-02 10:30:11 +00:00
|
|
|
/**
|
|
|
|
* file semmelstatzR_log.php
|
|
|
|
*
|
|
|
|
* @package SemmelstatzR
|
|
|
|
* @version $Rev$
|
|
|
|
* @author Ortwin Pinke <info@dceonline.de>
|
|
|
|
* @author Andreas 'Redunzl' Mueller
|
|
|
|
* @copyright (c)2011 PHP-Backoffice
|
|
|
|
* @copyright (c)2005-2009 kopfhoch-studio
|
|
|
|
* @link http://www.php-backoffice.de/projects/semmelstatzR
|
|
|
|
* @link http://sourceforge.net/projects/semmelstatz/
|
|
|
|
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*/
|
2011-05-02 09:17:45 +00:00
|
|
|
|
|
|
|
if(!current_user_can('manage_statz')) {
|
|
|
|
die('Zugriff verweigert');
|
|
|
|
}
|
|
|
|
|
|
|
|
### ANZEIGE LOG
|
|
|
|
|
|
|
|
global $wpdb;
|
|
|
|
|
2011-05-02 10:30:11 +00:00
|
|
|
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
|
2011-05-02 09:17:45 +00:00
|
|
|
$limit = $sem_options["statz_datarecs_limit"]; $mask = $sem_options["statz_mask_referer"];
|
|
|
|
$completerecords =
|
|
|
|
$wpdb->get_results("SELECT id, ip, time, referer, page, username FROM ".$wpdb->statz." ORDER BY time DESC LIMIT 0, ".$limit);
|
|
|
|
|
|
|
|
print "<div class='wrap'>";
|
2011-05-02 10:30:11 +00:00
|
|
|
print "<div id='icon-semmelstatzR' class='icon32'><br /></div>";
|
|
|
|
print "<h2>SemmelstatzR › Log</h2>";
|
2011-05-02 09:17:45 +00:00
|
|
|
print "<div class='statz'>Die neuesten ".$limit." Datensätze</div>";
|
|
|
|
|
|
|
|
if ($completerecords == NULL) {
|
|
|
|
print "<small>... noch keine Einträge</small>";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
print "<table cellpadding='5' style='text-align:center; width:100%;'>";
|
|
|
|
print "<thead>";
|
|
|
|
print "<tr>";
|
|
|
|
print "<th style='text-align:center;width:110px;'><small>Datum</small></th>";
|
|
|
|
print "<th style='text-align:center;width:80px;'><small>TCP/IP</small></th>";
|
|
|
|
print "<th style='text-align:left;'><small>Referer</small></th>";
|
|
|
|
print "<th style='text-align:left;'><small>Suchbegriff</small></th>";
|
|
|
|
print "<th style='text-align:left;'><small>Post/Page</small></th>";
|
|
|
|
print "<th style='text-align:left;'><small>Username</small></th>";
|
|
|
|
print "</tr>";
|
|
|
|
print "</thead>";
|
|
|
|
print "<tbody>";
|
|
|
|
|
|
|
|
foreach ($completerecords as $key=>$completerecord) {
|
|
|
|
$id = $completerecord->id;
|
|
|
|
$ip = $completerecord->ip;
|
|
|
|
if(sem_checkIfIPisEncoded($ip) == true) $ip = sem_decodeIP($ip);
|
|
|
|
$date = mysql2date("d.m.Y G:i", $completerecord->time);
|
|
|
|
$referer = $completerecord->referer;
|
|
|
|
if($referer == "") {
|
|
|
|
$referer = "--";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(strlen($referer) >= 50) {
|
|
|
|
$printreferer = substr($referer, 0, 50)."...";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$printreferer = $referer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$keyword = sem_getKeyword($referer);
|
|
|
|
if(empty($keyword)) $keyword ='--';
|
|
|
|
$page = $completerecord->page;
|
|
|
|
if ($page == 0) {
|
|
|
|
$link = get_option('siteurl');
|
|
|
|
$title = "0"; //oder wie auch immer
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$link = get_permalink($page);
|
|
|
|
$postarray = get_post($page, ARRAY_A);
|
|
|
|
$title = $postarray['post_title'];
|
|
|
|
}
|
|
|
|
$username = $completerecord->username;
|
|
|
|
print "<tr"; if(1&$key) print " class='alternate'"; print ">";
|
|
|
|
print "<td style='white-space:nowrap;text-align:center;'><small>".$date."</small></td>";
|
|
|
|
print "<td style='white-space:nowrap;text-align:center;'>
|
|
|
|
<a target='_blank' style='border:none;' href='http://ws.arin.net/whois/?queryinput=".$ip."'>
|
2011-05-02 10:30:11 +00:00
|
|
|
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/arin.png' /></a>
|
2011-05-02 09:17:45 +00:00
|
|
|
<a target='_blank' style='border:none;' href='http://www.ripe.net/whois?searchtext=".$ip."'>
|
2011-05-02 10:30:11 +00:00
|
|
|
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/ripe.png' /></a>
|
2011-05-02 09:17:45 +00:00
|
|
|
<a target='_blank' style='border:none;' href='http://www.utrace.de/?query=".$ip."'>
|
2011-05-02 10:30:11 +00:00
|
|
|
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/utrace.png' /></a></td>";
|
2011-05-02 09:17:45 +00:00
|
|
|
print "<td style='text-align:left;'><small>";
|
|
|
|
if ($referer == "--") {
|
|
|
|
print "--</small></td>";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if($mask != true) {
|
|
|
|
print "<a target='_blank' style='text-decoration:none;' href='".$referer."'>".$printreferer."</a></td>";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$referer = htmlspecialchars($referer, ENT_QUOTES);
|
|
|
|
print "<a target='_blank' style='text-decoration:none;' href='http://www.google.com/url?sa=D&q=".$referer."'>".$printreferer."</a></td>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
print "<td style='text-align:left;'><small>".$keyword."</small></td>";
|
|
|
|
print "<td style='text-align:left;'><small><a target='_blank' style='text-decoration:none;' href='".$link."'>".$title."</small></td>";
|
|
|
|
print "<td style='text-align:left;'><small>".$username."</small></td>";
|
|
|
|
print "</tr>";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "</tbody>";
|
|
|
|
print "</table>";
|
|
|
|
print "<hr />";
|
|
|
|
|
|
|
|
if (function_exists('sem_showCopyright')) sem_showCopyright();
|
|
|
|
|
|
|
|
print "</div>";
|
|
|
|
|
|
|
|
?>
|