1
0
Fork 0

i18n standard entries

Dieser Commit ist enthalten in:
oldperl 2011-12-17 16:26:57 +00:00
Ursprung b90587fef1
Commit 172c9c52da

Datei anzeigen

@ -147,7 +147,7 @@ function sem_draw24HoursGoo() {
print "<div align='left'>"; print "<div align='left'>";
if(empty($results)) { if(empty($results)) {
print '<small>... '. semr_i18n("no entries at all").'</small></div>'; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
@ -223,19 +223,21 @@ function sem_draw24HoursGoo() {
AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE time >= CURDATE() - INTERVAL ".$daylimit." DAY AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE time >= CURDATE() - INTERVAL ".$daylimit." DAY
GROUP BY date ORDER BY time DESC"); GROUP BY date ORDER BY time DESC");
print "<div class='statz'>".$limit."-Tage-Statistik</div>"; print '<div class="statz">';
printf (semr_i18n("%s-Days-Statz"), $limit);
print '</div>';
if (empty($thedays)) { if (empty($thedays)) {
print '<small>... '. semr_i18n("no entries at all").'</small></div>'; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
print "<table class='statzelement'>"; print "<table class='statzelement'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align:left;'>Datum</th>"; print "<th style='text-align:left;'>".semr_i18n("Date")."</th>";
print "<th style='width: 15%;text-align:center;'>Besucher</th>"; print "<th style='width: 15%;text-align:center;'>".semr_i18n("Visitors")."</th>";
print "<th style='width: 15%;text-align:center;'>Hits</th>"; print "<th style='width: 15%;text-align:center;'>".semr_i18n("Hits")."</th>";
print "<th style='width: 15%;text-align:center;'>Referer</th>"; print "<th style='width: 15%;text-align:center;'>".semr_i18n("Referer")."</th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
@ -245,13 +247,13 @@ function sem_draw24HoursGoo() {
$today = time(); $today = time();
$difference = ceil(($today - $date) / (60*60*24))-1; $difference = ceil(($today - $date) / (60*60*24))-1;
if($difference == 0) { if($difference == 0) {
$date = "Heute"; $date = semr_i18n("Today");
} }
elseif($difference == 1) { elseif($difference == 1) {
$date = "Gestern"; $date = semr_i18n("Yesterday");
} }
elseif($difference == 2) { elseif($difference == 2) {
$date = "Vorgestern"; $date = semr_i18n("2 days ago");
} }
else { else {
$date = mysql2date("d.m.Y",$theday->date); $date = mysql2date("d.m.Y",$theday->date);
@ -267,7 +269,7 @@ function sem_draw24HoursGoo() {
print "</tr>"; print "</tr>";
} }
print "<tr>"; print "<tr>";
print "<td style='text-align:left;'><a href='".get_option('siteurl')."/wp-admin/admin.php?page=semmelstatzR/semmelstatzR-history.php'>mehr...</a></td>"; print "<td style='text-align:left;'><a href='".get_option('siteurl')."/wp-admin/admin.php?page=semmelstatzR/semmelstatzR-history.php'>".semr_i18n("more")."...</a></td>";
print "</tr>"; print "</tr>";
print "</tbody>"; print "</tbody>";
print "</table>"; print "</table>";
@ -284,17 +286,19 @@ function sem_draw24HoursGoo() {
$lastreferers = $wpdb->get_results("SELECT DISTINCT referer, time FROM ".$wpdb->statz." WHERE referer $lastreferers = $wpdb->get_results("SELECT DISTINCT referer, time FROM ".$wpdb->statz." WHERE referer
NOT LIKE '".$homehost."' ORDER BY time DESC LIMIT 0, ".$limit); NOT LIKE '".$homehost."' ORDER BY time DESC LIMIT 0, ".$limit);
print "<div class='statz'>Die letzten ".$limit." Referer</div>"; print "<div class='statz'>";
printf (semr_i18n("The last %s Referrer"), $limit);
print "</div>";
if (empty($lastreferers)) { if (empty($lastreferers)) {
print '<small>... '. semr_i18n("no entries at all").'</small></div>'; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
print "<table class='statzelement'>"; print "<table class='statzelement'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align:center;width:12%;'>Zeit</th>"; print "<th style='text-align:center;width:12%;'>".semr_i18n("Time")."</th>";
print "<th style='text-align:left;'>Referer</th>"; print "<th style='text-align:left;'>".semr_i18n("Referrer")."</th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
@ -324,29 +328,31 @@ function sem_draw24HoursGoo() {
} }
function sem_showKeyword() { function sem_showKeyword() {
global $wpdb; global $wpdb;
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$limit = $sem_options["statz_keyword_limit"];
$results = $wpdb->get_results("SELECT referer, time, ip FROM $wpdb->statz WHERE referer != 'NULL' ORDER BY time DESC");
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen print "<div class='statz'>";
$limit = $sem_options["statz_keyword_limit"]; printf(semr_i18n("The last %s search terms"), $limit);
print "</div>";
$results = $wpdb->get_results("SELECT referer, time, ip FROM $wpdb->statz WHERE referer != 'NULL' ORDER BY time DESC"); if (empty($results)) {
print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<div class='statz'>Die letzten $limit Suchbegriffe</div>"; print "<hr />";
if (empty($results)) { return;
print '<small>... '. semr_i18n("no entries at all").'</small></div>'; }
print "<hr />"; print "<table class='statzelement'>";
return; print "<thead>";
} print "<tr>";
print "<table class='statzelement'>"; print "<th style='text-align: center;width:12%;'>".semr_i18n("Time")."</th>";
print "<thead>"; print "<th style='text-align:left;width:70%;'>".semr_i18n("search term")."</th>";
print "<tr>"; print "<th style='text-align:left;'>".semr_i18n("TCP/IP")."</th>";
print "<th style='text-align: center;width:12%;'>Zeit</th>"; print "</tr>";
print "<th style='text-align:left;width:70%;'>Suchbegriff</th>"; print "</thead>";
print "<th style='text-align:left;'>TCP/IP</th>"; print "<tbody>";
print "</tr>"; $i=0;
print "</thead>";
print "<tbody>";
$i=0;
foreach($results as $result) { foreach($results as $result) {
$referer = $result->referer; $referer = $result->referer;
$keyword = sem_getKeyword($referer); $keyword = sem_getKeyword($referer);
@ -382,58 +388,61 @@ function sem_draw24HoursGoo() {
COUNT(".$wpdb->statz.".page) AS count FROM ".$wpdb->posts.", ".$wpdb->statz." WHERE COUNT(".$wpdb->statz.".page) AS count FROM ".$wpdb->posts.", ".$wpdb->statz." WHERE
".$wpdb->statz.".page = ".$wpdb->posts.".ID AND time >= '$today' GROUP BY postid ORDER BY count DESC LIMIT 10"); ".$wpdb->statz.".page = ".$wpdb->posts.".ID AND time >= '$today' GROUP BY postid ORDER BY count DESC LIMIT 10");
print "<div class='statz'>Die Top10 aller Posts & Pages heute</div>"; print "<div class='statz'>";
print semr_i18n("Top 10 of todays posts &amp; pages")."</div>";
if (empty($topreads)) { if (empty($topreads)) {
print '<small>... '. semr_i18n("no entries at all").'</small></div>'; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
print "<table class='statzelement'>"; print "<table class='statzelement'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align: left; width: 45%;'>Post/Page</th>"; print "<th style='text-align: left; width: 45%;'>".semr_i18n("Post/Page")."</th>";
print "<th style='text-align: left; width: 45%;'>Postname</th>"; print "<th style='text-align: left; width: 45%;'>".semr_i18n("Postname")."</th>";
print "<th style='text-align: center; width: 10%;'>Hits</th>"; print "<th style='text-align: center; width: 10%;'>".semr_i18n("Hits")."</th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
foreach ($topreads as $key=>$topread) { foreach ($topreads as $key=>$topread) {
$posttitle = $topread->posttitle; $posttitle = $topread->posttitle;
$postname = $topread->postname; $postname = $topread->postname;
$postid = $topread->postid; $postid = $topread->postid;
$count = $topread->count; $count = $topread->count;
print "<tr"; if(1&$key) print " class='alternate'"; print ">"; print "<tr"; if(1&$key) print " class='alternate'"; print ">";
print "<td style='text-align: left;'><a target='_blank' href='$postid'>".$posttitle."</a></td>"; print "<td style='text-align: left;'><a target='_blank' href='$postid'>".$posttitle."</a></td>";
print "<td style='text-align: left;'>".$postname."</td>"; print "<td style='text-align: left;'>".$postname."</td>";
print "<td style='text-align: center;'>".$count."</td>"; print "<td style='text-align: center;'>".$count."</td>";
print "</tr>"; print "</tr>";
} }
print "</tbody>"; print "</tbody>";
print "</table>"; print "</table>";
print "<hr />"; print "<hr />";
} }
function sem_showTopReads() { function sem_showTopReads() {
global $wpdb; global $wpdb;
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$limit = $sem_options["statz_topreads_limit"]; $limit = $sem_options["statz_topreads_limit"];
$topreads = $wpdb->get_results("SELECT post_title AS posttitle, post_name as postname, guid AS postid, $topreads = $wpdb->get_results("SELECT post_title AS posttitle, post_name as postname, guid AS postid,
hits AS count FROM ".$wpdb->posts." WHERE hits != '0' GROUP BY postid ORDER BY hits DESC LIMIT 0, ".$limit); hits AS count FROM ".$wpdb->posts." WHERE hits != '0' GROUP BY postid ORDER BY hits DESC LIMIT 0, ".$limit);
print "<div class='statz'>Die Top".$limit." aller Posts & Pages</div>"; print "<div class='statz'>";
printf (semr_i18n("Top %s of all posts &amp; pages"), $limit);
print "</div>";
if (empty($topreads)) { if (empty($topreads)) {
print '<small>... '. semr_i18n("no entries at all").'</small></div>'; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
print "<table class='statzelement'>"; print "<table class='statzelement'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align: left; width: 45%;'>Post/Page</th>"; print "<th style='text-align: left; width: 45%;'>".semr_i18n("Post/Page")."</th>";
print "<th style='text-align: left; width: 45%;'>Postname</th>"; print "<th style='text-align: left; width: 45%;'>".semr_i18n("Postname")."</th>";
print "<th style='text-align: center; width: 10%;'>Hits</th>"; print "<th style='text-align: center; width: 10%;'>".semr_i18n("Hits")."</th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
@ -450,7 +459,7 @@ function sem_draw24HoursGoo() {
} }
print "</tbody>"; print "</tbody>";
print "</table>"; print "</table>";
print "<hr />"; print "<hr />";
} }
function sem_showWhoWasOnlineToday() { function sem_showWhoWasOnlineToday() {
@ -463,14 +472,14 @@ function sem_draw24HoursGoo() {
print semr_i18n("Known visitors today"); print semr_i18n("Known visitors today");
print '</div>'; print '</div>';
if (empty($todaysonlineusers)) { if (empty($todaysonlineusers)) {
print '<small>... '. semr_i18n("no entries at all").'</small></div>'; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
print "<table class='statzelement'>"; print "<table class='statzelement'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align: left; width: 80%;'>Besucher (Hits)</th>"; print "<th style='text-align: left; width: 80%;'>".semr_i18n("Visitor (Hits)")."</th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
@ -483,7 +492,7 @@ function sem_draw24HoursGoo() {
} }
print "</tbody>"; print "</tbody>";
print "</table>"; print "</table>";
print "<hr />"; print "<hr />";
} }
function sem_showTopCommented() { function sem_showTopCommented() {
@ -492,35 +501,35 @@ function sem_draw24HoursGoo() {
".$wpdb->comments.",". $wpdb->posts." WHERE comment_approved = '1' AND comment_post_id = id ".$wpdb->comments.",". $wpdb->posts." WHERE comment_approved = '1' AND comment_post_id = id
GROUP BY guid ORDER BY count DESC LIMIT 0, 10"); GROUP BY guid ORDER BY count DESC LIMIT 0, 10");
print "<div class='statz'>Die Top10 aller kommentierter Posts</div>"; print "<div class='statz'>";
print semr_i18n("Top 10 of all commented posts")."</div>";
if (empty($topcommentedposts)) { if (empty($topcommentedposts)) {
print "<small>... noch keine Eintr&auml;ge</small>"; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
print "<table class='statzelement'>"; print "<table class='statzelement'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align: left; width: 80%;'>Post/Page</th>"; print "<th style='text-align: left; width: 80%;'>".semr_i18n("Post/Page")."</th>";
print "<th style='text-align: center; width: 20%;'>Kommentare</th>"; print "<th style='text-align: center; width: 20%;'>".semr_i18n("Comments")."</th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
foreach ($topcommentedposts as $key => $topcommentedpost) { foreach ($topcommentedposts as $key => $topcommentedpost) {
$posttitle = $topcommentedpost->post_title; $posttitle = $topcommentedpost->post_title;
$count = $topcommentedpost->count; $count = $topcommentedpost->count;
$postid = $topcommentedpost->guid; $postid = $topcommentedpost->guid;
print "<tr"; if(1&$key) print " class='alternate'"; print ">"; print "<tr"; if(1&$key) print " class='alternate'"; print ">";
print "<td style='text-align: left;'><a target='_blank' href='".$postid."'>&nbsp;".$posttitle."</a></td>"; print "<td style='text-align: left;'><a target='_blank' href='".$postid."'>&nbsp;".$posttitle."</a></td>";
print "<td style='text-align: center;'>".$count."</td>"; print "<td style='text-align: center;'>".$count."</td>";
print "</tr>"; print "</tr>";
} }
print "</tbody>"; print "</tbody>";
print "</table>"; print "</table>";
print "<hr />"; print "<hr />";
} }
function sem_showCommenters() { function sem_showCommenters() {
@ -533,43 +542,45 @@ function sem_draw24HoursGoo() {
comment_author_email AS email, comment_author_url AS homepage FROM " .$wpdb->comments . " WHERE comment_author_email AS email, comment_author_url AS homepage FROM " .$wpdb->comments . " WHERE
comment_approved = '1' GROUP BY comment_author ORDER BY count DESC LIMIT 0, ".$limit); comment_approved = '1' GROUP BY comment_author ORDER BY count DESC LIMIT 0, ".$limit);
print "<div class='statz'>Die Top".$limit." aller Kommentierer</div>"; print "<div class='statz'>";
printf(semr_i18n("Top %s of all commentators"), $limit);
print "</div>";
if (empty($topcommenters)) { if (empty($topcommenters)) {
print "<small>... noch keine Eintr&auml;ge</small>"; print '<small>... '. semr_i18n("no entries at all").'</small>';
print "<hr />"; print "<hr />";
return; return;
} }
print "<table class='statzelement'>"; print "<table class='statzelement'>";
print "<thead>"; print "<thead>";
print "<tr>"; print "<tr>";
print "<th style='text-align: left; width: 20%;'>User</th>"; print "<th style='text-align: left; width: 20%;'>".semr_i18n("User")."</th>";
print "<th style='text-align: left; width: 30%;'>Email</th>"; print "<th style='text-align: left; width: 30%;'>".semr_i18n("Email")."</th>";
print "<th style='text-align: left; width: 40%;'>Homepage</th>"; print "<th style='text-align: left; width: 40%;'>".semr_i18n("Homepage")."</th>";
print "<th style='text-align: center; width: 10%;'>Kommentare</th>"; print "<th style='text-align: center; width: 10%;'>".semr_i18n("Comments")."</th>";
print "</tr>"; print "</tr>";
print "</thead>"; print "</thead>";
print "<tbody>"; print "<tbody>";
foreach ($topcommenters as $key=>$topcommenter) { foreach ($topcommenters as $key=>$topcommenter) {
$commenter = $topcommenter->commenter; $commenter = $topcommenter->commenter;
$email = $topcommenter->email; $email = $topcommenter->email;
$homepage = $topcommenter->homepage; $homepage = $topcommenter->homepage;
if($homepage=="http://") $homepage=""; if($homepage=="http://") $homepage="";
$url=parse_url($homepage); $url=parse_url($homepage);
$homepage = $url['host']; $homepage = $url['host'];
$count = $topcommenter->count; $count = $topcommenter->count;
print "<tr"; if(1&$key) print " class='alternate'"; print ">"; print "<tr"; if(1&$key) print " class='alternate'"; print ">";
print "<td style='text-align: left;'>".$commenter."</td>"; print "<td style='text-align: left;'>".$commenter."</td>";
print "<td style='text-align: left;'><a href='mailto:".$email."'>".$email."</a></td>"; print "<td style='text-align: left;'><a href='mailto:".$email."'>".$email."</a></td>";
print "<td style='text-align: left;'><a target='_blank' href='http://".$homepage."'>".$homepage."</a></td>"; print "<td style='text-align: left;'><a target='_blank' href='http://".$homepage."'>".$homepage."</a></td>";
print "<td style='text-align: center;'>".$count."</td>"; print "<td style='text-align: center;'>".$count."</td>";
print "</tr>"; print "</tr>";
} }
print "</tbody>"; print "</tbody>";
print "</table>"; print "</table>";
print "<hr />"; print "<hr />";
} }
### AKTUELL Anzeige ### AKTUELL Anzeige
@ -577,7 +588,7 @@ function sem_draw24HoursGoo() {
print "<div class='wrap'>"; print "<div class='wrap'>";
print "<div><a name='top'></a></div>"; print "<div><a name='top'></a></div>";
print "<div id='icon-semmelstatzR' class='icon32'><br /></div>"; print "<div id='icon-semmelstatzR' class='icon32'><br /></div>";
print "<h2>SemmelstatzR &rsaquo; Aktuell</h2>"; print "<h2>SemmelstatzR &gt; ".semr_i18n("Current Statz")."</h2>";
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen $sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
if ($sem_options["statz_show_useronline"]) sem_showWhoIsOnline(); if ($sem_options["statz_show_useronline"]) sem_showWhoIsOnline();
sem_draw24HoursGoo(); sem_draw24HoursGoo();