Installing Updates
All the permissions in the world won't help you if your board has a flaw in its security, which could let Joe Hacker simply slip past those permissions Fortunately, the phpBB Group regularly publishes updated versions of phpBB that contain security and other bug fixes. Keeping up with these updates, as tedious as it may be especially if Chapter 11 inspires you to install a ton of modifications , is quite important, as updates have been known to be released in rapid succession. While installing...
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...
Accessing the Drupal Site
To access the Drupal site, open your browser and navigate to the value that you set for the base_url. If you've done everything correctly, you'll see the screen shown in Figure 1-1. Welcome to your new Drupal-powered website. This message will guide you through your first steps with Drupalj and will disappear once you have posted your first piece of content. Welcome to your new Drupal-powered website. This message will guide you through your first steps with Drupalj and will disappear once you...
Organic Groups Module
One of the hallmarks of vibrant online communities is the presence of a common interest or theme that unites those who are involved. Whether this common interest is relatively broad or narrow, there are likely to be smaller but related topics that are of interest only to a subset of the community. For instance, on a music school site, the brass players might want to organize their own rehearsals and brass ensemble concerts. The ability for these people to band together and form a group is the...
Installing the Organic Groups Module
Please take the time to back up your database before installing the Organic Groups module. While this is good advice for every module that has its own database definitions, it is especially important in this case, as the installation of the Organic Groups module will make fundamental changes in the database's data, and that will alter the way the database behaves. Specifically, there is a table, node_access, which controls whether a given user can view a given node. In the absence of a...
Setting the Database and Base URLs
Now you must edit the sites default settings.php file that is part of the Drupal installation you downloaded from Drupal.org. You must give values to the database URL db_url and the base URL base_url variables. The database URL is the single most important configuration setting that you are asked to make while installing Drupal. You need four pieces of information to do it correctly The database management system you are using MySQL, MySQLi, or PostgreSQL The name of the database user The...
Comment Blacklist
The final section of the Discussion Options page is a comment blacklist. If any of the words in this list are found in a comment, that comment does not even appear in the moderation queue. Be careful which words you put in this list. If any word matches and even partial words can match you will not even be notified by e-mail about the comment, unlike with all of the other methods. Thus, you will not normally get chance to approve a comment that matches the blacklisted words here. In fact,...
Access Rules
Chances are that not all visitors to your site will behave themselves. Some will have an agenda that runs counter to your site's goals. This group of shady users includes spammers and a wide variety of people who will use their power to post content to deface, defame, defile, and defraud. Furthermore, your site on the open Internet is likely to come under a number of automated attacks, which attempt to do anything from take over your server to fill your logs with links to dubious sites. Some...
Using Image Assist
Now that you've configured the Image Assist module, you can use it to insert in-line images into posts. When you create a new story, blog, page, or similar node type that has one or more text areas for content, you will notice the Image Assist icon directly below the text areas. Click this icon, and the Image Assist pop-up window will appear so make sure your browser allows pop-ups for your site , as shown in Figure 4-6. Figure 4-6. The Image Assist icon and pop-up window Figure 4-6. The Image...
Tip The Tagadelic module httpdrupalorgprojecttagadelic shows free tagging tags
Hierarchy If your terms are to appear in a flat list, then the Hierarchy field should be Disabled. If child terms should have only one parent, choose Single. Single represents a one-to-many relationship between a parent and its children. If terms should be able to have multiple parents, choose Multiple. This represents a many-to-many relationship between parents and children child terms can have many parents . Multiple select This allows you to assign more than one term to content. This is...
Location Module
Adding location information to content can be very useful. Whether it is a shipping address, a meeting place, or the place where a photograph was taken, location adds an interesting dimension and opens up new possibilities for how communities form and how web sites are used. The Location module provides a set of location services, including appending location information to content and users, doing proximity searches, and linking to external map providers. Much like the Event module, the...
Exercise Play Block Lottery
Imagine how many visitors your site would get if every time they viewed a page, they had a chance to win the lottery. It doesn't matter which page is viewed if the lucky number is drawn, a winner has been chosen. Here's how to make a random You Win block for your site. 1. Create a new block admin block add named Block Lottery. Use the following message for the body or create your own lt p gt lt strong gt You win lt strong gt lt p gt lt p gt You have won block lottery. Congratulations, and enjoy...
Finding Term IDs
The first thing that you need in order to query the taxonomy category system is the ID number of the term s you are interested in. You'll need to do some sleuthing to find this, but it is not hard to do. Select administer gt categories gt edit terms to go to the edit page of a vocabulary. There you will see a list of terms as well as an Edit link for each one. The Edit link provides the important clue that you are seeking. Hover your cursor over the link, and the URL to the link will appear in...
Country Location Features
The last section on the Location module settings page, entitled Enable all available features for locations from the following countries, is a list of countries that have specific features available. It corresponds directly with the files found in the modules location supported folder. The vast majority of the countries listed offer the feature of knowing their states or provinces and nothing else. Thus, the major practical implication of enabling ten or so countries from central Africa is that...
Image Assist Input Formats
Navigate to administer gt input formats admin filters and look at your various formats. As an example, click configure for the Filtered HTML format. The two pertinent filters are the HTML filter and the Inline Images filter. If you want the macro tags to work, you need to include the Inline Images filter. If you want to be able to insert pure HTML using Image Assist, you need to configure the HTML filter to accept lt img gt , lt div gt , and lt a gt tags. Otherwise, your images will be filtered...
Introducing the User Control Panel
The new User Control Panel represents the nerve center for user functions in phpBB 3.0, and it is amazingly informative. The new Overview page, shown in Figure 9-21, gives you the low-down on forum announcements from administration, lets you see what topics you are watching a great improvement from phpBB 2.0, in which you hadn't a clue as to what topics you were watching , lets you revisit drafts of posts you are working on, and much more. Additionally, all the profile-editing tools from phpBB...
Before a Comment Appears
The first setting in this section, An administrator must approve the comment, means that an administrator must approve every single comment including TrackBacks and Pingbacks before it is displayed on your site. To that end, all comments are placed in a moderation queue. This is the most effective anti-comment spam measure. Nothing gets past WordPress, because you must approve each comment before it is posted on your site. As you can imagine, enabling comment approval is the most inconvenient...
How Drupal Finds Themes
Whenever you visit the theme administration page admin themes , Drupal looks to see which themes are available and lists them for you. This is a four-step process, which is important to be aware of if you are interested in modifying existing themes or making new themes 1. Drupal looks for pure themes like Chameleon by searching for subdirectories of themes that contain a name .theme file. It expects that the name of the theme will match the directory in which it is found, so chameleon.theme...
WordPress Features
WordPress includes the usual support for blogging, with comments, TrackBacks, and Pingbacks. Here is a summary of its main features It supports multiple authors and registered visitors with the privilege to comment. You can configure different administration rights for each author. It supports a draft mode for your posts, so you can work on them until you are ready to publish. It supports protected posts, where a reader must supply a password to read the post. It supports private posts, visible...
phpMyAdmin and phpPgAdmin
Anyone using phpMyAdmin http www.phpmyadmin.net home_page or phpPgAdmin http phppgadmin.sourceforge.net to administer the database might be satisfied with the export functionality that these programs offer. If you decide to rely on these tools for your database backup, you must have iron discipline and make the backup on a regular schedule. For details on making database backups with phpMyAdmin or phpPgAdmin, try these tutorials For phpPgAdmin
Exercise Use Random Colors for Blocks
If you wanted to have each block on the page have a randomly chosen color, this would be a great opportunity to add the logic for choosing the color. Naturally, you could do this directly in the block.tpl.php file, but that would make the file harder to read for your graphic designer, who doesn't care how you determine the color, only that it is available in a nice, clean variable to be applied inside the template. First, add the following _phptemplate_variables function to the template.php...
Installing the Location Module
The Location module is made up of the following parts A public API definition describing how to work with location information in Drupal. This can be found in the file location_API.txt. location.module, an implementation of the Location module location.inc, a set of common tools earth.inc, a set of tools for working with latitude and longitude values A set of 243 files found in location supported, each representing a different country, providing location services that range from a list of...
Creating a sites Subdirectory
Your Drupal installation has a folder named sites. The sites folder is where Drupal looks to see what domains and subdomains it is supposed to handle. During installation, I instructed you to use the sites default settings.php file for your site configuration. This is fine, as long as you need to run only one site with your Drupal installation. Now, since you are learning to run multiple sites, you need to create a subdirectory in the sites folder for every site that you wish to run with this...
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...
Fantastico and Debian
Two options for completely automated installations of Drupal include Fantastico offered by many web hosts and the Debian operating system. Fantastico is a set of scripts to install web applications such as Drupal on a server, and Debian is a GNU Linux distribution that allows you to install Drupal using the apt-get tool, which installs and updates Debian packages. If you're using one of these tools, make sure to check that they are installing the latest stable version of Drupal, or you risk...
Time Zones
First, set the default time zone for your server. This is not necessarily straightforward and requires a decision on your part. Should the default time zone for the server be the time zone where the server is physically located, the time zone where the site administrator resides, or the time zone of the site's target audience, if this can be determined Whichever time zone you choose will be used by default to display times and dates on your server. The different time zones appear in the Default...
Database Administrator Module
The Database Administration module dba , introduced in Chapter 4 and available from http drupal.org project dba, can help you keep a backup copy of your data by using a cron.php task to generate a database dump, zip or tar it, and mail it to you. This is a super option as long as your database isn't too large and your e-mail service can handle large attachments. When your data starts taking up many megabytes of space in zipped format, you'll need another solution, but the dba module will fill...
Toggle Display
Other settings that you can turn on or off include Site Name, Site Slogan, and Mission Statement. These are all text that you configured on the general site settings page admin settings . Then there are the primary and secondary links that you created on the theme configuration global settings page admin themes settings . Enabling the User Pictures in Posts option or the User Pictures in Comments option controls whether user pictures or avatars are displayed in posts or comments. These fields...
Using phpBBs Template System
When writing hacks for phpBB, interfacing with the template engine is about as inevitable as death and taxes. While this chapter will not specifically detail the creation of templates a Chapter 12 topic , your modifications will need to perform some operations to properly integrate with the templating engine. Therefore, you should have some idea of how the template engine works. When a phpBB page is started, all output is directed to an output buffer, which holds all output until the end of the...
Image Assist HTML Use and Permissions
Image Assist can achieve the task of inserting images into posts in two ways Insert special non-HTML tags called macros into the post. These macros are then replaced with HTML at page-load time by the content filter system. Insert finished HTML into the post, without any further filtering. The macro tag approach has the advantage that you can change the template for inserted images on a live site, and the change will take place for all previously inserted images. This is helpful if you might be...
Uploading and Viewing Images
When you are ready to upload images to your site, select content gt image node add image . The process for uploading images is straightforward, and the module will automatically make thumbnails and various derivative sizes on the server. Since images are nodes, you make the same decisions about whether they should be promoted to the front page as with any other node type. In addition, you have the option of viewing your images in the context of the galleries you specified. If you have the Menu...
Country Selection
As a convenience, the Location module lets you set a default country for your web site with the Default Country Selection field. This should be the country that generates the largest portion of your traffic. Whichever country you set here will be selected by default in all location forms. If the locations your site tracks are all within one country, you can simplify matters even further by checking Hide Country Selection, which saves your users the step of selecting the country. The default...
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...
Installing a Copy of subSilver
Start by installing a second copy of subSilver, under a different name. This permits you to watch your changes in real time as they unfold, while keeping the original subSilver template intact in case something goes wrong. Make sure you rename the folder to something else I'll call mine aSilver . Also be sure that you rename the subSilver.cfg file inside the directory to foldername .cfg, where foldername is the name you gave the subSilver copy's directory. For example, I'll have an aSilver...

