You are previewing Building Websites with PHP-Nuke.
O'Reilly logo
Building Websites with PHP-Nuke

Book Description

"

A practical guide to creating and maintaining your own community website with PHP-Nuke

  • Step through creating your own web portal with PHP-Nuke

  • Simple and practical guidance to mastering PHP-Nuke

  • For people with basic knowledge of web development

In Detail

PHP-Nuke is a free tool for managing the content of a dynamic website. As one of the most popular applications on the Internet, PHP-Nuke has grown into a complex, powerful tool with an extraordinary range of features, and a loyal community of supporters. Through a web-based interface, users can edit and manage their site without the need for knowledge of web programming. PHP-Nuke is ideal for running a community-driven website, where visitors create accounts, comment and interact with the site, and contribute material in an easily managed fashion. PHP-Nuke has many of the features you would want from a website such as news stories, ratings, comments, discussion forums, and its look can be easily controlled with the use of themes.

If you want to create a powerful, fully-featured website in no time, this book is for you. This book will help you explore PHP-Nuke, putting you in the picture of what it offers, and how to go about realizing this.

Throughout the book we develop an example site, as you are taken on a detailed tour of the features of PHP-Nuke. You will be introduced to the main components of PHP-Nuke, and learn how to manage them. You will develop the skills and confidence to manage all types of content on the site, and also understand how users work and interact with the site.

To make sure that you create a site that looks the way you want it to, the book covers customizing themes to help define your look for your pages.

Although PHP-Nuke allows you to accomplish much without doing any web programming, to extend your site you will need to get your hands dirty with some coding. The book leads you through adding custom code to PHP-Nuke, and shows you how PHP-Nuke puts pages together, and the functions it uses for the fundamental operations of the site.

A practical guide to creating and maintaining your own community website with PHP-Nuke, the legendary, free, open source website content management system

"

Table of Contents

  1. Building Websites with PHP-Nuke
    1. Building Websites with PHP-Nuke
    2. Credits
    3. About the Author
    4. Preface
      1. What This Book Covers
      2. What You Need To Use This Book
      3. Conventions
      4. Reader Feedback
      5. Customer Support
        1. Errata
        2. Questions
    5. 1. An Introduction to PHP-Nuke
      1. What PHP-Nuke Can Do for You
        1. The Visitor Experience
        2. The Management Experience
      2. What Exactly is PHP-Nuke?
        1. Modular Structure
        2. Themed Interface
        3. Multi-Lingual Interface
      3. PHP-Nuke as an Open-Source Content Management System
        1. Open Source
        2. Content Management System
      4. Getting Help in the PHP-Nuke Community
      5. The Dinosaur Portal
      6. Summary
    6. 2. Installing PHP-Nuke
      1. Downloading PHP-Nuke
        1. Extracting PHP-Nuke
      2. Downloading the Patches
        1. Applying the Patches
      3. Preparing the PHP-Nuke Database
        1. Creating the Database
        2. Creating a Database User
        3. Populating the Database
      4. Configuring PHP-Nuke
      5. Putting PHP-Nuke Files into the Web Server Root
      6. Testing the Installation
        1. Database Connection Problem
        2. No Data in the Database
        3. Still Having Problems?
      7. Summary
    7. 3. Your First Page
      1. Your New Homepage
      2. Blocks
      3. Modules
        1. A Fistful of Default Modules
      4. Creating the Super User
      5. Becoming the Administrator
        1. A New Welcome
        2. Editing Text in PHP-Nuke
          1. HTML Rules
          2. Forbidden Tags
          3. Adding Links
          4. Adding Images
          5. HTML Editor in PHP-Nuke 7.7
            1. Time For Action—Changing the Welcome Message
      6. Restricting User Access
      7. Summary
    8. 4. Managing the Site
      1. Your Site, Your Database
      2. Visiting the Administration Area
      3. Site Preferences
        1. Turning off the Graphical Icons
      4. The Cookie Crumbles
      5. Backing Up the Site Database
      6. Managing Blocks
        1. Types of Blocks
          1. Block Positioning
          2. Block Visibility
        2. The Blocks Administration Area
          1. Time For Action—Changing Block Position
        3. Adding Blocks
          1. Options for All Blocks
            1. Time For Action—Adding a Static Block
          2. Adding Other People's News with RSS/RDF Blocks
            1. Time For Action—Creating a New Headline Site
            2. Time For Action—Adding the RSS/RDF Block
          3. Adding a File Block
            1. Time For Action—Adding the Total Hits Block
              1. What Just Happened?
      7. Managing Modules
        1. Time For Action—Activating Modules
        2. Editing Module Properties
          1. Invisible Modules
            1. Time For Action—Editing the Top 10
        3. Adding New Modules
          1. Time For Action—Installing a Simple Module
            1. What Just Happened?
      8. Summary
    9. 5. Managing Users
      1. Ingredients of a User
      2. Setting Up a New User
        1. Time For Action—Setting Up a New User Manually
          1. What Just Happened?
        2. Subscribing a User
          1. Time For Action—Registering as a User
            1. What Just Happened?
        3. Graphical Code for User Registration
        4. Seeing Who's Who
      3. The Your Account Module
        1. Editing the User Profile
        2. Your Account Configuration
          1. Talking to the World with Public Messages
          2. It's My Block and I'll Cry if I Want to...
        3. Private Messages
        4. User Journal
          1. Your Journal Entries
          2. Adding a Journal Entry
            1. Viewing your Journal Entries
          3. Peeking into the Journals of Others
      4. Rewarding the User
        1. Points on Offer
          1. Time For Action—Awarding Points for Viewing Pages
            1. What Just Happened?
          2. Restricting Module Access to User Groups
            1. Time For Action—Restricting the Statistics Module to Frequent Page Viewers
              1. What Just Happened?
      5. Managing Other Administrators
        1. Authors versus the Super User
        2. Creating an Author
      6. Summary
    10. 6. Story Management with PHP‑Nuke
      1. The Story Story
        1. The Story Publication Process
        2. Finding and Interacting with Stories
      2. Organizing Stories
        1. Topics
        2. Categories
        3. Planning the Dinosaur Portal Topics and Categories
      3. Topic Management
        1. Time For Action—Creating New Topics
          1. What Just Happened?
        2. Time For Action—Editing Topics
          1. What Just Happened?
        3. Deleting a Topic
      4. Adding Stories
        1. Time For Action—Adding a New Story
          1. What Just Happened?
        2. Category Management
      5. The Visitor View of a Story
        1. Related Links, Scoring, and Friends
        2. Everyone Has an Opinion... Comments
          1. Time For Action—Posting a Comment
            1. What Just Happened?
          2. Time For Action—Replying to a Comment
            1. What Just Happened?
        3. Seeing Your Comments
        4. Controlling Comment Posting
          1. Allowing Comments
          2. Disallowing Comments
          3. Restricting Comment Posting to Registered Visitors
          4. Administrator Removal of Comments
          5. Filth Filter
          6. Karma and Comment Moderation
        5. Comments in Moderation
          1. Time For Action—Enabling Comment Moderation
            1. What Just Happened?
          2. Time For Action—Moderating Comments
            1. What Just Happened?
        6. Multiple Comment Moderation
        7. Customizing the User View of Comments
          1. Time For Action—Filtering out Comments
            1. What Just Happened?
      6. Story Management
        1. Editing Stories
        2. Deleting Stories
        3. User-Submitted Stories
          1. Setting Up the Mail Notification
          2. Visitor Story Submission
          3. Approving Stories
      7. Finding Stories
        1. From the Homepage
        2. From the Topics module
        3. From the Search module
        4. From the Story Archive
        5. From the Categories Menu Block
      8. Special Administrator
      9. Points and Prizes
      10. Sharing your News
      11. Polls and the Surveys Module
        1. Attaching a Poll to a Story
        2. The Surveys Module
        3. Survey Management
      12. Summary
    11. 7. Content Management Modules
      1. Content
        1. Time For Action—Creating a Content Category
          1. What Just Happened?
        2. Time For Action—Adding a Content Page
          1. What Just Happened?
        3. The Content Block
        4. Managing Categories
        5. Special Administrator
        6. Restricting Access
        7. Points and Prizes
      2. FAQ
        1. Time For Action—Adding a FAQ Category
          1. What Just Happened?
        2. Time For Action—Adding a FAQ
          1. What Just Happened?
        3. Managing FAQs
          1. Editing a FAQ
        4. The FAQ Block
        5. Special Administrator
        6. Restricting Access
        7. Points and Prizes
      3. Encyclopedia
        1. Time For Action—Adding a new Encyclopedia
          1. What Just Happened?
        2. Time For Action—Adding a new Entry
          1. What Just Happened?
        3. Managing the Encyclopedia
        4. Viewing the Encyclopedia
        5. The Encyclopedia Block
        6. Special Administrator
        7. Restricting Access
        8. Points and Prizes
      4. Web Links and Downloads
        1. Time For Action—Creating a Web Link Category Structure
          1. What Just Happened?
        2. Time For Action—Adding a Web Link
          1. What Just Happened?
        3. Interacting with Web Links
        4. Checking the Web Link
          1. Modifying Web Link Details
          2. Reporting Broken Links
        5. Submitting Web Links
        6. Managing Web Links
          1. Modifying Web Links
          2. Managing User-Submitted Web Links
          3. Managing User-Submitted Modification Requests
          4. Managing User-Submitted Broken Link Notifications
          5. Validating Links
          6. Changing Category Structure
            1. Time For Action—Moving Categories
              1. What Just Happened?
        7. Web Links Block
        8. Special Administrator
        9. Restricting Access
        10. Points and Prizes
      5. Reviews
        1. Submitting Reviews
        2. Interacting with Reviews
        3. Managing Reviews
          1. Customizing the Reviews Welcome Page
        4. The Reviews Block
        5. Special Administrator
        6. Restricting Access
        7. Points and Prizes
      6. Module Feature Comparison
      7. Summary
    12. 8. Managing the Discussion Forums
      1. Forum Structure
      2. The Forums Administration Area
        1. Forum Configuration
          1. Creating a Category
          2. Creating a Forum
      3. The Visitor Experience
        1. Posting a Topic
      4. Forum Permissions
        1. Creating Groups
        2. Setting Forum Permissions
        3. Setting Group Permissions
        4. Joining Groups
          1. Approving the Membership Application
      5. Moderating the Forum
        1. Setting a Forum Moderator
      6. Summary
    13. 9. Customizing Layout with Themes
      1. What Does a Theme Control?
        1. Appearance
        2. Page Layout
      2. Theme Management
        1. Theme File Structure
        2. Installing a New Theme
        3. Removing an Existing Theme
      3. From an Existing Theme to a New Theme
        1. Starting Off
          1. Replacing Traces of the Old Theme
        2. Templates and PHP Files
          1. PHP Files
          2. Templates
        3. Changing the Page Header
          1. Time For Action—Changing the Site Logo Graphic
            1. What Just Happened?
          2. Time For Action—Changing the Site Header Layout
            1. What Just Happened?
          3. Time For Action—Fixing and Adding the Topics List
            1. What just Happened?
          4. Time For Action—Adding a Welcome Message to the User
            1. What Just Happened?
          5. Time For Action—Adding the User Avatar
            1. What Just Happened?
          6. Time For Action—Adding a Horizontal Navigation Bar
            1. What Just Happened?
          7. Time For Action—Changing Some Background Colors
            1. What Just Happened?
        4. Working with the Stylesheet
          1. Time For Action—Background Image with Style
            1. What Just Happened?
          2. Time For Action—Changing the Links
            1. What Just Happened?
          3. Time For Action—Changing the OpenTable() Function
            1. What Just Happened?
          4. Time For Action—Styling the Navigation Bar
            1. What Just Happened?
        5. Changing Blocks
          1. Time For Action—Show Right-Hand Blocks on All Pages
            1. What Just Happened?
          2. Time For Action—Hide Right-Hand Blocks For Certain Modules
            1. What Just Happened?
          3. Time For Action—Making the Block Titles Uppercase
            1. What Just Happened?
          4. Time For Action—Creating a New Block
            1. What Just Happened?
          5. Time For Action—Making Right-Hand Blocks Different from Left-Hand Blocks
            1. What Just Happened?
        6. Changing Story Layout
          1. Creating a Rounded Box
            1. Creating the Corner Images
            2. Creating the HTML
            3. Creating the CSS
              1. Time For Action—Change the Format of Stories on the Front Page
                1. What Just Happened?
            4. Variables Available in Story Formatting
          2. Changing the Layout of the Story Extended View
        7. Changing the Footer
      4. Adding a Favicon
        1. Including Custom Files
      5. Page Output from Start to Finish
      6. Summary
    14. 10. Programming PHP-Nuke
      1. What Happens When a Page is Requested?
        1. Where Does PHP-Nuke Get Information From?
        2. Requesting a Page
      2. Creating a Block
        1. Time For Action—Creating the Database Table
          1. What Just Happened?
        2. Time For Action—Creating the Text File
          1. What Just Happened?
        3. Time For Action—Creating the Block Code
          1. What Just Happened?
      3. Data Access in PHP-Nuke
      4. Module File and Folder Structure
      5. Creating a User Submissions Module
        1. Module Development Steps
        2. Creating the Module Folder
        3. Creating the Database Tables
        4. The Visitor Code—the index.php File
          1. Overall Structure of the Module index.php File
            1. Tracking Down the Code for a Module Operation
          2. Inviting the User to Submit an Item
            1. Getting User Information
            2. Preparing the ShowTypes() Function for Languages
          3. Displaying the Form for User Input
          4. Preparing to Add the Encyclopedia Entry
          5. Storing the Submission
        5. The User Submission Administration Area
          1. Creating the Modules Administration Menu Entry
          2. Selecting the Correct Administration Area
        6. Creating the Administration Code
          1. Displaying the List of Submitted Items
          2. Editing and Approving the Submitted Item
          3. Displaying the Submitted Item
          4. Accepting the Submitted Item
          5. Removing a Submitted Item
          6. Deleting a Submitted Item
        7. Extending the Module
          1. Extending at the Front End
          2. Extending at the Administration End
      6. Summary
    15. A. Installing XAMPP