示例#1
0
$allowed = array('home', 'forum', 'topic', 'post_topic', 'post_reply', 'edit_reply');
//Check for notifications
if ($pageName != 'notification' and $NOTIFICATIONS->Check()) {
    //append the current page URL to the first notification for return
    if ($NOTIFICATIONS->AppendUrlToFirst()) {
        //Go to the notifications page
        $NOTIFICATIONS->Launch();
    }
}
//Moving this to the page itself
//$CORE->LoadHeader();
if (in_array($pageName, $allowed)) {
    if (!file_exists($config['RootPath'] . '/template/forums/pages/' . $pageName . '.php')) {
        echo 'Error: The page file is missing.';
    } else {
        //Load my forum base module
        $CORE->load_CoreModule('forums.base');
        //load the page
        include_once $config['RootPath'] . '/template/forums/pages/' . $pageName . '.php';
    }
} else {
    echo 'Error: Page not allowed.';
}
//Moving this to the page itself
//$CORE->LoadFooter();
//free up some memory
unset($allowed);
unset($pageName);
//Run a complete shutdown
Shutdown::Execute();
exit;
示例#2
0
 /**
  ** triggerSuccess, parameters must be setup by onSuccess() function
  **
  ** Parameters:
  ** ------------------------------------------------------------------------------------------------------------
  ** $key (optional) 	- The key for witch the success should be triggerd, if none specifed current will be used
  **
  ** Returns:
  ** ------------------------------------------------------------------------------------------------------------
  ** success 	- Returns nothing
  ** error	- Returns echos error string and returns false
  **
  **/
 public function triggerSuccess($key = false)
 {
     global $config;
     if (!$key) {
         $key = $this->currentMultipleError;
     }
     if (isset($this->success[$key])) {
         //save the success message
         $_SESSION['multipleErrors' . $key . '_success'] = $this->success[$key]['message'];
         //call the shutdown
         Shutdown::Execute();
         //redirect
         header("Location: " . $config['BaseURL'] . $this->success[$key]['redirect']);
         exit;
     } else {
         echo '<br> triggerError() has no record with key: ' . $key . '.<br>';
         return false;
     }
 }