# # INITIALIZE THE MESSAGE QUEUE # if (!isset($_SESSION['_message_queue']) || !is_array($_SESSION['_message_queue'])) { $_SESSION['_message_queue'] = array(); } if (isset($REFERRER) && !isset($_SESSION['_message_queue'][$REFERRER])) { $_SESSION['_message_queue'][$REFERRER] = array(); } # # DISPATCH # if (isset($PARAMS['action']) && function_exists('action_' . $PARAMS['action'])) { echo call_user_func('action_' . $PARAMS['action']); } else { echo action_pull(); } # # FINISH # session_write_close(); # # HELPERS # function is_assoc($php_val) { return is_array($php_val) && array_keys($php_val) !== range(0, sizeof($php_val) - 1); } function is_session_id($php_val) { return strlen($php_val) == strlen(session_id());
# $_SESSION['client_agent'] = $_SERVER['HTTP_USER_AGENT']; $_SESSION['client_address'] = $_SERVER['REMOTE_ADDR']; if (!is_array($_SESSION['client_queue'])) { $_SESSION['client_queue'] = array(); } if (isset($_SERVER['HTTP_REFERRER']) && !isset($_SESSION['client_queue'][$_SERVER['HTTP_REFERRER']])) { $_SESSION['client_queue'][$_SERVER['HTTP_REFERRER']] = array(); } # # DISPATCH # if (isset($_GET['action']) && function_exists('action_' . $_GET['action'])) { call_user_func('action_' . $_GET['action']); } else { action_pull(); } # # FINISH # session_write_close(); # # SESSION_MANAGEMENT # function _session_open($path, $session_name) { $_path = dirname(__FILE__) . '/' . $path; if (!is_dir($_path)) { mkdir($_path); } return true;