Отображение счетчиков Hits и Hosts в Опера, лечим следующим образом:
1. Открываем файл function/user.php
2. Находим код:
3. Удаляем его
4. Прописываем вместо него код:
5. Радуемся жизни...
1. Открываем файл function/user.php
2. Находим код:
switch(isset($_GET['hit'])) {
case "1":
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_hit = "config/counter/hits.txt";
$hits = file($count_hit);
$hit = explode("|", trim($hits[0]));
if (date("Ymd") > $hit[1]) {
unlink($count_hit);
$wco = "1|".date("Ymd")."";
} else {
$wco = "".intval($hit[0]+1)."|".intval($hit[1])."";
}
$fpc = fopen($count_hit, "wb");
fwrite($fpc, $wco);
fclose($fpc);
if (rename($count_hit, $count_hit) == false) {
# unlink ($count_hit);
# rename ($count_hit, $count_hit);
}
$image = ImageCreateFromGif("images/banners/hits".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $hit[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
exit;
break;
}
switch(isset($_GET['host'])) {
case "1":
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_host = "config/counter/hosts.txt";
$check = ($_SESSION['host'] == date("d")) ? false : true;
if ($check) {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
if (date("Ymd") > $con[1]) {
unlink($count_host);
$wc = "1|".date("Ymd")."";
} else {
$wc = "".intval($con[0]+1)."|".intval($con[1])."";
}
$fph = fopen($count_host, "wb");
fwrite($fph, $wc);
fclose($fph);
unset($_SESSION['host']);
$_SESSION['host'] = date("d");
} else {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
}
$image = ImageCreateFromGif("images/banners/hosts".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $con[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
exit;
break;
}
case "1":
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_hit = "config/counter/hits.txt";
$hits = file($count_hit);
$hit = explode("|", trim($hits[0]));
if (date("Ymd") > $hit[1]) {
unlink($count_hit);
$wco = "1|".date("Ymd")."";
} else {
$wco = "".intval($hit[0]+1)."|".intval($hit[1])."";
}
$fpc = fopen($count_hit, "wb");
fwrite($fpc, $wco);
fclose($fpc);
if (rename($count_hit, $count_hit) == false) {
# unlink ($count_hit);
# rename ($count_hit, $count_hit);
}
$image = ImageCreateFromGif("images/banners/hits".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $hit[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
exit;
break;
}
switch(isset($_GET['host'])) {
case "1":
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_host = "config/counter/hosts.txt";
$check = ($_SESSION['host'] == date("d")) ? false : true;
if ($check) {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
if (date("Ymd") > $con[1]) {
unlink($count_host);
$wc = "1|".date("Ymd")."";
} else {
$wc = "".intval($con[0]+1)."|".intval($con[1])."";
}
$fph = fopen($count_host, "wb");
fwrite($fph, $wc);
fclose($fph);
unset($_SESSION['host']);
$_SESSION['host'] = date("d");
} else {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
}
$image = ImageCreateFromGif("images/banners/hosts".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $con[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
exit;
break;
}
3. Удаляем его
4. Прописываем вместо него код:
IF (isset($_GET["hit"])) {
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_hit = "config/counter/hits.txt";
$hits = file($count_hit);
$hit = explode("|", trim($hits[0]));
if (date("Ymd") > $hit[1]) {
unlink($count_hit);
$wco = "1|".date("Ymd")."";
} else {
$wco = "".intval($hit[0]+1)."|".intval($hit[1])."";
}
$fpc = fopen($count_hit, "wb");
fwrite($fpc, $wco);
fclose($fpc);
if (rename($count_hit, $count_hit) == false) {
# unlink ($count_hit);
# rename ($count_hit, $count_hit);
}
$image = ImageCreateFromGif("images/banners/hits".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $hit[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
}
IF (isset($_GET["host"])) {
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_host = "config/counter/hosts.txt";
$check = ($_SESSION['host'] == date("d")) ? false : true;
if ($check) {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
if (date("Ymd") > $con[1]) {
unlink($count_host);
$wc = "1|".date("Ymd")."";
} else {
$wc = "".intval($con[0]+1)."|".intval($con[1])."";
}
$fph = fopen($count_host, "wb");
fwrite($fph, $wc);
fclose($fph);
unset($_SESSION['host']);
$_SESSION['host'] = date("d");
} else {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
}
$image = ImageCreateFromGif("images/banners/hosts".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $con[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
}
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_hit = "config/counter/hits.txt";
$hits = file($count_hit);
$hit = explode("|", trim($hits[0]));
if (date("Ymd") > $hit[1]) {
unlink($count_hit);
$wco = "1|".date("Ymd")."";
} else {
$wco = "".intval($hit[0]+1)."|".intval($hit[1])."";
}
$fpc = fopen($count_hit, "wb");
fwrite($fpc, $wco);
fclose($fpc);
if (rename($count_hit, $count_hit) == false) {
# unlink ($count_hit);
# rename ($count_hit, $count_hit);
}
$image = ImageCreateFromGif("images/banners/hits".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $hit[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
}
IF (isset($_GET["host"])) {
$img = (intval($_GET['img'])) ? "_".$_GET['img']."" : "";
$count_host = "config/counter/hosts.txt";
$check = ($_SESSION['host'] == date("d")) ? false : true;
if ($check) {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
if (date("Ymd") > $con[1]) {
unlink($count_host);
$wc = "1|".date("Ymd")."";
} else {
$wc = "".intval($con[0]+1)."|".intval($con[1])."";
}
$fph = fopen($count_host, "wb");
fwrite($fph, $wc);
fclose($fph);
unset($_SESSION['host']);
$_SESSION['host'] = date("d");
} else {
$hosts = file($count_host);
$con = explode("|", trim($hosts[0]));
}
$image = ImageCreateFromGif("images/banners/hosts".$img.".gif");
$color = ImageColorAllocate($image, 255, 255, 255);
ImageString($image, 1, 40, 4, $con[0], $color);
Header("Content-type: image/gif");
ImageGif($image, "", 100);
ImageDestroy($image);
}
5. Радуемся жизни...