Using Desktop Link Checking Tools

An alternative to online link checking services is desktop link checking tools. One such tool I came across is an extension for the Firefox web browser. If you are using this browser, you can install the LinkChecker extension by Kevin A. Freitas. This extension allows you to check the links on any page you are viewing. After you install the extension into Firefox from Kevin's site, you will have a new command in the Tools menu Check Page Links, as shown in Figure 18-12. Click this command, and...

Pingbacks Track Backs and Comments

The first setting on the Discussion Options page, Attempt to notify any Weblogs linked to from the article (slows down posting), specifies that when you post a story that contains links, WordPress will attempt to send a Pingback message to each of those links. It uses a little discrimination in that it pings only links it thinks are permalinks. Links that are only to domains (such as http www.google.com or http amazon.co.uk) are not pinged. The reasoning is that it only makes sense to Pingback...

Menu Module

One of the most important aspects of any web site is its navigation menus. Furthermore, one of the first questions many people have about using Drupal is, How do I make my own navigation menu The Menu module is the tool that allows you to customize and create navigation menus. Drupal comes with a default navigation menu that serves as the main control panel for your Drupal site. By now, you are probably very familiar with this menu and its create content, my account, and administer links. 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...

Exercise Identify Themable Functions

The goal of this exercise is to modify the function responsible for calling themable functions in such a way that allows you to see in the HTML output which function was called. To do this, you will wrap the output from each call to a themable function in HTML comments like this < -- BEGIN theme_foo --> result of the themable function < -- END theme_foo --> This way, you can look at the source code of a generated page and know exactly which themable function to override in order to...

Changing the Front Page

Now let's look at the site's front page again. Click the Drupal icon or the Home link to return to the front page. Instead of the default message introducing you to your new site, you see a view of the story you just created. If you entered longer text for the body of the story, it will have been shortened on the front page. The shortened view of a post in Drupal is called a teaser. The front page is a listing of recent content that has been added to your site. If you add several more stories...

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...

Filtering Content

A key aspect of all Drupal sites is that they gather text-based input from users and display it in web pages. Whenever user-provided text is included in an HTML document, there is risk that the text might interfere with the HTML in some way, or even worse, allow attackers to damage a site or render it useless. This could happen in many ways, from malformed or inappropriate HTML tags breaking the carefully designed layout of a site to a single line of JavaScript code that redirects the page to a...

Setting Forum Permissions

After filling in the settings and continuing, phpBB will tell you it created the forum, and it gives you a link to start filling in permissions another nice touch (before, you had to remember to set permissions). Permissions in phpBB 3.0 are vastly expanded over version 2.0, with the introduction of access control lists (ACLs). The new ACLs work with both individual users and user groups, as shown in Figure 8-27. You can add groups or users to the list and apply permissions to each object....

Tip The Glossary module httpdrupalorgprojectglossary builds a categorybased glossary on your web site to help visitors

Free tagging Sites like del.icio.us (http del.icio.us ) and Flickr (http www.flickr.com ) have championed the use of free tagging for categorizing content. Instead of the site administrator creating a set of terms and expecting the users to choose one or more of them as they apply, the users themselves can create the terms as a list of words that apply, thus the name free tagging. Drupal offers free tagging as an option as well. By checking the Free Tagging check box on the edit vocabulary...

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...

Formatting Posts Using BBCode

Phpbb Bbcode Buttons

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...

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...

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 in the style made famous by Flickr

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...

Word Press 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...

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...

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...