#!/usr/local/bin/php -q $previous_user_timestamp) $current_user_count = $current_user_count + 1; } // Write out the latest timestamp but not if it is empty if (!empty($timestamp)) { $fd = @fopen($tmpfile, "w"); if ($fd) { fwrite($fd, $timestamp); } @fclose($fd); } /* If $timestamp is less than or equal to previous_user_timestamp return 0, * as we only want the 'X' number of users logged in since last RRD poll. */ if($timestamp <= $previous_user_timestamp) $result = 0; else { $result = $current_user_count; } } else $result = $no_users; echo "$result"; ?>