You are previewing Building Online Communities with phpBB 2.
O'Reilly logo
Building Online Communities with phpBB 2

Book Description

A practical guide to creating and maintaining online discussion forums with phpBB, the leading free open source PHP/MySQL-based bulletin board

  • Simple, practical steps to build and customize your own phpBB-powered online community

  • Learn from experienced phpBB administrators and enthusiasts to get the most from phpBB

  • Full coverage of powerful features including customization, administration and developing your own modifications

  • In Detail

    phpBB is a free, open source Internet community application, with outstanding discussion forums and membership management. Written in the PHP scripting language, and making use of the popular MySQL database, phpBB is a standard among web hosting companies throughout the world, and is one of the most widely-used bulletin board packages in the world. phpBB short-circuits the need for you to be a web development master in order to create and manage massive online communities.

    phpBB handles sites of all sizes, the largest known phpBB-powered site on the Internet handles over 1.5 million members and has 191 million posts to the forums!

    The book begins with the initial installation and configuration of phpBB on your system, with troubleshooting tips to help you through. You will then go on a tour of phpBB and its features, stepping you through the basic tasks, growing your understanding and familiarizing you with the power of phpBB.

    Everybody wants their community to look special, and customizing your forum is the next stop in the book. Beginning with a detailed rundown of styles and themes, you will then see how to customize your forum by first modifying existing styles, adding new elements, and even creating a new style from scratch.

    The book then goes onto cover further administration of your community, creating hacks or "modifications" for phpBB, custom PHP programming with phpBB, and reference appendices with more phpBB resources, the phpBB file and directory structure, guides to the BBCode and permission systems, and the phpBB database structure round off this book.

    This book gives you the power to use phpBB to set up and run your own online discussion forums with ease, and develop your own Internet community. It takes you through the whole process of setting up your phpBB site, and helps you create, customize and manage your own online community with phpBB. Written by experienced phpBB administrators and enthusiasts, the emphasis is on simple, and practical guidance for you to get the most from phpBB.

    Table of Contents

    1. Building Online Communities with phpBB 2
      1. Building Online Communities with phpBB 2
      2. Credits
      3. Foreword
      4. About the Authors
      5. Introduction
        1. What This Book Covers
        2. What You Need for Using This Book
        3. Conventions
        4. Reader Feedback
        5. Customer Support
          1. Downloading the Example Code for the Book
          2. Errata
          3. Questions
      6. 1. Introduction to phpBB
        1. Online Communities
        2. Building the Community—The Tools
        3. The Name
        4. The Environment
        5. Why phpBB?
        6. History
        7. Development
        8. Example phpBB Sites
          1. A Standard phpBB Layout
          2. Standard Sites with Different Templates
          3. Sites with Standard Style and Modified Features
          4. Modified phpBB Installations with Custom Templates
          5. GaiaOnline
        9. Summary
      7. 2. Installing and Configuring phpBB
        1. Pre-Installation
          1. Requirements
          2. The Attack Plan
                1. Time For Action - Setting Up the Environment on Your Local Computer
          3. Finishing Pre-Install Touch—The Database
                1. Setting Up the Database for Local Installations
                2. Time For Action—Creating the Forum Database with phpMyAdmin
                  1. What Just Happened
                3. Time For Action—Creating the Forum Database Using the Command Prompt
                4. Setting Up the Database for Remote Installations
          4. phpBB Pre-Installation Checklist
        2. Installation
          1. Troubleshooting the Installation
            1. Symptom
              1. Reason
              2. Solution
            2. Symptom
              1. Reason
              2. Solution
            3. Symptom
              1. Reason
              2. Solution
            4. Symptom
              1. Reason 1
              2. Solution
              3. Reason 2
              4. Solution
            5. Symptom
              1. Reason 1
              2. Solution
              3. Reason 2
              4. Solution
                1. Time For Action—Deleting phpBB Tables using phpMyAdmin
                2. Time For Action—Deleting phpBB Tables Using the Command Prompt
        3. Post-Installation Tasks
                1. Time For Action—Deleting Unneeded Directories
                  1. What Just Happened?
                2. Basic Configuration
                3. Time For Action—Initial Configuration Using the Administration Panel
                  1. What Just Happened?
                4. Setting Up the avatars Directory
        4. Security Tips
                1. Administrator Password
                2. Disallow Remote Connections to the Database
                3. MySQL Account
                4. config.php
                5. .htaccess Protection for the Administration Panel
        5. Finding Help
        6. Summary
      8. 3. A Quick Tour of phpBB
        1. Visitor Experience
          1. Overview
          2. Registration
            1. Step 1
            2. Step 2
            3. Step 3
          3. Logging In
          4. Editing Your Profile
                1. Time For Action—Creating and Editing "The Dude" Profile
                  1. What Just Happened?
          5. Posting
            1. Anatomy of a Posting
            2. Replying
            3. Starting a New Topic
            4. Formatting a Posting
                1. Time For Action—Formatting a Post
                  1. What Just Happened
            5. Editing a Posting
            6. Deleting a Posting
          6. Searching
          7. Sending and Receiving Private Messages (PM)
                1. Time For Action—The Dude PMs the Administrator
                  1. What Just Happened?
          8. Voting in Polls
          9. Staying Current with the Topics
          10. Viewing Information about Other Users
            1. Memberlist
            2. Usergroups
            3. Who Is Online
        2. Moderator Experience
                1. Time For Action—Assigning Moderator Privileges to a User
                  1. What Just Happened?
          1. Managing Postings
            1. Editing and Deleting
            2. Editing the First Posting in a Topic
            3. Viewing Poster’s IP Address
          2. Managing Topics
            1. Deleting, Locking, and Unlocking Topics
            2. Moving Topics
                1. Time For Action—Creating a Forum
                  1. What Just Happened?
            3. Splitting Topics
            4. Doing It All Together—The Moderator Control Panel
        3. Administrator Experience
          1. Administration Panel Overview
          2. Forum Admin
            1. Forum Management
              1. Creating New Forums and Categories
                1. Time For Action—Creating a New Category
                  1. What Just Happened
                2. Time For Action—Creating a New Forum
                  1. What Just Happened
              2. Fine Tuning Existing Forums and Categories
                1. Editing
                2. Deleting
                3. Changing Display Order
                4. Time For Action - Tweaking display order
                  1. What Just Happened
                5. Using the Resync Options
            2. Who Can Do What—Setting Up Forum Permissions
                1. Time For Action—Setting Forum Permissions in Simple Mode
                  1. What Just Happened?
            3. Pruning
                1. Time For Action—Pruning a Forum
                  1. What Just Happened?
          3. Systems Administration Using General Admin Options
            1. Configuration
            2. Database Backup and Restore
                1. Time For Action—Backing Up Your Board Data
                  1. What Just Happened
                2. Time For Action—Restoring Your Database from a Backup Copy
                  1. What Just Happened
            3. Mass E-Mail
            4. Smilies
            5. Filtering Words Using Word Censors
                1. Time For Action—Creating a Word Filter
                  1. What Just Happened
          4. Introduction to User Management
            1. Editing User Profiles
            2. Deleting Users
            3. Permissions
            4. Banning Users
            5. Disallowing Users
        4. Summary
      9. 4. Customizing Your Forum
        1. phpBB Styles
        2. Structure of a Style
          1. Style Elements
          2. Style Storage
        3. Editing phpBB Files
        4. Installing a New Style
          1. Creating a Copy Style
                1. Time For Action—Creating a Copy Style
                  1. What Just Happened?
          2. Installing One Element at a Time
          3. Troubleshooting
            1. Style Does Not Appear in Administration
            2. Configuration File Cannot Be Opened
          4. Removing an Installed Style
        5. Create or Customize
        6. Customizing Through the Stylesheet
          1. Editing the Stylesheet in the Admin Panel
                1. Time For Action—Editing the Stylesheet
                  1. What Just Happened?
            1. Editing Other Theme Components
            2. Allowed Values
            3. Commonly Used and Altered Elements
              1. Table Cell Colors
              2. Font Colors
          2. Changing CSS Styles to Change the Look of Your Site
            1. Using External Stylesheets
        7. Customizing through Images
          1. Installing New Images to Change the Look of Your Site
        8. Hacking phpBB
          1. MODs and Hacks
          2. phpBB Modification
          3. Installing a Modification
                1. Time For Action—Installing a Small Modification
                  1. What Just Happened?
            1. Installing a Downloaded Modification
            2. The Copy Action
            3. The SQL Action and Editing the Database
            4. The Open Action
            5. The Find Action
            6. The Addition Actions
            7. The In-Line Actions
            8. The Last Action
            9. The Trouble with Templates
            10. Uninstalling Modifications
                1. Time For Action—Uninstalling a Small Modification
                  1. What Just Happened?
              1. Removing Other Changes
          4. Example Modifications
          5. Moving Elements
          6. Adding New Elements to Your Forum
                1. Time For Action—Adding a Menu Link
                  1. What Just Happened?
            1. Adding New Languages
        9. Summary
      10. 5. Forum Administration
        1. Making Your Board Multi-Lingual
                1. Time For Action—Adding Spanish Support to Your Forum
                  1. What Just Happened?
        2. Avatars: Enabling and Configuring
        3. Managing Smilies
          1. Smilies’ Properties
          2. Smilies Administration Panel
          3. Editing or Deleting a Smilie
          4. Adding New Smilies
                1. Time For Action—Adding a New Smilie Using an Existing Image
                  1. What Just Happened?
                2. Time For Action—Adding a Custom Smilie
                  1. What Just Happened?
          5. Adding Smilies with a .pak File
                1. Time For Action—Adding Smilies Using a .pak File
                  1. What Just Happened?
          6. Creating a .pak File
                1. Time For Action—Creating a .pak File
                  1. What Just Happened?
          7. Assigning Ranks
                1. Time For Action—Creating Automatic Ranks
                  1. What Just Happened?
                2. Time For Action—Creating and Assigning a Special Rank
                  1. What Just Happened?
        4. Understanding Forum Permissions
            1. Permission Types and Permission Levels
            2. Simple and Advanced Mode of Setting Permissions
                1. Time For Action—Creating and Fine-Tuning a Private Forum
                  1. What Just Happened
        5. Understanding User Permissions
                1. Time For Action—Making The Dude a Private User of The Dudes Forum
                  1. What Just Happened?
        6. Usergroups and Group Permissions
                1. Time For Action—Creating a New Group
                  1. What Just Happened?
                2. Time For Action—Editing a Group
                  1. What Just Happened?
          1. Group Permissions
                1. Time For Action—Setting Group Permissions
                  1. What Just Happened?
        7. Second Look into Database Backups and Restore
          1. Using phpMyAdmin
                1. Time For Action—Creating an SQL Database Dump
                  1. What Just Happened?
          2. Using MySQL Command-Line Tools
                1. Creating Backups with mysqldump
                2. Using the mysql Utility to Restore a Database
                3. Time For Action—Creating a Database Copy from a SQL Dump
                  1. What Just Happened?
                4. Other Tools
        8. The Board’s Human Side: Flamewars and Banning
      11. 6. Creating Your Own Template
        1. Sketching the Layout
        2. TPL Stands for Template
        3. Making Your Template Folder
        4. Editors for .tpl Documents
        5. Ready, Set, Go!
          1. Adding the Banner Image
          2. Adding a Menu
        6. CSS
        7. Modifying the Forum Index in index_body.tpl
        8. Modifying the Forum Body in viewforum_body.tpl
          1. Fixing the Size of the Jump Menu
        9. And the Story Continues
            1. agreement.tpl
            2. bbcode.tpl
            3. confirm_body.tpl
            4. error_body.tpl
            5. faq_body.tpl
            6. forumIE.css
            7. groupcp_info_body.tpl
            8. groupcp_pending_info.tpl
            9. groupcp_user_body.tpl
            10. index.htm
            11. index_body.tpl
            12. jumpbox.tpl
            13. login_body.tpl
            14. memberlist_body.tpl
            15. message_body.tpl
            16. modcp_body.tpl
            17. modcp_move.tpl
            18. modcp_split.tpl
            19. modcp_viewip.tpl
            20. subSilver.tpl
            21. subSilver.css
            22. overall_footer.tpl
            23. overall_header.tpl
            24. posting_body.tpl
            25. posting_poll_body.tpl
            26. posting_preview.tpl
            27. posting_smilies.tpl
            28. posting_topic_review.tpl
            29. privmsgs_body.tpl
            30. privmsgs_popup.tpl
            31. privmsgs_preview.tpl
            32. privmsgs_read_body.tpl
            33. profile_add_body.tpl
            34. profile_avatar_gallery.tpl
            35. profile_send_email.tpl
            36. profile_send_pass.tpl
            37. profile_view_body.tpl
            38. search_body.tpl
            39. search_results_posts.tpl
            40. search_results_topics.tpl
            41. search_username.tpl
            42. simple_footer.tpl
            43. simple_header.tpl
            44. theme_info.cfg
            45. viewforum_body.tpl
            46. viewonline_body.tpl
            47. viewtopic_body.tpl
            48. viewtopic_poll_ballot.tpl
            49. viewtopic_poll_result.tpl
          1. The Admin Folder
        10. Icons and Images
        11. Final Touches
        12. Summary
      12. 7. Creating a New MOD
        1. Introduction to MODs and Hacks
        2. Before You Begin
          1. Building Your Skillset
          2. The Right Tools for the Job
        3. Creating a Simple MOD: A New BBCode Tag
          1. Step 1—Determine Your Goal
          2. Step 2—Plan Your Database Changes
          3. Step 3—Choose Your Files
          4. Step 4—File Editing and Creation
                1. Time For Action—The First Edit
                  1. What Just Happened?
                2. Time For Action—The Second Edit
                  1. What Just Happened?
                3. Time For Action—Editing BBCode HTML
                  1. What Just Happened?
                4. Time For Action—Adding a Language String
                  1. What Just Happened?
                5. Time For Action—Adding a Template Variable
                  1. What Just Happened?
                6. Time For Action—Adding a Posting Form Button
                  1. What Just Happened?
            1. Pros and Cons of the Strike BBCode Methods
          5. Step 5—Break It and Fix It
        4. Make Your MOD Accessible to the World
          1. Packaging Your MOD
            1. Using the MOD Template Header
              1. MOD Title
              2. MOD Author
              3. MOD Description
              4. MOD Version
              5. Installation Level
              6. Installation Time
              7. Files to Edit
              8. Included Files
              9. phpBB.com’s Security Notice
              10. Author Notes
            2. Creating the List of Actions
              1. The Open Action
              2. The Find Action
              3. The Addition Actions
              4. Additional Open, Find, and Addition Action Examples
            3. Using Other Actions
              1. Copying Files—The Copy Action
              2. Altering the Database—The SQL Action
              3. Replacing Code—The Replace With Action
              4. Modifying Portions of a Line—In-Line Actions
            4. Adding the MOD Template Footer
            5. The Completed Instruction File
            6. Creating a ZIP File
          2. Submitting Your Modification
        5. Summary
      13. 8. Programming phpBB
        1. Hello phpBB World!
        2. Working with the Database
          1. Database Abstraction
          2. Database Abstraction Working
          3. Using the phpBB Database Abstraction Layer
            1. Option 1
            2. Option 2
            3. Option 3
        3. Using phpBB Messages
        4. Using phpBB’s Multi-Language System
        5. Using phpBB Templates
          1. A Simple Example
          2. Using Loops in phpBB Templates
          3. Using Conditions in phpBB Templates
        6. User Authentication
          1. Using the Authentication Function
          2. Checking for Poll-Creation Privileges
          3. Miscellaneous Functions
            1. Getting Board Statistics
            2. Retrieving User Information
            3. Encoding and Decoding IP Addresses
            4. Displaying Dates
            5. Getting a List of Censored Words
            6. Preserving the Session in the Hyperlinks
            7. IN_PHPBB
          4. Postings-Related Functions
            1. Create Links Automatically
            2. Processing Smilies
            3. Displaying a Posting Body
          5. Coding Guidelines
        7. Recent Postings MOD
          1. The Challenge
          2. The Template
          3. The Code
        8. Summary
      14. A. Directory Structure
        1. Required Directories
          1. The Root Directory
            1. extension.inc
            2. common.php
            3. config.php
          2. Administration Files
          3. Database Abstraction Layer Files
            1. Included Files
          4. Installation Files
          5. Language Packs
          6. Template Storage
        2. Optional Directories
          1. Cached Pages
          2. phpBB Documentation
          3. Images
        3. Other Directories of Note
          1. Contributed Extras
          2. Modification Files
      15. B. phpBB Resources
        1. phpBB.com—Documentation and Support
        2. MODs and Styles
        3. Programming
        4. Other Sites of Interest
      16. C. phpBB Code and Permission Cheatsheets
        1. BBCode Cheatsheet
          1. Formatting
          2. Lists
          3. Quotes and Code Snippets
          4. Inserting Images and Links
        2. Permissions Cheatsheet
          1. Permission Types
          2. Permission Levels
          3. Simple Mode Permissions
      17. D. phpBB Database Structure
        1. phpbb_auth_access
        2. phpbb_banlist
        3. phpbb_categories
        4. phpbb_config
        5. phpbb_confirm
        6. phpbb_disallow
        7. phpbb_forum_prune
        8. phpbb_forums
        9. phpbb_groups
        10. phpbb_posts
        11. phpbb_posts_text
        12. phpbb_privmsgs
        13. phpbb_privmsgs_text
        14. phpbb_ranks
        15. phpbb_search_results
        16. phpbb_search_wordlist
        17. phpbb_search_wordmatch
        18. phpbb_sessions
        19. phpbb_smilies
        20. phpbb_themes
        21. phpbb_themes_name
        22. phpbb_topics
        23. phpbb_topics_watch
        24. phpbb_user_group
        25. phpbb_users
        26. phpbb_vote_desc
        27. phpbb_vote_results
        28. phpbb_vote_voters
        29. phpbb_words