Formatting Posts Using BBCode

PhpBB provides a potent and safe HTML substitute, known as BBCode, so users can format their text (bold, italic, underline, and so on) without exposing your board to the possibility of malicious HTML. BBCode is usable in forum posts, private messages, and signatures (small lines of text registered users can optionally attach to every post). The BBCode system is incredibly powerful and easily customized via phpBB's template engine, which I will discuss in Chapter 12. Table 9-1 outlines the...

Building Blocks

Think of a layout as building blocks or puzzle pieces that you want to fit together in certain ways. PHP allows you to split up your files in this way and include them into the original. Furthermore, WordPress encourages this kind of split in its support for theming. The themes supplied with WordPress are structured this way. So, first you'll break down the theme files into multiple pieces. You will take each of the elements of the header, the main section, the individual sidebars, and so on,...

Choosing Avatar Options

PhpBB offers many options for displaying avatars, as Figure 9-9 illustrates. You can permit users to upload avatars to the server from their hard drives or another web site, or link to avatar images on remote sites. Alternatively, you can provide a gallery of avatars for your users to peruse and select from. You can pick and choose which options you wish to enable by using the Configuration panel in the Administration panel, under the heading Avatar Settings. Permitting users to upload their...

Creating Path Aliases

After you have enabled the Path module, users with the Create URL Aliases permission will have a Path Alias field available to them on all content-creation forms. The Path Alias value must be unique and not contain characters unsuitable for URLs the & and characters in particular should be avoided (the slash, , is fine). When a path has been assigned an alias, users will be able to access the content using that path alias instead of the normal path. For example, creating a blog post may...

Adding a Recent Comments PlugIn

Now you will install another plug-in, which will list a number of the most recent comments to the blog in the sidebar. This is great mechanism to keep your readers interested. It allows them to see which topics are still being discussed, and thus is an added incentive to keep reading those topics and to continue to get involved. Real conversation about a shared interest between your readers is the lifeblood of an active online community. The plug-in is the Customizable Comment Listings plug-in...

Adding Registration and Login Links

Something missing from this template are the links to register and log in to the blog. Most WordPress blogs, being one-person blogs, don't need these links. Many themes don't even bother to include them. For a community blog, you will want to add them to your theme. To the index.php template file, add the code highlighted in bold in Listing 16-7. Listing 16-7. WordPress Template Tags for Registration and Login Links Added to index.php num_items > 10)) > < ul> < h2> < php...

Bayesian Filter

The Bayesian filter learns to detect spam by being shown content that has been identified as spam by the site administrator. The best way to describe this method is to quote Jeremy Andrews, the author of the Spam module. The Bayesian filter does statistical analysis on spam content, learning from spam and non-spam that it sees to determine the likelihood that new content is or is not spam. The filter starts out knowing nothing, and has to be trained every time it makes a mistake. This is done...

Cleaning Comment Spam

If you recall from Chapter 15, I mentioned that WordPress doesn't give you any way to access comments marked as spam. For that, you need a third-party plug-in. Chris J. Davis's Spam Nuker is one such plug-in. Download the Spam Nuker plug-in from http www.chrisjdavis.org 2005 03 05 spam-nuker-151 . Install this as a plug-in on your blog and activate it. Go to WordPress's Manage page, and you will see an extra tab labeled Spam. Click the Spam tab, and you will be presented with a page like the...

Spam Module Permissions

The permissions structure of the Spam module is designed to let you divide your users into roughly three groups those who can decide what content is or is not spam, those who are trustworthy and never create spam, and everyone else who cannot be trusted. The Access Spam Rating and Administer Spam Rating permissions can be given to user roles who will help train the filter and identify spam. When looking at content, they will be able to mark it either as spam or not spam, thus assigning a new...

Monitoring Bandwidth

Bandwidth usage is another limit your hosting service will specify. Strictly speaking, bandwidth is the wrong term to use. Hosting companies usually restrict your monthly data transfer allowance that is, they monitor how much data is transferred from your account each month. Unfortunately, the term bandwidth is so commonly used for this allowance that it has become the way to describe it. If you exceed the allowed bandwidth, several things may happen The hosting company may shut down your site...

Installing the Image Module

Installing the Image module is quite straightforward. Just download the module from http drupal.org project image, place the entire image folder in the modules directory, and activate the module from the admin modules page. If you wish to use the ImageMagick library (http www.imagemagick.org script index.php) for converting and resizing images, you will also need to move the modules image image.imagemagick.inc file into the includes directory of your Drupal installation. If you wish to use the...

Getting Drupal Support

Documentation isn't worth anything if you don't know where to find it, and sometimes all the documentation in the world isn't as useful as being able to ask someone for advice. Knowing where to look and whom to ask will greatly enhance your success and enjoyment as a Drupal site administrator. Not surprisingly, the main resource for Drupal documentation and help is Drupal.org. Here is a quick tour of the most important resources to be found there. Projects Keeping up with the latest releases...

Adding Contributed Modules

One of Drupal's great strengths is the ease with which new functionality can be added in the form of contributed modules. The clear and well-defined hook system (http drupaldocs.org api head group hooks) allows modules to interact with all of the Drupal subsystems, including the user, menu, taxonomy, filtering, and node-handling systems. As a result, more than 350 modules have been contributed to the Concurrent Versions System (CVS) repository at http drupal.org project Modules. The...

Identifying Feeds

The process of configuring your site to act as an aggregator of syndicated content starts with finding the URLs of feeds to which you wish to subscribe. Fortunately, for many sites on the Web, this is as easy as locating the RSS link or icon, right-clicking it, and choosing Copy Link Location. For other sites, including most blogs hosted by Blogger (http blogger.com), the feed URL is embedded in the page source header, and no link or icon is provided. Modern browsers such as Firefox recognize...

Content Type Creation

To create a flexinode type, choose administer > content > content types > add content type (admin node types add_type). The content type name and description that you choose for your new type are analogous to the names and descriptions you can see for existing node types when you click create content (node add). The help text will appear at the top of the form when you or other web users create new instances of the custom node. Use this field to give any special instructions that might be...

Adding Track Back URIs

As well as having links to other blogs in your post, you might also want to add TrackBacks to other posts. If the other blog supports TrackBack, a TrackBack URI will be displayed somewhere on the blog post. Often, this URI is not visible unless just that one posting and its comments are displayed, as shown in Figure 15-4. This is because TrackBacks are meant to add a comment or comment-like entry to that other blog posting. Over the next few weeks I want to increase my morning distance until...

GNULinux Solutions

The part that confuses most people about using cron for your Drupal installation is that the cron program is responsible only for the scheduling. You need a second program to actually call the cron.php file. wget, lynx, and curl are three candidates for this second program, and you are free to choose which one works best for you. You need to configure the program to call the URL of the cron.php file via HTTP It is important to allow the web server to handle the request instead of calling...

Caution The uploaded files are not permanently attached to a node until you click the Submit button

After uploading files as attachments to a node, you must click the Submit button and save the node. Failing to do this will result in the attachments being lost. To delete an attachment from a node, check the box in the Delete column next to the desired file and click Submit. The file will be removed from the node and deleted from the server. The check boxes in the List column control whether a given uploaded file will be visible when the content is being displayed. Most of the time, you will...

Accessing the phpBB Database Abstraction Layer

The database abstraction layer provided by phpBB helps to simplify support for major database systems. PHP has groups of functions, such as mysql_query , that correspond to whichever database type it is accessing. This can prove painful when writing blocks of SQL to support different databases you will not only need to define different SQL which you typically must do in any case , but you will also must implement the query method for each different database system. Undoubtedly, this can prove...

Teasers and the More Tag for Lengthy Articles

If you are writing lengthy articles on your blog, they tend to overpower the front page of your blog. While an article is new enough to still be on the front page, its length will push all the other articles a long way out of the visitors' sight. For example, I added a 700-word article as the newest post on my sample blog. This meant that a visitor would need to scroll down through four screens before the next story was visible. If you had several such articles on your front page, it could...

Poor Mans Cron The Poormanscron Module

For many people, the Poormanscron module is the easiest choice for addressing the cron issue. The module is a snap to install. You just need to move it to the modules directory, activate it, and set some basic configurations, such as how often it should run. When people visit your site, the Poormanscron module triggers the cron tasks, exactly as calling cron.php would do. The main drawback to this approach is that it makes the cron tasks dependent on your site having visitors. This isn't a...

Book Module

The Book module is one of the most useful of all Drupal modules due to its ability to add a high level of structure and organization to the content on your site. Its main function is to maintain a hierarchy of content and to offer a means of ordered navigation between them. These are the familiar previous, next, and up links that you can see at Drupal.org in the handbook for example, at http drupal.org node 22963 . Furthermore, the Book module has a content type of its own, called book pages.

Custom Visibility Settings

The first field on the block configuration page, Custom Visibility Settings, deals with the question of whether authenticated users should be able to customize which blocks are visible to them when they visit the site. The first option, Users cannot control whether or not they see this block, means essentially that the administrator-defined visibility settings are to be honored, and the user will not be given the choice to enable disable this block. The other two options, Show this block by...

Roles and Permissions

Drupal strives to offer fine-grained control over the access of content and the execution of actions. It is important that you, the site administrator, can decide exactly what each user is able to see and do on the site. To support this, all users are assigned roles and permissions. A role describes a profile or use case for a user or group of users. For example, you may have roles named Moderator, Editor, and Admin. Two roles are defined by Drupal by default The Anonymous User role is assigned...

Exercise 21 Block Offensive Usernames

Suppose you want to block all usernames that contain the text bad word. 1. Create a new rule by selecting access control gt account rules gt add rule admin access rules add . 2. Select Deny and Username, and then enter the mask bad word , as shown in Figure 2-3. permissions roles account rules list add rule check rules Matches any number of characters, even zero characters, _ Matches exactly one character. 3. Click the Add Rule button. Your rule is now in effect. 4. To test it and make sure it...

Configuring Site Settings

To begin configuring Drupal, make sure that you are logged in as the administrator the account that you created in Chapter 1 , and then select administer gt settings in the navigation block to get to the site settings page the URL to the page is When you access the site settings page, Drupal takes the opportunity to check some aspects of your installation in order to help you avoid problems. Because of this, you may be confronted with one or more messages when you access this page for the first...

Creating Drupal Content

In Drupal, there is a concept of a front page, which will be the page shown whenever your site is accessed with the value that you gave as the base_url, with no further path information. At the moment, with your freshly installed Drupal site that has no content, this front page will show the following message Welcome to your new Drupal-powered website. This message will guide you through your first steps with Drupal, and will disappear once you have posted your first piece of content. As it...

Contents at a Glance

About the About the Technical CHAPTER 1 Introducing CHAPTER 2 Configuring CHAPTER 3 Using the Drupal Core CHAPTER 4 Adding Contributed CHAPTER 5 Adding and Customizing CHAPTER 6 Maintaining Your CHAPTER 7 Introducing CHAPTER 8 Installing and Configuring CHAPTER 9 Touring phpBB's CHAPTER 10 Securing and Maintaining CHAPTER 11 Modifying CHAPTER 12 Styling CHAPTER 13 Introducing CHAPTER 14 Installing and Configuring CHAPTER 15 Starting to Blog and Building Your Community 401 CHAPTER 16 Changing...