1
0
Fork 0

i18n standard entries

Dieser Commit ist enthalten in:
oldperl 2011-12-17 17:02:05 +00:00
Ursprung d68581e0f3
Commit ebd8b29827

Datei anzeigen

@ -46,106 +46,106 @@
*/ */
if(!current_user_can('manage_statz')) { if(!current_user_can('manage_statz')) {
die('Zugriff verweigert'); die(semr_i18n("Restricted Area"));
} }
### ANZEIGE LOG global $wpdb;
global $wpdb; $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$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);
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen print "<div class='wrap'>";
$limit = $sem_options["statz_datarecs_limit"]; $mask = $sem_options["statz_mask_referer"]; print "<div id='icon-semmelstatzR' class='icon32'><br /></div>";
$completerecords = print "<h2>SemmelstatzR &gt; ".semr_i18n("Log")."</h2>";
$wpdb->get_results("SELECT id, ip, time, referer, page, username FROM ".$wpdb->statz." ORDER BY time DESC LIMIT 0, ".$limit); print "<div class='statz'>";
printf(semr_i18n("The %s newest records"), $limit);
print "</div>";
print "<div class='wrap'>"; if ($completerecords == NULL) {
print "<div id='icon-semmelstatzR' class='icon32'><br /></div>"; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<h2>SemmelstatzR &rsaquo; Log</h2>";
print "<div class='statz'>Die neuesten ".$limit." Datens&auml;tze</div>";
if ($completerecords == NULL) {
print "<small>... noch keine Eintr&auml;ge</small>";
return; return;
} }
print "<table cellpadding='5' style='text-align:center; width:100%;'>"; print "<table cellpadding='5' style='text-align:center; width:100%;'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align:center;width:110px;'><small>Datum</small></th>"; print "<th style='text-align:center;width:110px;'><small>".semr_i18n("Date")."</small></th>";
print "<th style='text-align:center;width:80px;'><small>TCP/IP</small></th>"; print "<th style='text-align:center;width:80px;'><small>".semr_i18n("TCP/IP")."</small></th>";
print "<th style='text-align:left;'><small>Referer</small></th>"; print "<th style='text-align:left;'><small>".semr_i18n("Referrer")."</small></th>";
print "<th style='text-align:left;'><small>Suchbegriff</small></th>"; print "<th style='text-align:left;'><small>".semr_i18n("Search term")."</small></th>";
print "<th style='text-align:left;'><small>Post/Page</small></th>"; print "<th style='text-align:left;'><small>".semr_i18n("Post/Page")."</small></th>";
print "<th style='text-align:left;'><small>Username</small></th>"; print "<th style='text-align:left;'><small>".semr_i18n("Username")."</small></th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
foreach ($completerecords as $key=>$completerecord) { foreach ($completerecords as $key=>$completerecord) {
$id = $completerecord->id; $id = $completerecord->id;
$ip = $completerecord->ip; $ip = $completerecord->ip;
if(sem_checkIfIPisEncoded($ip) == true) $ip = sem_decodeIP($ip); if(sem_checkIfIPisEncoded($ip) == true) $ip = sem_decodeIP($ip);
$date = mysql2date("d.m.Y G:i", $completerecord->time); $date = mysql2date("d.m.Y G:i", $completerecord->time);
$referer = $completerecord->referer; $referer = $completerecord->referer;
if($referer == "") { if($referer == "") {
$referer = "--"; $referer = "--";
} }
else { else {
if(strlen($referer) >= 50) { if(strlen($referer) >= 50) {
$printreferer = substr($referer, 0, 50)."..."; $printreferer = substr($referer, 0, 50)."...";
} }
else { else {
$printreferer = $referer; $printreferer = $referer;
} }
} }
$keyword = sem_getKeyword($referer); $keyword = sem_getKeyword($referer);
if(empty($keyword)) $keyword ='--'; if(empty($keyword)) $keyword ='--';
$page = $completerecord->page; $page = $completerecord->page;
if ($page == 0) { if ($page == 0) {
$link = get_option('siteurl'); $link = get_option('siteurl');
$title = "0"; //oder wie auch immer $title = "0"; //oder wie auch immer
} }
else { else {
$link = get_permalink($page); $link = get_permalink($page);
$postarray = get_post($page, ARRAY_A); $postarray = get_post($page, ARRAY_A);
$title = $postarray['post_title']; $title = $postarray['post_title'];
} }
$username = $completerecord->username; $username = $completerecord->username;
print "<tr"; if(1&$key) print " class='alternate'"; print ">"; 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;'><small>".$date."</small></td>";
print "<td style='white-space:nowrap;text-align:center;'> print "<td style='white-space:nowrap;text-align:center;'>
<a target='_blank' style='border:none;' href='http://ws.arin.net/whois/?queryinput=".$ip."'> <a target='_blank' style='border:none;' href='http://ws.arin.net/whois/?queryinput=".$ip."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/arin.png' /></a>&nbsp; <img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/arin.png' /></a>&nbsp;
<a target='_blank' style='border:none;' href='http://www.ripe.net/whois?searchtext=".$ip."'> <a target='_blank' style='border:none;' href='http://www.ripe.net/whois?searchtext=".$ip."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/ripe.png' /></a>&nbsp; <img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/ripe.png' /></a>&nbsp;
<a target='_blank' style='border:none;' href='http://www.utrace.de/?query=".$ip."'> <a target='_blank' style='border:none;' href='http://www.utrace.de/?query=".$ip."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/utrace.png' /></a></td>"; <img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/utrace.png' /></a></td>";
print "<td style='text-align:left;'><small>"; print "<td style='text-align:left;'><small>";
if ($referer == "--") { if ($referer == "--") {
print "--</small></td>"; print "--</small></td>";
} }
else { else {
if($mask != true) { if($mask != true) {
print "<a target='_blank' style='text-decoration:none;' href='".$referer."'>".$printreferer."</a></td>"; print "<a target='_blank' style='text-decoration:none;' href='".$referer."'>".$printreferer."</a></td>";
} }
else { else {
$referer = htmlspecialchars($referer, ENT_QUOTES); $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 "<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>".$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><a target='_blank' style='text-decoration:none;' href='".$link."'>".$title."</small></td>";
print "<td style='text-align:left;'><small>".$username."</small></td>"; print "<td style='text-align:left;'><small>".$username."</small></td>";
print "</tr>"; print "</tr>";
} }
print "</tbody>"; print "</tbody>";
print "</table>"; print "</table>";
print "<hr />"; print "<hr />";
if (function_exists('sem_showCopyright')) sem_showCopyright(); if (function_exists('sem_showCopyright')) sem_showCopyright();
print "</div>"; print "</div>";
?> ?>