342 CHAPTER 11 MODIFYING PHPBB $message = (My space web page)

342 CHAPTER 11 MODIFYING PHPBB $message = ( !$is_auth[’auth_view’] ) ? . $lang[’Topic_post_not_exist’] : sprintf($lang[’Sorry_auth_read’], . $is_auth[’auth_read_type’]); message_die(GENERAL_MESSAGE, $message); } // // End auth check // In Listing 11-6, the first two lines do predefined queries to the database to see what kind of authorization level is available for the objects requested. In this case, the queries are sending the ID number of the forum you are in (as it corresponds to the database), the $userdata variable containing all pertinent information about the current user (logged in or anonymous), and additional information about the data in the topic (such as the topic s database ID number, so it can determine if the topic is locked, for example). Next, the script checks to see if the current user s permissions permit the user to read or view topics in the forum. If one of these checks fails, phpBB then looks to see if a session is logged in on the computer. If this is the case, phpBB spits out an Access Denied error message and ends the script. If not, phpBB will redirect the user to the login screen, where the user has the opportunity to enter the username and password of a user with proper permissions to the forum. Giving Feedback to Your Users When Something Goes Wrong phpBB permits you to give feedback to your users via the message_die() function. It enables you to display a message to the user and then abort processing. It is useful for reporting failure conditions or other problems to the user, such as failed password validation or the user being banned. The function takes six parameters: Any of four constants: GENERAL_MESSAGE, used to display a message that may convey a noncritical error or failure GENERAL_ERROR, used for errors that occur in your pages CRITICAL_MESSAGE, typically used when the system has basic configuration loaded but is unable to reach a session (this is used for banned users, for example) CRITICAL_ERROR, when phpBB is encountering serious problems (database connectivity failures, for example) Message text, which should explain the situation that caused the error message A message title, which summarizes the situation (such as Critical Error, Banned User, or Warning) Optionally, the line an error occurred on, if necessary, for debugging purposes Optionally, the file the error occurred in, if necessary, for debugging purposes Optionally, the SQL statement that may have triggered the error, if necessary, for debugging purposes
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Leave a Reply