Dieser Commit ist enthalten in:
Ursprung
808ff10984
Commit
0a403d6417
4 geänderte Dateien mit 220 neuen und 110 gelöschten Zeilen
72
trunk/includes/class.semmelstatzR.php
Normale Datei
72
trunk/includes/class.semmelstatzR.php
Normale Datei
|
@ -0,0 +1,72 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* File: class.semmelstatzR.php
|
||||||
|
*
|
||||||
|
* @package SemmelstatzR
|
||||||
|
* @version $Rev$
|
||||||
|
* @since 2011/11/07 v 1.0.0 Beta
|
||||||
|
* @author SEM-Team
|
||||||
|
* @copyright (c)2011 SEM-Team
|
||||||
|
* @link http://sourceforge.net/projects/semmelstatz/
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class semmelstatzR {
|
||||||
|
|
||||||
|
protected $_oDb;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @global type $wpdb
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
$this->_initDb();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public */
|
||||||
|
|
||||||
|
|
||||||
|
/* protected */
|
||||||
|
|
||||||
|
|
||||||
|
/* private */
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @global wpdb $wpdb
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private function _initDb() {
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
if($this->_oDb instanceof $wpdb) {
|
||||||
|
return true;
|
||||||
|
} else if($wpdb instanceof wpdb) {
|
||||||
|
$this->_oDb = $wpdb;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
|
@ -8,16 +8,17 @@
|
||||||
* @author Andreas 'Redunzl' Mueller
|
* @author Andreas 'Redunzl' Mueller
|
||||||
* @copyright (c)2011 PHP-Backoffice
|
* @copyright (c)2011 PHP-Backoffice
|
||||||
* @copyright (c)2005-2009 kopfhoch-studio
|
* @copyright (c)2005-2009 kopfhoch-studio
|
||||||
* @link http://www.php-backoffice.de/projects/semmelstatzR
|
|
||||||
* @link http://sourceforge.net/projects/semmelstatz/
|
* @link http://sourceforge.net/projects/semmelstatz/
|
||||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!current_user_can('manage_statz')) {
|
define('SEMMELSTATZR_VERSION', '1.0.0 Beta');
|
||||||
die('Zugriff verweigert');
|
define('SEMMELSTATZR_SRVPATH', dirname(__FILE__));
|
||||||
}
|
define('SEMMELSTATZR_HTML_RELPATH', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)));
|
||||||
|
|
||||||
|
if(current_user_can('manage_statz')) {
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
$pre = $wpdb->prefix; $lenpre = strlen($pre);
|
$pre = $wpdb->prefix; $lenpre = strlen($pre);
|
||||||
|
@ -87,4 +88,8 @@ if(!current_user_can('manage_statz')) {
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
echo '<p>No permission to access this area</p>';
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -1,31 +1,47 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
Plugin Name: SemmelstatzR
|
Plugin Name: semmelstatzR
|
||||||
Plugin URI: http://sourceforge.net/projects/semmelstatz/
|
Plugin URI: http://sourceforge.net/projects/semmelstatz/
|
||||||
Description: Visitorstatistic for Wordpress, based upon the original wp-plugin semmelstatz by Andreas 'Redunzl' Mueller (http://www.kopfhoch-studio.de)
|
Description: Visitorstatistic for Wordpress, based upon the original wp-plugin semmelstatz by Andreas 'Redunzl' Mueller (http://www.kopfhoch-studio.de)
|
||||||
Version: 1.0.0 beta
|
Version: 1.0.0 Beta
|
||||||
Author: Ortwin Pinke
|
Author: SEM-Team
|
||||||
Author URI: http://www.ortwinpinke.de
|
Author URI: http://semmelstatz.sf.net
|
||||||
|
License: GPLv3
|
||||||
|
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* file semmelstatzR.php
|
* file semmelstatzR.php
|
||||||
*
|
*
|
||||||
* @package SemmelstatzR
|
* @package SemmelstatzR
|
||||||
* @version $Rev$
|
* @version $Rev$
|
||||||
* @author Ortwin Pinke <info@php-backoffice.de>
|
* @author Ortwin Pinke <me@ortwinpinke.de>
|
||||||
* @author Andreas 'Redunzl' Mueller
|
* @author Andreas 'Redunzl' Mueller
|
||||||
* @copyright (c)2011 PHP-Backoffice
|
* @copyright (c)2011 SEM-Team
|
||||||
* @copyright (c)2005-2009 kopfhoch-studio
|
* @copyright (c)2005-2009 kopfhoch-studio
|
||||||
* @link http://www.php-backoffice.de/projects/semmelstatzR
|
|
||||||
* @link http://sourceforge.net/projects/semmelstatz/
|
* @link http://sourceforge.net/projects/semmelstatz/
|
||||||
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* based upon semmelstatz
|
||||||
* Copyright (c) 2005-2009 Andreas 'Redunzl' Mueller (redunzl@gmx.de)
|
* Copyright (c) 2005-2009 Andreas 'Redunzl' Mueller (redunzl@gmx.de)
|
||||||
* Copyright (c) 2011- Ortwin Pinke (info@php-backoffice.de)
|
|
||||||
*
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License (version 2) as
|
||||||
* published by the Free Software Foundation.
|
* published by the Free Software Foundation.
|
||||||
|
@ -40,32 +56,7 @@ Author URI: http://www.ortwinpinke.de
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
### constants
|
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'semmelstatzR_startup.php';
|
||||||
define('SEMMELSTATZR_VERSION', '1.0.0 Beta');
|
|
||||||
define('SEMMELSTATZR_SRVPATH', dirname(__FILE__));
|
|
||||||
define('SEMMELSTATZR_HTML_RELPATH', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)));
|
|
||||||
|
|
||||||
### Deklaration der Tabellennamen
|
|
||||||
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'] . '%';
|
|
||||||
}
|
|
||||||
|
|
||||||
### localization
|
|
||||||
//if(!load_plugin_textdomain('semmelstatzR','/wp-content/languages/')) {
|
|
||||||
$plugin_dir = basename(dirname(__FILE__));
|
|
||||||
load_plugin_textdomain('semmelstatzR',null,$plugin_dir.'/locale/');
|
|
||||||
//}
|
|
||||||
|
|
||||||
include_once SEMMELSTATZR_SRVPATH.'/includes/functions.semr.php';
|
|
||||||
include_once SEMMELSTATZR_SRVPATH.'/includes/functions.semr_template.php';
|
|
||||||
|
|
||||||
|
|
||||||
if(is_admin() == true) {
|
if(is_admin() == true) {
|
||||||
|
|
42
trunk/semmelstatzR_startup.php
Normale Datei
42
trunk/semmelstatzR_startup.php
Normale Datei
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* file semmelstatzR_startup.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://sourceforge.net/projects/semmelstatz/
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
### constants
|
||||||
|
define('SEMMELSTATZR_VERSION', '1.0.0 Beta');
|
||||||
|
define('SEMMELSTATZR_SRVPATH', dirname(__FILE__));
|
||||||
|
define('SEMMELSTATZR_HTML_RELPATH', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)));
|
||||||
|
|
||||||
|
### Deklaration der Tabellennamen
|
||||||
|
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'] . '%';
|
||||||
|
}
|
||||||
|
|
||||||
|
### localization
|
||||||
|
if(!load_plugin_textdomain('semmelstatzR')) {
|
||||||
|
$plugin_dir = basename(dirname(__FILE__));
|
||||||
|
load_plugin_textdomain('semmelstatzR',null,$plugin_dir.'/locale/');
|
||||||
|
}
|
||||||
|
|
||||||
|
include_once SEMMELSTATZR_SRVPATH.'/includes/functions.semr.php';
|
||||||
|
include_once SEMMELSTATZR_SRVPATH.'/includes/functions.semr_template.php';
|
||||||
|
?>
|
Laden …
In neuem Issue referenzieren