⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cf.php

📁 多用户PHP统计系统 1.统计系统支持多用户申请 2.两种统计模式:1.页面浏览统计 2.独立IP统计 3.两种统计图样:1.统计小图标显示 2.数字样式,共几十种数字样式,还可以自己增加 4
💻 PHP
字号:
<?
@include("myfunction.php");
$action=$_GET["action"];
$tmp=httppath(2);
?>

<?
if($action!="")
{
 @include("conn.php");
 @include("chkstr.php");
 @include("setopen.php");
}
?>

<?
if($action=="")
{
?>
function WriteCookie (cookieName, cookieValue, expiry)
{
var expDate = new Date();
if(expiry)
{
expDate.setTime (expDate.getTime() + expiry);
document.cookie = cookieName + "=" + escape (cookieValue) + "; path=/ expires=" + expDate.toGMTString();
}
else
{
document.cookie = cookieName + "=" + escape (cookieValue);
}
}

function ReadCookie(name){
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0) {
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}

function DeleteCookie(name) {
 var expires = new Date();
 expires.setTime (expires.getTime() - 1);
 WriteCookie( name , "Delete Cookie", expires,null,null,false);
}

 var lfstatcookie=ReadCookie("lfstatcookie");
 if(lfstatcookie=="")
 {
 a=new Date();
 h=a.getHours();
 m=a.getMinutes();
 s=a.getSeconds();
 sparetime=1000*60*60*24*1-(h*3600+m*60+s)*1000-1;
 
 WriteCookie('lfstatcookie',"yes",sparetime);
 }

 var ly=escape(document.referrer);
 var weburl=location.href;
 ly=ly.replace(/\&/g,"|");
 weburl=weburl.replace(/\&/g,"|");
 document.write("<script src=<?echo $tmp;?>cf.php?action=getcount&username=<?echo $_GET["username"];?>&ly=" + ly + "&weburl=" + weburl + "&lfstatcookie=" + lfstatcookie + "></script>");

<?
}
?>

<?
if($action=="getcount")
{
?>

<?
$username=$_GET["username"];
$ly=$_GET["ly"];
if($ly=="") $ly="-";

$ly=str_replace("|","&",$ly);

$weburl=$_GET["weburl"];
$weburl=str_replace("|","&",$weburl);

$lfstatcookie=$_GET["lfstatcookie"];

$lyhead=beakurl($ly);
$ip = $_SERVER['REMOTE_ADDR'];


if(abs(strtotime("now")-strtotime($rsset["lastdeldate"]))>3600*24*1)
{
 $sql="delete from cfstat_ly where TO_DAYS(NOW())-TO_DAYS(adddate)>6";
 mysql_query($sql);

 $sql="delete from cfstat_webcount where TO_DAYS(NOW())-TO_DAYS(adddate)>1";
 mysql_query($sql);
 
 $sql="update cfstat_admin set lastdeldate='".date("Y-m-d")."'";
 mysql_query($sql);
}
  
if($lfstatcookie=="")
{
 $sql="update cfstat_ly set counter=counter+1,ip='$ip',lasttime='".date("Y-m-d H:i:s")."' where username='$username' and lyhead='$lyhead' and TO_DAYS(NOW())-TO_DAYS(adddate)=0";
 mysql_query($sql);
 
 if(mysql_affected_rows()==0)
 {
  $sql="insert into cfstat_ly (username,ip,lyhead,ly,adddate,addtime,lasttime) values ('$username','$ip','$lyhead','$ly','".date("Y-m-d")."','".date("Y-m-d H:i:s")."','".date("Y-m-d H:i:s")."')";
  mysql_query($sql);
 } 
}


 $sql="update cfstat_webcount set counter=counter+1,lasttime='".date("Y-m-d H:i:s")."' where username='$username' and weburl='$weburl' and TO_DAYS(NOW())-TO_DAYS(adddate)=0";
 mysql_query($sql);
 
 if(mysql_affected_rows()==0)
 {
  $sql="insert into cfstat_webcount (username,weburl,adddate,addtime,lasttime) values ('$username','$weburl','".date("Y-m-d")."','".date("Y-m-d H:i:s")."','".date("Y-m-d H:i:s")."')";
  mysql_query($sql);
 }

 if($lfstatcookie=="")
 {
  $sql="update cfstat_day_count set counter=counter+1,ipcounter=ipcounter+1 where username='$username' and TO_DAYS(NOW())-TO_DAYS(adddate)=0";
 }
 else
 {
  $sql="update cfstat_day_count set counter=counter+1 where username='$username' and TO_DAYS(NOW())-TO_DAYS(adddate)=0";
 } 
 mysql_query($sql);

 if(mysql_affected_rows()==0)
 {
  $sql="insert into cfstat_day_count (username,adddate) values ('$username','".date("Y-m-d")."')";
  mysql_query($sql);
 }

if($lfstatcookie=="")
{
 $sql="update cfstat_user set showtotal=showtotal+1,realshowtotal=realshowtotal+1,realiptotal=realiptotal+1 where username='$username'";
 }
else
{
 $sql="update cfstat_user set showtotal=showtotal+1,realshowtotal=realshowtotal+1 where username='$username'";
}
mysql_query($sql);

$sql="select * from cfstat_user where username='$username'";
$result=mysql_query($sql);
$rs=mysql_fetch_array($result);

if($rs["countershow"]==1)
{ 
 echo "document.write('".countercode($rs["style"],8,$rs["showtotal"],$tmp,$rsset["title"])."');";
}
elseif($rs["countershow"]==2)
{
 $mycode="<a href=".$tmp."index.php target=_blank title=".$rsset["title"]."><img src=".$tmp."images/counter.gif border=0></a>";
 echo "document.write('".$mycode."');";
}
elseif($rs["countershow"]==3)
{
 $mycode="<a href=".$tmp."index.php target=_blank title=".$rsset["title"].">&#x7EDF;&#x8BA1;</a>";
 echo "document.write('".$mycode."');";
}
?>

<?
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -