... und es tut doch nicht ganz.
Hallo Leute
Ist es möglich, dass sich PHP-Skripte gegenseitig stören? Ausserhalb von phpWCMS läuft useronline.php prima. Nur innerhalb von phpWCMS gibt es Fehlermeldungen:
Warning: fopen(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/httpd/vhosts/wolfsland.ch/httpdocs:/tmp:/usr/bin) in /home/httpd/vhosts/wolfsland.ch/httpdocs/05scripts/useronline.php on line 60
Warning: fopen(/): failed to open stream: Operation not permitted in /home/httpd/vhosts/wolfsland.ch/httpdocs/05scripts/useronline.php on line 60
Warning: fclose(): supplied argument is not a valid stream resource in /home/httpd/vhosts/wolfsland.ch/httpdocs/05scripts/useronline.php on line 61
Warning: readdir(): supplied argument is not a valid Directory resource in /home/httpd/vhosts/wolfsland.ch/httpdocs/05scripts/useronline.php on line 64
Warning: closedir(): supplied argument is not a valid Directory resource in /home/httpd/vhosts/wolfsland.ch/httpdocs/05scripts/useronline.php on line 76
Zur Zeit sind 0 Besucher online.
Hier der code von useronline:
Code: Select all
<?php
#################################################
# :: planetUser :: Version vom 11.04.2003
#################################################
#
# COPYRIGHT NOTICE
# Copyright 2003 PlaNet Concept e.K.
# All Rights Reserved.
# EMail: kontakt@planetc.de
# URL : http://www.planetc.de
// Anzahl der Minuten, die ein User als online gelten soll (ein Tag hat 1440 Minuten ;-)
$ip_time = 180;
// Mindest-User-Anzahl die angezeigt wird
$fake_user = 0;
// Anzahl der online befindlichen User anzeigen
// 1 = Ja || 0 = Nein
$display = 1;
// Formatierung der Anzeige
$count_font_face = "verdana"; // Schriftart
$count_font_size = "2"; // Schrift-Größe
$count_font_color = "#ffffff"; // Farbe der Schrift
#################################################
# ab hier muß nichts geändert werden, es sei denn, Sie wissen was Sie tun...
#################################################
$rem_adr = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$data_path = dirname(__FILE__).'/data';
# IP-Adresse prüfen
$count_user = check_ipfile($rem_adr);
if ($display) {
// User-Online Anzeige
if ($count_user=="1") {
$pre = "ist";
} else {
$pre = "sind";
}
echo "Zur Zeit $pre <b>$count_user</b> Besucher online.";
}
#############################
# IP-Adresse checken
#############################
function check_ipfile($senders_ip) {
global $ip_time, $data_path, $fake_user;
$ip_dat = $data_path.'/'.$senders_ip;
$ip_folder = opendir($data_path);
$now_date = date("U");
// IP hinzufügen oder alte mit aktueller Zeit überschreiben
$ip_file = fopen("$ip_dat","w+");
fclose ($ip_file);
// alte IP-Files löschen
while ($datfile = readdir($ip_folder)) {
if (preg_match("=\d{2}.*=", $datfile)) {
$dat_date = date("U", filectime($data_path.'/'.$datfile));
$keep_time = 60*$ip_time;
$dif_time = $now_date - $keep_time;
if ($dat_date < $dif_time) {
@unlink($data_path.'/'.$datfile);
} else {
$ip_count++;
}
}
}
closedir($ip_folder);
$ip_count = $ip_count + $fake_user;
return ($ip_count);
} // end func
#################################################
?>
cmod hab' ich gefummelt, Pfadangaben dito ... nichts. Hat jemand eine Idee?
Gruss
cyber