1
0
Fork 0

update: renaming and new file comment header

Dieser Commit ist enthalten in:
oldperl 2011-05-02 10:30:11 +00:00
Ursprung a4c6329e41
Commit 7346c0ed11
8 geänderte Dateien mit 206 neuen und 137 gelöschten Zeilen

Datei anzeigen

@ -1,11 +1,19 @@
<?php
/***********************************************
* *
* semmelstatz_database.php v3.3 *
* Copyright: © 2005-2009 kopfhoch-studio *
* *
***********************************************/
/**
* file semmelstatzR_database.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$
*/
if(!current_user_can('manage_statz')) {
die('Zugriff verweigert');
@ -17,8 +25,8 @@ if(!current_user_can('manage_statz')) {
print "<div class='wrap'>";
print "<div><a name='top'></a></div>";
print "<div id='icon-semmelstatz' class='icon32'><br /></div>";
print "<h2>Semmelstatz &rsaquo; Datenbank</h2>";
print "<div id='icon-semmelstatzR' class='icon32'><br /></div>";
print "<h2>SemmelstatzR &rsaquo; Datenbank</h2>";
print "<div class='statz'>Datenbank</div>";
print "<table class='statzelement'>";

Datei anzeigen

@ -1,11 +1,19 @@
<?php
/***********************************************
* *
* semmelstatz_history.php v3.3 *
* Copyright: Š 2005-2009 kopfhoch-studio *
* *
***********************************************/
/**
* file semmelstatzR_history.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$
*/
if(!current_user_can('manage_statz')) {
die('Zugriff verweigert');
@ -175,8 +183,8 @@
### ANZEIGE HISTORY
print "<div class='wrap'>";
print "<div id='icon-semmelstatz' class='icon32'><br /></div>";
print "<h2>Semmelstatz &rsaquo; Historie</h2>";
print "<div id='icon-semmelstatzR' class='icon32'><br /></div>";
print "<h2>SemmelstatzR &rsaquo; Historie</h2>";
sem_drawLast30DaysGoo();
sem_drawAllMonthGoo();

Datei anzeigen

@ -1,12 +1,20 @@
<?php
/**
* 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$
*/
/***********************************************
* *
* semmelstatz_log.php v3.3 *
* Copyright: © 2005-2009 kopfhoch-studio *
* *
***********************************************/
if(!current_user_can('manage_statz')) {
die('Zugriff verweigert');
}
@ -15,14 +23,14 @@ if(!current_user_can('manage_statz')) {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$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);
print "<div class='wrap'>";
print "<div id='icon-semmelstatz' class='icon32'><br /></div>";
print "<h2>Semmelstatz &rsaquo; Log</h2>";
print "<div id='icon-semmelstatzR' class='icon32'><br /></div>";
print "<h2>SemmelstatzR &rsaquo; Log</h2>";
print "<div class='statz'>Die neuesten ".$limit." Datens&auml;tze</div>";
if ($completerecords == NULL) {
@ -77,11 +85,11 @@ if(!current_user_can('manage_statz')) {
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."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/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."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/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."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/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>";
if ($referer == "--") {
print "--</small></td>";

Datei anzeigen

@ -1,11 +1,19 @@
<?php
/*******************************************
* *
* semmelstatz_options.php v3.3 *
* Copyright: © 2005-2009 kopfhoch-studio *
* *
*******************************************/
/**
* file semmelstatzR_options.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$
*/
if(!current_user_can('manage_statz')) {
die('Zugriff verweigert');
@ -34,7 +42,7 @@ 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'];
update_option("semmelstatz_options", $sem_options);
update_option("semmelstatzR_options", $sem_options);
echo '<div class="updated fade"><p>Einstellungen gespeichert</strong></p></div>';
}
@ -49,7 +57,7 @@ if(!current_user_can('manage_statz')) {
$sem_options["statz_recdays_limit"] = $_POST["statz_recdays_limit"];
if($sem_options["statz_recdays_limit"] < 1 || (!is_numeric($sem_options["statz_recdays_limit"]))) $sem_options["statz_recdays_limit"] = 1;
update_option("semmelstatz_options", $sem_options);
update_option("semmelstatzR_options", $sem_options);
echo "<div class='updated fade'><p>Der Wert f&uuml;r das Limit wurde erfolgreich gespeichert.</p></div>";
}
@ -74,7 +82,7 @@ if(!current_user_can('manage_statz')) {
$sem_options['statz_do_cron'] = true;
$sem_options['statz_next_cron'] = time() + 86400;
}
update_option("semmelstatz_options", $sem_options);
update_option("semmelstatzR_options", $sem_options);
}
?>
@ -83,8 +91,8 @@ if(!current_user_can('manage_statz')) {
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=<?php echo plugin_basename(__FILE__); ?>">
<div id='icon-semmelstatz' class='icon32'><br /></div>
<h2>Semmelstatz &rsaquo; Einstellungen</h2>
<div id='icon-semmelstatzR' class='icon32'><br /></div>
<h2>SemmelstatzR &rsaquo; Einstellungen</h2>
<p><input type="submit" class="button-secondary" name="options_save" value="&Auml;nderungen &uuml;bernehmen" /></p>
@ -239,7 +247,7 @@ if(!current_user_can('manage_statz')) {
</tr>
<tr valign="middle">
<th>Anzahl Datens&auml;tze im <a href='admin.php?page=semmelstatz/semmelstatz-log.php'>Log</a></th>
<th>Anzahl Datens&auml;tze im <a href='admin.php?page=semmelstatzR/semmelstatzR-log.php'>Log</a></th>
<td><input name="statz_datarecs_limit" type="text" id="statz_datarecs_limit"
value="<?php echo $sem_options["statz_datarecs_limit"]; ?>" style="text-align:center;" size="3" maxlength="4" />
</td>
@ -258,8 +266,8 @@ if(!current_user_can('manage_statz')) {
</form>
<div id='icon-semmelstatz' class='icon32'><br /></div>
<h2>Semmelstatz &rsaquo; Statz-Tabellen</h2>
<div id='icon-semmelstatzR' class='icon32'><br /></div>
<h2>SemmelstatzR &rsaquo; Statz-Tabellen</h2>
<table class="form-table">

Datei anzeigen

@ -1,11 +1,19 @@
<?php
/***********************************************
* *
* semmelstatz_statz.php v3.3 *
* Copyright: © 2005-2009 kopfhoch-studio *
* *
***********************************************/
/**
* file semmelstatzR_statz.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$
*/
if(!current_user_can('manage_statz')) {
die('Zugriff verweigert');
@ -16,7 +24,7 @@ if(!current_user_can('manage_statz')) {
function sem_showWhoIsOnline() {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$onlinetime = $sem_options["statz_online_time"];
$onlineusers = $wpdb->get_results("SELECT DISTINCT username, page, ip, time
@ -60,11 +68,11 @@ if(!current_user_can('manage_statz')) {
print "<td style='text-align:left;'><a target='_blank' href=".$link.">".$title."</td>";
print "<td style='white-space:nowrap;text-align:left;'>
<a target='_blank' style='border:none;' href='http://ws.arin.net/whois/?queryinput=".$ip."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/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."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/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."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/img/utrace.png' /></a></td>";
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/utrace.png' /></a></td>";
print "<td style='text-align:center;'>$time</td>";
print "</tr>";
}
@ -123,7 +131,7 @@ if(!current_user_can('manage_statz')) {
function sem_showDailyStatz() {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$limit = $sem_options["statz_days_limit"];
$daylimit = $limit - 1;
@ -175,7 +183,7 @@ if(!current_user_can('manage_statz')) {
print "</tr>";
}
print "<tr>";
print "<td style='text-align:left;'><a href='".get_option('siteurl')."/wp-admin/admin.php?page=semmelstatz/semmelstatz-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'>mehr...</a></td>";
print "</tr>";
print "</tbody>";
print "</table>";
@ -185,7 +193,7 @@ if(!current_user_can('manage_statz')) {
function sem_showReferers() {
global $wpdb, $homehost;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$limit = $sem_options["statz_referer_limit"];
$mask = $sem_options["statz_mask_referer"];
@ -234,7 +242,7 @@ if(!current_user_can('manage_statz')) {
function sem_showKeyword() {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$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");
@ -267,11 +275,11 @@ if(!current_user_can('manage_statz')) {
print "<td style='text-align: left;'><a target='_blank' href='".str_replace(' ','+',htmlspecialchars($referer, ENT_QUOTES))."'>".$keyword."</a></td>";
print "<td style='text-align: left;vertical-align:bottom;'>
<a target='_blank' href='http://ws.arin.net/whois/?queryinput=".$ip."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/img/arin.png' /></a>&nbsp;
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/arin.png' /></a>&nbsp;
<a target='_blank' href='http://www.ripe.net/whois?searchtext=".$ip."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/img/ripe.png' /></a>&nbsp;
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/ripe.png' /></a>&nbsp;
<a target='_blank' href='http://www.utrace.de/?query=".$ip."'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/img/utrace.png' /></a></td>";
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/utrace.png' /></a></td>";
print "</tr>";
$i++;
@ -324,7 +332,7 @@ if(!current_user_can('manage_statz')) {
function sem_showTopReads() {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$limit = $sem_options["statz_topreads_limit"];
$topreads = $wpdb->get_results("SELECT post_title AS posttitle, post_name as postname, guid AS postid,
@ -432,7 +440,7 @@ if(!current_user_can('manage_statz')) {
function sem_showCommenters() {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
$limit = $sem_options["statz_comment_limit"];
$topcommenters = $wpdb->get_results("SELECT comment_author AS commenter, COUNT(comment_ID) AS count,
@ -482,9 +490,9 @@ if(!current_user_can('manage_statz')) {
print "<div class='wrap'>";
print "<div><a name='top'></a></div>";
print "<div id='icon-semmelstatz' class='icon32'><br /></div>";
print "<h2>Semmelstatz &rsaquo; Aktuell</h2>";
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
print "<div id='icon-semmelstatzR' class='icon32'><br /></div>";
print "<h2>SemmelstatzR &rsaquo; Aktuell</h2>";
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
if ($sem_options["statz_show_useronline"]) sem_showWhoIsOnline();
sem_draw24HoursGoo();
if ($sem_options["statz_show_todayusers"]) sem_showWhoWasOnlineToday();

Datei anzeigen

@ -1,11 +1,19 @@
<?php
/***********************************************
* *
* semmelstatz_templates.php v3.3 *
* Copyright: © 2005-2009 kopfhoch-studio *
* *
***********************************************/
/**
* file semmelstatzR_templates.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$
*/
if(!current_user_can('manage_statz')) {
die('Zugriff verweigert');
@ -33,7 +41,7 @@ if(!current_user_can('manage_statz')) {
print "<form>";
print "<div class='wrap'>";
print "<div id='icon-template' class='icon32'><br /></div>";
print "<h2>Semmelstatz &rsaquo; Template-Funktionen</h2>";
print "<h2>SemmelstatzR &rsaquo; Template-Funktionen</h2>";
print "<br />";
print "<table class='statzelement'>";
print "<thead>";

Datei anzeigen

@ -1,12 +1,18 @@
/**********************************************
* *
* semmelstatz.css v3.3 *
* Copyright: © 2005-2009 kopfhoch-studio *
* Kontakt: http://www.kopfhoch-studio.de/ *
* *
***********************************************/
/**
* file semmelstatzR.css
*
* @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$
*/
p.statz, div.statz {
/* font-family: tahoma,verdana,arial,helvetica; */
@ -112,7 +118,7 @@ table.chartelement {
background: #eee;
}
#icon-semmelstatz {
#icon-semmelstatzR {
background: transparent url(img/icon_observe.png);
}

Datei anzeigen

@ -1,28 +1,43 @@
<?php
/*
Plugin Name: Semmelstatz
Plugin URI: http://www.kopfhoch-studio.de/blog/2765
Description: Besucherstatistik fuer den Wordpress-Admin
Version: 3.3
Author: Andreas 'Redunzl' Mueller
Author URI: http://www.kopfhoch-studio.de/blog/kontakt
Plugin Name: SemmelstatzR
Plugin URI: http://sourceforge.net/projects/semmelstatzR/
Description: Visitorstatistic for Wordpress, based upon the original wp-plugin semmelstatzR by Andreas 'Redunzl' Mueller (http://www.kopfhoch-studio.de)
Version: 1.0.0 beta
Author: Ortwin Pinke
Author URI: http://www.ortwinpinke.de
*/
/*
Copyright (c) 2005-2009 Andreas 'Redunzl' Mueller (redunzl@gmx.de)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License (version 2) as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
/**
* file semmelstatzR.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$
*
* Copyright (c) 2005-2009 Andreas 'Redunzl' Mueller (redunzl@gmx.de)
* Copyright (c) 2011- Ortwin Pinke (info@php-backoffice.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2) as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
### konstante für version
@ -43,22 +58,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
}
### Erstellen des Top-Level-Menus im Adminbereich
add_action('admin_menu', 'semmelstatz_menu');
function semmelstatz_menu() {
add_action('admin_menu', 'semmelstatzR_menu');
function semmelstatzR_menu() {
if (function_exists('add_menu_page')) {
add_menu_page('Semmelstatz','Semmelstatz', 'manage_statz', 'semmelstatz/semmelstatz-statz.php', '', plugins_url('semmelstatz/img/statz_small.png'));
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('semmelstatz/semmelstatz-statz.php', 'Aktuell', 'Aktuell', 'manage_statz', 'semmelstatz/semmelstatz-statz.php');
add_submenu_page('semmelstatz/semmelstatz-statz.php', 'Historie', 'Historie', 'manage_statz', 'semmelstatz/semmelstatz-history.php');
add_submenu_page('semmelstatz/semmelstatz-statz.php', 'Log', 'Log', 'manage_statz', 'semmelstatz/semmelstatz-log.php');
add_submenu_page('semmelstatz/semmelstatz-statz.php', 'Datenbank', 'Datenbank', 'manage_statz', 'semmelstatz/semmelstatz-database.php');
add_submenu_page('semmelstatz/semmelstatz-statz.php', 'Templates', 'Templates', 'manage_statz', 'semmelstatz/semmelstatz-templates.php');
add_submenu_page('semmelstatz/semmelstatz-statz.php', 'Einstellungen', 'Einstellungen', 'manage_statz', 'semmelstatz/semmelstatz-options.php');
add_submenu_page('semmelstatzR/semmelstatzR-statz.php', 'Aktuell', 'Aktuell', 'manage_statz', 'semmelstatzR/semmelstatzR-statz.php');
add_submenu_page('semmelstatzR/semmelstatzR-statz.php', 'Historie', 'Historie', 'manage_statz', 'semmelstatzR/semmelstatzR-history.php');
add_submenu_page('semmelstatzR/semmelstatzR-statz.php', 'Log', 'Log', 'manage_statz', 'semmelstatzR/semmelstatzR-log.php');
add_submenu_page('semmelstatzR/semmelstatzR-statz.php', 'Datenbank', 'Datenbank', 'manage_statz', 'semmelstatzR/semmelstatzR-database.php');
add_submenu_page('semmelstatzR/semmelstatzR-statz.php', 'Templates', 'Templates', 'manage_statz', 'semmelstatzR/semmelstatzR-templates.php');
add_submenu_page('semmelstatzR/semmelstatzR-statz.php', 'Einstellungen', 'Einstellungen', 'manage_statz', 'semmelstatzR/semmelstatzR-options.php');
}
}
### Default-Werte der statz-Optionen in das Array 'semmelstatz_options' schreiben
### Default-Werte der statz-Optionen in das Array 'semmelstatzR_options' schreiben
add_action('init', 'sem_init_options');
function sem_init_options() {
global $wpdb;
@ -67,7 +82,7 @@ add_action('init', 'sem_init_options');
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'statz%';"); // Löschen der alten Optionen
}
if(!get_option('semmelstatz_options')) {
if(!get_option('semmelstatzR_options')) {
$sem_options = array(
"statz_comment_limit" => 10,
"statz_datarecs_limit" => 100,
@ -93,12 +108,12 @@ add_action('init', 'sem_init_options');
"statz_write_admins" => false,
"statz_write_users" => false
);
add_option( 'semmelstatz_options', $sem_options );
add_option( 'semmelstatzR_options', $sem_options );
}
}
### Anlegen der Tabellen, Optionen schreiben
add_action('activate_semmelstatz/semmelstatz.php', 'sem_statzsetup');
add_action('activate_semmelstatzR/semmelstatzR.php', 'sem_statzsetup');
function sem_statzsetup() {
global $wpdb;
if(@is_file(ABSPATH.'/wp-admin/upgrade-functions.php')) {
@ -152,7 +167,7 @@ add_action('init', 'sem_init_options');
add_action('wp_head', 'sem_writeStatz');
function sem_writeStatz() {
global $wpdb, $wp_query, $isBot, $isAdmin, $page;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
sem_writeYesterdayToHist();
$useragent = $wpdb->escape($_SERVER['HTTP_USER_AGENT']);
@ -197,30 +212,30 @@ add_action('init', 'sem_init_options');
### Zeitgesteuertes Limitieren der statz-Tabelle
// Wenn semmelKron JA UND statz_next_cron älter JETZT, dann...
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$sem_options = get_option('semmelstatzR_options'); ### optionsarray auslesen
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', 'semmelstatz_css');
function semmelstatz_css() {
print "<link rel='stylesheet' href='".get_option('siteurl')."/wp-content/plugins/semmelstatz/semmelstatz.css' type='text/css' media='screen' />\n";
add_action('admin_head', 'semmelstatzR_css');
function semmelstatzR_css() {
print "<link rel='stylesheet' href='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/semmelstatzR.css' type='text/css' media='screen' />\n";
}
### Rendert eine Mini-STATZ. Idee: René Tauchnitz
function sem_dashboardStatz() {
print "<p>".sem_showNumUsersOnline() . " Besucher online - Heute: ".sem_showTodayStatz()."&nbsp;
<a title='mehr...' href='".get_option('siteurl')."/wp-admin/admin.php?page=semmelstatz/semmelstatz-statz.php'>&raquo;&raquo;</a></p>";
<a title='mehr...' href='".get_option('siteurl')."/wp-admin/admin.php?page=semmelstatzR/semmelstatzR-statz.php'>&raquo;&raquo;</a></p>";
}
### Widget für die Mini-STATZ
add_action('wp_dashboard_setup', 'sem_dashboardStatz_setup');
function sem_dashboardStatz_setup() {
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$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', 'Semmelstatz', 'sem_dashboardStatz' );
wp_add_dashboard_widget( 'sem_dashboardStatz', 'SemmelstatzR', 'sem_dashboardStatz' );
}
### Mini-Statz für Dashboard-Widget & AKTUELL-Anzeige
@ -579,18 +594,18 @@ add_action('init', 'sem_init_options');
### 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('semmelstatz_options'); ### optionsarray auslesen
$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("semmelstatz_options", $sem_options);
update_option("semmelstatzR_options", $sem_options);
}
}
### Zeigt Copyright-Notiz an
function sem_showCopyright() {
print "<p class='copyright'>semmelstatz ". SEMMELSTATZ_VERSION . " ist (c) kopfhoch-studio 2005-2009<br />
print "<p class='copyright'>semmelstatzR ". SEMMELSTATZ_VERSION . " ist (c) kopfhoch-studio 2005-2009<br />
<a target='_blank' style='border:none;' href='http://www.kopfhoch-studio.de/blog/2765'>
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatz/img/statz.png' /></a></p>";
<img src='".get_option('siteurl')."/wp-content/plugins/semmelstatzR/img/statz.png' /></a></p>";
}
### statz-Tabelle leeren (NICHT LÖSCHEN!!!)
@ -628,7 +643,7 @@ add_action('init', 'sem_init_options');
### Datensätze älter als statz_recdays_limit-Tage löschen
function sem_delOutOfLimit() {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$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";
@ -639,10 +654,10 @@ add_action('init', 'sem_init_options');
### Wenn AUTOMATISCHES LIMIT aktiviert, dann LIMITIERE und erhöhe NEXT_CRON
function sem_doCronStatzLimit() {
sem_delOutOfLimit();
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$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("semmelstatz_options", $sem_options);
update_option("semmelstatzR_options", $sem_options);
}
### Konvertiert Strings von utf-8 in ISO-8859
@ -950,7 +965,7 @@ add_action('init', 'sem_init_options');
### Anzahl der Online-Besucher - Verweildauer in den Einstellungen
function sem_showNumUsersOnline() {
global $wpdb;
$sem_options = get_option('semmelstatz_options'); ### optionsarray auslesen
$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