I'm sorry, but I'm not that good in php that I know what that means.
What I wonder is, that the include works in an external file but not in phpwcms. Where is the difference?
Code: Select all
<?php
/*
**************************************
* counter.php
* -------------
* project: chCounter v2.3
* last modified: February|28|2004
* copyright by Christoph Bachner, 2004
* contact: webmaster@christoph-bachner.net | www.christoph-bachner.net
*
**************************************
*
* This file is part of chCounter.
*
* chCounter 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 2 of the License, or
* (at your option) any later version.
*
* chCounter 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 chCounter; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**************************************
*/
$chCounter_error_reporting_alt = error_reporting();
error_reporting(E_ALL);
if($HTTP_SERVER_VARS['PHP_SELF'] == __FILE__)
{
$GLOBALS['chC']['dbconfig'] = array();
$GLOBALS['chC']['env'] = array();
$chCounter_tempvars = array();
}
$GLOBALS['chC']['env']['serverpfad'] = dirname(__FILE__);
require_once($GLOBALS['chC']['env']['serverpfad']."/include/config.inc.php");
require_once($GLOBALS['chC']['env']['serverpfad']."/include/functions.inc.php");
require_once($GLOBALS['chC']['env']['serverpfad']."/include/mysql.class.php");
require_once($GLOBALS['chC']['env']['serverpfad']."/include/template.class.php");
require_once($GLOBALS['chC']['env']['serverpfad']."/include/functions_counter.inc.php");
/************** env **************/
if($GLOBALS['chC']['env']['mode'] == 'js')
{
$chCounter_visible = $chCounter_tempvars['visible'];
$chCounter_status = $chCounter_tempvars['status'];
$GLOBALS['chC']['env']['seite'] = htmlspecialchars($chCounter_tempvars['seite']);
$GLOBALS['chC']['env']['referer'] = $chCounter_tempvars['referer'];
if(!empty($chCounter_tempvars['res_width']) && !empty($chCounter_tempvars['res_height']))
$GLOBALS['chC']['env']['aufloesung'] = htmlspecialchars($chCounter_tempvars['res_width']."x".$chCounter_tempvars['res_height']);
}
else
{
if(!isset($chCounter_status))
$chCounter_status = "active";
if(!isset($chCounter_visible))
$chCounter_visible = "1";
$GLOBALS['chC']['env']['seite'] = $GLOBALS['chC']['env']['php_self'];
if(!empty($GLOBALS['chC']['env']['query_string']))
$GLOBALS['chC']['env']['seite'] .= "?".$GLOBALS['chC']['env']['query_string'];
}
if(!empty($chCounter_tempvars['cookie']))
{
$chCounter_status = 'inactive';
}
$GLOBALS['chC']['env']['seitentitel'] = (isset($chCounter_pagetitle)) ? $chCounter_pagetitle : "";
if(session_id())
{
$GLOBALS['chC']['env']['seite'] = preg_replace("/(\w)+=".session_id()."&?/", '', $GLOBALS['chC']['env']['seite']);
$GLOBALS['chC']['env']['seite'] = preg_replace("/(&|\?)$/", '', $GLOBALS['chC']['env']['seite']);
}
$GLOBALS['chC']['env']['referer'] = addslashes($GLOBALS['chC']['env']['referer']);
$GLOBALS['chC']['env']['useragent'] = addslashes($GLOBALS['chC']['env']['useragent']);
$GLOBALS['chC']['env']['http_accept_language'] = addslashes(htmlspecialchars($GLOBALS['chC']['env']['http_accept_language']));
$GLOBALS['chC']['env']['seite'] = addslashes( $GLOBALS['chC']['env']['seite'] );
/************** db **************/
$GLOBALS['chC']['db'] = new chC_mysql($GLOBALS['chC']['dbconfig']['server'], $GLOBALS['chC']['dbconfig']['user'], $GLOBALS['chC']['dbconfig']['passwort'], $GLOBALS['chC']['dbconfig']['database']);
$GLOBALS['chC']['db']->set_accepted_errors("1062");
/************** config **************/
$GLOBALS['chC']['config'] = $GLOBALS['chC']['db']->query("SELECT
blockzeit,
eintraege_loeschen_nach,
url_hp,
verzeichnis,
user_online_fuer,
stats_ignore_counterfile,
stats_seiten_search_title,
activate_referer,
activate_seiten,
activate_useragents,
activate_tage,
activate_monate,
activate_suchwoerter,
activate_countries,
activate_aufloesung,
activate_js,
activate_tageszeit_tag,
ignored_referers,
lang,
block_bots,
zeitzone
FROM `".$GLOBALS['chC']['dbconfig']['table_config']."`");
$GLOBALS['chC']['config'] = $GLOBALS['chC']['db']->fetch_assoc($GLOBALS['chC']['config']);
$GLOBALS['chC']['config']['visibility'] = $chCounter_visible;
$GLOBALS['chC']['config']['status'] = $chCounter_status;
if($GLOBALS['chC']['env']['mode'] == "show_version")
die("chCounter v2.3");
if($GLOBALS['chC']['config']['block_bots'] == "1")
{
if(preg_match("#(Googlebot|Scooter|Slurp|Infoseek|Spider|Nutch|Blitz|Fireball|FAST|bot|Crawler)#i", $GLOBALS['chC']['env']['useragent']))
$GLOBALS['chC']['config']['status'] = 'inactive';
}
/************** variables **************/
$GLOBALS['chC']['variables'] = array(
'zeit_zu_tagesanfang' => mktime(0,0,0,gmdate("n", time() + (3600 * ($GLOBALS['chC']['config']['zeitzone'] + date("I")))), gmdate("j", time() + (3600 * ($GLOBALS['chC']['config']['zeitzone'] + date("I")))), gmdate("y", time() + (3600 * ($GLOBALS['chC']['config']['zeitzone'] + date("I"))))),
'zeit_zu_monatsanfang' => mktime(0,0,0,gmdate("n", time() + (3600 * ($GLOBALS['chC']['config']['zeitzone'] + date("I")))), 1, gmdate("y", time() + (3600 * ($GLOBALS['chC']['config']['zeitzone'] + date("I")))))
);
$GLOBALS['chC']['variables']['chCounter_template'] = isset($chCounter_template) ? $chCounter_template : '';
$GLOBALS['chC']['variables']['cr'] = ($GLOBALS['chC']['config']['visibility'] != "0")
? "60,33,45,45,13,10,124,32,99,104,67,111,117,110,116,101,114,32,118,50,46,51,13,10,124,32,40,99,41,32,98,121,32,67,104,114,105,115,116,111,112,104,32,66,97,99,104,110,101,114,44,32,50,48,48,52,13,10,124,32,119,119,119,46,99,104,114,105,115,116,111,112,104,45,98,97,99,104,110,101,114,46,110,101,116,13,10,45,45,62"
: "60,33,45,45,13,10,124,32,99,104,67,111,117,110,116,101,114,32,118,50,46,51,32,91,105,110,118,105,115,105,98,108,101,32,109,111,100,101,93,13,10,124,32,40,99,41,32,98,121,32,67,104,114,105,115,116,111,112,104,32,66,97,99,104,110,101,114,44,32,50,48,48,52,13,10,124,32,119,119,119,46,99,104,114,105,115,116,111,112,104,45,98,97,99,104,110,101,114,46,110,101,116,13,10,45,45,62";
/************** values **************/
$GLOBALS['chC']['values'] = array();
/************** counter **************/
chC_get_counter_values();
chC_manage_blocked_users_and_logs();
chC_manage_online_users();
if(!isset($GLOBALS['chC']['variables']['blocked']) && $GLOBALS['chC']['config']['status'] != "inactive")
{
if($GLOBALS['chC']['config']['activate_referer'] == "1")
chC_stat_referer();
if($GLOBALS['chC']['config']['activate_useragents'] == "1")
chC_stat_useragent();
if($GLOBALS['chC']['config']['activate_countries'] == "1")
chC_stat_country();
chC_stat_tages_monats_besuche();
if($GLOBALS['chC']['config']['activate_aufloesung'] == "1")
chC_stat_resolution();
if($GLOBALS['chC']['config']['activate_suchwoerter'] == "1")
chC_stat_suchwoerter();
if($GLOBALS['chC']['config']['activate_js'] == "1")
chC_stat_js();
if($GLOBALS['chC']['config']['activate_tageszeit_tag'] == "1")
chC_stat_tageszeit_wochentag();
chC_count_log_block_user();
}
if($GLOBALS['chC']['config']['status'] !== "inactive")
{
chC_stat_hits();
if($GLOBALS['chC']['config']['activate_seiten'] == "1")
chC_stat_seiten();
}
/************** print **************/
chC_print();
/************** finishing **************/
chC_optimize_db();
unset($chCounter_tempvars, $chCounter_visible, $chCounter_status, $chCounter_pagetitle);
error_reporting($chCounter_error_reporting_alt);
?>