Mal wieder ein [PHP] Problem / Problems with [PHP]

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Mal wieder ein [PHP] Problem / Problems with [PHP]

Post by Hero »

Hi,
I just wantet to include a counter in my site.
Usually that works pretty good, but with phpwcms it doesn't work out.

Normally the counter is included like this:

Code: Select all

<?php
$chCounter_visible = "0";
include("/usr/export/www/vhosts/funnetwork/hosting/gruleiru/counter/counter.php");
?>
That works: http://gruleiru.gr.funpic.de/phpwcms/counter.php

So I included this code in the Head in phpwcms:

Code: Select all

[PHP]
$chCounter_visible = "0";
include("/usr/export/www/vhosts/funnetwork/hosting/gruleiru/counter/counter.php");[/PHP]
But now I get these errors:
http://gruleiru.gr.funpic.de/phpwcms/index.php?index

What did I do wrong?

thanks!
Andreas

---------

Hallo zusammen!
Ich wollte gerne einen Counter in meine Seite einbinden.
Klappt in normalen PHP seiten auch wunderbar, nur phpwcms spielt da nicht mit.

Der Counter wird standardmäßig so eingebunden:

Code: Select all

<?php
$chCounter_visible = "0";
include("/usr/export/www/vhosts/funnetwork/hosting/gruleiru/counter/counter.php");
?>
Klappt auch: http://gruleiru.gr.funpic.de/phpwcms/counter.php

Also in den Hauptbereich folgendes eingefügt:

Code: Select all

[PHP]
$chCounter_visible = "0";
include("/usr/export/www/vhosts/funnetwork/hosting/gruleiru/counter/counter.php");[/PHP]
Jetzt bekomme ich aber zig Fehlermeldungen:
http://gruleiru.gr.funpic.de/phpwcms/index.php?index

Hab ich da irgendwas falsch gemacht?

danke!
Andreas
Last edited by Hero on Thu 6. Jan 2005, 12:25, edited 1 time in total.
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Post by Hero »

I'm sorry, but I'm not that good in php that I know what that means.
Anyway: here is the counter.php

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);
?>
Pappnase

Post by Pappnase »

hallo

änder doch mal in dem php tag den absoluten pfad in die url! ode rhast du das schon probiert!
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Post by Hero »

Hab das mal auf

Code: Select all

[PHP]
$chCounter_visible = "0";
include("../counter/counter.php");[/PHP]
geändert. gleicher Fehler :cry:

Das muss irgendwie an phpwcms liegen weil in einer eigenen php file läufts doch!
Pappnase

Post by Pappnase »

hallo

und was hälst du hiervon!?

Code: Select all

[PHP]
$chCounter_visible = "0";
include(" http://gruleiru.gr.funpic.de/counter/counter.php");[/PHP]
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Post by Hero »

Da machen die Sicherheitsbestimmungen von meinem Hoster nicht mit :evil:
Warning: Unknown(): Der Zugriff auf externe Dateien ueber URL Filewrappers ist aus Sicherheitsgr&uuml;nden nicht erlaubt. in /usr/export/www/vhosts/funnetwork/hosting/gruleiru/phpwcms/include/inc_front/front.func.inc.php(2048) : eval()'d code on line 3

Warning: Unknown(http://gruleiru.gr.funpic.de/counter/counter.php): failed to open stream: no suitable wrapper could be found in /usr/export/www/vhosts/funnetwork/hosting/gruleiru/phpwcms/include/inc_front/front.func.inc.php(2048) : eval()'d code on line 3

Warning: (null)(): Failed opening 'http://gruleiru.gr.funpic.de/counter/counter.php' for inclusion (include_path='.:') in /usr/export/www/vhosts/funnetwork/hosting/gruleiru/phpwcms/include/inc_front/front.func.inc.php(2048) : eval()'d code on line 3
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Post by Hero »

Da bekomme ich auch wieder den Variablen Fehler!
Pappnase

Post by Pappnase »

hallo

also jetzt würde ich mal sagen zu einem vernünfigen hoster wechslen ;-)
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Post by Hero »

lief alles glatt soweit.

aber ich werd gleich mal ne zweit installation aufsetzen um zu gucken obs am webspace liegt...
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Post by Hero »

schnauf. genau das gleiche Problem :evil:

Na, dann werd ich mich mal nach (paid?) webspace umsehen...

danke für eure Hilfe!
Andreas
Pappnase

Post by Pappnase »

hallo

kannst dich ja mal bei all-inkl umschauen udn auch gerne über den banner auf der docuseite gehen!*zwinker*
Hero
Posts: 87
Joined: Thu 16. Dec 2004, 16:14
Location: Düsseldorf
Contact:

Post by Hero »

wenns der sein soll, werd ich drann denken :D
Post Reply