XtGem Forum catalog
VipPrao.Wap.Sh
HomeMp3PCForum
02:51:1815/11/2019
₪ Quảng Cáo
+ Tags cloud - Seo for wap
wWw.Facebook.Com/ VipPrao.Wap.Sh

Người dùng online trong 30 phút cuối

<?php

$dataFile = "visitors.txt";

$sessionTime = 30; //this is the time in **minutes** to consider someone online before removing them from our file

//Please do not edit bellow this line

error_reporting(E_ERROR | E_PARSE);

if(!file_exists($dataFile)) {

$fp = fopen($dataFile, "w+");

fclose($fp);

}

$ip = $_SERVER['REMOTE_ADDR'];

$users = array();

$onusers = array();

//getting

$fp = fopen($dataFile, "r");

flock($fp, LOCK_SH);

while(!feof($fp)) {

$users[] = rtrim(fgets($fp, 32));

}

flock($fp, LOCK_UN);

fclose($fp);

//cleaning

$x = 0;

$alreadyIn = FALSE;

foreach($users as $key => $data) {

list( , $lastvisit) = explode("|", $data);

if(time() - $lastvisit >= $sessionTime * 60) {

$users[$x] = "";

} else {

if(strpos($data, $ip) !== FALSE) {

$alreadyIn = TRUE;

$users[$x] = "$ip|" . time(); //updating

}

}

$x++;

}

if($alreadyIn == FALSE) {

$users[] = "$ip|" . time();

}

//writing

$fp = fopen($dataFile, "w+");

flock($fp, LOCK_EX);

$i = 0;

foreach($users as $single) {

if($single != "") {

fwrite($fp, $single . "\r

");

$i++;

}

}

flock($fp, LOCK_UN);

fclose($fp);

if($uo_keepquiet != TRUE) {

echo '<div style="padding:5px; margin:auto; background-color:#fff"><b>' . $i . ' online in last 30 minutes</b></div>';

}

?>

Copy code:
Tags cloud VipPrao
share code chong copy trang wap xtgem totGia lap xem giao dien wap tren nhieu dong mobile bang Google ChromeShare full code zip index tet trung thu depCode tao logo in tren lon nuoc ngot Coca-ColaTool tao logo Coca-Cola html php
1234...107108109»
Tag: >
₪ THỐNG KÊ
Đang online: 10 online
Hôm nay: 2 [+5]
Trong tháng: 6
Tổng cộng: [+ 1019]
Design by
© Copyright 2014 VipPrao
ThankToXtgem.Com
All Right Reserved
DMCA SiteMap.html | SiteMap.xml | SiteMap.xml.gz | Ror.xml | UrlList.txt | Google+