delete: old readme files
update: start with localization and cleanup of code
Dieser Commit ist enthalten in:
Ursprung
7346c0ed11
Commit
a23cd6e222
3 geänderte Dateien mit 43 neuen und 59 gelöschten Zeilen
|
@ -1,10 +0,0 @@
|
|||
|
||||
UPDATE auf Version 3.3:
|
||||
|
||||
Es ist zwingend erforderlich, SEMMELSTATZ zu deaktivieren und den alten Ordner
|
||||
SEMMELSTATZ aus dem Plugin-Verzeichnis zu löschen. Ein simples Überschreiben der
|
||||
Plugin-Dateien funktioniert nicht, da sich die Namen der Dateien geändert haben.
|
||||
Außerdem werden diverse Änderungen an den STATZ-Tabellen vorgenommen, die aber nur
|
||||
bei Aktivierung des Plugins abgearbeitet werden.
|
||||
|
||||
Ich bitte um Beachtung...
|
|
@ -1,18 +0,0 @@
|
|||
******************************************************
|
||||
* *
|
||||
* SEMMELSTATZ *
|
||||
* Statistik-Plugin für Wordress >= 2.7.x *
|
||||
* *
|
||||
******************************************************
|
||||
|
||||
Plugin-URL: http://www.kopfhoch-studio.de/blog/2765
|
||||
Autor: Andreas Müller aka Redunzl Semmelmann
|
||||
Copyright (c) 2005-2009 Andreas Müller & kopfhoch-studio Waiblingen, Deutschland
|
||||
|
||||
Die komplette Dokumentation befindet sich im Blog:
|
||||
|
||||
*******************************************
|
||||
* *
|
||||
* http://www.kopfhoch-studio.de/blog/2765 *
|
||||
* *
|
||||
*******************************************
|
|
@ -41,21 +41,27 @@ Author URI: http://www.ortwinpinke.de
|
|||
*/
|
||||
|
||||
### konstante für version
|
||||
define('SEMMELSTATZ_VERSION', '3.3');
|
||||
define('SEMMELSTATZR_VERSION', '1.0.0 Beta');
|
||||
|
||||
### Deklaration der Tabellennamen
|
||||
global $wpdb;
|
||||
$wpdb->statz = $wpdb->prefix . 'statz';
|
||||
$wpdb->statzhist = $wpdb->prefix . 'statzhist';
|
||||
global $wpdb;
|
||||
$wpdb->statz = $wpdb->prefix . 'statz';
|
||||
$wpdb->statzhist = $wpdb->prefix . 'statzhist';
|
||||
|
||||
### Auslesen des Domainnamens
|
||||
global $homehost;
|
||||
if(substr($_SERVER['SERVER_NAME'],0,4) == 'www.') {
|
||||
$homehost = '%' . substr($_SERVER['SERVER_NAME'],4) . '%';
|
||||
}
|
||||
else {
|
||||
$homehost = '%' . $_SERVER['SERVER_NAME'] . '%';
|
||||
}
|
||||
global $homehost;
|
||||
if(substr($_SERVER['SERVER_NAME'],0,4) == 'www.') {
|
||||
$homehost = '%' . substr($_SERVER['SERVER_NAME'],4) . '%';
|
||||
} else {
|
||||
$homehost = '%' . $_SERVER['SERVER_NAME'] . '%';
|
||||
}
|
||||
|
||||
### localization
|
||||
if(!load_plugin_textdomain('semmelstatzR','/wp-content/languages/')) {
|
||||
$plugin_dir = basename(dirname(__FILE__));
|
||||
load_plugin_textdomain('semmelstatzR',null,$plugin_dir.'/locale/');
|
||||
}
|
||||
|
||||
|
||||
### Erstellen des Top-Level-Menus im Adminbereich
|
||||
add_action('admin_menu', 'semmelstatzR_menu');
|
||||
|
@ -197,9 +203,8 @@ add_action('init', 'sem_init_options');
|
|||
$readingnow = wp_title('', false);
|
||||
if(empty($readingnow)) {
|
||||
$page = 0;
|
||||
}
|
||||
else {
|
||||
$page = $wp_query->post->ID;
|
||||
} else {
|
||||
$page = $wp_query->post->ID;
|
||||
}
|
||||
|
||||
$wpdb->query("INSERT INTO $wpdb->statz (ip, time, referer, page, username)
|
||||
|
@ -218,33 +223,38 @@ add_action('init', 'sem_init_options');
|
|||
}
|
||||
|
||||
### CSS für den SEMMELSTATZ-Admin-Bereich
|
||||
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";
|
||||
}
|
||||
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()."
|
||||
<a title='mehr...' href='".get_option('siteurl')."/wp-admin/admin.php?page=semmelstatzR/semmelstatzR-statz.php'>»»</a></p>";
|
||||
}
|
||||
function sem_dashboardStatz() {
|
||||
echo '<p>';
|
||||
printf(_n("%d Visitor online", "%d Visitors online", sem_showNumUsersOnline(), "semmelstatzR"), sem_showNumUsersOnline());
|
||||
echo ' - ';
|
||||
printf(__("Today: %s", "semmelstatzR"),sem_showTodayStatz());
|
||||
echo ' <a title="'.__("more...", "semmelstatzR").'" href="'.get_option('siteurl').'/wp-admin/admin.php?page=semmelstatzR/semmelstatzR-statz.php">»»</a>';
|
||||
echo '</p>';
|
||||
}
|
||||
|
||||
### Widget für die Mini-STATZ
|
||||
add_action('wp_dashboard_setup', 'sem_dashboardStatz_setup');
|
||||
function sem_dashboardStatz_setup() {
|
||||
$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', 'SemmelstatzR', 'sem_dashboardStatz' );
|
||||
}
|
||||
add_action('wp_dashboard_setup', 'sem_dashboardStatz_setup');
|
||||
function sem_dashboardStatz_setup() {
|
||||
$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', 'SemmelstatzR', 'sem_dashboardStatz' );
|
||||
}
|
||||
|
||||
### Mini-Statz für Dashboard-Widget & AKTUELL-Anzeige
|
||||
function sem_showTodayStatz() {
|
||||
global $wpdb;
|
||||
$thedays = $wpdb->get_results("SELECT COUNT(ip) AS hits, COUNT(DISTINCT ip) AS visitors, COUNT(DISTINCT referer)
|
||||
AS referers, substring(time,1,10) AS date FROM ".$wpdb->statz." WHERE time >= CURDATE() GROUP BY date");
|
||||
$thedays = array(array('hits' => 33));
|
||||
if (empty($thedays)) {
|
||||
return "<small>... noch keine Einträge</small>";
|
||||
return "<small>".__("... no entries", "semmelstatzR")."</small>";
|
||||
}
|
||||
foreach($thedays as $key=>$theday) {
|
||||
$date = mysql2date("l",$theday->date);
|
||||
|
@ -252,7 +262,9 @@ add_action('init', 'sem_init_options');
|
|||
$visitors = $theday->visitors;
|
||||
$referers = $theday->referers;
|
||||
}
|
||||
return $visitors." Besucher - ".$hits." Hits - ".$referers." Referer";
|
||||
return sprintf(_n("%d Visitor","%d Visitors",$visitors, "semmelstatzR"),$visitors)." - "
|
||||
.sprintf(_n("%d Hit","%d Hits",$hits, "semmelstatzR"),$hits)." - "
|
||||
.sprintf(_n("%d Referrer","%d Referrers",$referer, "semmelstatzR"),$referers);
|
||||
}
|
||||
|
||||
### Encodierung der IP-Adresse durch simple arithmetische Operation
|
||||
|
|
Laden …
In neuem Issue referenzieren