public static function log($type = '', $data = array()) { if (empty($type)) { return zotop::$logs; } if (is_array($type)) { $log = $type; } if (is_string($data)) { $log = array('type' => $type, 'content' => $data); } if (is_array($data)) { $log = array('type' => $type, 'content' => $data); } if (!empty($log) && is_array($log)) { $log = array('type' => $log['type'], 'title' => $log['title'], 'content' => $log['content'], 'description' => $log['description'], 'userid' => zotop::user('id'), 'url' => url::location(), 'createip' => ip::location(), 'createtime' => TIME); zotop::$logs[] = $log; } return zotop::$logs; }