Beispiel #1
0
function boom_status()
{
    global $config;
    $count_file = "{$config['dir']}/{$_COOKIE['STAT_BOOM_ID']}.php";
    if (!file_exists($count_file)) {
        echo "<meta http-equiv=refresh content=5;URL='javascript:history.back(1);'><br><font size=3>您尚未登陆,帐号『<font color=ff0000>{$_COOKIE[STAT_BOOM_ID]}</font>』不存在</font><br><br><br>";
        include "bottom.php";
        exit;
    }
    $info = file_myfun($count_file);
    list($php_code, $yesterday, $today, $month, $total, $all_day, $top_day, $top_day_time, $top_online, $top_online_time, $mode, $time, $pass, $pagename, $pageurl, $ip, ) = explode("|", $info[0]);
    if ($_COOKIE[STAT_BOOM_PASSWORD] != $pass) {
        echo "<meta http-equiv=refresh content=5;URL='javascript:history.back(1);'><br><font color=ff0000>您尚未登陆,密码错误!</font><br><br><br>";
        include "bottom.php";
        exit;
    }
}
Beispiel #2
0
function php_count($id = "index", $type = "", $image = "1", $path = "")
{
    require "config.php";
    $from = check($_SERVER[HTTP_REFERER]);
    $count_file = "{$path}{$config[dir]}/{$id}.php";
    //数据文件
    $count_bak_file = "{$path}{$config[dir]}/{$id}.bak.php";
    //备份数据文件
    if (!file_exists($count_file)) {
        //如果数据文件不存在
        if ($config[mode] == b) {
            $fp = fopen($count_file, "w");
            chmod("{$count_file}", 0666);
            fputs($fp, "{$php_code}|0|0|0|0|0|0||||||||http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}||||||");
            fclose($fp);
            $fp = fopen("{$config['dir']}/list.txt", "a");
            flock($fp, LOCK_EX);
            fputs($fp, "{$id}\n");
            fclose($fp);
        } else {
            echo "<font color=ff0000>帐号<b>{$id}</b>不存在</font>";
            exit;
        }
    }
    $info = file_myfun($count_file);
    if (!$info[0]) {
        //数据为0则使用备份数据文件
        $info = file_myfun($count_bak_file);
        $bak = "0";
    }
    $info_all = count($info);
    list(, $yesterday, $today, $month, $total, $all_day, $top_day, $top_day_time, $top_online, $top_online_time, $mode, $time1, $pass, $pagename, $pageurl, $ip1, $bak_num) = explode("|", $info[0]);
    $time = time();
    if ($bak == "0") {
        $bak_num++;
    }
    if (!$_COOKIE["STAT_BOOM_{$id}"] or $_COOKIE["STAT_BOOM_{$id}"] != $id) {
        //判断防止刷新
        $yx_time = $time + $config[jgtime];
        setcookie("STAT_BOOM_{$id}", "{$id}", "{$yx_time}", "{$_SERVER['PHP_SELF']}");
        if (date("d", $time1) != date("d", $time)) {
            //判断是否同一天
            $all_day++;
            $yesterday = $today;
            $today = 1;
            if ($bak != "0") {
                copy($count_file, $count_bak_file);
            }
        } else {
            $today++;
        }
        if (date("m", $time1) != date("m", $time)) {
            //判断是否同一月
            $month = 1;
        } else {
            $month++;
        }
        if ($today > $top_day) {
            $top_day = $today;
            $top_day_time = date("Y-m-d");
        }
        $total++;
        $ip = guest_ip();
        $locality = convert_ip($ip);
        //************************** 写入新数据 **************************//
        $fp = fopen($count_file, "w");
        flock($fp, LOCK_EX);
        fputs($fp, "{$php_code}|{$yesterday}|{$today}|{$month}|{$total}|{$all_day}|{$top_day}|{$top_day_time}|{$top_online}|{$top_online_time}|{$mode}|{$time}|{$pass}|{$pagename}|{$pageurl}|{$ip}|{$bak_num}|||\n");
        if ($info_all > $config[info_max]) {
            $i = $info_all - $config[info_max] + 1;
        } else {
            $i = 1;
        }
        for ($i; $i < $info_all; $i++) {
            $info[$i] = trim($info[$i]) . "\n";
            fputs($fp, $info[$i]);
        }
        fputs($fp, "{$time}|{$ip}|{$locality}|{$from}|\n");
        fclose($fp);
    }
    //************************** 显示信息 **************************//
    if ($type == img) {
        $count = $total;
        $len = strlen($count);
        //总访量位数
        if ($len < 7) {
            $rest = 7 - $len;
        } else {
            $rest = 2;
        }
        for ($i = 1; $i <= $rest; $i++) {
            $count = "0" . $count;
            //补足0
        }
        for ($i = 0; $i < strlen($count); $i++) {
            $number = substr($count, $i, 1);
            $images = "<img src='{$config[url]}images/number/{$image}/{$number}.gif' border=0>";
            $show = "{$show}" . "{$images}";
        }
        echo "<A href='{$config[url]}index.php?id={$id}' title='-=BOOM流量统计2.9=-&#10;今日:{$today} | 昨日:{$yesterday}'>{$show}</A>";
    } elseif ($type == move) {
        echo "<table width='88' border='0' cellspacing='1' cellpadding='2' height='31' background='{$config[url]}/images/logo/{$image}.gif'>";
        echo "  <tr height=14><td align='center' valign='top'><marquee scrollDelay='50' scrollAmount='2'>";
        echo "    <a href='{$config[url]}index.php?id={$id}' target=blank style='FONT-FAMILY:Arial, Verdana; font-size: 9pt; color: #ffffff; text-decoration: none'>总访问量:" . $total . " 本月访问:" . $month . " 今日访问:" . $today . "</a></marquee></td></tr>";
        echo "  <tr height=8><td></td></tr></table>";
    } elseif ($type == ico) {
        echo "<A href='{$config[url]}index.php?id={$id}'><IMG src='{$config[url]}/images/ico/{$image}.gif' border=0 title='-=BOOM流量统计2.9=-&#10;今日:{$today} | 昨日:{$yesterday}'></A>";
    } elseif ($type == hide) {
    } else {
        echo "<A href='{$config[url]}index.php?id={$id}' title='-=BOOM流量统计2.9=-&#10;昨日:{$yesterday} | 本月:{$month}'>今日访问:{$today} 总访问量{$total}</A>";
    }
}
Beispiel #3
0
<?php

/*
---------------------------------------------
	BOOM流量统计
                   2.x ——2.9版本数据转换程序

转换完成后一定删除!!!
---------------------------------------------
*/
include "config.php";
$id = file("{$config[dir]}/list.txt");
$id_max = count($id);
for ($i = 0; $i < $id_max; $i++) {
    $id[$i] = trim($id[$i]);
    $info = file_myfun("{$config[dir]}/{$id[$i]}.php");
    $info_max = count($info);
    $fp = fopen("{$config[dir]}/{$id[$i]}.php", w);
    flock($fp, LOCK_EX);
    fputs($fp, trim($info[0]) . "\n");
    for ($ii = 1; $ii < $info_max; $ii++) {
        list($time, $ip, $from) = explode("|", trim($info[$ii]));
        fputs($fp, "{$time}|{$ip}||{$from}|\n");
    }
    fclose($fp);
}
echo "<br><center>数据!转换完成!</center><br>请删除upgrade.php程序";
Beispiel #4
0
        chmod("{$count_file}", 0666);
        fputs($fp, "{$php_code}|0|0|0|0|0|0||||||||{$_SERVER['HTTP_REFERER']}||||||");
        fclose($fp);
        $fp = fopen("{$config['dir']}/list.txt", "a");
        flock($fp, LOCK_EX);
        fputs($fp, "{$id}\n");
        fclose($fp);
    } else {
        echo "document.write('<font color=ff0000>帐号<b>{$id}</b>不存在</font>')";
        exit;
    }
}
$info = file_myfun($count_file);
if (!$info[0]) {
    //数据为0则使用备份数据文件
    $info = file_myfun($count_bak_file);
    $bak = "0";
}
$info_all = count($info);
list(, $yesterday, $today, $month, $total, $all_day, $top_day, $top_day_time, $top_online, $top_online_time, $mode, $time1, $pass, $pagename, $pageurl, $ip1, $bak_num) = explode("|", $info[0]);
$time = time();
if ($bak == "0") {
    $bak_num++;
}
if (!$_COOKIE["STAT_BOOM_{$id}"] or $_COOKIE["STAT_BOOM_{$id}"] != $id) {
    //判断防止刷新
    $yx_time = $time + $config[jgtime];
    setcookie("STAT_BOOM_{$id}", "{$id}", "{$yx_time}", "{$_SERVER['PHP_SELF']}");
    if (date("d", $time1) != date("d", $time)) {
        //判断是否同一天
        $all_day++;