Tải bản đầy đủ (.pdf) (561 trang)

apress building online communities with drupal, phpbb and wordpress

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (14.32 MB, 561 trang )

Robert T. Douglass, Mike Little,
and Jared W. Smith
Building Online
Communities with
Drupal, phpBB, and
WordPress
5629_FM_final.qxd 11/16/05 4:11 PM Page i
Building Online Communities with Drupal, phpBB, and WordPress
Copyright © 2006 by Robert T. Douglass, Mike Little, and Jared W. Smith
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN (pbk): 1-59059-562-9
Printed and bound in the United States of America 987654321
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Matt Wade
Technical Reviewers: Steve Potts, James Walker
Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis, Jason Gilmore,
Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser
Project Manager: Sofia Marchant
Copy Edit Manager: Nicole LeClerc
Copy Editor: Marilyn Smith
Assistant Production Director: Kari Brooks-Copony
Production Editor: Lori Bring
Compositor: Linda Weidemann
Proofreader: Linda Seifert
Indexer: Rebecca Plunkett
Artist: Kinetic Publishing Services, LLC


Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail , or
visit .
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley,
CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail , or visit .
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly
by the information contained in this work.
The source code for this book is available to readers at in the Source Code section.
5629_FM_final.qxd 11/16/05 4:11 PM Page ii
I’m dedicating my portion of this book to my Aunt Sobeida Linder,
whose inspiring spirit in the face of nearly impossible odds sets an example
we can all admire and try to live up to. She personified the phrase
“live life to the fullest,” as she did exactly that with every day she had,
good days and bad.We miss you tremendously.
Jared Smith
5629_FM_final.qxd 11/16/05 4:11 PM Page iii
5629_FM_final.qxd 11/16/05 4:11 PM Page iv
Contents at a Glance
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
About the Technical Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
PART 1
■ ■ ■
Drupal
■CHAPTER 1 Introducing Drupal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

■CHAPTER 2 Configuring Drupal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
■CHAPTER 3 Using the Drupal Core Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
■CHAPTER 4 Adding Contributed Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
■CHAPTER 5 Adding and Customizing Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
■CHAPTER 6 Maintaining Your Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
PART 2
■ ■ ■
phpBB
■CHAPTER 7 Introducing phpBB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
■CHAPTER 8 Installing and Configuring phpBB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
■CHAPTER 9 Touring phpBB’s Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
■CHAPTER 10 Securing and Maintaining phpBB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
■CHAPTER 11 Modifying phpBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
■CHAPTER 12 Styling phpBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
PART 3
■ ■ ■
WordPress
■CHAPTER 13 Introducing WordPress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
■CHAPTER 14 Installing and Configuring WordPress. . . . . . . . . . . . . . . . . . . . . . . . . . 379
■CHAPTER 15 Starting to Blog and Building Your Community . . . . . . . . . . . . . . . . . 401
■CHAPTER 16 Changing the Look of Your Blog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
■CHAPTER 17 Customizing Your Blog’s Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
■CHAPTER 18 Maintaining Your Blog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
v
5629_FM_final.qxd 11/16/05 4:11 PM Page v
5629_FM_final.qxd 11/16/05 4:11 PM Page vi
Contents
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
About the Technical Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
PART 1
■ ■ ■
Drupal
■CHAPTER 1 Introducing Drupal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
What Is Drupal? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Who Should Use Drupal? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Installing Drupal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Meeting Drupal Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Obtaining Drupal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Setting Up the Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Setting the Database and Base URLs. . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Accessing the Drupal Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Troubleshooting Installation Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Creating the First User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Creating the files Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Using Other Installation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Creating Drupal Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Adding a News Story. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Changing the Front Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Touring Drupal’s Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Introducing Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Introducing Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Introducing Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Introducing Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Introducing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Introducing Taxonomy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
vii

5629_FM_final.qxd 11/16/05 4:11 PM Page vii
■CHAPTER 2 Configuring Drupal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Configuring Site Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
General Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Error Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Cache Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
File System Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Image Handling Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
RSS Feed Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Date Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
String Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Setting Up and Maintaining User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . 30
Configuring User Accounts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Managing User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Controlling Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Using Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Using Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Administering Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Adding Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Managing Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Configuring Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Filtering Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Viewing, Searching, and Updating Content . . . . . . . . . . . . . . . . . . . . . 48
Managing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Configuring Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Managing the Comment Approval Queue . . . . . . . . . . . . . . . . . . . . . . 50
Configuring Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Enabling Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Choosing Theme Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Using Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Understanding Vocabularies and Terms. . . . . . . . . . . . . . . . . . . . . . . . 53
Configuring Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Leveraging Categories with Custom URLs . . . . . . . . . . . . . . . . . . . . . 56
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
■CONTENTSviii
5629_FM_final.qxd 11/16/05 4:11 PM Page viii
■CHAPTER 3 Using the Drupal Core Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Aggregator Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Identifying Feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Configuring Feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Viewing Feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Archive Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Block Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Blog Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Configuring Blogs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Accessing Blogs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
BlogAPI Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Configuring BlogAPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Publishing to Your Site Using BlogAPI. . . . . . . . . . . . . . . . . . . . . . . . . . 66
Book Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Using Book Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Working with the Book Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Viewing Book Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Comment Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Contact Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Using the Personal Contact Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Using the Sitewide Contact Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Drupal Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Using Distributed Authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Running a Directory Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

Configuring the Drupal Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Filter Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Forum Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Configuring Containers and Forums. . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Setting Up Forum Categories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Help Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Legacy Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Locale Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Enabling and Importing Translations . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Translating Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Exporting Translations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
■CONTENTS
ix
5629_FM_final.qxd 11/16/05 4:11 PM Page ix
Menu Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Modifying Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Adding Custom Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Showing Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Adding Menu Links the Easy Way. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Resetting Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Node Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Page and Story Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Path Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Creating Path Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Creating Aliases to Drupal Paths. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Ping Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Poll Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Creating Polls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Administering Polls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Profile Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

Creating Custom Profile Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Viewing Profile Listing Pages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Search Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Enabling the Search Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Building the Search Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Statistics Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Configuring Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Banning Abusive Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
System Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Taxonomy Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Throttle Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Throttling Modules and Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Configuring Throttle Thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Tracker Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Upload Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Configuring File Uploads. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Uploading Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Podcasting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
User Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Watchdog Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
■CONTENTSx
5629_FM_final.qxd 11/16/05 4:11 PM Page x
■CHAPTER 4 Adding Contributed Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Getting Drupal Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Introducing Some Useful Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Installing Contributed Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
TinyMCE Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Installing the TinyMCE Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Configuring the TinyMCE Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

Image Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Installing the Image Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Configuring the Image Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Uploading and Viewing Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Image Assist Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Installing the Image Assist Module . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Configuring the Image Assist Module. . . . . . . . . . . . . . . . . . . . . . . . . 110
Using Image Assist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Flexinode Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Installing the Flexinode Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Adding Custom Node Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Event Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Installing the Event Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Configuring the Event Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Event-Enabling Node Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Viewing Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Exporting Event Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Location Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Installing the Location Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Configuring the Location Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Location-Enabling Node Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Organic Groups Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Installing the Organic Groups Module . . . . . . . . . . . . . . . . . . . . . . . . 131
Activating Group Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Configuring the Organic Groups Module . . . . . . . . . . . . . . . . . . . . . . 132
Configuring Organic Groups Albums. . . . . . . . . . . . . . . . . . . . . . . . . . 134
Creating Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Managing Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
■CONTENTS
xi

5629_FM_final.qxd 11/16/05 4:11 PM Page xi
Spam Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Detecting Spam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Installing the Spam Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Configuring the Spam Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Managing URL Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Creating Custom Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Using Other Filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Database Administration Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Installing the Database Administration Module . . . . . . . . . . . . . . . . 141
Configuring the Database Administration Module . . . . . . . . . . . . . . 141
Using the Database Administration Module . . . . . . . . . . . . . . . . . . . 143
Running Queries and Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Developer Tools (Devel) Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Installing the Devel Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Configuring the Devel Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Viewing Timer and Query Log Information . . . . . . . . . . . . . . . . . . . . 145
Using Developer Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Emptying the Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
■CHAPTER 5 Adding and Customizing Themes. . . . . . . . . . . . . . . . . . . . . . . . . 149
Understanding Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Theme Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
How Drupal Finds Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Installing New Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Customizing Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Introducing Themable Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Using Template Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Overriding Themable Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Adding Custom Regions for Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . 176

Using CSS for Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Creating a Custom Favicon.ico . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Using Theme-Related Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
■CONTENTSxii
5629_FM_final.qxd 11/16/05 4:11 PM Page xii
■CHAPTER 6 Maintaining Your Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Scheduling Automated Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Introducing Cron.php. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Calling Cron.php. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Running Multiple Drupal Sites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Directing Requests for Multiple Sites. . . . . . . . . . . . . . . . . . . . . . . . . 190
Creating a sites Subdirectory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Using Site-Specific Modules and Themes. . . . . . . . . . . . . . . . . . . . . 193
Sharing a Database Among Multiple Sites . . . . . . . . . . . . . . . . . . . . 194
Sharing Tables Across Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Making Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Making Database Backups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Making File System Backups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Moving Your Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Maintaining a Test Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Creating the test_site Subdirectory . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Creating a Copy of the Site Database. . . . . . . . . . . . . . . . . . . . . . . . . 205
Copying the Files to the test_site directory. . . . . . . . . . . . . . . . . . . . 205
Updating the Test Site’s Configuration Settings . . . . . . . . . . . . . . . . 205
Accessing the Test Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Updating Drupal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Tracking Your Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Testing the Update. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Performing the Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

Getting Drupal Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
The Drupal Community. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
PART 2
■ ■ ■
phpBB
■CHAPTER 7 Introducing phpBB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
The Basics of Running Your Own Forums . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Some Forum Administration Lingo . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Organizing Your Forums Logically. . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Respecting Your Bread and Butter: Your User Base . . . . . . . . . . . . . 220
Keeping Things Familiar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Keeping Things Fresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Using a Quality Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
■CONTENTS
xiii
5629_FM_final.qxd 11/16/05 4:11 PM Page xiii
Enter phpBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
The Million-Dollar Question: Why Use phpBB?. . . . . . . . . . . . . . . . . . . . . . 222
phpBB’s Feature Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
End-User Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Administrative Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
phpBB’s Security Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
phpBB’s Customizability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
phpBB’s Scalability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
What We’ll Accomplish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Looking Toward Olympus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
■CHAPTER 8 Installing and Configuring phpBB . . . . . . . . . . . . . . . . . . . . . . . . 231
Installing phpBB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Meeting phpBB Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

Obtaining phpBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Preparing Your Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Running the Install Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Troubleshooting Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Performing Post-Installation Chores. . . . . . . . . . . . . . . . . . . . . . . . . . 238
Configuring phpBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Using the phpBB Administration Panel. . . . . . . . . . . . . . . . . . . . . . . . 241
Configuring Basic Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Creating Your Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Touring the phpBB 3.0 Installer and Administration Panel . . . . . . . . . . . . 252
Installing phpBB 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Configuring phpBB 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
■CHAPTER 9 Touring phpBB’s Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Reading and Posting to Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Using the Forum Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Marking Forums As Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Watching Topics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Formatting Posts Using BBCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Working with Emoticons (Smilies). . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Making Topics Sticky and Posting Announcements. . . . . . . . . . . . . 270
Attaching Polls to Topics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Editing Posts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
■CONTENTSxiv
5629_FM_final.qxd 11/16/05 4:11 PM Page xiv
Creating User Profiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Entering Registration Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Adding Profile Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Setting User Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Choosing Avatar Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276

Administering User Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Creating a Ranking System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Private Messaging with phpBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Reading and Managing Private Messages . . . . . . . . . . . . . . . . . . . . 279
Sending Private Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Searching Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Performing a Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Conducting Special Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Grouping Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Setting Up User Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Viewing Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Modifying and Removing Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Visiting Other Points of Interest. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Touring phpBB 3.0 Feature Upgrades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Introducing the Board Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Posting and Reading in phpBB 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Introducing the User Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Private Messaging in phpBB 3.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Searching with phpBB 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
■CHAPTER 10 Securing and Maintaining phpBB. . . . . . . . . . . . . . . . . . . . . . . . . 295
Implementing Security Strategies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Best Practices for Delegating Power . . . . . . . . . . . . . . . . . . . . . . . . . 295
How to Audit Moderators and Administrators . . . . . . . . . . . . . . . . . . 296
Guidelines for Strong, Secure Passwords . . . . . . . . . . . . . . . . . . . . . 298
Installing Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Keeping Abreast of Updates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Obtaining Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Upgrading with the Changed Files Only Package. . . . . . . . . . . . . . . 299
Upgrading with the Patch File Only Package . . . . . . . . . . . . . . . . . . 302

Mastering phpBB Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Using Advanced Forum Permissions. . . . . . . . . . . . . . . . . . . . . . . . . . 303
Setting Per-User Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Using Permissions with User Groups . . . . . . . . . . . . . . . . . . . . . . . . . 306
■CONTENTS
xv
5629_FM_final.qxd 11/16/05 4:11 PM Page xv
Managing Registrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Validating New User Accounts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Enabling Visual Confirmation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Disallowing Usernames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Managing Your Ban Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Moderating Your Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Moderating Individual Posts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Performing Mass Moderation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Using the IP Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Maintaining and Performance Tuning phpBB . . . . . . . . . . . . . . . . . . . . . . . 314
Pruning Dead Posts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Managing Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Using Template Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Introducing phpBB 3.0 Security and Maintenance Enhancements. . . . . 320
Managing Permissions in phpBB 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . 320
Using Strengthened Security Features in phpBB 3.0. . . . . . . . . . . . 320
Performance Tuning in phpBB 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Pruning in phpBB 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Backing Up and Restoring Databases in phpBB 3.0 . . . . . . . . . . . . 324
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
■CHAPTER 11 Modifying phpBB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Installing Modifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Getting Ready to Install a Hack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

Acquiring Your Hacks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Installing a Hack. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Creating Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Getting Ready to Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Using the phpBB Coding Conventions . . . . . . . . . . . . . . . . . . . . . . . . 335
Releasing Your Modifications to the Community . . . . . . . . . . . . . . . 343
Looking Ahead to phpBB 3.0 Modifications . . . . . . . . . . . . . . . . . . . . . . . . 346
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
■CHAPTER 12 Styling phpBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Acquiring Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Creating and Modifying Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Working with phpBB’s Template System . . . . . . . . . . . . . . . . . . . . . . 349
Creating Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Getting Help with Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
■CONTENTSxvi
5629_FM_final.qxd 11/16/05 4:11 PM Page xvi
Installing and Using Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Adding Templates and Styles to phpBB . . . . . . . . . . . . . . . . . . . . . . . 362
Using Your Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Touring phpBB 3.0 Templating Improvements . . . . . . . . . . . . . . . . . . . . . . 365
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
PART 3
■ ■ ■
WordPress
■CHAPTER 13 Introducing WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
A Brief History of Blogging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Weblogs: Guides to the Web. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
The Beginnings of Publishing Software . . . . . . . . . . . . . . . . . . . . . . . 370
True Weblogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Weblog Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

Types of Blogging Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Publishing Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Blogging-Related Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Why WordPress? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
WordPress Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
WordPress Releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
■CHAPTER 14 Installing and Configuring WordPress. . . . . . . . . . . . . . . . . . . . 379
Installing WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Meeting the Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Obtaining WordPress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Obtaining Helper Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Preparing Your Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Running the Install Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Logging In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Introducing the Dashboard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Changing the Admin Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Configuring WordPress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Setting General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Configuring Discussion Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Avoiding Comment Spam. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Setting File Upload Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Making Your First Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
■CONTENTS
xvii
5629_FM_final.qxd 11/16/05 4:11 PM Page xvii
■CHAPTER 15 Starting to Blog and Building Your Community . . . . . . . . . . 401
Using Basic Post Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Marking Up Your Post with Quicktags. . . . . . . . . . . . . . . . . . . . . . . . . 401
Categorizing Posts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403

Adding TrackBack URIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Publishing or Saving Your Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Using Advanced Post Editing Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Allowing Comments and Pings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Password-Protecting Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Adding Excerpts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Using Advanced Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Using Custom Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Previewing Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Adding Images to Your Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Uploading Images with WordPress . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Using the IImage Browser Plug-In . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Managing Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Adding a New Category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
Adding Subcategories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Deleting Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Managing Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Viewing, Editing, and Deleting Comments. . . . . . . . . . . . . . . . . . . . . 417
Moderating Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Providing Comment Feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Adding Multiple Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Allowing Self-Registering Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Assigning User Permissions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Adding Blog Pages with RSS Feeds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Installing and Activating the RSS Link List Plug-In . . . . . . . . . . . . . 424
Creating a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Using the RSS Link List Plug-In on a Page . . . . . . . . . . . . . . . . . . . . 426
Improving Your Site’s Search Engine Visibility . . . . . . . . . . . . . . . . . . . . . . 428
Providing Semantic, Standards-Compliant Content. . . . . . . . . . . . . 428
Presenting Multiple Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428

Generating Search-Engine-Friendly Permalinks. . . . . . . . . . . . . . . . 429
Contributing to Your Site’s Search Engine Ranking . . . . . . . . . . . . . 430
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
■CONTENTSxviii
5629_FM_final.qxd 11/16/05 4:11 PM Page xviii
■CHAPTER 16 Changing the Look of Your Blog . . . . . . . . . . . . . . . . . . . . . . . . . . 433
Using Themes to Communicate with Your Audience . . . . . . . . . . . . . . . . . 433
Selecting an Installed Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Adding New WordPress Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Finding Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Installing Themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Modifying an Existing Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Examining a Theme’s Components. . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Installing and Copying the Theme. . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Modifying Theme Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
Changing the Template. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Adding the RSS Feed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Adjusting the Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Adding Registration and Login Links . . . . . . . . . . . . . . . . . . . . . . . . . 448
Adding a Recent Comments Plug-In. . . . . . . . . . . . . . . . . . . . . . . . . . 450
Cleaning Up the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
■CHAPTER 17 Customizing Your Blog’s Layout . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Considering What Your Reader Is Doing. . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Having a Conversation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Discussing the News. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Coming to Learn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Looking for a Review. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Moving to the Next Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Changing the Layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463

Building Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
A Conversation Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
A Learning Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Other Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
■CHAPTER 18 Maintaining Your Blog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Backing Up and Restoring Your Database. . . . . . . . . . . . . . . . . . . . . . . . . . 489
Making Backups with the WP-DB Backup Plug-In. . . . . . . . . . . . . . 490
Using the WP-Cron Plug-In for Regular Unattended Backups . . . . 493
Restoring Your Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
■CONTENTS
xix
5629_FM_final.qxd 11/16/05 4:11 PM Page xix
Monitoring Storage Space and Bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . 496
Monitoring Your Storage Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Cleaning Comment Spam. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Monitoring Bandwidth. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Checking Your Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Using Online Link Checking Services. . . . . . . . . . . . . . . . . . . . . . . . . 501
Using Desktop Link Checking Tools . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Keeping Your Content Fresh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Adding New Posts Regularly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Seeking New Readers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Keeping Your Site Interesting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Encouraging Contributors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Maintaining Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
■INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
■CONTENTSxx
5629_FM_final.qxd 11/16/05 4:11 PM Page xx

About the Authors
■ROBERT T. DOUGLASS is a core developer and member of the security team
for the Drupal project. As a leading voice in the Drupal community, he works
hard to introduce new programmers and webmasters to the joys of building
web sites with Drupal. To this end, Robert headed Drupal’s involvement in
the Google Summer of Code, 2005. Robert is a freelance Drupal consultant
and programmer, working out of his home in Germany.
■MIKE LITTLE is one of the founders of the WordPress project and is still an occasional
contributing developer. He wrote his first computer program over 26 years ago. He has been
programming professionally for more than 15 years in a variety of languages, including PHP,
Java, JSP, Perl, C, and assembler. He first encountered the Web in 1993 and has been fiddling
with it ever since.
When he is not tapping away at a keyboard, he likes to read—mostly science fiction, fan-
tasy, biographies, and the odd technical book. He listens to music as much as possible.
■JARED W. SMITH started his foray into message board communities at the
increasingly less tender age of 15, when he first participated in various mes-
sage boards on the Web. He particularly was amazed at the layout of the
Ultimate Bulletin Board (UBB), Infopop’s groundbreaking community solu-
tion, and he decided he must give a UBB-based community a shot on his
own site. Of course, most 15-year-olds don’t have $160 to shell out at a whim.
It was at this time that Jared stumbled over phpBB 1.0.0, which, sure enough, was a free mes-
sage board solution that looked—gasp!—just like UBB!
Immediately, Jared became intrigued with the product. The easy installation amazed him,
and he loved the speed. There was a problem though: the first editions of the board weren’t that
great looking. The borders were too thick on the edges, the fonts were too small, no CSS was used,
and so on, but no matter. He dove into the code and totally reworked the design for his now-
defunct Windows support site, WindowsLaunchpad.com. Jared learned a lot from that experience
and proceeded to begin writing and releasing modifications such as the Anchor Hack, which
returned users to the last post in a thread after they posted, and an enhanced version of another
Who’s Online hack, which he optimized for performance and redesigned to present the informa-

tion in a clearer format. His work, including work with the phpBB 2.0.x series, earned him
multiple accolades such as “phpBB of the Month” at phpBBHacks.com, where he was one of the
original support team members and now serves as an advisor to the webmaster.
Presently, Jared blogs about a variety of topics at www.jaredwsmith.com (using WordPress,
no less), and in the very near future, he will be maintaining a phpBB board there as well. In his
scarce spare time, Jared has fun being lousy at first-person shooter-style games, goes canoeing
with his friends in the summer, and is the most unlikely sports buff you may ever meet. He
presently resides in beautiful downtown Charleston, South Carolina, with a friend and the
best kitty ever, Penelope.
xxi
5629_FM_final.qxd 11/16/05 4:11 PM Page xxi
5629_FM_final.qxd 11/16/05 4:11 PM Page xxii
About the
Technical Reviewers
■STEVE POTTS graduated from Manchester University with a Bachelor’s degree in Applied
Computing, and then went on to pursue a Master’s degree at the Open University in Com-
puting for Commerce and Industry.
Even before his start in higher education, he was working hard in the defense industry
to squeeze an immense amount of failure-resistant software into what was such a remarkably
small footprint that digital watches would find it miniature now.
Given his obvious disposition for being meticulous (his friends have other words to describe
this), he is an accomplished technical editor who has worked on Java, XHTML, PHP, and Wireless
publications, including the award-winning “Son of Web Pages That Suck.”
His work to date has involved hundreds of applications in defense, handheld devices,
smartphones, mobile Internet, and the Web.
Steve is founder of his technical consultancy outfit Free Balloon, and he holds the reward-
ing position of CTO at Hawdale Associates, an invigorating usability and design customer
experience company operating out of Manchester, England.
■JAMES WALKER is a founder and lead developer at Bryght, a Vancouver-based company offer-
ing Drupal hosting and services. He is also an active member of the Drupal community, having

made several core contributions over the past three years. He also maintains nine contributed
modules and advises on the security team. When not promoting Drupal world domination, he
enjoys spending time with his wife and two children.
xxiii
5629_FM_final.qxd 11/16/05 4:11 PM Page xxiii
5629_FM_final.qxd 11/16/05 4:11 PM Page xxiv

×