/*********************************************************** Online plug-in v.1.07 by Amir http://www.sima.spb.ru ***********************************************************/ $time = time(); function gonline() { GLOBAL $su, $pth, $plugin_tx,$plugin_cf,$_SERVER,$ip,$time; $ip = $_SERVER['REMOTE_ADDR']; $plugin=basename(dirname(__FILE__),"/"); $minutes = $plugin_cf['online']['period_considered_active']; $found = 0; $users = 0; $user = ""; $tmpdata = $pth['folder']['plugins'].$plugin."/data/online.txt"; if(!is_file($tmpdata)) { $handle = fopen($tmpdata, "w"); fclose($handle); chmod($tmpdata,0666); } $f = fopen($tmpdata, "r+"); flock($f,2); while (!feof($f)) { $user[] = chop(fgets($f,65536)); } fseek($f,0,SEEK_SET); ftruncate($f,0); foreach ($user as $line) { list($savedip,$savedtime) = split("\|",$line); if ($savedip == $ip) {$savedtime = $time;$found = 1;} if ($time < $savedtime + ($minutes * 60)) { fputs($f,"$savedip|$savedtime\n"); $users = $users + 1; } } if ($found == 0) { fputs($f,"$ip|$time\n"); $users = $users + 1; } fclose ($f); $o.="
"; if ($users==1){ $o.=$plugin_tx['online']['first_part_singular']; $o.=" " . $users . " "; $o.= $plugin_tx['online']['last_part_singular']; } else { $o.=$plugin_tx['online']['first_part_plural']; $o.=" " . $users . " "; $o.= $plugin_tx['online']['last_part_plural']; } $o.="
"; return $o; } ?>CMSimple_XH 1.4 Jan. 19. 2011 Build: 2011011801
based on: CMSimple version 3.3 - December 31. 2009
Many Thanks to Peter Andreas Harteg for providing CMSimple as free Open Source Software under the GPL3 licence since 2010:
"From December 31. 2009 CMSimple is released under the GPL 3 licence with no link requirements."
But please note:
"You may not remove copyright information from the files, and any modifications will fall under the copyleft conditions in the GPL 3."
Congratulations on your new installation of CMSimple_XH.
Default login is 'test' ('admin'/'test' if security type is wwwaut)
Remember to change login under settings.
Please read about File permissions and Security issues in the FAQ-section of www.cmsimple-xh.de.
Powered by CMSimple_XH | сделано: sima | вход