Advertisement
joachip

Typical phpBB 3.x page including header and footer

Mar 3rd, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2. // phpBB initialization
  3. define('IN_PHPBB', true);
  4. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  5. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  6. include($phpbb_root_path . 'common.' . $phpEx);
  7. $user->session_begin();
  8. $auth->acl($user->data);
  9. $user->setup();
  10.  
  11. // require user to be logged in
  12. if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
  13. {
  14.     if ($user->data['user_id'] != ANONYMOUS)
  15.     {
  16.         trigger_error('NO_VIEW_USERS');
  17.     }
  18.  
  19.     login_box('', ((isset($user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)])) ? $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)] : $user->lang['LOGIN_EXPLAIN_MEMBERLIST']));
  20. }
  21.  
  22. // here we build the actual contents
  23. $title = 'Hello '.$user->data['username'];
  24. $body = 'You are user number '.$user->data['user_id'];
  25.  
  26. // finally put them into a standard page template
  27. $template->assign_vars(array('MESSAGE_TITLE' => $title, 'MESSAGE_TEXT' => $body));
  28. page_header($title, false);
  29. $template->set_filenames(array('body' => 'message_body.html'));
  30. page_footer();
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement