Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> statysktyki Imperator Stat
Italy
post
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 27.02.2003

Ostrzeżenie: (0%)
-----


Mam problem ze statystykami Imperator Stat! na swoim serwerze mam domene "yebood.com" a moja strona znajduje sie w katalogu "yebood.com/muzyka". statystyki są w katalogu "yebood.com/muzyka/istat". I tu jest problem. Gdy dam odnośnik do statystykk "<? include(istat/stat.php); ?>" to wyświetla się na stronie link do statystyk jak by byly na domenie yebood.com czyli "yebood.com/istat". W pliku stat.php zmienilem adres na "http://www.yebood.com/muzyka/istat". Sami mozecie zobaczyc co sie dzieje: http://www.yebood.com/muzyka

Prosze o rady- ale namieszalem (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

aha- link do statystyk jest pod newswami.
Go to the top of the page
+Quote Post
piotrdd2
post
Post #2





Grupa: Zarejestrowani
Postów: 136
Pomógł: 2
Dołączył: 13.05.2003
Skąd: Przemyśl

Ostrzeżenie: (0%)
-----


może tak?
zmień
[php:1:260e5831e7]<? include("istat/stat.php"); ?>[/php:1:260e5831e7]
na
[php:1:260e5831e7]<? include("muzyka/istat/stat.php"); ?>[/php:1:260e5831e7]
Go to the top of the page
+Quote Post
Italy
post
Post #3





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 27.02.2003

Ostrzeżenie: (0%)
-----


to odnosnik jest dobr tylko raczej w gdzie indziej jest zle. Zmienilem w stat.php odnosnik na "muzyka/istat" to teraz mam taki blad ale nie wiem co on zoznacza
Cytat
Fatal error: Call to undefined function: istatbrowser() in /usr/local/apache/www/htdocs/yebood.com/html/muzyka/istat/stat.php on line 170
Go to the top of the page
+Quote Post
piotrdd2
post
Post #4





Grupa: Zarejestrowani
Postów: 136
Pomógł: 2
Dołączył: 13.05.2003
Skąd: Przemyśl

Ostrzeżenie: (0%)
-----


pokaż kod php
Go to the top of the page
+Quote Post
scanner
post
Post #5





Grupa: Zarząd
Postów: 3 503
Pomógł: 28
Dołączył: 17.10.2002
Skąd: Wrocław




ISTAT ma coś chyba skopane w inkludownaniu swoich plików przy głębszym zagnieżdzenu. Sam pamiętam, jak walczyłem z tym kiedyś dwa dni.
Ale wiem, zę przez forum przewija się ktoś z autorów - mosze poszperać po postach io go namierzyć i wysłać mu PW?
Go to the top of the page
+Quote Post
Italy
post
Post #6





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 27.02.2003

Ostrzeżenie: (0%)
-----


Troche dużo tego ale sam chciałes (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Cytat
<?  
// tu ustaw sciezke do statystyki
$istat_path="http://www.yebood.com/muzyka/istats;

error_reporting(E_ERROR|E_PARSE);
$istat["lastip_log"]="$istat_path/logs/lastip.isl";
$istat["stat_log"]="$istat_path/logs/stat.isl";
$istat["browser_log"]="$istat_path/logs/browser.isl";
$istat["os_log"]="$istat_path/logs/os.isl";
$istat["host_log"]="$istat_path/logs/host.isl";
$istat["referer_log"]="$istat_path/logs/referer.isl";
$istat["last_log"]="$istat_path/logs/last.isl";
$istat["lang_log"]="$istat_path/logs/lang.isl";
$istat["keyword_log"]="$istat_path/logs/keyword.isl";
$istat["search_log"]="$istat_path/logs/search.isl";
$istat["domena_log"]="$istat_path/logs/domena.isl";
$istat["pages_log"]="$istat_path/logs/pages.isl";


include($istat_path."/conf.php");
include($istat_path."/mod/browser.php");
include($istat_path."/mod/os.php");
include($istat_path.'/mod/search.php');

//tworzenie plikow
all_create_files();

if(isset($HTTP_X_FORWARDED_FOR) && $HTTP_X_FORWARDED_FOR != ''){
$istat["ip"]=$HTTP_X_FORWARDED_FOR;  
} else {
$istat["ip"]=$REMOTE_ADDR;
}


if(eregi(',',$istat[ip])) {
$istat["ip"] = eregi_replace(' ','',$istat[ip]);
$ips = explode(',',$istat["ip"]);
$istat["ip_proxy"] = $ips[0];
$istat["ip"] = $ips[1];
}

$istat["host"]=$REMOTE_HOST;
if(strlen($istat[host]) < 4 || $istat[host] == 'unknown') {
$istat["host"]=gethostbyaddr($istat[ip]);
if(strlen($istat[host]) < 4 || $istat[host] == 'unknown') {  
 $istat["host"]=gethostbyaddr($istat[ip_proxy]);
}
}

if(!file_exists($istat["stat_log"]))
{
 $istat_id=fopen($istat["stat_log"],"w");
 for($n=0; $n<47; $n++) fputs($istat_id,"0,");
 fputs($istat_id,"0");
 fclose($istat_id);
 chmod($istat["stat_log"],0666);
}
 
$istat_dat=file($istat["stat_log"]);
$istat_buf=explode(",",$istat_dat[0]);
$istat_buf[46]++;   //liczba odsłon
$istat_dat[0]=implode(",",$istat_buf);
$istat_id=fopen($istat["stat_log"],"w");
flock($istat_id,2);
fputs($istat_id,chop($istat_dat[0]));
flock($istat_id,3);
fclose($istat_id);

$istat_pages=0;

$nwip=explode(";",$istat[wyklucz]);
$nw=count($nwip);
for($n=0; $n<$nw; $n++)
{
if($istat[ip]==$nwip[$n]){ $istat_pages=1; break;}
}
 

if($istat_pages==0){

if($istat["pages"]=="on") include "$istat_path/pages.php";  

$istat["czas"]=time();


$istat_fip=file($istat["lastip_log"]);  
$istat_reload=1;
$istat_eflag=0;
$istat[expired]=$istat[expired]*60;  

for($istat_n=0; $istat_n<count($istat_fip); $istat_n++)  
 if(eregi($istat["ip"],$istat_fip[$istat_n])) { $istat_eflag=1; break;}

if($istat_eflag==1){
$istat_ips=explode("|",$istat_fip[$istat_n]);
if($istat_ips[1]+$istat["expired"] < $istat["czas"])  
{
 $istat_fip[$istat_n]=$istat["ip"]."|".$istat["czas"]."n";
 $istat_id=fopen($istat["lastip_log"],"w");
 flock($istat_id,2);
 for($n=0; $n<count($istat_fip); $n++) fputs($istat_id,chop($istat_fip[$n])."n");
 flock($istat_id,3);
 fclose($istat_id);
 $istat_reload=0;
}
}  
else{
 $istat_id=fopen($istat["lastip_log"],"a");
 flock($istat_id,2);
 fputs($istat_id,$istat["ip"]."|".$istat["czas"]."n");
 flock($istat_id,3);
 fclose($istat_id);
 $istat_reload=0;
}
 



if($istat_reload==0) {   // zablokowanie przeładowań

$istat["refer"]=$HTTP_REFERER;
if(!$istat["refer"]) $istat["refer"]="-";

$istat["rok"]=date("Y");
$istat["miesiac"]=date("n");
$istat["dzien"]=date("j");
$istat["fday"]=date("z")+1;
$istat["godzina"]=date("G");
$istat["tydzien"]=date("w");
$istat["unknow"]=0;

$istat_dat=file($istat["stat_log"]);
$istat_buf=explode(",",$istat_dat[0]);
$istat_buf[0]++;                     // ogólna liczba odwiedzin
$istat_buf[13+$istat["godzina"]]++;  // najczęsciej w godzinach
$istat_buf[37+$istat["tydzien"]]++;  // najczęsciej w dniach tygodnia  
$istat_dat[0]=implode(",",$istat_buf);
$istat_id=fopen($istat["stat_log"],"w");
flock($istat_id,2);
fputs($istat_id,chop($istat_dat[0]));
flock($istat_id,3);
fclose($istat_id);
 

$istat["rok_log"]=$istat_path."/logs/".$istat["rok"];
if(!file_exists($istat["rok_log"]))
{
 $istat_id=fopen($istat["rok_log"],"w");
 flock($istat_id,2);
 fputs($istat_id,date("L")."n");
 for($x=0; $x<366; $x++) fputs($istat_id,"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0n");
 flock($istat_id,3);
 fclose($istat_id);
 chmod("$istat[rok_log]", 0666);
}


// zapisz kolory i rozdzielczosć
?>
<!-- wstawka Imperator Stats -->
<script language='JavaScript'>

var v=navigator.appName;
if(v!='Netscape') var scolor=screen.colorDepth; else var scolor=screen.pixelDepth;
document.write('<img src="http://<? echo $SERVER_NAME ?>/istat/rstat.php?scr='+screen.width+'&colorbit='+scolor+'" width=1 height=1 border=0>');  
</script>
<!-- koniec wstawki -->
<?

istat_save($istat["browser_log"],istatBrowser());

istat_save($istat["os_log"],istatOs());

 // statystyka z podziałem na daty
if(date("L")==1) {
$nrmonth=array(31,29,31,30,31,30,31,31,30,31,30,30);
} else {
$nrmonth=array(31,28,31,30,31,30,31,31,30,31,30,30);
}



$istat_nday=file($istat["rok_log"]);
$istat_hour_visit=explode(",",$istat_nday[$istat["fday"]]);
settype($istat_hour_visit[$istat["godzina"]],"integer");
$istat_hour_visit[$istat["godzina"]]++;   //zwieksz liczbe odwiedzin o odpowiedniej godzinie
$istat_hour_visit[24]=$istat["tydzien"];  //dzien tygodnia
$istat_nday[$istat["fday"]]=implode(",",$istat_hour_visit);
$istat_id=fopen($istat["rok_log"],"w");
flock($istat_id,2);
for($x=0; $x<count($istat_nday); $x++) fputs($istat_id,chop($istat_nday[$x])."n");
flock($istat_id,3);
fclose($istat_id);  

// lista wszystkich ip i host
istat_save($istat["host_log"],$istat["host"]);  


// lista domen
if($istat["ip"]!=$istat["host"]){
$istat_dane=explode(".",$istat["host"]);
$istat_ile=count($istat_dane);
if(eregi('/',$istat_dane[$istat_ile-1])) { eregi_replace('/','',$istat_dane[$istat_ile-1]); }
$istat["domena"]=$istat_dane[$istat_ile-2].".".$istat_dane[$istat_ile-1];
istat_save($istat["domena_log"],$istat["domena"]);  
}

function textwrap($text){
$wrap=81;
$pocz=0;
$len = strlen($text);
if ($len > $wrap) {
        $h =  '';
 $x = 0;

 while($pocz<$len) {
  $v = substr($text,$pocz,$wrap);
  if(ereg(chr(10),$v)) {
   while(ereg(chr(10),$v)==1) {
    $plc = strpos($v,chr(10))+1;
    $h .= substr($text,$pocz,$plc-2).'<BR>';
    $pocz = $pocz+$plc;
    $v = substr($text,$pocz,$wrap);
   }
    $h .= substr($text,$pocz,$wrap).'<BR>';
    $pocz = $pocz+$wrap;
  } else {
   $h .= substr($text,$pocz,$wrap).'<BR>';
   $pocz = $pocz+$wrap;
  }
 }
} else {
 $h = $text;  
}  
return $h;  
}






//lista państw z których najczę&para;ciej była odwiedzana strona
if ($istat["host"]!=$istat["ip"] && $istat["host"]!="localhost")  
{  
$istat_lang_ip = substr(strrchr($istat["host"], "."), 1);
istat_save($istat["lang_log"],strtolower($istat_lang_ip));
}

// lista słów kluczowych wpisywanych do wyszukiwarek
$istat[search]=istatSearch();

if($istat[search][0]) { istat_save($istat["search_log"],$istat[search][0]); }
if($istat[search][1]) { istat_save($istat["keyword_log"],$istat[search][1]); }

// lista adresów sk&plusmn;d przybyli go&para;cie

if($istat["refer"]!="-")
{
if($istat[search][1])  
 {  
   $istat["ref_tmp"]=explode("?",$istat["refer"]);
$istat["refer"]=$istat["ref_tmp"][0];
 }
 
istat_save($istat["referer_log"],textwrap($istat["refer"]));
}



// lista ostatnich odwiedzin

$istat_lines=file($istat["last_log"]);  
$istat_num=count($istat_lines); if($istat_num>1000) $istat_num=500;
$istat_id=fopen($istat["last_log"],"w");
 fputs($istat_id,date("Y-m-d H:i").",".$istat["host"].",".$istat["refer"].",".istatOs()."/".istatBrowser()."n");
 for($n=0; $n<$istat_num; $n++) fputs($istat_id,chop($istat_lines[$n])."n");
fclose($istat_id);
}
}
echo"<a href=http://$SERVER_NAME/istat/index.php><img src="http://$SERVER_NAME/istat/images/nistat.gif" width=80 height=32 border=0 alt='www.iportal.nano.pl'></a>";

function createfile($filename)
{
$id=fopen($filename,"w");
fputs($id,"");
fclose($id);
chmod($filename, 0666);
}

function all_create_files()
{
GLOBAL $istat;
if(!file_exists($istat["keyword_log"])) { createfile($istat["keyword_log"]); }
if(!file_exists($istat["browser_log"])) { createfile($istat["browser_log"]); }
if(!file_exists($istat["os_log"]))  { createfile($istat["os_log"]); }
if(!file_exists($istat["host_log"])) { createfile($istat["host_log"]); }
if(!file_exists($istat["referer_log"])) { createfile($istat["referer_log"]); }
if(!file_exists($istat["last_log"])) { createfile($istat["last_log"]); }
if(!file_exists($istat["lang_log"])) { createfile($istat["lang_log"]); }
if(!file_exists($istat["keyword_log"])) { createfile($istat["keyword_log"]); }
if(!file_exists($istat["search_log"])) { createfile($istat["search_log"]); }
if(!file_exists($istat["domena_log"])) { createfile($istat["domena_log"]); }
if(!file_exists($istat["pages_log"])) { createfile($istat["pages_log"]); }
 
}



function istat_save($filename,$id_name)
{
$flag=1;
$lines=file($filename);
for($n=0; $n<count($lines); $n++)
{
 if(ereg($id_name,$lines[$n]))
  {
   $tmp=explode("|",$lines[$n]);
   $tmp[0]++;
   $lines[$n]=implode("|",$tmp);
   $flag=0;  
   break;
  }
 }
if($flag==1)
{
  $istat_id=fopen($filename,"a");
flock($istat_id,2);
fputs($istat_id,"1|$id_namen");
}
else{
 $istat_id=fopen($filename,"w");
 flock($istat_id,2);
 for($n=0; $n<count($lines); $n++) fputs($istat_id,chop($lines[$n])."n");
}
flock($istat_id,3);
fclose($istat_id);
return $flag;
}
?>
Go to the top of the page
+Quote Post
Italy
post
Post #7





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 27.02.2003

Ostrzeżenie: (0%)
-----


Tu masz link:

http://www.yebood.com/muzyka/stat.txt
Go to the top of the page
+Quote Post
K.Chmielowski
post
Post #8





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 4.07.2003
Skąd: Zakliczyn

Ostrzeżenie: (0%)
-----


Witaj!!!

A czytales moze plik readme?(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ?
Jesli nie to polecam Ci ta lekture!!!

A rozwiazanie Twojego problemu jest b.proste. :!: :!: :!:

Wykonuj moje polecenia
:arrow: 1. Zaloguj sie do admina
:arrow: 2 przejdz do menu "konfiguracja"
:arrow: 3. Tam w pierwszej linijce masz gotowa sciezke ktora mozesz wkleic w dowolnym miejscu stron php.
:arrow: 4. ... i po problemie

W razie problemow pisz na forum

krzysiek
Go to the top of the page
+Quote Post
piotrdd2
post
Post #9





Grupa: Zarejestrowani
Postów: 136
Pomógł: 2
Dołączył: 13.05.2003
Skąd: Przemyśl

Ostrzeżenie: (0%)
-----


nom (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
pierwsza linijka
Kod statystyki do wklejenia na Twoje strony WWW
[php:1:d5855e7927]include"/www/htdocs/yebood.com/html/muzyka/istat/stat.php"; [/php:1:d5855e7927]
Go to the top of the page
+Quote Post
Italy
post
Post #10





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 27.02.2003

Ostrzeżenie: (0%)
-----


Dzieki za porady ale plik readme przeczytalem w pierwszej kolejnosci! Ta linijke tez skopiowalem i ten link lączy sie z plikiem stat.php. Problem jest taki jak napisalem w pierwszym poscie.
Go to the top of the page
+Quote Post
GeoS
post
Post #11





Grupa: Zarejestrowani
Postów: 602
Pomógł: 0
Dołączył: --
Skąd: W - WA -> GRO

Ostrzeżenie: (0%)
-----


W wersji dostepnej na stronie nie ma obecnie wiekszych bledow.

Trzeba zmienic tylko zawartosc zmiennej $istat_path w 3 linii kodu w stat.php i wszystko powinno zaczac normalnie dzialac.

PS
A tym gosciem od autora bylem ja (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
scanner
post
Post #12





Grupa: Zarząd
Postów: 3 503
Pomógł: 28
Dołączył: 17.10.2002
Skąd: Wrocław




Cytat
A tym gosciem od autora bylem ja (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Wygrawerowałem sobie na już na monitorze (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
GeoS
post
Post #13





Grupa: Zarejestrowani
Postów: 602
Pomógł: 0
Dołączył: --
Skąd: W - WA -> GRO

Ostrzeżenie: (0%)
-----


Cytat
Wygrawerowałem sobie na już na monitorze (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)


Nie szkoda Ci bylo niszczyc tego jakze waznego urzadzenia :?: (IMG:http://forum.php.pl/style_emoticons/default/aaevil.gif) (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)
Go to the top of the page
+Quote Post
scanner
post
Post #14





Grupa: Zarząd
Postów: 3 503
Pomógł: 28
Dołączył: 17.10.2002
Skąd: Wrocław




spoko - ma warstwę zabezpieczającą (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
kenNY
post
Post #15





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 20.06.2003
Skąd: Nysa

Ostrzeżenie: (0%)
-----


nie wiem czy jeszcze aktualne... (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

tam gdzie masz http://$SERVER_NAME/istat/...
zmien na http://$SERVER_NAME/muzyka/istat/...

jest pare takich sciezek
Go to the top of the page
+Quote Post
Italy
post
Post #16





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 27.02.2003

Ostrzeżenie: (0%)
-----


A no to jest dobry pomysl (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Big dzieki! Jak to zrobie to napisze czy dziala, ale raczej musi zadzialac!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 18:13