public function __construct() { parent::__construct(); // Config Application instance. $this->site = array(DOMAIN => 'http://' . $_SERVER['HTTP_HOST'] . '/', ROOT => $_SERVER['DOCUMENT_ROOT'] . '/', STORE => 'file_store', COM => 'facebook/component/', MOD => 'facebook/module/', APP => 'http://apps.facebook.com/hakkomew/', IFRAME => 'http://' . $_SERVER['HTTP_HOST'] . '/facebook/module/iframe/'); //Set Default Component if (!isset($_GET['component'])) { $_GET['component'] = 'frontpage'; } //Query ID Position foreach (parent::ViewTable('position', 0) as $pos) { $this->idPosition[$pos['name']] = $pos['pos_id']; } //Query ID Component $this->idComponent = parent::GetValue('com_id', 'component', 'name', $_GET['component']); //Online User $user = self::Facebook('/me'); if ($user['session']) { if (!isset($_GET['manga'])) { $this->Update('user_online', 'mag_id', 0, 'uid', $user['session']['uid']); } $delWhere = parent::GetValue('expires', 'user_online', 'uid', $user['session']['uid']) . '<' . $_SERVER['REQUEST_TIME']; $this->Delete('user_online', $delWhere); if (parent::CountRow('user_online', 'uid', $user['session']['uid']) < 1) { $this->Insert('user_online', array('expires', 'uid'), array($user['session']['expires'], $user['session']['uid'])); } } else { // Guest User. echo '<iframe src="' . $this->site[IFRAME] . 'guest_cookie.php" frameborder="0" style="width:0px; height:0px;"></iframe>'; } }