From 4e8dfa09aa9032aa6a77e3fb8ad458b8103f9d38 Mon Sep 17 00:00:00 2001 From: Oldperl <44996956+oldperl@users.noreply.github.com> Date: Sat, 17 Dec 2011 23:28:39 +0000 Subject: [PATCH] i18n standard entries --- semmelstatzR-history.php | 4 +- semmelstatzR-templates.php | 276 ++++++++++--------------------------- 2 files changed, 76 insertions(+), 204 deletions(-) diff --git a/semmelstatzR-history.php b/semmelstatzR-history.php index cc4f2a4..3c14c7c 100644 --- a/semmelstatzR-history.php +++ b/semmelstatzR-history.php @@ -45,8 +45,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - if(!current_user_can('manage_statz')) { - die('Zugriff verweigert'); +if(!current_user_can('manage_statz')) { + die(semr_i18n("Restricted Area")); } include_once plugin_dir_path(__FILE__).'includes/pChart/class/pData.class.php'; diff --git a/semmelstatzR-templates.php b/semmelstatzR-templates.php index 5361a3a..19c01ba 100644 --- a/semmelstatzR-templates.php +++ b/semmelstatzR-templates.php @@ -46,210 +46,82 @@ */ if(!current_user_can('manage_statz')) { - die('Zugriff verweigert'); + die(semr_i18n("Restricted Area")); } -### TEMPLATES +// entry format: functionname, needed param, type of return, remarks, manual example (no function call) +$aTemplates = array( + array("sem_showTotalPosts", "", semr_i18n("Integer"), semr_i18n("Number of all Posts"), ""), + array("sem_showTotalComments", "", semr_i18n("Integer"), semr_i18n("Number of all Comments"), ""), + array("sem_showTotalUsers", "", semr_i18n("Integer"), semr_i18n("Total Number of all visitors since statistics started"), ""), + array("sem_showAverageUserPerDay", "", semr_i18n("Decimal"), semr_i18n("Average of daily visitors"), ""), + array("sem_showFirstPostDate", "", semr_i18n("Date (d.m.y)"), semr_i18n("Date of the first post"), ""), + array("sem_showPostDays", "", semr_i18n("Integer"), semr_i18n("Days since first post"), ""), + array("sem_showFirstCommentDate", "", semr_i18n("Date (d.m.y)"), semr_i18n("Date of the first comment"), ""), + array("sem_showCommentDays", "", semr_i18n("Integer"), semr_i18n("Days since first comment"), ""), + array("sem_showPostsPerDay", "", semr_i18n("Decimal"), semr_i18n("Average of posts per day"), ""), + array("sem_showCommentsPerDay", "", semr_i18n("Decimal"), semr_i18n("Average of comments per day"), ""), + array("sem_showNumCommenters", "", semr_i18n("Integer"), semr_i18n("Total of all commentators"), ""), + array("sem_showStatzStartDate", "", semr_i18n("Date (d.m.y)"), semr_i18n("Date of commencement of statistics"), ""), + array("sem_showStatzDays", "", semr_i18n("Integer"), semr_i18n("Period of the statistics in days"), ""), + array("sem_showNumUsersOnline", "", semr_i18n("Integer"), semr_i18n("Number of users online"), ""), + array("sem_showLastComments", "10", semr_i18n("Formatted list"), semr_i18n("The 'n' newest comments with author, post, sorted by date desc
CSS-ID: #lastcomments"), "n/a"), + array("sem_showLastPosts", "10", semr_i18n("Formatted list"), semr_i18n("The 'n' newest posts with title, sorted bei date desc
CSS_ID: #lastposts"), "n/a"), + array("sem_showMostReads", "10", semr_i18n("Formatted list"), semr_i18n("'n' most readed posts/pages with hits in brackets
CSS-ID: #mostreads"), "n/a"), + array("sem_showPostHitsInLoop", "get_the_ID()", semr_i18n("Integer"), semr_i18n("Shows count of hits of a post. Only works in the LOOP"), "only in LOOP") +); - $totalposts = sem_showTotalPosts(); - $totalcomments = sem_showTotalComments(); - $totalusers = sem_showTotalUsers(); - $averageuserperday = sem_showAverageUserPerDay(); - $firstpostdate = sem_showFirstPostDate(); - $postdays = sem_showPostDays(); - $firstcommentdate = sem_showFirstCommentDate(); - $commentdays = sem_showCommentDays(); - $postsperday = sem_showPostsPerDay(); - $commentsperday = sem_showCommentsPerDay(); - $numcommenters = sem_showNumCommenters(); - $statzstartdate = sem_showStatzStartDate(); - $statzdays = sem_showStatzDays(); - $numusersonline = sem_showNumUsersOnline(); +print "
"; +print "
"; +print "

"; +print "

SemmelstatzR > ".semr_i18n("Template-Functions")."

"; +print "
"; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; - ### DIE ANZEIGE - - print ""; - print "
"; - print "

"; - print "

SemmelstatzR › Template-Funktionen

"; - print "
"; - print "
".semr_i18n("Function")."".semr_i18n("Syntax")."".semr_i18n("Returns")."".semr_i18n("Example")."".semr_i18n("Remarks")."
"; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - - print ""; - print "
FunktionSyntaxRückgabewertHierBemerkung
sem_showTotalPostsGanzzahl$totalpostsAnzahl aller Beiträge
sem_showTotalCommentsGanzzahl$totalcommentsAnzahl aller Kommentare
sem_showTotalUsersGanzzahl$totalusersGesamtzahl aller Besucher seit Statistikaufzeichnung
sem_showAverageUserPerDayDezimal$averageuserperdayDurchschnittliche Anzahl der täglichen Besucher
sem_showFirstPostDateDatum (d.m.y)$firstpostdateDatum des 1. Posts
sem_showPostDaysGanzzahl$postdaysZeitraum in Tagen seit 1. Beitrag
em_showFirstCommentDateDatum (d.m.y)$firstcommentdateDatum des 1. Kommentars
sem_showCommentDaysGanzzahl$commentdaysZeitraum in Tagen seit 1. Kommentar
sem_showPostsPerDayDezimal$postsperdayDurchschnittliche Anzahl der Beiträge pro Tag
sem_showCommentsPerDayDezimal$commentsperdayDurchschnittliche Anzahl der Kommentare pro Tag
sem_showNumCommentersGanzzahl$numcommentersGesamtzahl aller Kommentierer
sem_showStatzStartDateDatum (d.m.y)$statzstartdateBeginn der Statistik
sem_showStatzDaysGanzzahl$statzdaysZeitraum der Statistik in Tagen
sem_showNumUsersOnlineGanzzahl$numusersonlineUser Online
sem_showLastCommentsFormatierte Listen/aDie neusten 'n' Kommentare mit Autor, Post, abwärts sortiert nach Datum
CSS-ID: #lastcomments
sem_showLastPostsFormatierte Listen/aDie neusten 'n' Posts mit Titel, abwärts sortiert nach Datum
CSS-ID: #lastposts
sem_showMostReadsFormatierte Listen/aDie 'n' meist gelesenen Post/Pages mit Hits in Klammern
CSS-ID: #mostreads
sem_showPostHitsInLoopGanzzahlNur im LoopZeigt die Anzahl der Hits eines Posts an. Funktioniert nur im LOOP.
"; - print "Sämtliche Funktionen (bis auf die letzte) sind außerhalb des LOOPS zu verwenden. Wird - SEMMELSTATZ deaktiviert, und die Verfügbarkeit der Templatefunktion ist nicht mittels - if (function_exists... sichergestellt, wird die Indexseite des Blogs fehlerhaft bzw. - überhaupt nicht dargestellt."; - print "
"; - print "
"; - print "
"; - - if (function_exists('sem_showCopyright')) sem_showCopyright(); - - print "
"; - - print "
"; - +// loop the functions array +foreach ($aTemplates as $value) { + if(empty($value[4])) { + $funcret = call_user_func($value[0]); + } else { + $funcret = $value[4]; + } + print ""; + print "$value[0]"; + print ""; + print "$value[2]"; + print "$funcret"; + print "$value[3]"; + print ""; +} +print ""; +print ""; +print semr_i18n("All functions (except the last one) you have to use outside the LOOP. + Display of blog index page will be incorrect if semmelstatzR is deactivated and + if you do not check for the existence of the templatefunctions + using if (function_exists..."); +/* +print "Sämtliche Funktionen (bis auf die letzte) sind außerhalb des LOOPS zu verwenden. Wird +SEMMELSTATZ deaktiviert, und die Verfügbarkeit der Templatefunktion ist nicht mittels +if (function_exists... sichergestellt, wird die Indexseite des Blogs fehlerhaft bzw. +überhaupt nicht dargestellt."; + * + */ +print ""; +print ""; +print ""; +print ""; +print "
"; +if (function_exists('sem_showCopyright')) sem_showCopyright(); +print ""; +print ""; ?> \ No newline at end of file