public function useraction() { $time = isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : time(); isset($_COOKIE['useraction']) && !empty($_COOKIE['useraction']) && ($cookiestr = $_COOKIE['useraction']); $ipstr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $ip = !empty($ipstr) ? ip2long($ipstr) : 0; $cookiearr = !empty($cookiestr) ? $this->decrypt_cookie($cookiestr) : array(); if (!empty($cookiearr)) { $tmp = $time - intval($cookiearr['time']); if ($tmp > 3600) { misc::set_cookie('useraction', '', $time + 3600, '/', TRUE); } else { $cookiearr['clicknum'] = $cookiearr['clicknum'] + 1; return $this->encrypt_cookie($cookiearr); } } else { $cookiearrb = array('cookiestr' => 'kaoder', 'clicknum' => 1, 'time' => $time, 'ip' => $ip); return $this->encrypt_cookie($cookiearrb); } }