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

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

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

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

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

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

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

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

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

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

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

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