Archive for November, 2007

350 CHAPTER 12 STYLING PHPBB Table 12-1.

Saturday, November 10th, 2007

350 CHAPTER 12 STYLING PHPBB Table 12-1. subSilver Theme Content Files File Description agreement.tpl bbcode.tpl confirm_body.tpl error_body.tpl faq_body.tpl groupcp_info_body.tpl groupcp_pending_info.tpl groupcp_user_body.tpl index_body.tpl jumpbox.tpl login_body.tpl memberlist_body.tpl modcp_body.tpl modcp_move.tpl modcp_split.tpl modcp_viewip.tpl overall_footer.tpl overall_header.tpl posting_body.tpl posting_poll_body.tpl posting_preview.tpl posting_smilies.tpl posting_topic_review.tpl privmsgs_body.tpl Template file containing the HTML layout of the user agreement, shown when a user registers for the forum Template file containing the HTML that is substituted for BBCode in posts A yes or no form shown when phpBB needs user input on an action before it can continue (such as when deleting a post) Template file containing the HTML for noncritical error messages displayed by phpBB Template file containing the HTML for the FAQ list Template file containing the HTML that displays information about a user group Template file containing the HTML that displays a list of pending group memberships Template file containing the HTML showing a user s group membership details Template file that provides the HTML for the Forum Index page A template snippet that contains the HTML for the forum jumpbox located in the bottom-right corner of most pages in phpBB Template file for the login form Template file for the Memberlist page Template file for the first page of the Moderator Control Panel, where topics are listed Template file for the form that permits a moderator to move topics to another forum Template file for the form that permits a moderator to split a topic into two separate topics Template file that provides the view for the IP management utility Template file for the main footer used on most pages in phpBB, which provides the copyright date and a link to the Administration panel (if applicable), and closes the page Template file for the main header used on most pages in phpBB, which provides the opening of the HTML page, style sheet information, meta tags, the Mozilla navigation bar, the site title and slogan, and other navigational aids Template file used to create the posting and private message sending form Template file that provides the interface for creating a poll Template file that provides the interface for previewing posts Template file that provides the expanded view of all available emoticons Template file that generates the topic review frame on the posting page Template file that generates the folder view for private messages
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

CHAPTER 12 STYLING PHPBB (Web server info) 349 they are

Friday, November 9th, 2007

CHAPTER 12 STYLING PHPBB 349 they are familiar with other phpBB-based boards. Finally, modifying the default theme helps you avoid a sticky mess involving other template authors who may or may not wish for you to use their work as a base. Caution If you are tempted to use FrontPage or another WYSIWYG HTML editor, resist at all costs! You run the risk of introducing a great deal of incompatible code. Additionally, these editors may try to reformat (and ultimately destroy) the .tpl files, which are not full HTML files, but rather snippets of HTML that phpBB s engine pieces together to build full pages. Avoiding WYSIWYG editors for special projects such as a phpBB template is always a smart move, as they just don t know how to handle these files. Stick with a text editor like EditPlus (http://www.editplus.com), and you won t go astray. Working with phpBB s Template System Before you begin creating or modifying a theme, you need to understand how phpBB uses templates. phpBB s styling system involves two components: The template engine does the work of putting together output from the phpBB script and individual template files (typically a header, body, and footer) to create the HTML pages you see while browsing your board. The style system operates from the database and, if your template is designed for it, permits you to use different color schemes and style sheets with the same template on the fly, without necessarily editing the template directly. Note When I refer to templates, I m talking about the physical files that make up a template set. When I refer to styles, I m talking about the color schemes retrieved from the phpBB database that can be applied to individual templates. The combination of templates and styles are generally known in phpBB lore as a theme. As you delve into the phpBB template code, you ll find the flexibility of the template system to work to your advantage, and you ll also find that it isn t much harder to work on a template than it is to create a static HTML page. Theme Files A full theme consists of its template files, style sheets (if needed), graphics, and theme configuration file. Table 12-1 lists the template files that come packaged with the subSilver template (.tpland .css files), which is the basis for the customizations I ll describe in this chapter. Note You will not be doing any work with the files in the templates/theme/admin directory in this chapter. You will not commonly want to modify those, although it is theoretically possible, because making changes to your administrative templates puts you at risk of rendering your Administration panel inaccessible.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Web hosting providers - 348 CHAPTER 12 STYLING PHPBB phpBBStyles.com: The

Thursday, November 8th, 2007

348 CHAPTER 12 STYLING PHPBB phpBBStyles.com: The greatest asset of this site (http://www.phpbbstyles.com) is the way it presents its demonstrations of styles. It uses a top frame with a drop-down list, which automatically switches the bottom frame to a preview of the style you ve selected. You can then jump from that page to download the selected theme. phpBBStyles.com also offers some modifications, as well as a lively community largely devoted to customizing phpBB. Just because you download a theme from the Internet doesn t mean you can t modify it. In fact, you re encouraged to personalize it in many cases! The next section explains how to do just that. If you don t feel that adventurous, that s okay, too. Feel free to skip ahead to the Installing and Using Your Themes section to learn how to install your theme into your phpBB database and then apply it to your site. Creating and Modifying Themes If you don t like the templates and styles available on the Internet, or you wish to integrate phpBB with the look of your web site, you ll need to create your own theme or modify an existing one. By creating your own themes, you are totally in the driver s seat as to how you want your board to look. I ll tell you up front that working on a template for phpBB is serious business. Depending on how much you wish to customize your template, you may find that it requires as little as a couple days or as long as a month (or more!) to get the theme the way you want it. Like most projects, some parts of templating can be quite tedious, but your hard work will most certainly be worth it in the end. Caution You ll want to make sure your HTML and Cascading Style Sheet (CSS) skills are up to snuff before you begin working with phpBB templates. phpBB 2.0 templates, by default, make liberal use of style sheets and somewhat advanced HTML to generate pages. Putting in the extra effort to integrate phpBB with your web site will score major points with your visitors. A seamless integration of phpBB with the rest of your site gives your board an extremely professional appearance and establishes continuity, so people will remain familiar with your board s navigation as it relates to the rest of your web site. The results will show that you put a lot of time and energy into what you do, and that you take pride in it. Additionally, do you want to be just another one of the many phpBB boards out there running the default subSilver theme? Making your community stand out captures your visitors interest, and they ll be more likely to come back for more. In this section, I m going to run with the assumption that you are shooting for an integrated look for your site. It s the course of action I recommend, as continuity goes a long way toward keeping visitors comfortable with your site s layout. This section is also based on modifying subSilver. When you re working on your themes, I strongly suggest using the default subSilver style as your base. subSilver is well tested, actively developed, and well supported in the community. It contains implementations of all the pertinent template variables, and has plenty of documentation. You can do as little or as much to it as you want. Because subSilver is the default phpBB theme, having some continuity between it and your custom skin will help users adjust to your community more quickly, especially if
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Web hosting comparison - Styling phpBB CHAPTER 1 2

Wednesday, November 7th, 2007

Styling phpBB CHAPTER 1 2 Let s face it, making your board stand out from the crowd is the best way to attract people to your community. The first thing people will notice about your board is not the amount of hacks you have installed or the organization of your forums it s how the board looks on their screen. You get only one chance to make a first impression, so why not do it with some style? When you start to make decisions about the styling of your phpBB installation, you want to weigh your options and circumstances carefully. Is this a professional project? In that case, you ll probably want to bypass acquiring your themes from the Internet and just dive into the code for a slick, integrated look with your site. On the other hand, perhaps your phpBB board will stand alone from any other site, and just be a hobbyist project. In that case, you might want to download a theme that catches your eye, customize it a bit, and install it. It all boils down to just how much work you really want to do. This, the final chapter in this part about phpBB, will take you through the process of styling your board. You ll learn how to obtain and install predefined styles for your phpBB installation, as well as how to create your own templates and styles if you so desire. Acquiring Themes Many sites in the phpBB community offer prefabricated themes free for downloading. These themes range from simplistic to elaborate, and everything in between. If you don t have the time to do customizations or are unfamiliar with HTML and CSS coding, consider downloading and installing a theme package. While I heartily recommend going for the gusto and giving your phpBB board a full styling treatment, complete with integration with the rest of your web site, operating with a downloaded theme is still better than running with the stock subSilver look. Finding themes for phpBB is just as easy as finding modifications for it. In fact, a lot of the same sites that offer modifications also offer themes for free download. Some of these sites may be quite familiar to you, especially after Chapter 11. Here are three sources that I recommend: phpBB.com Styles: At this site (http://www.phpbb.com/styles/), you can find and get demos of more than 100 categorized styles, and it also has support forums. Additionally, you can find documentation for creating your own styles and a full listing of the default template variables phpBB offers (discussed in the next section). phpBBHacks.com Templates: This site (http://www.phpbbhacks.com/templates.php) also offers a copious number of templates available for download, with support included. You can also use phpBBHacks.com to acquire graphics for your forums, such as rank images.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Web site optimization - 346 CHAPTER 11 MODIFYING PHPBB Looking Ahead

Wednesday, November 7th, 2007

346 CHAPTER 11 MODIFYING PHPBB Looking Ahead to phpBB 3.0 Modifications For the truly adventurous, this section examines some of the underlying changes in phpBB 3.0 that will affect the way modifications are written in the future. phpBB version 3.0 will contain a number of programming changes that will make it even easier for people to modify the board. While the mechanics of installing modifications are not expected to change, creating modifications will be a bit different. Caution This section s contents are based on a prerelease version of phpBB 3.0. The objects I briefly describe here have not been finalized yet and should be considered subject to change as of this writing. As phpBB evolves, the aim is to make the code simpler to understand, not harder. You will find that phpBB 3.0 s source code is even more thoroughly documented than phpBB 2.0. Additionally, the framework is being put in place to support PHPDoc-style documentation, which generates HTML pages that explain how methods work, why they exist, and how to access them. This will permit easily updated and accessible developer documentation, making hacking phpBB easier than ever. Another change is that phpBB 3.0 places users and permissions into their own objects. Previously, phpBB 2.0 provided the get_userdata() function as a way to retrieve user information from the database. In phpBB 3.0, you will use a userobject, similar to how you manipulate the database and template engine in the phpBB 2.0 world. This will make working with user data a lot more sensible and more encapsulated. Plus, userobjects help as the programming front end to the advanced authentication plug-ins that phpBB 3.0 will provide. Similarly, phpBB 3.0 will provide authentication and permissions information in an auth object. You will be able to retrieve all permissions information using an auth object, as well as access control lists for users and other items in the phpBB system. The auth object also provides phpBB s login services. Finally, phpBB 3.0 will also work with sessions as objects, which will constitute a far more structured version of the phpBB 2.0 sessions system. You will have more flexibility with this system, compared to version 2.0. Sessions were a sticking point for a lot of budding programmers in phpBB 2.0, and having a session object (as it will be called in code) consolidates the functionality and makes it much easier to access and understand. On a related note, changes in the session system will permit you to forego the infamous append_sid()function, which plagues phpBB 2.0 hackers everywhere. Summary We re almost to the finish line for this part of the book. You ve installed, configured, secured, and modified your phpBB installation. A truly great phpBB typically does not come clad in subSilver, however. Chapter 12 will take you through adding a touch of style to your community, helping to set it apart from the rest.
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Web design tools - CHAPTER 11 MODIFYING PHPBB 345 # #—–[

Monday, November 5th, 2007

CHAPTER 11 MODIFYING PHPBB 345 # #—–[ SAVE/CLOSE ALL FILES ]—————————————– # # EoM While this example is a bit simplistic, it is fairly straightforward to follow, and it gives you a general idea of how the standard template operates. You fill in the appropriate header information (including your name and contact information, which is important). You then get started with the modification proper. Use the OPEN directive to instruct the user to open the file. Always make sure you provide a good reference point for the user to find when giving instructions. Do not use line numbers, as they are subject to serious change between versions of phpBB or due to other modifications. If the same line appears in the same place throughout the file, give a few surrounding lines for the user to find in addition to that line, but don t give the user too much to look for. Finding the right balance between brevity and context is important. At the end of the modification, make sure you instruct the user to save and close all files, as a good reminder. Be sure to have a look around the Web to see how others template their phpBB hacks, as they can also provide a good guide to how to do it. Now that you ve templated your hack instructions, it s time to start getting people to test your hack to make sure it s fit for release. Beta Testing Hacks When creating a hack designed for public consumption, letting the public test your hack and give feedback is a solid step toward releasing a robust modification. Many of the hacks-oriented sites on the Internet provide a forum for you to release your hacks for testing purposes and permit you to receive feedback. phpBB.com and phpBBHacks.comboth provide forums for testing hacks in development. Use these forums to your advantage, as they are there to help. You will get valuable insight on your work from seasoned phpBB hackers, who have been there and done that. Plus, you can offer advice to others as you learn. Again, you have this tight community available to assist you, so take advantage! Submitting Your Finished Work When you have retraced the steps for your hack in the template, packaged them into a file, tested it, revised it, and tested it again, feel free to submit it to the various hack sites. The official phpBB site is a little more stringent with their submission requirements; use its modification validator tool at http://www.phpbb.com/mods/to make sure your hack is up to snuff. Since you will have beta tested it extensively (I hope!), the hack should have no problem being accepted and used around the Internet. After submitting your work and getting it accepted, make sure you make yourself available for support. This helps your public image, and also helps you further perfect your work. The better you support and keep your hack maintained, the more likely it will be adopted. If you like phpBB hacking, feel free to create more modifications! Most hack authors have several different modifications to choose from, and they gain quite a bit of notoriety doing so (and who knows where that could lead?).
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Web site designers - 344 CHAPTER 11 MODIFYING PHPBB Listing 11-8.

Sunday, November 4th, 2007

344 CHAPTER 11 MODIFYING PHPBB Listing 11-8. Using the phpBB Hack Template ############################################################## ## MOD Title: Change Some Language Strings ## MOD Author: Jared Smith (foo@jaredwsmith.com) ## MOD Description: Edits some language strings in lang_main. ## MOD Version: 1.0 ## ## Installation Level: Easy ## Installation Time: 3 Minutes ## Files To Edit: 1 ## language/lang_english/lang_main.php ## Included Files: N/A ############################################################## ## Author Notes: This hack is basically useless, but proves ## a point fairly easily. ## ############################################################## ## This MOD is released under the GPL License. ## Intellectual Property is retained by the MOD Author(s) listed above ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All ## Files Related To This MOD ############################################################## # #—–[ OPEN ]—————————————– # language/lang_english/lang_main.php # #—–[ FIND ]—————————————– # $lang[’Register’] = ‘Register’; # #—–[ REPLACE WITH ]———————————– # $lang[’Register’] = ‘Sign Up’; # #—–[ FIND ]——————————————- # $lang[’Too_many_registers’] = ‘You have made too many registration attempts.. Please try again later.’; # #—–[ AFTER, ADD ]——————————————- # $lang[’Registration_required’] = ‘Registration is required to use this board.’;
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Web hosting colocation - CHAPTER 11 MODIFYING PHPBB 343 Listing 11-7

Saturday, November 3rd, 2007

CHAPTER 11 MODIFYING PHPBB 343 Listing 11-7 shows an example of using message_die(), excerpted from viewtopic.php. Listing 11-7. Using message_die, from viewtopic.php sql_query($sql)) ) { message_die(GENERAL_ERROR, “Could not obtain topic information”, ‘’,. __LINE__, __FILE__, $sql); } . . . ?> In Listing 11-7, viewtopic.phpis trying to perform the first part of the query to the database. If this step fails, phpBB produces a General Error message, which notifies the user that topic information could not be identified, and gives the line of the file in which it failed, as well as the offending SQL statement. This permits the user to give debugging information to the developer. I recommend copious output of details in your error messages, as this can be of immense help to you as you work through creating your modifications, particularly if they are relatively large. Releasing Your Modifications to the Community An open-source community is only as successful as the quality of contributions it receives. While it is ultimately your call, I strongly encourage you to release any original modifications you make to the phpBB community at large. With your modifications released to the community, you help to cultivate the evolution of phpBB even further. Your work can receive criticism and enhancement. Plus, you never know when one of your features may be adopted in a future release! Here, I will give some pointers on how to release your modification to the community at large. Using the Hack Template The phpBB Group offers a hack template, which encourages consistency in each hack s installation instructions. You more than likely have noticed this template in the hacks you have browsed and installed. The consistency goes a long way toward opening the hack community to more and more people. Listing 11-8 shows an example of a hack documented with the template. This hack will lead you through making two small modifications to the lang_main.php file for the English language pack.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

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

Friday, November 2nd, 2007

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.

Mac os x web server - CHAPTER 11 MODIFYING PHPBB 341 The

Thursday, November 1st, 2007

CHAPTER 11 MODIFYING PHPBB 341 The level of authorization to check The forum ID to check authorization on A handle to the user s data (obtained via get_userdata()) The forum object on which to check access control lists (if necessary) If the permission is granted, auth()returns true; if not, it returns false. Table 11-5 lists the possible auth() values that you can check. Table 11-5. Available auth() Values Value Explanation AUTH_VIEW Checks if the user is able to view the object (topic, forum, and so on) AUTH_READ Checks if the user is able to view and read the object in question AUTH_POST Checks if the user is able to make new topics in the forum in question AUTH_REPLY Checks if the user is able to reply to posts in the forum in question AUTH_EDIT Checks if the user is able to edit posts in the forum in question AUTH_DELETE Checks if the user can delete posts in the forum in question AUTH_ANNOUNCE Checks if the user is permitted to post announcements in the forum in question AUTH_STICKY Checks if the user is permitted to post sticky topics in the forum in question AUTH_POLLCREATE Checks if the user is permitted to create polls in the forum in question AUTH_VOTE Checks if the user is able to vote in polls in the forum in question AUTH_ALL Returns all auth()values in an array, permitting you to pick and choose between multiple authorization levels if needed For example, Listing 11-6, which comes from viewtopic.php, gives an example of phpBB checking permissions on a topic. Listing 11-6. Using auth() to Check Topic Permissions, from viewtopic.php // // Start auth check // $is_auth = array(); $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data); if( !$is_auth[’auth_view’] || !$is_auth[’auth_read’] ) { if ( !$userdata[’session_logged_in’] ) { $redirect = ( isset($post_id) ) ? POST_POST_URL . “=:. $post_id” POST_TOPIC_URL . “=$topic_id”; $redirect .= ( isset($start) ) ? “&start=$start” : ‘’; redirect(append_sid(”login.$phpEx?redirect=. viewtopic.$phpEx&$redirect”, true)); }
In case you need quality webspace to host and run your web applications, try our personal web hosting services.