PHP-Nuke Garage

Team LiB
Next Section
Book Cover
• | Table of Contents
• | Index
PHP-Nuke Garage
By Don Jones
Publisher | : Prentice Hall PTR
Pub Date | : February 02, 2005
ISBN | : 0-13-185516-6
Pages | : 408

Enter your PHP-Nuke Garage... where you master the most powerful, cheap (and/or free) Web content system ever created, then use it to build great Web sites, portals, or communities... hands-on, step-by-step.

PHP-Nuke is remarkably capable and reliable, but until now, it's been poorly documented. This book fills the gap. Best of all, you can use it even if you have no experience with PHP, databases, coding, or hosting. Drawing on practical examples from a live example site, top IT author/trainer Don Jones illuminates every facet of working with PHP-Nuke: installation, configuration, customization, security, day-to-day administration, and much more.

Topics include: content delivery, design and themes, forums, journals, downloads, member lists, news/reviews, personalization, RSS, archiving, FAQs, feedback, statistics, surveys, pay sites, AvantGo mobile content, Amazon e-commerce links, and more. Jones even shows how to find a PHP-Nuke hosting service to handle the infrastructure for you -- so you can focus on content, not technology.

Organized into 66 easy modules, designed for rapid learning, and based on real examples, PHP-Nuke Garage will help you create the interactive site you've always wanted -- faster than you ever thought possible.

Team LiB
Next Section


Table of Contents

Team LiB
Book Cover
• | Table of Contents
• | Index
PHP-Nuke Garage
By Don Jones
Publisher | : Prentice Hall PTR
Pub Date | : February 02, 2005
ISBN | : 0-13-185516-6
Pages | : 408

Copyright
Praise for PHP-Nuke Garage
The Garage Series
About the Author
Preface
Acknowledgments
Part I. PHP-Nuke Quick Start
 | Chapter 1. What Is PHP-Nuke?
 |  | Yeah, but What Is It?
 |  | Who's Using PHP-Nuke?
 |  | Are There Any Alternatives?
 |  | A Word on Versions
 |  | Wondering What to Do First?
 | Chapter 2. How PHP-Nuke Works
 |  | Let's Start from the Very Beginning
 |  | Piles of Files and Folders
 |  | How Much of This Do I Need to Know?
 | Chapter 3. Understanding the Nuke Lingo
 |  | A Quick PHP-Nuke Tour
 |  | Of Modules, Mice, and Men
 |  | The Many Flavors of User
 |  | Articles and Topics
 |  | And Finally, Themes
 | Chapter 4. Finding a PHP-Nuke Host
 |  | Comparing Hosts: A Plethora of Checklists
 | Chapter 5. Installing PHP-Nuke
 |  | Before You Even Think About Starting
 |  | Before You Install PHP-Nuke
 |  | Installing PHP-Nuke
 |  | Do This, Right Now
 |  | All Done?
 | Chapter 6. Configuring Site Preferences
 |  | General Site Info
 |  | Multilingual and Banner Options
 |  | Footer Messages
 |  | Back-End Configuration
 |  | Mail New Stories to Admin
 |  | Comments, Graphics, and Miscellaneous Options
 |  | Users and Censor Options
 | Chapter 7. Choosing Modules
 |  | Managing Modules
 |  | The Modules
 |  | What Modules Are Right for You?
 | Chapter 8. Choosing Blocks
 |  | Block Management
 |  | The Blocks You Get
 | Chapter 9. Writing a Story
 |  | The Add New Article Screen
 |  | Formatting Your Story
Part II. Using PHP-Nuke
 | Chapter 10. Controlling Access to Modules
 |  | Types of Sites
 |  | Setting Up Access Control
 | Chapter 11. Using the AvantGo Module
 |  | Customizing the AvantGo Module
 |  | Using the AvantGo Module
 | Chapter 12. Using the Content Module
 |  | Making Content
 |  | Accessing Content
 | Chapter 13. Using the Downloads Module
 |  | Setting Up Downloads
 |  | Using and Managing Downloads
 |  | User-Submitted Downloads
 | Chapter 14. Using the Encyclopedia Module
 |  | Using Encyclopedias
 | Chapter 15. Using the FAQ Module
 |  | Using FAQs
 | Chapter 16. Using the Feedback Module
 | Chapter 17. Using the Journal Module
 |  | Updating Your Journal
 |  | Other Users' Journals
 | Chapter 18. Using the Members List Module
 | Chapter 19. Using the News Module
 |  | Administering Stories
 |  | Writing a New Story
 |  | Topics and Categories
 | Chapter 20. Using the Private Messages Module
 |  | Sending a Message
 | Chapter 21. Using the Recommend Us Module
 |  | Customizing the Message
 | Chapter 22. Using the Reviews Module
 |  | Writing a Review
 |  | Reviewing Reviews
 | Chapter 23. Using the Search Module
 |  | Search Results
 |  | Author, Author!
 | Chapter 24. Using the Sections Module
 |  | Sections? News? Content?
 | Chapter 25. Using the Statistics Module
 |  | Basic Statistics
 |  | Detailed Statistics
 | Chapter 26. Using the Stories Archive Module
 | Chapter 27. Using the Surveys Module
 |  | Using Surveys
 | Chapter 28. Using the Top Module
 | Chapter 29. Using the Topics Module
 |  | Making a Topic Icon
 |  | Using the Topics Module
 | Chapter 30. Using the Web Links Module
 |  | Using Web Links
 |  | Advanced Link Administration
 | Chapter 31. Using the Your Account Module
 |  | Pros and Cons
 | Chapter 32. Adding the NSN Your Account Tweak
 |  | Obtaining the Tweak
 |  | Installing the Tweak
 |  | Cha-Cha-Cha-Changes!
 |  | Configuring YAT
 |  | Using YAT
 | Chapter 33. Adding the Events Calendar Module
 |  | Administering Event Calendar
 |  | Using Event Calendar
 |  | Calendar Blocks
 | Chapter 34. Adding the Amazon.com Module
 |  | Administering NukeAmazon
 |  | Using NukeAmazon
 | Chapter 35. Making Your Own Simple HTML Module
 |  | A Shortcut
 | Chapter 36. Making Your Own Dynamic Module
 |  | The Basic Structure
 |  | Multifile Modules
 |  | A Basic Dynamic Module
 |  | Working with User Input
 |  | Databases
 | Chapter 37. Selecting and Using Built-In Blocks
 | Chapter 38. Using RSS Newsfeed Blocks
 | Chapter 39. Adding Third-Party Blocks
 | Chapter 40. Making Your Own Simple HTML Block
 |  | Using Static HTML
 |  | Or, There's the Extra-Easy Way
 | Chapter 41. Making Your Own Dynamic Block
Part III. PHP-Nuke Administration
 | Chapter 42. Administering Stories and Topics
 |  | Understanding the Structure
 |  | Planning User Access to Stories and Topics
 |  | Managing Topics
 |  | Creating and Scheduling Stories
 |  | The User's Views
 |  | Topic and Category Strategies
 | Chapter 43. Backing Up Your Site and Database
 | Chapter 44. Administering Banners
 |  | About Banners
 |  | Banner Administration
 |  | Banner Clients
 |  | Banners and Subscribers
 |  | Suggestions for Using Banners
 | Chapter 45. Administering Content
 |  | Content Administration
 |  | Content Strategies
 | Chapter 46. Administering Users, Admins, and Groups
 |  | All About Users
 |  | All About Groups
 |  | Creating a User Group
 |  | All About Admins
 | Chapter 47. Reviewing HTTP Referrers
 |  | Modifying Referrer Preferences
 | Chapter 48. Administering Messages
 | Chapter 49. Sending an e-Newsletter
 |  | A Working Newsletter
 | Chapter 50. Working with Submissions
 |  | Submitted News Stories and Reviews
 |  | Links and Downloads
 |  | Other Submissions
 | Chapter 51. Administering Surveys and Polls
 |  | Survey Strategies
 | Chapter 52. Understanding Themes
 |  | Theme Basics
 |  | An Example Theme
 | Chapter 53. Installing a Third-Party Theme
 |  | Theme Tips
 | Chapter 54. Tweaking a Theme to Meet Your Needs
 |  | Modifying Text Elements
 |  | Modifying Graphical Elements
Part IV. The PHP-Nuke Forums
 | Chapter 55. Managing Forums and Categories
 | Chapter 56. Managing Forums Settings
 |  | Avatar Management
 |  | Backup Database and Restore Database
 |  | Configuration
 |  | Mass E-mail
 |  | Smilies
 |  | Word Censors
 | Chapter 57. Using a Forum
 |  | Posting a Topic
 |  | Reading the Forums
 |  | Other Forums Options
 | Chapter 58. Moderating a Forum
 | Chapter 59. Managing Forums Security
 |  | Advanced Permissions
 |  | User Permissions
 |  | Group Permissions
 |  | What's a Moderator?
 | Chapter 60. Maintaining the Forums
Part V. Advanced PHP-Nuke Topics
 | Chapter 61. Fixing Common Errors
 |  | Installation Errors
 |  | Day-to-Day Errors
 | Chapter 62. Moving a PHP-Nuke Site to a New Host
 |  | Moving Your Site
 |  | Moving Your Domain Name
 | Chapter 63. Creating a Pay Subscription Site
 | Chapter 64. Working with the PHP-Nuke Database
 | Chapter 65. Securing PHP-Nuke
 | Chapter 66. Upgrading PHP-Nuke
 | Chapter 67. Last-Minute Changes
Index

Team LiB


Copyright

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.

The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests.

For more information, please contact:

U. S. Corporate and Government Sales
(800) 382-3419
corpsales@pearsontechgroup.com

For sales outside the U. S., please contact:

International Sales
international@pearsoned.com

Visit us on the Web: www.phptr.com

Library of Congress Catalog Number: 2004114353

Copyright © 2005 Pearson Education, Inc.

All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to:

Pearson Education, Inc.
Rights and Contracts Department
One Lake Street
Upper Saddle River, NJ 07458

Text printed in the United States on recycled paper at Edwards Brothers in Ann Arbor Michigan.

First printing, February 2005

Dedication

For Tigger and Ziggy


Praise for PHP-Nuke Garage

"This is a great book! The author's style is conversational and very easy to read and he has totally sold me on PHP-Nuke."

Robert Husted, Team Lead, TDS Telecom

"I developed my own Web site ( www.auditingwindows.com ) using PHP-Nuke and was very shocked to see that there was so much that I was not aware of regarding the product. I think that the book has raised the bar for quality and completeness. I would suggest this book to anyone who is new to PHP-Nuke all the way to experts, as it provides additional info experts may not be familiar with. The second part of the book certainly covers in depth topics that go beyond typical site development, but are fantastic for someone that would like to use these features."

Derek Melber, President, BrainCore.Net AZ, Inc.

"I use PHP-Nuke in a bilingual environment and have found it a perfect portal for multilingual deployment. This book addresses important aspects of PHP-Nuke in a sequence of topics that is both logical and user-friendly. Its layout makes it easy to navigate for the reader, who may be performing a variety of administrative tasks simultaneously. This book is an asset to anyone interested in having their own Web portal."

Joe Naberhaus, Professor, Universidad Del Mar

"At long last, the English-speaking PHP-Nuke community has a useful, step-by-step guide to setting up and managing a PHP-Nuke site."

Tim Evans, TKEvans.com, Inc.

"The aim and scope of the book appear to be exactly what is required by the PHP-Nuke community and those wishing to take advantage of all of the PHP-Nuke software capabilities."

Garry Neesam, Webmaster, Police999.com, currently running three PHP-Nuke Web sites


The Garage Series

Street-smart books about technology

Each author presents a unique take on solving problems, using a format designed to replicate the experience of Web searching.

Technology presented and organized by useful topicnot in a linear tutorial style.

Books that cover whatever needs to be covered to get the project done. Period.

Eben Hewitt, Java Garage. ISBN: 0321246233.

Tara Calishain, Web Search Garage. ISBN: 0131471481.

Kirk McElhearn, iPod & iTunes Garage. ISBN: 0131486454.

Marc Campbell, Web Design Garage. ISBN: 0131481991.

Don Jones, PHP-Nuke Garage. ISBN: 0131855166.

Dan Livingston, ActionScript 2.0 Garage. ISBN: 0131484753.

                         <a garage is where you work.
 in a garage, you do your  work, not somebody else's.
 it's where you experiment and listen to the old ball
                                    game. make music.
                                            get away.
                                              tinker.
it's where you do projects for passion, make your own
                                           rules, and
                          plot like an evil genius./>

(Irreverent. Culturally rooted.)

Edgy and fun. Lively writing. (The impersonal voice of an omniscient narrator is not allowed!)

[Eben Hewitt, series editor]

Check out the series at www.phptr.com/garageseries


About the Author

Don Jones has been working in the information technology industry for more than ten years. His first Web site, www.eboutique.com, was built in 1993 for a former employer. Today, he operates a number of Web sites, including one built entirely in PHP-Nuke. Don is a popular industry author, with more than a dozen books published, and is a frequent speaker at national technical conferences. He's also a Microsoft Most Valuable Professional (MVP). Don currently resides in Las Vegas, Nevada.


Preface

Ever wanted to make a really great Web site? One that not only looked good, but offered cool features like discussion forums, product reviews, news announcements, and more? Chances are, you've tried using something like Microsoft FrontPage, which is a great Web page editor but a lousy Web site builder, in many regards: it takes a lot of work. You may have even discovered third-party tools that create discussion forums and other neat features, but how do you tie them all together into one cohesive-looking site?

You could just keep plugging away until you come up with something you like, but I recommend doing what thousands of others have done: get Nuked. PHP-Nuke, to be specific, a Web portal or content-management system software package that's totally free, that's easy to use, and that offers a point-and-click way to create just about any kind of Web site you want. Do you need to know any programming? Nah. Don't get me wrong, knowing how to program will vastly expand the list of things you can do with PHP-Nuke, but you can do some flat-out amazing things without typing a single line of programming code. Lots of other people know how to program, and they've created add-ins for PHP-Nukemost of which are also freeso you can add functionality to your site simply by copying files and selecting a few preferences.

Do you need to know how to install PHP-Nuke? Maybe not. If you want to run your Web site on your own server, you may need to install PHP-Nuke yourself. It's not hard, and I'll cover the basic steps. But lots of people are paying someone elsea Web hostto host their Web sites. Many Web hosts also offer preinstalled PHP-Nuke packages, meaning that you can sign up and start creating your Web site within a few hours.

This book, then, is all about using PHP-Nuke. I don't assume that you have a lot of Web experience, and I certainly don't expect you to know how to program. Instead, I'll simply walk you through each and every aspect of PHP-Nuke, show you how it works, and give you some examples of how to use it. The great part about the Garage series is that you don't even have to read this book in the order I wrote it. Heck, I didn't even write it in order. Instead, you can just skip right to the topics that interest you. Want to know how to set up a news-letter on your site? Go to that topic first. Interested in posting book or product reviews on your site? There's a topic that shows you how. You build your Web site your way, in your order. Each topic is just a few pages long, with plenty of information and plenty of screen shots so that you can follow along more easily and get finished quickly.

I work mainly with Microsoft products, and I've written about a dozen books on Microsoft technologies. But when it came time for me to put up my own Web site on Microsoft scripting (www.scriptinganswers.com, which you'll see peppered throughout this book), I went with a decidedly non-Microsoft solution: PHP-Nuke. I didn't have time to create a Web site from scratch; I wanted to be able to click a few buttons and have a Web site up and running. That's what PHP-Nuke gave me, and I believe you'll get just as much satisfaction from working with it.

As you work with PHP-Nuke, you may run across folks on the Web who are really hardcore PHP-Nuke administrators. Don't feel intimidated! Just as with any other technology, there are the hardcore geekslike the folks who spend their weekends under the car hoods tuning things upand there are folks who just utilize the technologylike the folks who drive a car to work and pay someone else to change the oil. I'm kind of assuming you're in the latter category: you've got a Web site that you want to put up, you want to get it there quickly, and you don't want to have to learn a whole new profession to get there. If that's you, you're in the right book. I've tried to make it easy to get to know PHP-Nuke and to get your Web site up and running as quickly as possible.


Acknowledgments

I'd like to acknowledge everyone at Prentice Hall who's worked so hard to produce this book, as well as my literary agency, Studio B, for helping to shepherd the book through to completion. I'd like to thank the PHP-Nuke community for continuouslyand selflesslyworking to make such an easy-to-use, flexible piece of software. I'd also like to recognize the many folks who reviewed this text and offered suggestions and comments (although the final content is entirely my responsibility): Derek Melber, Joe Naberhaus, Tim Evans, Robert Husted, and series editor Eben Hewitt. Everyone's top concern was making this book as useful as possible.


Part I. PHP-Nuke Quick Start

Team LiB

Part I: PHP-Nuke Quick Start

What Is PHP-Nuke?

How PHP-Nuke Works

Understanding the Nuke Lingo

Finding a PHP-Nuke Host

Installing PHP-Nuke

Configuring Site Preferences

Choosing Modules

Choosing Blocks

Writing a Story


Chapter 1. What Is PHP-Nuke?

Let's start by ignoring the Nuke part of PHP-Nuke; it isn't nuclear-powered, and there's almost no danger of it starting a fission reaction or anything. The PHP part stands for PHP Hypertext Preprocessor (or something like thatit depends on whom you ask). Yeah, the P in PHP stands for PHP. It's called a self-referential acronym, and it's thought to be cute by the tech-heads who come up with this stuff.

Language lesson aside, PHP-Nuke is what we in the biz call a content-management system. In English, that means PHP-Nuke is a place where you can put gobs of contentnews articles, recipes, videogame tips, or whatever you likeall in one place. You can manage that content so that only certain people have access, so that certain content is published at a specific time, and so forth.

It's probably more accurate to say that PHP-Nuke started as a content-management system. Today's PHP-Nuke has grown into a full-fledged "Web site in a box" software package that contains everything but the kitchen sink. And I'm pretty sure I saw a kitchen sink add-in somewhere on the Internet. You (or, better yet, someone else) can install PHP-Nuke and get a Web site up and running in a few seconds. And that Web site won't be some weak-looking site that you put together in FrontPage; no, it'll be a complete Web site, with discussion boards, the capability for users to register, a newsletter-sending facility, and bunches more. All built right in. You can make your new Web site look however you want, thanks to PHP-Nuke's support for themes which, like Garanimals clothes for kids, let you select a coordinated look and feel for your Web site simply by selecting a menu option.

Okay, bottom line: What is PHP-Nuke, anyway? It's a tool for building Web sites that do what you want, look like what you want, and behave like you want. Like a big box of Legos, PHP-Nuke gives you a lot of components to work with, but you can assemble them in almost any way you please to make the Web site you really want.


Yeah, but What Is It?

Bear with me for some technical background material. PHP is a separate technology, designed for server-side scripting. Essentially, you make normal Web pages, which are formatted using the Hypertext Markup Language, or HTML. PHP then adds programming code right in with the HTML. When a Web browser asks a Web server for a PHP page, the Web server takes a moment to execute all that PHP code. The code runs on the server and does stuff like access the database, output text, and so forth. The practical upshot of all this is that you get a dynamic Web page, one which might look a bit different each time it's sent to a Web browser.

For a simple example, point your Web browser to www.ScriptingAnswers.com/cms2. Each time you look at this page, it'll be slightly different: Perhaps a different survey will be shown or the login security code will change. That's all the result of PHP code, or scripts, being executed on the Web server as the page is being transmitted to your Web browser.

PHP-Nuke is written entirely in PHP. So PHP-Nuke is basically a big bucket of Web pages with PHP scripts embedded in them. PHP, by the way, is completely free. Most of the databases used by PHP-Nuke (MySQL is a popular choice) are free. PHP-Nuke is free. The Apache Web server software usually used to host PHP-Nuke sites is free. The Linux operating system usually used on PHP-Nuke Web servers iswait for itfree. You can see how software would become popular with that pricing model.

So PHP-Nuke uses all of the PHP magic to create a Web site. How much do you need to know about PHP to use PHP-Nuke? Nada. Sure, a little bit of knowledge can go a long way if you really want to dive into PHP-Nuke and tweak it, but you don't need to do that. Most of the customization you do with PHP-Nuke is all done from a Web-based administrative interface, where you just click buttons and stuff to change the way your site works. You don't even need to know much in the way of HTML or anything else to use PHP-Nuke. It's just that simple to use.


Who's Using PHP-Nuke?

Heck, who isn't? Check out this diverse list of Web sites I found that use PHP-Nuke:

  • http://www.poetry4kids.com A Web site for children's poetry

  • http:://mobility.embo.org The Life Sciences Mobility Portal from EMBO

  • http://protector.warcenter.se The home page of Protector System

  • http://www.toms-home.com The home page for what appears to be a fellow named Tom

  • http://www.xplanefreeware.net A site for freeware related to the X-Plane Flight Simulator

  • http://www.lyricsworld.com A site for finding music lyrics

  • http://www.vg-network.com A site for fans of "vintage gaming," as in old computer games like that Atari you had when you were a kid

As you can see from this list, there's quite a variety of folks using PHP-Nuke. And if you check out these sites, you'll see that while they offer similar featuresdiscussion groups, downloads, a search engine, and so forthno two really look alike. Their owners have customized them, using PHP-Nuke's built-in tools to create a site that uniquely represents whatever it is they're all about. They're all using PHP-Nuke as a tool to create an online community centered on their interests, whether that is kids' poetry or old Nintendo games. There are even commercial sites using PHP-Nuke to sell software, computer hardware, and more.

From the Fridge

I run my own PHP-Nuke Web site, which is how I became interested in PHP-Nuke in the first place. It's called www.ScriptingAnswers.com, and it's a site designed for administrators of Microsoft Windows networks. It has absolutely nothing to do with PHP-Nuke itself, and believe me when I tell you that no few people at Microsoft have commented on the irony of me hosting this Windows-oriented Web site on a completely non-Microsoft platform using non-Microsoft software. Oh, well.

By the way, it's not that you can't run PHP-Nuke on a Microsoft server. There are versions of PHP for Microsoft's IIS Web server, and you can install and run Apache Web servers on Windows as well. It's just that I was looking for an inexpensive hosting solution, and those pretty much are all Linux-based since Linux doesn't cost anything.


Are There Any Alternatives?

You bet. Microsoft would love you to check out its SharePoint Portal Server, which is sort of similar to PHP-Nuke. IBM has its WebSphere product, which is also similar in terms of functionality. These, however, are enterprise-class solutions. They're designed to be deployed by the IT department of a large corporation, not by your mom. They're also really, really expensive and can cost tens of thousands of dollars to deploy, and may require several dedicated servers. PHP-Nuke doesn't provide the exact same functionality or capability as those commercial solutions, but it's free and can run on a cheap Web server. PHP-Nuke is perfect for everything from an internal departmental or workgroup Web site, or for your own personal Web site.

Now, keep in mind that imitation is the sincerest form of flattery. The success of PHP-Nuke has spawned literally dozens of imitators, not to mention derivative products, most of which are, like PHP-Nuke, free. Some of these were created to fill what their authors perceived as holes in PHP-Nuke's functionality. Some were created because their authors didn't like PHP-Nuke's author. Some were created to merge PHP-Nuke with another piece of software. You're welcome to check out these things; some of them do fill some specific needs. I've found PHP-Nuke to be just about perfect for most anything, though, which is, of course, why I wrote this book. Some of the PHP-Nuke competitors include these:

  • PostNuke, which is available at www.postnuke.com This is built along roughly the same lines as PHP-Nuke and does roughly the same things. There's more community support for PHP-Nuke, meaning you'll find more folks writing add-ins and offering help and advice.

  • NSN-Nuke, from www.nukescripts.net These folks actually make a lot of add-ins and tweaks for PHP-Nuke; NSN-Nuke seems to be a version of PHP-Nuke that incorporates all of their scripts. I'm not really clear on the benefits of NSN-Nuke over PHP-Nuke, though.

  • OSC2Nuke, which lives at www.osc2nuke.biz This is a merging of PHP-Nuke with the popular osCommerce software, which enables you to create online stores and shops.

There are certainly others. The differences between them are often as clear as the differences between German sports cars, which is to say that people get really excited about the product they like and really upset with people who like other products. Me, I'm happy with PHP-Nuke, and I'm betting you'll be pretty happy with it, too.


A Word on Versions

When I started writing this book, PHP-Nuke was at version 7.3. That's the version I have installed at www.ScriptingAnswers.com/cms2, which is the sample PHP-Nuke Web site I'll use throughout this book. The author of PHP-Nuke releases a new version every few months or so, but at some point I had to pin down which version I was going to use for the book. Given the time it takes to write a book, edit the manuscript, chop down trees, and print the thing, I can absolutely guarantee that a different version will be the "latest" by the time you're reading this.

Fret not. For the most part, each version of PHP-Nuke introduces relatively minor changes. It'll be a big deal going from 6.9 (which was a very popular version) to 7.3 because there were four versions' worth of changes, but for the most part, the product evolves relatively slowly. Many Web-hosting companies that include PHP-Nuke with their service are still installing v6.9, and you know what? It works fine. PHP-Nuke isn't like Microsoft Office or something, where if you don't have the latest version, the cool kids won't talk to you anymore. Plenty of folks are running the very stable older versions, and they're quite happy.

That said, if you do decide to upgrade, it's not difficult. Topic 66, "Upgrading PHP-Nuke," covers upgrades, in fact, showing you how to go from v6.9 to v7.3. (v6.9 is what my Web-hosting company installs for me, so I had to manually upgrade to 7.3. It was a piece of cake, as you'll see.)

So the bottom line is, don't worry too much about versions. Know what version you've got, and pay attention to www.phpnuke.org to see if the latest version has any features you care about. But don't think you need to upgrade "just because."


Wondering What to Do First?

In the next topic, I discuss how PHP-Nuke works under the hood. If you're interested in just getting started, I recommend that you skip that and move straight on to Topic 3, "Understanding the Nuke Lingo," which explains some important PHP-Nuke terms and concepts. If you've already got a Web host that installed PHP-Nuke for you, move right on to Topic 6, "Setting Site Preferences," to start configuring it; if not, Topic 4, "Finding a PHP-Nuke Host," will help you choose a PHP-Nuke hosting service. If you plan to install PHP-Nuke yourself, I'll walk you through that process in Topic 5, "Installing PHP-Nuke." Otherwise, you get to call the shots: Don't feel that you have to read the remainder of the book straight through. Don't let me tell you what to do first; decide what you want to do first, and then flip to the associated topic.


Chapter 2. How PHP-Nuke Works

I'm going to spend the next few pages indulging your inner geek. If you don't have an inner geek and wish I'd just get on with configuring PHP-Nuke, skip ahead one topic; I'll explain some critical PHP-Nuke terms in Topic 3, "Understanding the Nuke Lingo," and get right into configuration by Topic 6, "Configuring Site Preferences." Promise.

If you plan to continue with the inner-geek experience, go ahead and download PHP-Nuke from www.phpnuke.org. Even if you won't be hosting your Web site on your home computer, it'll be handy to have a local copy of PHP-Nuke to play with and look at. You don't need to set up a Web browser or anything; you can look inside PHP-Nuke's files using Windows Notepad, which is all you'll need for right now.


Let's Start from the Very Beginning

Somewhere in all the PHP-Nuke filesoften in a folder named HTMLyou'll find index.php, the main page that loads up when someone visits your PHP-Nuke Web site. Open a copy of Windows Notepad, and drag index.php into it. If you're a pretty hardcore kind of technology person, what you see will look interesting, or even fun. If you're not, it'll look terrifying. Don't worry; you don't need to learn any of this stuff. It's just fun to know. Here's what's at the top of my index.php file:

[View full width]

require_once("mainfile.php");
$_SERVER['PHP_SELF'] = "modules.php";
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module from ".$prefix."_main"));
$name = $row['main_module'];
$home = 1;

if ($httpref==1) {
    $referer = $_SERVER["HTTP_REFERER"];
    $referer = check_html($referer, nohtml);
    if ($referer=="" OR eregi("^unknown", $referer) OR substr("$referer",0,strlen
  ($nukeurl))==$nukeurl OR eregi("^bookmark",$referer)) {
    } else {
    $result = $db->sql_query("INSERT INTO ".$prefix."_referer VALUES
    (NULL, '$referer')");
    }
    $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM
    ".$prefix."_referer"));
    if($numrows>=$httprefmax) {
    $result2 = $db->sql_query("DELETE FROM ".$prefix."_referer");
    }
}

Cool, huh? This is the PHP language that PHP-Nuke is written in. Notice that the very first line instructs PHP to include, through the require_once function, a file named mainfil.php. You'll notice the user of require_once() and its companion, include(), throughout PHP-Nuke. In fact, for every single PHP-Nuke page, it's good odds that there were actually a half-dozen or more files involved. When index.php loads up for a Web browser, the server also reads inor includesany file mentioned in a require_once() or include() directive. This technique of including multiple files makes PHP-Nuke very modular and is, in fact, a key to its flexibility.

You'll also see a lot of database work going on inside a PHP-Nuke file. That's all that $db->sql_query stuff you see going on in that excerpt I showed you: queries from the database. Just about every piece of PHP-Nuke's configuration is contained in its database, including what theme your site is using, what modules are displayed on the pages, the actual content you add to the site, and more. PHP-Nuke without a database is like a Las Vegas casino without playing cards or dice: useless.

Scrolling down a bit in the index.php file, you'll see something like this:

    if (is_admin($admin)) {
        echo "<center><font class=\"\"><b>"._HOMEPROBLEM."</b></font><br><br>
[ <a href=\"admin.php?op=modules\">"._ADDAHOME."</a> ]</center>";
    } else {
        echo "<center>"._HOMEPROBLEMUSER."</center>";
    }

That echo statement actually writes out text and HTML that your Web browser will see. You'll notice that it's outputting some HTML tags, like <center> and <font>. What you don't see is any actual text, and you can stop looking because you won't find much of it in any PHP-Nuke file. That's because PHP-Nuke is fully localized, meaning that its user interface has been translated into more than 30 other languages. In the previous snippet, ._HOMEPROBLEM and ._HOMEPROBLEMUSER represent two strings of text that need to be displayed. These are replaced by actual text in whatever language PHP-Nuke is set up to use. So, for an English user, they might say something like "There's a problem with the home page, buddy." For a Thai user, on the other hand, they'd say something similar in Thai, using the appropriate character set and everything. Individual users on your sitewith your permissioncan specify their preferred language, and your site will automatically display in that language. That does not, by the way, mean your content will be automagically translated. PHP-Nuke is nice, but it's not magic. Setting a language preference displays the PHP-Nuke interface in the specified language; it's up to you to provide translations for any content you add.


Piles of Files and Folders

Figure 2.1 shows a Windows Explorer view of the PHP-Nuke files and folders. As you can see, there are a bunch of them.

Figure 2.1. The PHP-Nuke files and folders.

[View full size image]

It might be useful to know what's contained in these folders, in case you have to find a particular file:

  • The Admin folder contains the pages that make up the administrative interface, which are the pages you use to configure the site and its various options and modules.

  • The Blocks folder contains the files that make up PHP-Nuke's blocks, which are the little boxes of content on the left (and sometimes the right) side of each page. You can add your own blocks, or ones you download or buy, simply by copying the block's PHP file into the Blocks folder.

  • The db folder contains files that interface with various types of databases. PHP-Nuke deals with these files on its own.

  • The Images folder contains a variety of images that are used in the site, the administration screens, and so forth.

  • The Includes folder contains many of PHP-Nuke's main functionality files. As I mentioned, each PHP-Nuke page tends to include a half-dozen pages or more, which may, in turn, include additional pages of their own. A lot of these "included" pages live in the Includes folder.

  • The Language folder contains one file for each available language. These files contain the global text strings used throughout PHP-Nuke; as you'll see later, individual modules often provide their own module-specific language files as well.

  • The Modules folder contains one subfolder for each available module. Want to add a module to your site? Generally, you'll just copy it into the Modules folder, and it'll be available. Each module's folder usually contains a Languages subfolder and may contain an Images subfolder, along with one or more PHP files that make up the module.

  • The Themes folder contains one subfolder for each installed visual theme. Installing a new theme? Just copy it into the Themes folder.

Most add-in modules, themes, and so forth will instruct you to copy files to various folders to install the add-in; with this list, you'll have a better idea of where to start with those instructions.


How Much of This Do I Need to Know?

Not very dang much. I know plenty of folks who are happily humming away with PHP-Nuke, having done nothing more complicated than finding a friendly looking File Transfer Protocol (FTP) client with which to upload files to their Web site. They have yet to crack open a PHP file or a database. One of them, www.windowsauditing.com, is run by a guy who is fairly technical but just doesn't have the time to fuss with any kind of Web programming. Another, www.howlermonkey.com, is run by a complete techno-peasant (his words, not mine) who couldn't program a Web site if his life depended on it. So clearly, using PHP-Nuke doesn't require a lot of hardcore programming or Web site design skills.


Chapter 3. Understanding the Nuke Lingo

Like most other computer products, PHP-Nuke has its own special terminology. Reading through the PHP-Nuke documentation, or even trying to use the product, can be a royal pain until you understand that special terminologywhich is what this topic is all about.


A Quick PHP-Nuke Tour

Probably the easiest way to do this is to just look at a PHP-Nuke site and start assigning the appropriate "Nukeified" terms to what appears on the site. Figure 3.1 shows a typical PHP-Nuke home page. Okay, maybe not typical, but it's typical enough: It's the home page of PHP-Nuke itself, www.phpnuke.org. Don't worry about reading the text in this screen shot; what you're looking for are the names of the various sections and elements.

Figure 3.1. The PHP-Nuke page layout.

[View full size image]

So here's how it all lays out:

  • The left and right columns on either side of the page contain blocks. Blocks can display news headlines from other sites, advertising, surveys, book reviews, and much more. A bunch of blocks are included with PHP-Nuke, and you can add new blocks that you or others create.

  • At the top of the page is your logo. This is usually a graphic image.

  • The top of the page can also contain a banner ad. Banners can appear in a block as well. PHP-Nuke contains all the functionality to rotate through an inventory of banners and to track the number of times they're displayed and clicked.

  • You can display messages at the top of the site's home page. These messages are usually announcements. You can have multiple messages running at once, and you can have them displayed to all users, anonymous users, registered users, and so forth. For example, you might have a different "welcome to the site!" message displayed to registered and anonymous users.

  • In the middle of the page is the module content. I'll talk about modules in a second.

Several of these elements are universal, appearing on nearly every page of a PHP-Nuke site: the blocks, the logo, and the banner ad.


Of Modules, Mice, and Men

This business of modules is key to how PHP-Nuke operates. A module is a piece of functionality either built into or added on to PHP-Nuke. Modules display a certain type of information in a certain way. For example, the Downloads module displays lists of software that people can download from your Web site; the Web Links module, as you might guess, displays a database of links to other Web sites.

PHP-Nuke comes with oodles of built-in modules, including ones that display news headlines (that's the module shown in Figure 3.1, and it's usually the module you'll select for your home page), discussion forums, Frequently Asked Questions (FAQs), and more. I'll spend plenty of time discussing the various modules and how they work later in this book.

Any individual page within your site is associated with one, and only one, module. The page consists of the module's content in the center, with your logo and a banner ad at the top of the page, and blocks down both sides of the page. There's also a footer at the bottom of the page that usually contains a copyright notice and perhaps a few simple links to other pages.

You get a bunch of control options for modules. You can, for example, turn off modules so that they're not used on your site. You can restrict modules so that only registered users, or only subscribed users, can access the modules. You can even change the modules' names as they appear on the Web sitealthough you can't change the way the modules work without reprogramming them.

One of the most important blocks in PHP-Nuke is called the Modules block. It's shown in Figure 3.1 and appears on many PHP-Nuke sites. It's simply a list of all active modules on your site, a sort of "main menu" to everything your site has to offer. PHP-Nuke automatically fills in this list based on the modules you activate.


The Many Flavors of User

I've already mentioned a registered user and other user types without explaining them, and I feel a little guilty about it, so it's time to fess up. PHP-Nuke has four types of user accounts:

  • Anonymous user. This is a user who hasn't logged on to your Web site. You don't know who this is.

  • Registered user. This is a user who's signed up for an account on your Web site and who has, therefore, created a username and password to identify himself. These users are actually considered anonymous until they log on by entering their username and password into the appropriate location.

  • Subscribed user. These folks have actually paid you money to join your Web site. PHP-Nuke doesn't provide any built-in means of actually accepting money; you have to plug that in yourself, and whatever you provide has to update PHP-Nuke's database to mark these users as subscribed.

  • Administrator. This is a special type of user who sits apart from other users. Administrator users have a separate username and password, which is required to log on to the administrator portions of your site. Why are administrators special? Because they can administer the site, meaning that they can add, change, and delete content and perform other tasks.

Modules can be restricted to different types of users, and messages can also be targeted to specific user types. Don't worry, I'll show you how to do all of that. For example, Topic 10, "Controlling Access to Modules," sounds like the perfect place to cover module access control!


Articles and Topics

I'll definitely be covering this information later, but it's such a confusing area (at least, it was for me) that I'll go ahead and hit it now to get you prepped. Take a look at Figure 3.2, which shows that typical PHP-Nuke home page again. This time, I want you to focus on the news stories that appear on the home page.

Figure 3.2. Anatomy of a news story.

[View full size image]

What you're looking at here is a news story, or, in PHP-Nuke's special lingo, an article. It consists of a title and a block of text, just like news stories in a newspaper. Articles are always associated with a topic, and that topic's icon and name are also shown as a part of the news story. Topics basically just help categorize articles. For example, a site on gardening might have topics for News, Outdoor Plants, Indoor Plants, and Gardening Tools. Or something like thatI'm no good at gardening.


And Finally, Themes

Themes are something you'll run across a lot in the PHP-Nuke world. A theme is basically just the "look and feel" for your site. Maybe you prefer a site with a white background, subtle graphics, and black text: That's your theme. Others prefer a site with fancy, metallic-looking graphics, a dark background, and very small textthat's their theme. PHP-Nuke actually comes with a bunch of themes that you can choose from, and there are, at last count, 1.32 jillion additional themes available for purchase (or for free) out on the Internet. Seriously, some people spend their entire lives making themes so that you don't have to. I'll be covering themes in more detail in Topic 52, "Understanding Themes," but for right now, you need to understand a few basics:

  • Every graphic, color, font selection, and other visual element is dependent on the theme. Change the theme, and any visual element of your site will change with it.

  • Some themes don't allow a place for a banner ad at the top of the page. Others might not include a right column of blocks. That's okay; it's just a decision the theme's author made. So the theme can, to a degree, control the content possibilities of your site.

  • Simple themeslike those included with PHP-Nukemay include just some basic graphics and colors. Others may use complicated Macromedia Flash animations, fancy sliding menus, or other cool elements. These themes may take a bit more work to install on your Web site.

  • You can probably make your own theme by customizing one of the simpler themes that comes with PHP-Nuke: tweaking colors, changing fonts, replacing graphics with your own, and so forth.

Themes provide your site's visitors with a visual experience, and this should match your site's content and mission. For example, a site about cars might use graphics that look like diamond-plate metal and might use icons of tools throughout the site. A site on gardening might use graphics or curly vines as the border between articles and might use dark green text or a light green background to help reinforce the gardening theme.

From the Fridge

I spent about two weeks coming up with a theme for my www.ScriptingAnswers.com site. It was really complex, with lots of cool swooshing graphics, amazingly complex icons, and lots of blink stuff to attract attention to various portions of the page. My users hated it. Whoops. I backed off and came up with a simpler, cleaner design that was less likely to make people's eyes bleed. That went over much better. The moral of my story? Make sure you attract users who will appreciate your artistic endeavors, instead of ungrateful wretches who just want a site that's "easy to use" and "doesn't make my eyes bleed." (No, I'm just kidding.)


Chapter 4. Finding a PHP-Nuke Host

Okay, with some PHP-Nuke lingo under your belt, you're probably ready to get started. Now, you've really got two options when it comes to running a PHP-Nuke site: Host it yourself, or let someone else host it for you. Hosting it yourself means you have to buy the server, install the Linux or Windows operating system, install a database server like MySQL, install a Web server like Internet Information Services or Apache, and finally install PHP-Nuke itself. Sounds like hard work, and if that's the way you've decided to go, good luck with it.

Me, I prefer the easy way out: Let someone else host it. There are something like four zillion hosting companies out there that can provide you with inexpensive Web space that includes PHP-Nuke and all the prerequisites. They install it, they back it up every night in case something goes wrong, and they worry about making sure the electricity doesn't go out. Much less hassle for you, allowing you to focus on your site.

Type "php-nuke host" into Google (or your favorite search engine) and brace yourself because you'll get a lot of hits. You'll find some more on the phpnuke.org home page in the advertising (about half the ads there are for PHP-Nuke hosting companies, which is pretty useful). Most hosting companies use a Linux-based operating system, the Apache Web server, the MySQL database server, and PHP-Nuke itselfall of which means nothing to you, except that PHP-Nuke will work, which is really all that matters, right?


Comparing Hosts: A Plethora of Checklists

Figure 4.1 shows a typical hosting provider's Web page, where they compare their various hosting plans. This is kind of like cell phone plans, in a lot of ways: Different plans have different features, different limits (like minutes on your cell phone), and so forth. Probably 90 percent of the features and whatnot won't matter to you for a PHP-Nuke site.

Figure 4.1. Comparison chart for one host's various plans.

[View full size image]

Here's what you really need to worry about:

  • Price. Usually per-month. However, note that many hosts advertise a lower monthly rate that applies only when you pay for a year or two in advance. Check their cancellation penalties, if any. See, this really is like a cell phone contract!

  • Space. Disk space is important, but not as important as you might think. For example, my PHP-Nuke site at www.ScriptingAnswers.com takes up a whopping 1 megabyte (MB) of disk spacefrom my allotment of 20 gigabytes (GB). A gigabyte is 1,000 megabytes, which means I'm using only a tiny percent of my allotted space. Unless you plan to host a lot of downloadable files or big graphics, most hosting plans will give you ample space.

    UNDER THE HOOD

    PHP-Nuke is really a sort of Web application in and of itself, written in a language called PHP (hence the name PHP-Nuke). PHP, in turn, is designed to run on a Web server, such as the free Apache Web server or the InternetInformation Services ( IIS) Web server bundled with Microsoft Windows. Apache, by the way, can run on most Linux versions or on Windows. PHP-Nuke requires a database, which can be the free MySQL database, the similar PostgreSQL, or any of a number of database engines. It's getting all of those bits installed and talking to one another that can be complicated, which is why it's a task I leave in the capable hands of my hosting provider.

  • Bandwidth. This is potentially something to worry about if your site becomes as popular as, say, Microsoft.com. Bandwidth is usually calculated in gigabytes per month. So, let's say your home page, including all of its graphics, takes about 100 kilobytes (KB) to transmit across the Internet. If 100 people view your home page in a month, they'll consume 10,000KB, or 10MB, of bandwidth. If your hosting provider gives you 10GB of monthly transfer rate (bandwidth), you can have 100,000 people view your home page each month. Of course, every page, not just your home page, consumes bandwidth, and different pages are of different sizes. But for most hobbyist Web sites, the bandwidth a host offers is probably more than sufficient.

  • E-mail accounts. Most Web-hosting plans come with more e-mail accounts than you could possibly need. Mine gives me an unlimited number, which is just ridiculous.

  • PHP, MySQL, and PHP-Nuke. Of course, these are all things you want to see. They tell you that PHP-Nuke is offered by the hosting service.

  • Domain name registration. If you don't have a domain name for your site (something like www.MyFunWebSite.com), the host will get one for you. Normally, domain names cost about $35 per year, but you may get a deal if you buy it along with a year or more of hosting service.

  • Setup fees. Plenty of hosts don't charge this, so if you don't want to pay it, you don't have to. Hosts that do charge a setup fee range from $10 to $50. Since most of the setup is actually automated, there's really not much need to charge you. For comparison purposes, I usually figure out what the first year of hosting will cost me, including any setup fees and monthly service fees, and use that as my comparison number.

Like a cell phone contract, overage charges apply. Use up too much disk space or too much bandwidth, and you'll pay a little bit extra (maybe a dollar or so) for each increment you're over. Of course, if you're consistently over, as with a cell phone plan, you can usually upgrade to a bigger plan that provides more capacity in the base monthly fee.

Look for a host that provides a 30-day guarantee, refunding your money if you aren't happy. This gives you 30 days to make sure PHP-Nuke works correctly. Generally, you'll have to install (sort of) PHP-Nuke yourself: This usually involves going to a Web-based "control panel" after signing up for service and clicking the Install PHP-Nuke button. Not very hard.

From the Fridge

I recently switched from one company to another for my cell service, and it looks like they're about to be bought out by yet another company. I firmly believe that all cell phone companies suck, so the choice for Company B was based primarily on the price of their service. I have since switched plans about a million times, trying to find the sweet spot between the minutes I need and the lowest possible price. On one switch, I think they got annoyed at me because they took me off the national plan I was on. The next time I traveled out of state on business, I was charged something like $50 a minute for roaming (I'm exaggerating, but not much) and got a $400 cell phone bill. I had to argue for an hour that I was supposed to be on a national plan. Very irritating. Fortunately, Web-hosting services don't have a "roaming" concept, so you won't have to worry about that for your PHP-Nuke site.

Also look for a service that provides nightly backups. If someone hacks your site, or if you just screw up and delete everything, they can restore your site to last night's condition by using their backups.

How much should you expect to pay? For a small site, $6 per month isn't impossible to find. If you want fancier features, like an e-commerce plug-in (to make an online store), more e-mail accounts (why?), or more disk space, you'll pay a bit more. If you're paying more than $25 a month, though, either you're paying too much or you have some really esoteric needs that you're paying for. I currently pay something like $17 a month for 20GB of space, 60GB of monthly bandwidth, infinite e-mail addresses, and so forth.

By the way, all these hosting plans I've been talking about are virtual server plans. In other words, whatever Web server your site winds up on will also be hosting other people's Web sites. You're all sharing the server. My host, canaca.com, tells me that its Web servers hold 300GB of space total. Knowing that I get 20GB of space, I can conclude that my server may be hosting up to 14 sites other than my own (or more, if those other sites are on smaller plans). You might ask your potential hosting companies how many sites they load onto a single server. Sure, $5 a month is cheap, but if you're sharing with 200 other sites, your site isn't going to be very peppy. After all, one server can do only so much.

So your next step should be clear: Find a hosting provider. If you plan to host PHP-Nuke yourself, get the server up and running. C'mon, what are you waiting for?

Sidebar . FAQ

How much disk space/bandwidth/whatever should I shop for?

How much will you need? Seriously, there's no way of providing a stock answer for that. A typical PHP-Nuke site might use as much as 10MB after a few months of operation, and 4,000 users who visit every day might consume 1GB or so of bandwidth. But that's like saying the average temperature in Las Vegas is 100 degrees: It's true for only a relatively few number of days out of the year. In other words, you'll need to experiment a bit to see how much space and bandwidth you need. Remember that most hosting services will let you upgrade to a bigger plan if you need to.

Should I splurge for my own dedicated server?

Sureand you should buy it from me. Send checks to Don Jones…. Oh, heck. No, you probably shouldn't. The fact is, if your site is getting hammered enough to need a dedicated server, then you're probably approaching or exceeding what PHP-Nuke is designed to deliver. PHP-Nuke isn't made to handle 50,000 users a day, which is something where you'd probably want to have your own server.

I saw an ad for a $10 domain name! Is this for real?

Probably, with some caveats. Many Web hosts will register your domain name cheaply or even for free to earn your business, but they might require a long-term contract. Cancel early, and they might hit you with the registration fee after all. Other times, the low-priced registration is per year, but based upon your registering the name for a long, multiyear period, which means you could be forking out a hundred bucks total. Read the fine print! The "suggested retail price" for a domain name registration is $35 per year.


Chapter 5. Installing PHP-Nuke

I expect that many folks will simply host their Web site with a provider who has already installed PHP-Nuke or who will do so for you. Many providers offer little automated "control panels" that you access through a special Web page, enabling you to install nifty things like PHP-Nuke. However, I know that some of you will want to install PHP-Nuke on your own server, using your own two hands and the sweat of your brow. This topic is for you.


Before You Even Think About Starting

PHP-Nuke is a simple install, primarily because all of its prerequisite pieces aren't necessarily so simple. As this is not a book about Web servers, database servers, or operating systems, I'm not going to help you install those bits. If you're not feeling brave enough to try, you should reconsider that decision about hosting your Web site with someone who'll install PHP-Nuke for you.

PHP-Nuke will run on any system that has the following components already installed:

  • An operating system. This can be some flavor of Linux, Windows UNIX, or even Mac OS X. Heck, write your own operating system, if you want to. The choice of operating system makes no difference whatsoever in how PHP-Nuke operates.

    And by the way, lots of Linux- and UNIX- based systems (and this includes Mac OS X) come preinstalled with Apache, PHP, and MySQL, giving you all of your prerequisites right up front. Windows, sadly, comes with none of these, Microsoft having gone its own route for Web servers and stuff.

  • A Web server. Apache is highly recommended because it works so well with the other bits of software you'll need. However, you can use Microsoft's IIS, if you want. Because of the way PHP is implemented under IIS, it might be a less than satisfying experience, which is why I recommend Apache. Apache runs fine on Windows, by the way, provided that you resolve any conflicts with IIS (which is easily done by uninstalling IIS). You can get Apache from www.apache.org, if you're so inclined.

  • PHP version 4.2.x or later (version 5.0 is the most recent, as of this writing). You can get this from www.php.net. PHP must be installed as a module under Apache. Note that half the Apache installers you'll find will have PHP 4.2.x built right in, so you may not need to install PHP separately.

  • A database server. MySQL is cheap (free) and easy to install, and can be downloaded from www.mysql.com. PHP-Nuke will also work with mSQL, PostgreSQL, PostgreSQL_local, ODBC-style databases, Sybase, and Interbase servers. I have no idea whether any of these are appreciably better than MySQL, which is the one I use and the one that PHP-Nuke is developed on and tested with.

As I mentioned, plenty of operating systems come with all of these things built right in. I have one of the flat-screen iMac computers running OS X 10.3, and it has PHP, Apache, and MySQL, all preinstalled and operating just fine.

From the Fridge

It's funny how you get hooked on a thing. I bought an iPod when they first came out because, well, 10GB of space for MP3s? How could you not buy one? The iMac came after a week of watching Microsoft Word crash on my PC; I loaded Microsoft Word X onto the Mac, and it never crashed. I wrote about six books on Microsoft server technologies on that Mac, which causes no end of amusement for the folks I know at Microsoft. When I realizedquite recently, in factthat the Mac was preloaded with all this Web server stuff, I went back to a PC for writing and started using the Mac as my little in-house Web server. I tried, by the way, getting Apache and PHP and MySQL all running on a Windows box. I'm apparently not smart enough to do so because it never all worked quite right.


Before You Install PHP-Nuke

You have to understand that this is a book on PHP-Nuke, not on Linux, Apache, MySQL, and the other things that PHP-Nuke needs to run. So before you try installing PHP-Nuke, here's a quick checklist to follow to make sure everything else is working okay:

  • Can you view static HTML pages on your Web server?

  • Can you view a PHP page, such as the phpinfo.php page that comes with many PHP distributions, on your Web server?

  • Can you install and use a tool like phpMyAdmin, which is a Web-based MySQL administrative tool? If you can, you know that MySQL is up and running properly.

  • Can you perform all these previous tasks not just from the server itself, but from a Web browser that's running on another machine?

Obviously, if you're going to have someone else host your site, these things are their concern; if you're building your own server, these are sort of the minimum levels of functionality needed before installing PHP-Nuke is even a consideration.

Sorry if this comes across as a cop-out, but the sheer number of Linux variations, Apache versions, MySQL distributions, and other variables make it impossible to address even a fraction of the possibilities in this book. My general experience has been that if all of the previous items are working okay, your PHP-Nuke installation will go off without a hitch.


Installing PHP-Nuke

If you're already accustomed to the lengthy process involved with most software installations, PHP-Nuke is going to be a bit of a disappointment. It's mainly copying files and is not terribly exciting or time-consuming.

Once you've gotten the prerequisites in place, download whatever version of PHP-Nuke you plan to use. I'm using v7.3 for this book; given that a new version comes out every few months you can pretty much rest assured that a newer version will be available as you're reading this. But the installation procedure won't change much.

Start by decompressing the PHP-Nuke package you downloaded. Ideally, you'll decompress this right onto your Web server. You don't have to, though: You can decompress it on your desktop PC or whatever and use a File Transfer Protocol (FTP) client to copy the files up to your Web server, if necessary. Where do the files go? Well, if you want your PHP-Nuke site to be accessible from the root of your Web site (for example, www.mysite.com), put the files in the root (under Apache, it's called the docroot). If you want your files to go in a subdirectory (such as www.mysite.com/phpnuke), create the subdirectory and put the files in it.

Next, you'll need to create a database for PHP-Nuke to use. MySQL comes with a command-line tool called mysqladmin; to create a database, you just run something like mysqladmin create nuke from a command line on your server.

Next, you'll need to build the initial database structure. PHP-Nuke's download package has a subfolder named sql that contains a SQL script; importing that into your newly created database sets up the structure. Running mysql nuke < nuke.sql does the trick. Again, you run that from the command line on your Web server. If you're not using MySQL as your database server, then you're on your own, but other open-source database servers work more or less the same way.

Almost done. Now you need to open the config.php file, which is located right in the root of the PHP-Nuke Web site, in a text file editor. There are a few lines you'll need to edit, since these tell PHP-Nuke where it can find the database, which contains most of the other configuration information. The lines you need to change are right near the top of the file:

$dbhost = "localhost";
$dbuname = "root";
$dbpass = "";
$dbname = "nuke";
$prefix = "nuke";
$user_prefix = "nuke";
$dbtype = "MySQL";
$sitekey = "SdFk*fa28367-dm56w69.3a2fDS+e9";
$gfx_chk = 0;
$subscription_url = "";

Under no circumstances should you mess with anything else in the config.php file. Seriously, no good can come of it. Here's what the previous configuration lines are asking for:

  • DBHost The name of the server holding your database. If it's the same machine as your Web server, just leave it at localhost.

  • DBUName The username PHP-Nuke should use to access its database. Enter whatever username you set up. This user must have full read/write access to the entire PHP-Nuke database.

  • DBpass The password for the previously mentioned user. Note that the config.php file can't be easily read by your site's users, but it is possible. I don't recommend using your database server's superuser account in this file; make up a new user that PHP-Nuke will use all for itself.

  • DBName The name of the database PHP-Nuke will use.

  • Prefix The prefix used on each table name in the PHP-Nuke database. Usually, you can leave this as nuke.

  • User_Prefix Again, leaving this as nuke usually works.

  • DBType MySQL is the default, for MySQL databases. This can also be mysql4,postgres,mssql,oracle,msaccess,db2 , or mssql-odbc. Don't think for a second that, just because it's an option, using a Microsoft Access database is a good idea; it isn't. Site performance will be horrible.

  • SiteKey Change this to whatever you want, but don't use any quotation marks within the double quotes that are already there. And don't leave the default value in place! This key will be used to encrypt certain bits of data within your site, so you want the key to be unique to your site.

  • Subscription_URL The URL to which users should be redirected if they try to access a subscribers-only page.

The Gfx_chk parameter is interesting. To prevent automated Web software from creating a zillion user accounts on your Web site, PHP-Nuke implements a graphical check routine. This requires users to type in a series of digits that they read off a graphic. Automated software would have a difficult time "reading" the graphic, especially since it's partially obscured with gridlines, so this simple check helps prevent automated signups and logins. But the little graphic thing can also be a pain for regular users, so you need to decide whether you want to use it. Set the Gfx_chk parameter to meet your preferences:

  • 0 Don't use it.

  • 1 Use it for administrator logins only.

  • 2 Use it for user logins only.

  • 3 Use it for new user signups (registrations) only.

  • 4 Use it for user logins and registrations.

  • 5 Use it for administrator and user logins.

  • 6 Use it for administrators and for new user registrations.

  • 7 Use it for everything.

Okay, next you just need to chmod some files, run a sudo command, download three quantum registers into the oscillating diode array…just kidding. You're finished. You should be able to access your new Web site by using your Web browser.


Do This, Right Now

Before you do anything else, you need to create your site's superuser. This will usually be done for you if your Web-hosting company installed PHP-Nuke, but not always. Check. You need to create at least one superuser account, or administrator, to configure your site.

To do so, point your Web browser to http://servername/admin.php. You may be prompted to log on if you're hosting your site with someone; in that case, you've already got a superuser and don't need to create a new one. Just log on with whatever credentials the hosting company told you to use for your PHP-Nuke administration.

Otherwise, click Edit Admins from the Administration Menu. Create a new administratorthink up a clever name like Adminwith a good, difficult-to-guess password. Select the Super User check box to make this user a superuseror, in PHP-Nuke's less politically correct terminology, the God Admin.

You should also set your site's preferences in the Administration console, but I'll cover that in the next topic. If you're already checking out your new Web site and noticing that things don't look quite right, it's okay. They'll get better after you set a few configuration settings to the proper values.


All Done?

Yep, that's the installation. Now you're ready to start configuring whatever bits of PHP-Nuke you want. I recommend you start with Topic 6, "Configuring Site Preferences," which covers the most critical configuration items for a new site, but after that, you're on your own. Decide what parts of your new Web site interest you the most, and start therejust look for the appropriate topic, and I'll walk you through it.

By the way, if your Web-hosting company installed PHP-Nuke for you, that doesn't mean you can't install the latest version of PHP-Nuke right now. Topic 66, "Upgrading PHP-Nuke," covers upgrades, which are a bit simpler than fresh installations. Make sure you have your super admin account in place before proceeding with the upgrade.

UNDER THE HOOD

Boy, this confused me when I started using PHP-Nuke: It keeps a separate list of admins (which are also called Authors) and regular users. You'll probably have one of each on your site. If you log onto your site and don't see an Administration link somewhere on the left or right side, go directly to the admin.php page of your site (type it in your browser's URL line) and log in using your admin credentials, not your regular user credentials.

Sidebar . FAQ

How do I install Apache/Linux/MySQL/PHP?

No, you're not tricking me into answering that one. Seriously, those are complex topics, and entire books have been written on them! For Apache installation information, go to www.apache.org. For MySQL, check out www.mysql.org. For PHP, you can visit www.php.net. For Linux, you'll need to check out the instructions specific to your "build" or "distribution" of Linux; they're all different. But you dang well need to make sure all of these are installed and working before installing PHP-Nuke!!

I installed PHP-Nuke, and all I get is blank pages.

I'll guess that you didn't install PHP, or you didn't configure Apache to use PHP. You'll need to do that, and the PHP installation documentation tells you how. Find it at www.php.net.

I'm getting database error messages! What do I do?

First, make sure your PHP-Nuke config.php file has the correct information for connecting to your database. Also make sure the PHP-Nuke installation pages were run correctly to set up your database. If those pages displayed any errors, those errors have to be addressedyou can't just ignore them, unfortunately. Don't I wish! Sometimes errors occur because you don't have permissions to create a new database (for example); that's something you'll have to work out among you, your operating system, and your MySQL installation. Check the MySQL docs for details. If you're using a hosted service that includes MySQL, talk to your hosting provider: Sometimes they need to create databases for you, rather than letting you do it yourself.


Chapter 6. Configuring Site Preferences

This is a task you'll normally need to do only once, or at least not very often. Site preferences control several overall aspects of your Web site, including its default theme and language. You should definitely adjust these preferences after installing PHP-Nuke for the first time and after any upgrades, which may add preferences.

You access these preferences from the Administration menu, which is shown in Figure 6.1.

Figure 6.1. The Administration menu.

[View full size image]

Just locate the icon labeled Preferences, and click it. The Administration Menu immediately redisplays, but this time it is followed by all of the available preferences. I'll describe each of them in detail; the easiest thing is probably just to look at each one, set it to be what you want, and then move on.


General Site Info

The General Site Info section configures several important global settings for your site:

  • Site Name. You can type anything you want here; this name is displayed in Web browser title bars when they're browsing your site.

  • Site URL. This needs to be the complete URL of your site's PHP-Nuke root folder. In other words, if you have a Web server named www.scriptinganswers.com (I do) and you've installed PHP-Nuke into a folder named CMS2, then the full path to PHP-Nuke's index.php page is www.scriptinganswers.com/cms2/index.php. So, the site URL would just be www.scriptinganswers.com/cms2.

  • Site Logo. This is a version of your site's graphical logo, if you have one, which is compatible with mobile devices like cell phones and PDAs. You must copy the graphic to the Images folder of the PHP-Nuke Web site. This logo isn't displayed on your site's home page; it's sent only to mobile clients who access your site through the AvantGo module.

  • Site Slogan. Some themes display a slogan, or tagline, on each page. This is where you define that slogan.

  • Site Start Date. The date your site opened for business.

  • Administrator E-mail. The e-mail address where you want to receive administration-related e-mails about your site.

  • Number of Items in Top Page. There's a Top 10 page in PHP-Nuke that shows the top 10 most-read articles. You can change that to be a Top 5, 15, 20, 25, or 30 page instead of Top 10.

  • Stories Number in Home. The number of articles to display on the home page. Note that you can allow users to override this number with their own preference; see the "Number of News Items in Home" option under "User and Censor Options" later in this topic.

  • Stories in Old Articles Box. PHP-Nuke provides an Old Articles block that lists older articles (those that won't fit on the home page) to the left or right side of the page. You can configure how many stories appear in this block.

  • Activate Ultramode. A bit later in this topic, I describe RSS newsfeeds, which are also called Ultramode. If you want other Web sites to be able to retrieve a list of news items from your site and display those headlines as links back to your site, then activate Ultramode.

  • Allow Anonymous to Post. This is pretty straightforward. Do you want unidentified users posting on your Web site, or do you want them to have to register and get a password first?

  • Default Theme. This is the theme you want your site to use. By default, users can select their own theme from those installed in PHP-Nuke's Themes folder, but new users will start with your selected theme. Simply delete any themes you don't want your users to access.

  • Site Language. Select the default language for your site.

  • Local Time Format. Use en_US for standard time formatting, such as 8:02 P.M.


Multilingual and Banner Options

PHP-Nuke has some neat multilingual features that are turned off by default. When turned on, users can select their preferred language for the site, either by clicking a little flag graphic or by selecting their language from a list (the default). The language selection affects PHP-Nuke's built-in text strings, since they've been translated into more than 30 languages for you. If you choose to post content in multiple languages, users will see the version that matches their language (if a version is available for them).

Right under Multilingual Options is Banners Options, which enables you to turn banners on or off for your site. PHP-Nuke offers built-in banner-rotation capabilities for graphical advertising; most of the built-in themes and many aftermarket themes provide a space for banners.


Footer Messages

These footer messages appear at the bottom of each page on your site. By default, they include a copyright message for PHP-Nuke; you can include whatever message you like here. You can use HTML tags to format the messages to your liking.

Now, there are some restrictions on the footer message. You should consult the PHP-Nuke documentation, though, because I'm no lawyer. In general, the gist is that, unless you've paid for a commercial PHP-Nuke license, you need to leave the default footer message basically alone. Again, though, check this out on your own in the PHP-Nuke docs at www.phpnuke.org.


Back-End Configuration

PHP-Nuke can allow other Web sites and newsreaders to read your articles via an XML-based technology known as RSS, or Really Simple Syndication. This fancy technology basically allows one Web site to contact yours and ask for a list of available headlines; anyone clicking on a headline is sent to your site to read it. Lots of Web sites are now offering RSS newsfeeds, as they're called; PHP-Nuke lets you get into the act as well. The "back-end configuration" enables you to specify a title for your site that will appear in the RSS newsfeed. You can also specify the language; the default, en-us is U.S. English.


Mail New Stories to Admin

One of the modules built into PHP-Nuke is "Submit News," which allows users to submit articles for your approval. Once approved, these articles begin appearing on your site (or you can schedule them to appear on a specific date). PHP-Nuke always displays a reminder of how many submissions are waiting for your approval, but you can also have it e-mail you a quick note when new submissions are received. This feature is off by default; if you turn it on, you'll need to specify the e-mail address that should receive the messages, the e-mail subject and body, and the account that will be listed as the From e-mail address on the e-mail.

Here's a tip: Set that From account to something unique. That way, you can set up e-mail filters in your e-mail software to look for mail coming from that address and highlight it, or at least make sure the message isn't discarded as spam.


Comments, Graphics, and Miscellaneous Options

Comments are a feature that allows users to leave a short note in your online polls or articles. You actually enable or disable comments in the Miscellaneous Options section, which I'll get to in a second; in the Comments Moderation section, you get to decide how comments will be administered. With No Moderation, comments are posted as they're made; you can also select a level of moderation that requires someone to approve comments before they're posted. In the Comments Options section, you can set the maximum size for comments and the default name a comment is attributed to. The default maximum comment size, 4,096 bytes, is roughly one page of single-spaced, typewritten text, or about 650 words. Roughly, 1 byte equals one letter, so you can decide for yourself what the average word length will be and do the math from there.

If you don't like the graphical Administration menu and would prefer to have a faster-loading all-text version, just select No for the Graphics in Administration Menu? option.

There are four Miscellaneous options (spelled "Miscelaneous" in PHP-Nuke):

  • Activate HTTP Referrers. This tracks each referrer to your Web site, allowing you to view them in one giant list.

  • You can set the maximum number of referrers stored in the database, up to a maximum of 2,000.

  • You can allow users to leave comments in polls and surveys.

  • You can allow users to leave comments in your posted articles.


Users and Censor Options

You can define the minimum length for user passwords. I encourage you to set a minimum of at least six characters, and eight would be better. The longer the password, the less likely it is that someone will guess it.

There are also three activation options for users:

  • Broadcast Messages. This allow users to visit their Your Account page and send a short broadcast message. This message, which can be up to 255 characters long, is displayed to all online users for 10 minutes, just under the site's logo (provided your theme allows for this). Users can turn off this option individually, or you can disable the functionality completely.

  • Headlines Reader. This activates an in-site headlines reader, which uses XML to pull news headlines from compatible Web sites. PHP-Nuke comes preconfigured with a couple dozen compatible Web sites, and you can add your own. These headlines are shown only on users' Your Account page, not anywhere else on the site.

  • Number of News Items in Home. If you enable this, users can go into Your Account and modify the number of news items that appear in the home page. Keep in mind that some themes won't honor this setting.

UNDER THE HOOD

When you visit Web site A and click a link to Web site B, Web site A's address gets sent to the Web server at Web site B as a referrer. That way, Web site B can tell where you came from, or, in the lingo, who referred you. Tracking referrers can allow you to get a feel for where users are coming from. If your biggest referrer is Google, it means you're getting most of your visitors from that site, for example.

PHP-Nuke also has the capability to remove offensive words and replace them with the written equivalent of a "beep." The list of "bad words" is stored in the config.php file, near the bottom. Here's a clean version of the list:

$CensorList = array("darn",
            " dang",
            "meanie",
            "witch",
            "witches",
            "lawyer",
            "politics",
            "lawyers",
            "politicians",
            "postal",
            "durn",
            "belgium",
            "po'd",
            "drugs");

You can edit or extend this list to include whatever you want. When PHP-Nuke finds one of these words, it will replace it with ***** by default. You can change that in the preferences menu. You can also change how PHP-Nuke looks for these bad words: anywhere in any text, only at the beginning, or an exact match. Here are some examples, based on the previous list:

  • Exact Match will bleep out witch and witches, but not witched, because this isn't explicitly listed.

  • Match at the Beginning will censor witch and witched because the listed word witch appears at the beginning of both.

  • Match Anywhere will censor switched as well as witch because switched contains the listed word witch.


Chapter 7. Choosing Modules

Modules form the heart and soul of PHP-Nuke, providing the various types of content that your site offers. Each "section" or "page" of your Web site consists of a single module, which is usually displayed with a column of blocks to either side. PHP-Nuke comes with a rather eclectic collection of modules already activated, so you'll probably want to dive in and turn off a few.

Now, a quick word of warning: Your PHP-Nuke installation may have a different set of modules than those I describe here. That's because each version of PHP-Nuke can add, or even remove, a module or two. Over time, it adds up to quite a difference. In addition, when you upgrade PHP-Nuke, any modules not present in the new version aren't removed; they're just not upgraded. For example, my site at www.scriptinganswers.com/cms2 includes a WebMail module. The site is running on PHP-Nuke v7.3, but version 7.3 doesn't include the WebMail module. So what gives? Well, the site was originally installed as v6.9, which does come with a WebMail module. When I upgraded the site to 7.3, the WebMail module wasn't removed. So the practical upshot is that if you have the module and want to use it, you can. You can even still download the module from www.phpnuke.org, although currently you need to join the site's Club to do so.


Managing Modules

You manage your modules from the Administration menu's Modules section, which is shown in Figure 7.1. Each module is listed on one line of this table. Here's what the columns mean:

  • Title. This is the official PHP-Nuke name for the module. You don't need to have this name displayed on your site because you can make a….

  • Custom Title. This is the title of your module as displayed on your site.

  • Status. Modules can be active or inactivepretty self-explanatory.

  • Visible To. This controls who can see a module. A module has to be active to be seen, but not necessarily everyone will be able to see it. Your choices here are Everyone, Administrators Only, Registered Users Only, and Subscribers Only.

  • Group. This displays the group that your module is associated with.

  • Functions. This column provides links allowing you to edit a module, activate or deactivate it, and put it into your home page.

Figure 7.1. The Modules Administration menu.

[View full size image]

You'll notice that one module is listed with a colored background. That module is currently In Home, which means it's the module that comprises your site's home page. There are two special restrictions for this module: You can't deactivate it (since you'd be deactivating your home page), and you can't restrict it (since everyone must be able to view your home page). You can make another module the home page, however, by clicking that module's Put in Home link in the Functions column.

If you click a module's Edit link (in the Functions column), you can change who can see that module, and you can change the module's title. You can also control the module's block visibility, making it visible or invisible. Here's how this works: Notice in Figure 7.2 that each page of the Web site includes a block named Modules. I've kept it located in the default position at the top of the left column.

Figure 7.2. The Modules block, located at the top of the left column.

[View full size image]

The purpose of this block is to act as a sort of main menu. It lists, by default, every active module on your site, providing users with a way to access the modules at any time. Sometimes, however, you might not want a module visible there. Suppose you're using a theme, for example, that has a button for Downloads across the top of the page. It might seem redundant, therefore, to also list the Downloads module in the main menu. No problem: Simply edit the Downloads module and select No for Visible in Modules Block. The Downloads module will still be active, but it won't be listed in the main menu.


The Modules

Okay, you're probably ready to learn what each of these puppies does for you. Please remember that the list I'm giving you is what you get with a PHP-Nuke 6.9 site that's been upgraded to v7.3 (a fairly common scenario); upgrading from 6.8 might present a different default list, and a fresh installation of 7.3 might yield yet a different list. So just sort of play it by ear. If you ever wonder what a module does, you can try it: Just activate it, make it visible to Administrators only, and then check it out without giving the rest of your users access to it.

So here are the modules. Keep in mind that I devote an entire topic to most of these, so if you're really curious as to what they do or how they work, skip ahead a few pages. Topics 11 through 36 cover modules.

  • Addon-Sample. This is never activated by default, and it doesn't do anything. It's just a sample of how you can write your own modules. Topics 35, "Making Your Own Simple HTML Module," and 36, "Making Your Own Dynamic Module," cover making your own simple modules.

  • AvantGo. AvantGo might make more sense if you check it out at www.avantgo.com. Basically, it's a way to deliver your site's content to users of mobile devices, like Palm and Windows Mobile devices.

  • Content. I like to think of the Content module as a kind of basic document library. You essentially just enter HTML to create individual pages, which are accessible via their own URL. The Content module itself acts as a sort of menu to all of these pages. So if you've got some static content, like a Contact Us page, it should go into the Content module.

  • Downloads. Providing your users with access to downloadable files is easy with this module. You can create categories and individual links. And the cool part is that you don't have to host the actual download files on your site; you can simply link off to files that are located elsewhere on the Internet.

  • Encyclopedia. This module enables you to create one or more encyclopedias, each of which contains an alphabetical, searchable database of definitions and descriptions. If your site deals with a lot of specialized terminology, providing an encyclopedia can help your users figure out those terms.

  • FAQ. You've probably run across this TLA (three-letter acronym) before: It stands for Frequently Asked Questions. The FAQ module lets you create multiple categories for questions and then provide both the questions and their answers. Hopefully, users will check here for answers before sending you yet another e-mail about it.

  • Feedback. If you're interested in what your users think of your site (and who wouldn't be?), this module allows them to tell you. It provides a short form users can fill out to send you their comments on your site.

  • Forums. The Forums module in PHP-Nuke is actually a transported version of phpBB, which is a very popular standalone discussion system for the Internet. Being integrated with PHP-Nuke allows the forums to use the same usernames and passwords as PHP-Nuke, but the "look and feel" of the forums still is distinctly different from the rest of your site. Anyway, the point of the forums is to provide a sort of written conversation area, where users can post messages and reply to them. Everything's organized by categories and topics, keeping the forums easy to use.

  • Journal. Today this module would probably be called a blog, or Web log, rather than a journal, but the intent is the same: a place for users to record their thoughts, rants, or whatever, and share them with the public, if they choose to do so.

  • Members_List. Just as the name implies, this is a simple list of all the members on your site.

  • News. This is the page usually set as your home page. It displays several of your latest articles (which, regardless of their content, PHP-Nuke refers to as news), in descending order so that the newest article is listed first.

  • Private_Messages. This module uses the Forums, really, allowing users to send private messages to one another within your site. It's kind of like a mini e-mail system, and users do have a maximum number of messages they can keep.

  • Recommend_Us. This module allows users to have a preconfigured message (which PHP-Nuke configures, not you) sent to a friend, recommending your site. A potential problem with this module is that it can be used to send spam from your site; most administrators disable it for that reason.

  • Reviews. This module enables you to review books, products, or whatever you like. Users can post reviews, too.

  • Search. As the name implies, this module searches for keywords throughout your site, displaying a list of "hits." Note that this module isn't a terribly robust search solution; if you're serious about having people search your site, you might look into some third-party replacement search modules. Search Google for them.

  • Sections. When you publish a news article (remember, PHP-Nuke considers almost everything to be a news article, although it might just as easily be a story or tutorial or something), you can elect to have it appear in the News module on the home page. The Sections module provides access to all other news articles, allowing users to browse articles that weren't published to the home page.

  • Statistics. This is an interesting module to check out, even if you don't make it available to your users. It shows things like the Web browsers used to visit your site and other statistical information.

  • Stories_Archive. As stories grow older and rotate off the home page, this module gives a convenient way to access them by month. All the stores you post in July 2005, for example, will be available through this module, neatly categorized under July 2005.

  • Submit_News. Users may have something to contribute to your Web site, and this gives them a way to do it. You get to review and approve (or deny) anything users submit before it shows up on your site.

  • Surveys. Polls and surveys can be fun, and this module lets you set them up and lets your users respond to them, leave comments about them, and so forth. Note that users can also post a poll in association with a message in the Forums, which makes this module a bit redundant. However, surveys in this module can also appear in a block on every page of your site, giving them more exposure.

  • Top. This cool module displays the Top 10 for your site, including the top 10 most-read stories, top 10 users, and a plethora of other information. Might not be as interesting to your users as to you, but you never know. Keep in mind that, as the administrator, you can access even "inactive" modules, meaning that you can check out your site's "top 10" without giving your users the ability to do so.

  • Topics. News articles (remember, everything is "news") are organized by a fairly complex system of topics. This module provides access to those topics, allowing users to browse your articles fairly easily.

  • WebMail. This module, which has been discontinued in newer versions of PHP-Nuke, provides access to a Web-based e-mail system within PHP-Nuke. Note that the Preferences option on the Administration menu previously was used to configure WebMail; since the module is missing from newer versions of PHP-Nuke, you can no longer configure it. A replacement standalone module available for download (check www.phpnuke.org) has its own Administration Menu icon, but, for the most part, users weren't using this module, which is why it was discontinued.

  • Web_Links. You can use this module to maintain a database of Web links, all nicely categorized, that might be of interest to your users. They can submit new links, which you must approve before they're posted to the site.

  • Your_Account. This all-important module provides users with account-management options, such as the capability to update their site profile, change their password, and so forth.

Phew. That's a lot of modules. And that's not nearly the half of it; as you'll read in some of the later Topics (32, "Adding the NSN Your Account Tweak," through 34, "Adding the Amazon.com Module," come to mind), you can add more modules simply by copying their files to the correct location in your site, and there are oodles and oodles of modules out there for you to try. Hop on over to www.phpnuke.org, the official PHP-Nuke home page, and you'll see what I mean.

As a quick aside, I should point out that the author of PHP-Nuke maintains a PHP-Nuke Club, over at www.phpnuke.org. By joiningwhich costs about $10 per monthyou'll have access to the latest version of PHP-Nuke (when a new version comes out, it goes into the club, and the previous version becomes publicly available). You'll have access to discontinued modules, in case you want to use them with a newer version of PHP-Nuke. The Club also includes some themes, graphics, and all sorts of stuff. You can find more modules at www.nukescripts.com, along with many other sites; try searching Google for "PHP-Nuke Modules," and see what comes up.

Sidebar . FAQ

What modules should I use?

Figure out a small number that is appropriate for your site's content and audience. Don't overwhelm everyone (and yourself) by choosing every single module that you can; pick the ones that make sense, and add more later if it makes sense to do so. For example, if you eventually want to have a FAQ, but you don't have any content for it right now, don't enable that module. Do so only when you've got something to put in it, so it doesn't sit there all empty and lonely in the meantime.

I don't understand the Webmail module. Why would I use it?

Search me. I've always turned it off, and PHP-Nuke doesn't even come with it anymore, so I don't think it's been a real hit with PHP-Nuke users.

What's the point of the Top and Statistics modules?

Bragging rights, mostly. They do provide useful informationsee the individual topics on those modules within this bookbut your site users aren't likely to do much more than glance at these modules very occasionally. Feel free to turn them off; as the administrator, you'll still have access to them and the information they provide.


What Modules Are Right for You?

Tough call. You know your site's content and users better than I do, though, so this decision is all about you. I do have a recommendation for you, though: Start small. Enable just the modules you think your site needs to function. You'll have enough of a challenge getting those modules full of content without worrying about less important ones. For example, there's no point enabling the FAQ module if you don't, in fact, have any frequently asked questions to answer. Once your site matures a bit, you can start tacking on additional modules to meet your users' needs. The temptation to turn on everything, just to make your site more appealing, is strong, but you can resist. Stick with the basics, and branch out from there!


Chapter 8. Choosing Blocks

Blocks are those cuddly little sections of content running up and down the left and right sides of each PHP-Nuke page. Blocks provide a way to get more content right in front of your users' faces, acting as a sort of teaser to additional sections of your site, or maybe just providing some useful sideline-style functions.

Before I even tell you what blocks are available, though (and no fair peeking on your own), I want to offer some advice: When it comes to blocks, less is more. I've visited PHP-Nuke sites where the number of blocks is so high that the page is three times longer than the content in the middle of the page. Nobody is going to scroll down to see all that. As a general rule, your blocks shouldn't extend much past the end of whatever's in the middle of the page (the module content, that is).

So, with moderation in mind, let's talk about how you work with blocks.


Block Management

It will probably come as no surprise that the Administration menu contains an item named Blocks, and that clicking on it will take you into the Blocks Administration screen, shown in Figure 8.1.

Figure 8.1. The Blocks Administration menu.

[View full size image]

Now, unlike the Modules menu, which lists every installed module, the Blocks menu lists only those blocks that you've specifically added to it. Blocks can still be activated and deactivated, but there's a whole slew of 'em available to you that won't be shown on this menu. More on that in a bit.

The Blocks menu has seven columns:

  • Title. This is the title of the block, as it appears on your Web site. You can change this to whatever you like.

  • Position. This lets you decide whether you want the block on the left- or right-side column of the page.

  • Weight. This enables you to configure the order in which the blocks appear. Just click the little arrows to move a block up or down in the list. Note that sometimes PHP-Nuke gets confused: You'll have multiple blocks with the same weight number, and the wrong arrow buttons will appear. If this happens, go to the bottom of the list and click Fix Block's Weight Conflicts, and PHP-Nuke will regroup and fix itself.

  • Type. This is the type of block. A few blocks are built by PHP-Nuke itself, and these have a type of SYSTEM. Most are read from a file on the Web server, and these have a type of, obviously, FILE. There are other types, but you don't really need to sweat this particular detail.

  • Status. This is Active or Inactive, telling you whether the block is currently appearing on your site.

  • Visible To. This lets you decide who can see the block. Your options include All Visitors, Administrators Only, Registered Users Only, and Subscribers Only.

  • Functions. Finally, this column contains links enabling you to edit a block, delete it, or deactivate it. Inactive blocks contain a Show link that activates the block.

Below the list is the Add a New Block section, which is whereyou guessed ityou add new blocks to the list. Blocks offer a lot of flexibility, but, unfortunately, this Add a New Block section is unnecessarily complicated. Here's what to do (Figure 8.2 shows the screen if you'd like to follow along):

  • Title. This applies to all blocks and is the title of the block as it will appear on your site. Keep titles short because most themes will get messed up if block titles run more than one line of text.

  • RSS/RFS file URL. Some explanation is in order. An RSS feed is basically a set of news headlines pulled from another Web site. The headlines are displayed within the block as hyperlinks, which link back to the site that the news came from. Yahoo! News provides several RSS feeds, for example.

    There are two ways to configure an RSS feed. One is to select Custom from the drop-down list and type the URL of an RSS feed, which you normally pick up from the site that's offering the feed. The second option is to select a preconfigured feed from the drop-down list; PHP-Nuke comes with a couple of dozen. You can also click the Setup link, to the right of the drop-down list, to configure your own feeds for future use.

    If you configure an RSS feed, you can skip down to the Position item on the Add a New Block screen. You won't use Filename or Content.

    Honestly, the easiest way to see this in action is to try it. Figure 8.3 shows a portion of the news.yahoo.com Web site. Notice in the left column of the site that several XML icons appear (other sites use a similar RSS icon). That's your indication that the RSS newsfeed is available. Click on the XML link, and you'll get a funny-looking page; copy its URL from your Web browser into PHP-Nuke, and you'll be able to add that newsfeed as a new block and see what it looks like on your site.

    Figure 8.3. Finding RSS feeds.

    [View full size image]

  • Filename. Assuming you didn't decide to create an RSS block, you can select an existing block filename from the Filename drop-down list. I discuss the available files in the next section of this topic. If you do select a file, you won't use the Content text box.

  • Content. If you didn't select either an RSS feed or a filename, you can provide some plain HTML content that will appear in your block. This is a handy way to add a brief, static message to your site.

  • Position. Select Left or Right to have this block appear on that side. After you add the block, you can adjust its vertical position using the block list, as I described earlier.

  • Activate URL. Simple: Do you want the block turned on or not?

  • Expiration and After Expiration. Blocks can expire after a specified number of days. After they expire, you can have them deactivate themselves or be permanently deleted (note that deleting removes them only from the list; it doesn't delete any files on disk if the block is a file-based block).

  • Refresh time. This applies for RSS blocks and controls how frequently PHP-Nuke re-fetches the headlines.

  • Who Can View This? Select Registered Users, All Visitors, Administrators, or Subscribers.

  • Visible to Subscribers? Choose Yes or No. This option enables you to define a block of, say, advertising that is visible to All Users but not visible to subscribers, who may have paid for the privilege of not being inundated with advertising on your site.

Figure 8.2. Adding a block.

[View full size image]


The Blocks You Get

PHP-Nuke comes with a few useful blocks to start with, and it's easy to add more. Generally, just copy the block's file (which will have a PHP filename extension) into your site's Blocks subfolder, and the block will show up on the Filename drop-down list.

These come with PHP-Nuke:

  • Advertising. Displays banner ads in a block. This block displays only banners that have been entered as block banners so that you can make sure they're not too wide for the block. Generally, about 100120 pixels in width is the max.

  • Amazon. Displays a rotation of Amazon.com products (which you can set up). Users who click through to an actual product are sent along with your Amazon.com affiliates ID (if you have one), giving you credit for any sales. This block isn't included with newer versions of PHP-Nuke, and several replacement blocks are available that offer more functionality.

  • Big Story. Shows the most-read story of the day.

  • Content. Displays shortcuts into your Content module.

  • Encyclopedia. Displays shortcuts into your Encyclopedia module.

  • Ephemerid. Displays an ephemerid. That's one of those "on this day in 1776, such and such occurred" things. PHP-Nuke lets you manage your own ephemerids.

  • Forums. Shows recent posts in the forums and provides a shortcut into that module.

  • Languages. Allows users to select their language.

  • Last 5 Articles. Lists the last five articles posted to your site and provides a shortcut into the News module.

  • Last Referrers. Shows the last five Web sites that referred someone to your site.

  • Login. Provides a place for users to log in or, if they're logged in, log out.

  • Modules. Serves as a main menu, listing all active and visible modules in your site. Note that administrators will see an extended list, including inactive and invisible modules.

  • Old Articles. A shortcut into the Stories_Archive module, listing some of the older news stories from your site.

  • Reviews. Shows an item from the Reviews module and provides a shortcut into that module.

  • Search. Provides a shortcut into the Search module.

  • Subscription. Provides a link to your subscription page, where users can pay you for access to your site. Note that PHP-Nuke doesn't come with a built-in subscription page; you have to build one yourself or get one from someone else. Topic 63, "Creating a Pay Subscription Site," covers this in some detail.

  • Survey. Displays a survey from the Surveys module and provides a shortcut into that module.

  • Top 10 Downloads. Shows the top 10 downloads from your site and provides a shortcut into the Downloads module.

  • Top 10 Links. Shows the top 10 Web links and provides a shortcut into the Web Links module.

  • Total Hits. Shows the total number of visits, or "hits," to your Web site.

  • User Info. Shows the current user his basic information and provides a shortcut into the Your Account module.

  • Who's Online. Shows a small block listing the number of users currently online. Also shows you how many private messages you have waiting and provides a shortcut into the Private_Messages module.

As you can see, many of these blocks simply serve as teasers or shortcuts, helping attract attention to other modules of your site.

Sidebar . FAQ

What blocks should I choose?

As few as possible, to start with. Don't overwhelm your usersor yourselfby enabling every block that PHP-Nuke comes with. Pick a few blocks that lend real value to your site, and leave it at that for a while, until you decide that another block is really needed.

I don't understand RSS blocks. What are they?

Simply put, they display news headlines downloaded from another Web site. That other Web site has to provide those headlines in a special format called RSS. PHP-Nuke comes preprogrammed with several sites that provide RSS newsfeeds, as they're called, although some of the preprogrammed sites are no longer in operation, so you won't be able to pull headlines from them.

How is a block different from a module?

Blocks appear in the left and right columns (and, in certain circumstances, in the top-middle or bottom-middle of the page) on every page of your site; modules provide different functionality and constitute the primary "middle column" content on each page of your site.

I added a subscription block. What's my site's subscription URL?

PHP-Nuke doesn't come with onethis is something you have to build on your own. Check out Topic 63 for more details.


Chapter 9. Writing a Story

PHP-Nuke is set up so that storiesnews articles, whatever you want to call themform a central part of your site. That does not have to remain the case; if you want your site to focus primarily on downloads, then make that module (Downloads, that is) the module that appears on your site's home page and disable the News module completely. But most sites will want to have a place to post announcements, at least, and the News module is good for that, too. Plus, whatever module is in the home page must be accessible to all visitors, and you might want to restrict access to other modules to just those users who've registered with you (which is free for them) or subscribed to your site (which might cost something).

Writing a story, then, is a fundamental part of managing a PHP-Nuke site. To start, click the NEW Story link in the special Administration block (which only administrators can see). You can also click the Add Story item from the Administration menu.


The Add New Article Screen

Figure 9.1 shows the top part of the Add New Article screen, which is where you'll write your story.

Figure 9.1. Adding a new article.

[View full size image]

Start by providing a title. Be descriptive; titles like "Hey, this is cool" don't really draw readers in. Think newspaper headlines: "Thousands Cheer for New Apple Pie Recipe" or something really catchy.

Next, select the topic. Now, if you haven't set up your topics yet, you should do that from the Topics item on the Administration menu. The default topic, PHP-Nuke, is probably not going to be very descriptive for you. You can also select associated topics, which might be topics that this story has something to do with but aren't really the best topic for it. For example, an article on apple pie would certainly have a main topic of Desserts, but it might have associated topics, such as Pastries or High-Fat Food. These associated topics will show up as links when the reader views your story, helping them find additional, related (at least vaguely) content.

Next, you'll need to select a category. There's only one default category, Articles. You can think of categories as sort of subtopics, I guess. To add, edit, or delete a category, just click the appropriate links to the right of the Category drop-down list. Categories aren't related to a single topic; all of the topics on your site share the same categories.

Yeah, I know, this is confusing. Maybe an example would work better. Let's say you have the following topics: Desserts, Entrees, Appetizers, and Sides. Now suppose you create the following categories: News, Recipes, Meal Plans, Tips, and the default, Articles. Now suppose you post a new apple pie recipe:

That'd be in the Desserts topic, in the Recipes category. What about a news article on new heirloom apples? News topic, Articles category. Not every topic-category combination will make sense (Entrée News?), but you don't have to use them.

When readers view an article, they'll be able to cross-link to a list of other articles in the same category or topic, so categories and topics really just provide a way of organizing articles according to two separate lists. That way, readers can quickly get a list of recipes or read everything you've written about entrees.

Okay, hopefully that makes sense. Your next choice is whether this story will appear in the home page (assuming you've set up the News module to be in the home page). You can also choose to activate or deactivate comments for the story, although for comments to be active, the site-wide preference must also be enabled (I cover those preferences in Topic 6, "Configuring Site Preferences").

Now comes the fun part. For story text, enter a short lead-in paragraph that will appear under the story's headline. The Extended Text box should contain the remainder of your story. And while you can put basic HTML tags in the story, PHP-Nuke filters out most advanced tags. For example, you won't be able to embed client-side JavaScript, styles, and so forth.

Finally, you have the option to program the story, meaning that you can keep it in reserve and have it automatically appear on a specified date at a specified time. When you're all done, you can preview your story to see what it will look like, and then go ahead and post it for all to see.


Formatting Your Story

Both the Story Text and Extended Text text boxes assume that you'll be providing HTML-formatted text. This requires some special attention. One way to quickly come up with HTML-formatted text is to use an HTML editor, like Microsoft FrontPage, that enables you to type text however you want and format it as you would in a word processor. In FrontPage, you can then click on the Code tab and grab the actual HTML. Just grab everything between the <BODY> and </BODY> tags, as shown in Figure 9.2. Other HTML editors work similarly.

Figure 9.2. Selecting HTML-formatted text in Microsoft FrontPage.

[View full size image]

Once you've copied the HTML to the Clipboard, you can paste it into the Story Text and/or Extended Text text boxes.

You can also format your story manually by typing the HTML tags. It's not hard. Here's a quick rundown of the most useful tags:

  • <br> creates a line break. Use two in a row to create a new paragraph, separated from the previous one by a blank line.

  • <b> boldfaces text. Just pick whatever you want to be boldfaced, and surround it with <b> and </b>.

  • <i> works similar to boldfacing, only it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • You can surround paragraphs with the special <p>paragraph</p> tags. Doing so eliminates the need to use the <br> tags because paragraphs are automatically separated by some whitespace.

Probably the other main tag you'll want to use is one to create hyperlinks. First, select the text that you want to be the link. Try to make it descriptive; if you're linking to a Web page about a book, make the book's title the link rather than providing text that just says "click here." Or, if you're linking to another Web site, make the site's name the link.

Anyway, when you've figured out which text will be the link, surround it with <a>anchor</a> tags (which, in this case, would make the word anchor the hyperlink). Now you just need to add some stuff to the opening <a> tag to make it a working link. If the site you're linking to is, for example, www.phpnuke.org, you'd build a link <a href="http://www.phpnuke.org">to the PHP-Nuke Web site</a> like that. Be sure you always start the URL with http:// because if you don't, it won't work properly (unless you're linking to a page within your own site; then you just need to provide the page name).

I cover more about managing stories and stuff in Topic 19, "Using the News Module."


Part II. Using PHP-Nuke

Team LiB

Part II: Using PHP-Nuke

Controlling Access to Modules

Using the AvantGo Module

Using the Content Module

Using the Downloads Module

Using the Encyclopedia Module

Using the FAQ Module

Using the Feedback Module

Using the Journal Module

Using the Members List Module

Using the News Module

Using the Private Messages Module

Using the Recommend Us Module

Using the Reviews Module

Using the Search Module

Using the Sections Module

Using the Statistics Module

Using the Stories Archive Module

Using the Surveys Module

Using the Top Module

Using the Topics Module

Using the Web Links Module

Using the Your Account Module

Adding the NSN Your Account Tweak

Adding the Events Calendar Module

Adding the Amazon.com Module

Making Your Own Simple HTML Module

Making Your Own Dynamic Module

Selecting and Using Built-In Blocks

Using RSS Newsfeed Blocks

Adding Third-Party Blocks

Making Your Own Simple HTML Block

Making Your Own Dynamic Block


Chapter 10. Controlling Access to Modules

You should give some thought to how you want to control access to the content on your site. There are basically three categories of user in the PHP-Nuke world: anonymous, registered, and subscriber. An anonymous user, of course, is just someone who shows up. You have no idea who this is and have no way of finding out. A registered user is someone who provides you with a username, an e-mail address, a password, and possibly more. These users go through a confirmation process that PHP-Nuke handles automatically, ensuring that their e-mail address is valid and ensuring that you have a way to contact them. They can log into your site by using their username and password. A subscribed user is someone who's paid for access to your Web site. These users are also registered, and they have a username and password that they log in with.


Types of Sites

Different types of Web sites have different typical needs for access control. For example, I have a friend who runs a Web site on which he posts news and opinion pieces. He doesn't care who reads them, so most of his site's modules are open to all users. Folks who register can sign up for his newsletter, but not many people bother, and he's okay with that.

I have a Web site at www.scriptinganswers.com where I provide a lot of content related to Microsoft Windows administration. I also have an e-newsletter, which PHP-Nuke manages for me. I don't want anyone reading the content on the site unless they've logged in, so that I can keep track of how many people are accessing my site and keep track of which users are my frequent visitors. So, most of my site is available only to registered users.

Other sites might want to provide their content to only subscribed users, such as sites where the content is actually what you're paying for.

Regardless, certain sections of your site need to be accessible to everyone. You might use the Content module, for example, to post pages with your contact information, and you'd want (probably) everyone to be able to get to that page. Most Web sites always restrict their Forums module to registered users, since allowing anonymous users to post messages can result in a lot of rubbish (like sex ads) being posted to your site. Restricting things to registered users reduces their anonymity a bit, which helps people remember to behave themselves.

So you should start by mapping out which bits of your Web site you want to be accessible to everyone, which bits are for registered users, and which bitsif anyare strictly for subscribers.


Setting Up Access Control

Figure 10.1 shows the Content module being edited. To get here, simply go to the Administration menu, click Modules, and then find the module you want to edit. Click its Edit link (in the right column of the modules list), and you'll see something like this screen.

Figure 10.1. Editing a module.

[View full size image]

You can see that you can restrict any single module to registered users, subscribers, or administrators, or you can throw open the module to all visitors. Setting up your site's access from this point is fairly straightforward, with one notable exception.

The News module is the default home page for a PHP-Nuke Web site, and whichever module is in the home cannot be restricted. So if you plan to put lots of stories into the News module and you want to force users to register before reading them, you can't have the News module in your home page. You'll have to select a different module for the home.

This is a quandary for some Webmasters. It was for me when I was building www.scriptinganswers.com: I wanted the latest news stories to be listed on the home page, but I wanted you to have to register before you could read the whole story. So I had to get someone to make me a custom module I named Homepage, which lists the articles. That module is available to all visitors. Clicking on a headline takes you into the News module, which is restricted; you can see in Figure 10.2 what happens when an unregistered user (or a registered user who hasn't logged in) tries to read one of the news stories.

Figure 10.2. Access denied!

[View full size image]

This message is generated automagically by PHP-Nuke because I have the News module set up to allow only registered users. PHP-Nuke realized that the current user wasn't logged in and displayed this message when he tried to access the News module.

So give some thought to how you want people accessing your site, and then configure PHP-Nuke accordingly. Don't forget that you can configure block visibility the same way; you probably don't want a Forums block shown to all visitors if the Forums module itself is restricted to registered users. On the other hand, you might want it to be visible: The block might serve as a teaser for the forums. But users might be confused when they see a block that, when they click on it, tells them "Access Denied."


Chapter 11. Using the AvantGo Module

If you've gotten PHP-Nuke up and running, try clicking on the AvantGo module. As shown in Figure 11.1, it's not terribly exciting; it shows a logo for your site, your site's name, and a very simple list of the latest news articles.

Figure 11.1. The AvantGo module.

[View full size image]

Clicking on one of the stories reveals an even less snazzy screen where the article is displayed, as shown in Figure 11.2.

Figure 11.2. Reading a story in the AvantGo module.

[View full size image]

Here's the deal: AvantGo (www.avantgo.com) is a free service that users of personal digital assistants (PDAs) like Palm devices, Windows Mobile devices, and a few cell phones, can sign up for. The service retrieves content from specified sites (like yours) and stores it in users' mobile devices so that they can read this interesting content from their postcard-size screen while on the train, plane, or whatever. So the substandard formatting of the AvantGo module is actually designed with consideration for these mobile devices' miniscule screens and lackluster graphics capabilities (lackluster, at least, on older devices).

UNDER THE HOOD

AvantGo works by installing a small piece of software on its users' computers. This software integrates with the users' device-synchronization software (ActiveSyncfor Windows Mobile devices or HotSyncfor Palm Devices). Whenever the user synchronizes the device (usually when docking it with a PC), AvantGo heads out and collects updated content for everything the user has in the AvantGo profile.

In the case of your site, AvantGo will hit the special URL for theAvantGo module, which is your site's main URL plus modules.php? name=AvantGo. Your site delivers up the contents of that module, which includes the main news articles menu and the subsequent article contents (the AvantGo profile must be configured to follow a"link depth"of 1 for the article content to be retrieved). AvantGo copies that content into the user's mobile device, allowing the user to read your content without being connected to the Internet.


Customizing the AvantGo Module

There's no administration section for this module; it automatically pulls your most recent news stories and includes them in the AvantGo feed. You can customize three basic things: the graphical logo, your site name, and your site's URL (listed at the bottom of news story screens). All of these are configured in the basic site Preferences page, which I cover in Topic 6, "Configuring Site Preferences." Figure 11.3 shows this module, with values filled in for the AvantGo module.

Figure 11.3. Configuring site preferences for the AvantGo module.

[View full size image]

I do recommend that you edit the AvantGo module (in the Modules Administration section) so that Visible in Modules Block is set to No. That way, the AvantGo module will be available to mobile users accessing your site, but it won't be readily available to users browsing your site from their PC. That way, users won't stumble across this less than attractive portion of your Web site; they'll read stories and articles right through the News module, as you intend for them to do.


Using the AvantGo Module

Users who want to access the AvantGo module need to configure their AvantGo profile to use the URL http://www.scriptinganswers.com/cms2/modules.php?name=AvantGo. Obviously, you'll substitute your own site name in this URL; the important part is the modules.php?name=AvantGo part, and please note that it is case sensitive. modules.php?name=avantgo will not work properly.

AvantGo currently refers to these customized subscriptions as personal channels. Figure 11.4 shows AvantGo's configuration screen, which is what your site's users will see if they want to add your site to their AvantGo profile. Even if you're not an AvantGo user, it's useful to know how this works so that you can help your users figure it out, if need be.

Figure 11.4. Configuring AvantGo with a personal channel.

[View full size image]


Chapter 12. Using the Content Module

The Content module is a place where you can keep and store static text content. You may wonder to yourself why PHP-Nuke seems to have so many places to store static content. After all, in Topic 9, "Writing a Story," I showed you how to write a news story; how are stories supposed to be different from "content?" In the PHP-Nuke world, a story is meant to be temporary: something that shows up on your home page for a while and then rotates into the archive for long-term storage. Content, on the other hand, is permanent text, like general contact information, which users will always need access to. Content doesn't show up on your home page (at least, not if you've left the News module as your home page), and it doesn't get rotated out into an archive, like news stories do. Content is just ever-present and unchanging.


Making Content

The Administration menu provides a Content item, which enables you to manage the content on your server. This section begins with a list of existing content items, although at first the list will, obviously, be empty. Next, the section contains two text boxes, which are used to add new content categories, as shown in Figure 12.1.

Figure 12.1. Adding a content category.

[View full size image]

Note that these categories are unique to the Content module; they're different from categories you may have set up for news stories, FAQs, and so forth. Right below the Add a Category section is the Edit Category section, which includes a drop-down list of all the categories you've created. Finally, there's the Add a New Page section, the top part of which is shown in Figure 12.2.

Figure 12.2. Adding a new content page.

[View full size image]

Adding a new page is easy. Start with the page's title, and then select its category. Note that the Category drop-down list box won't be displayed if you haven't yet defined any content categories. After selecting a category, you can provide a subtitle for the page. Keep it short; this will appear on the Content module's listing of available pages, and an especially long subtitle will make the listing difficult to read.

You then have three large text boxes for the page's actual content: Header Text, Page Text, and Footer Text. You can also include a short signature at the end. Here's how all of this fits together:

  • The title and subtitle will appear on each page of the content.

  • The header will appear on the first page of the content. You can format this text with HTML tags, if you like.

  • The footer will appear on the last page of the content. You can also format this text with HTML tags.

  • The signature will appear on the last page of the content and will be right-justified. HTML tags can be used to format this text also.

  • The page text can be split to appear on multiple pages. Just add the text <!--pagebreak--> where you want the text to be broken into pages. You can also add HTML formatting to the page text.

Figure 12.3 shows how you might enter a content page that you want broken into two pages; Figure 12.4 shows the final layout of the second (and last) page.

Figure 12.3. Creating a multipage layout.

[View full size image]

Figure 12.4. Reading the finished multipage content.

[View full size image]

Also note that you can use basic HTML tags in your content:

  • <br> creates a line break. Use two in a row to create a new paragraph, separated from the previous one by a blank line.

  • <b> boldfaces text. Just pick whatever you want to be boldface, and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • You can surround paragraphs with the special <p>paragraph</p> tags. Doing so eliminates the need to use the <br> tags because paragraphs are automatically separated by some whitespace.

Probably the other main tag you'll want to use is one to create hyperlinks. First, select the text that you want to be the link. Try to make it descriptive; if you're linking to a Web page about a book, make the book's title the link rather than providing text that just says "Click here." Or, if you're linking to another Web site, make the site's name the link.

Once you've figured out which text will be the link, surround it with <a>anchor</a> tags (which, in this case, would make the word anchor the hyperlink). Now you just need to add some stuff to the opening <a> tag to make it a working link. If the site you're linking to is, for example, www.phpnuke.org, then you'd build a link <a href="http://www.phpnuke.org">to the PHP-Nuke Web site</a> like that. Be sure you always start the URL with http:// because if you don't, it won't work properly (unless you're linking to a page within your own sitethen you just need to provide the page name).

Note that this HTML formatting works in most places in PHP-Nuke where you're entering text into a large text box; however, the special <!--pagebreak--> tag works only within the Content module.

The last option you'll select for a new content page is whether to activate it. Please note that all content can be accessed at any time; deactivated content is simply not listed, meaning that you have to know the content's exact URL to see it.


Accessing Content

Obviously, users access your content through the Content module, which will usually be listed in the Modules block on every page. The Content module starts with a list of content categories, if you've defined any. Uncategorized content is also listed on the first page. From there, users can drill down into the content categories, which list the content in those categories; ultimately, users can get to the actual content itself.

But there's another way to access content, including deactivated content. Suppose, for example, that you want to send out an e-newsletter that contains a hyperlink directly to a particular content page. You could just link to the content module, using a URL such as http://www.yoursite.com/modules.php?name=Content. But that would take users only to the list of content categories; it wouldn't put them right into a particular page.

You can also link directly to a specific page. The easiest way to do so is to browse to that page yourself, using the Content module, and then copy the URL from your browser's address bar. For example, Daisy's Contacting Us page can be accessed directly via the URL http://www.scriptinganswers.com/cms2/modules.php?name=Content&pa=showpage&pid=1. Each page of content will use the same URL, with only the pid=1 changing: The second page you create will be pid=2, then pid=3, and so forth. You can always get the correct URL by simply browsing to the page in question and copying the URL from your browser's address bar.

Which brings me to the point of deactivated content. On my site at www.scriptinganswers.com, I have several products for sale. I sell these through a third-party credit card processing company. So, I have various content pages set up that describe my products, with links that point to the processing company's checkout system. This allows my users to read about my products and then click a link to buy them. When the processing company is done handling the customer's order, it redirects the customer back to my site. I want my customers redirected to a nice "Thank you!" page, not just the site's home page, so that they feel their transaction is complete and that I appreciate their business (which I do).

So I created a new content page with my "thank you" message. Because I don't want this page generally accessible through the Content module, I deactivated it, which prevents it from being listed in the Content module. I provided the processing company with the direct URL to this page, allowing them to send customers to it after completing a transaction. In short, by deactivating the "thank you" page, I made it "hidden" so that it wouldn't be listed on my main Content menu (which would have looked weird), but I've still kept it available for the processing company to use.


Chapter 13. Using the Downloads Module

The Downloads module is a way for you to organize download links. Note that you do not have to physically host the downloads yourself; the Downloads module is simply a collection of links to downloadable content. That means your links can point to content that you're hosting on your own Web server or to content hosted on other Web servers on the Internet. For example, on my site at www.scriptinganswers.com, I provide links to many downloads hosted on Microsoft's Web servers. Microsoft's Web site is huge, so by providing these links to my users, I help them quickly find the downloads that will interest them without having to dig through Microsoft's site.


Setting Up Downloads

The Administration menugateway to so much else in PHP-Nukecontains an item for Downloads that enables you to manage the downloads on your site.

Start by adding a main category for downloads. Unlike some other areas of PHP-Nuke, you can't have any downloads until you've created some categories for the downloads to live in. Once you've created at least one main category, you can start creating downloads. Figure 13.1 shows the Add a New Download section of the Downloads Administration screen.

Figure 13.1. Adding a new download.

[View full size image]

Before I continue, I should point out that you can also add subcategories to further organize your content. Again, you'll have to create a main category before PHP-Nuke will let you add any subcategories.

Adding a download requires you to enter several pieces of information:

  • Program name. This is basically just the title of your download; it doesn't have to be the actual program name. Make this descriptive because it's what shows up in the list of downloads on your site.

  • File link. This must be a complete URL, including the http:// prefix, to the downloadable file.

  • Category. Choose the main category or subcategory that you want this download to be listed under.

    UNDER THE HOOD

    It's actually more confusing than that. Brace yourself.

    Goahead and accept as a fact that, with regard to disk storage, things proceed in increments of 1,000: A kilobyte is 1,000 bytes, a megabyte is 1,000KB, and so forth. It's different with computer memory, where the magic number is 1,204, but forget about that for now.

    TheWindows File Properties dialog box will actually list two sizes: Size and Size on Disk. The actual size of the file is its Size, as shown by Windows. The Size on Disk, however, can be much larger and represents how much room the file takes up on disk.

    This is going to sound silly, but that's just the way it works. See, when Windowsand other operating systems, for that mattergoes tostore things on disk, it must do so in certain increments. It's like buying minutes for a prepaid cell phone: You can't buy 5 minutes; you have to buy 50 (or whatever). When Windows stores files on disks, it does so in these specific increments, which on my system is 8KB. So if I store a 4KB file, it still takes up 8KB, with half of that space essentially wasted. If I store a 9KB file, it takes up 16KBtwo "blocks," so to speakwasting about 7KB.

    I know, it's crazy. But for the purposes of finding a file size for your Downloads module, just use the Size figure Windows gives you, not Size on Disk. Users will have to download only as many bytes as listed under Size, regardless of how much room that file will actually consume on their hard drives.

  • Description. You have up to 255 characters (about 50 words) to describe the download.

  • Author's name. List the author's name here, if it's known.

  • Author's e-mail. If you know the author's e-mail address and are allowed to share it, you can list it here. If not, just leave this blank.

  • File size. You can leave this blank, but if you know how large the download is (in bytes), list it because doing so can help your users decide whether to go ahead and download it. One way to get the file size is to download the file yourself and then right-click it in Windows and select Properties from the pop-up menu. One of the properties will be for file size, and Windows will list it in bytes for you.

    Just for your reference, remember that a kilobyte (KB) is 1,000 bytes; a megabyte (MB) is 1,000,000 bytes. That's with regard to file size, at least; for some reason, kilo- and megabytes are different when you're talking about computer memory rather than storage. It's all very confusing.

  • Version. If the download has an associated version number, list it. Otherwise, don't. It doesn't matterthis is just informational so your users can distinguish between two different downloads that point to different versions of the same file.

  • Home page. If the download is on another Web site, list that Web site's URL here. That way, users know where to go to learn more about the download, get help for it, and so forth.

  • Hits. This is a way to cheat. PHP-Nuke tracks how many people download each of your downloads and uses that information to compile its Top 10 lists and other statistics. You can fake it out by putting in a specific number of hits here, making a download seem more popular than it really is. Or, you can edit an existing download and reduce its number of hits, to make it seem less popular, you nefarious person, you.


Using and Managing Downloads

When users access your Downloads module, they're greeted by a list of main download categories, as shown in Figure 13.2.

Figure 13.2. Viewing the main download categories.

[View full size image]

Once they click on a category, users will see a list of all downloads in that category, plus a list of any subcategories. Obviously, they can then click a subcategory to see its downloads, or click on a download directly to begin downloading it.

Clicking the name of a download immediately downloads it. Users can also click Rate Resource to give a rating of one to five stars to the download, helping other users decide how useful it really is. Users can also click a Details link to get a full-page view of the download's detail information. This is all shown in Figure 13.3.

Figure 13.3. Viewing downloads.

[View full size image]

Other functions on this screen include the capability to sort by download title, date, rating, or popularity (based on the hit count I described earlier). To sort, simply click the appropriate A or D links, which sort ascending or descending, respectively. For example, to sort by reverse alphabetical order, you'd click the D link next to Title.

Another important function is the Report Broken Link link, which users can click to notify you that a download link isn't working. Now, in my experience, users tend to click this just to see what it does, so even if you're very careful with your download links, you'll need to know how to deal with this.

In Figure 13.4, notice the Waiting Content block in the left column. This is a special block shown only to the site's administrator, and you'll notice that the Broken Downloads line lists one broken download. Clicking the Broken Downloads link takes you to Figure 13.5, where you can check the download for yourself. You can click the download's name to try to download it on your own, and then click either the Ignore, Edit, or Delete links, as appropriate. The Ignore link removes the broken download report, meaning that either there was no problem or you've fixed the link. Edit takes you into the download's details so that you can fix the link, and Delete simply removes both the broken download report and the download link itself.

Figure 13.4. Notification of broken download link reports.

[View full size image]

Figure 13.5. Working with broken download reports.

[View full size image]

You can be proactive in catching bad download links by going to the Downloads administration page and selecting the Validate Downloads link, which is listed right under the Downloads logo. Clicking this link has PHP-Nuke check each of your download links (or those in a specific category) for validity. Although the check can be fairly easily fooled, it's a decent first crack at making sure all of your downloads are okay.


User-Submitted Downloads

Sidebar . FAQ

How do I upload files to the Downloads module?

The Downloads module doesn't really keep track of files. Really, it's just keeping track of links to files that are already on the Internet. So if you want to link to files on your own Web server, you can, but you'll need to take care of uploading the files yourself. To do so, you can use FTP or another means provided by your hosting service (if you're using a hosting service).

Why do users keep submitting broken link reports for perfectly good downloads?

Sometimes the link you're pointing to might not workperhaps the Web site is temporarily down, or perhaps the Internet is just busy. Your users might perceive this as a failing on your part and might report the link as broken. However, when you check, things might be working fine. You'll just have to accept this occasional annoyance as part and parcel of operating a Web site.

Do downloads count against my site's disk space limit?

Only if you're linking to files that live on your Web server. Keep in mind that the Downloads module can link to files on other Web servers, too; those files don't live on your server and, thus, don't count against any disk space limits that your hosting service might have imposed on your site.

When users are in your Downloads module, they have the capability to add a download via a link right under the Downloads graphical logo. Users are requested to input the same information that you'd input when adding a download, but the download isn't automatically added to the database. Instead, you have to review it and approve it.

You'll know that you have pending downloads to review by checking the Waiting Content block; you'll see a line labeled Downloads that shows how many submitted downloads you have waiting for you. You can review each of these; modify them, as appropriate; and accept them into your database.

Users can also submit modifications to an existing download by going to that download's details page and clicking the Modify link. Again, any modifications must be reviewed and approved by you, and they'll show up in the Waiting Content block under the Mod Downloads entry.


Chapter 14. Using the Encyclopedia Module

The Encyclopedia module lets you build multiple online "reference books," each of which can contain multiple entries. Figure 14.1 shows the Encyclopedia Manager, accessible from the Administration menu, where you'll create your first encyclopedia.

Figure 14.1. Creating a new encyclopedia.

[View full size image]

Once you've created an encyclopedia (or several, if you like), you can start adding terms. Figure 14.2 shows the Add a New Encyclopedia Term entry page, which is available after you've created at least one empty encyclopedia. As you can see, you can enter a title for the entry, as well as text describing it.

Figure 14.2. Creating a new encyclopedia term, or entry.

[View full size image]

Your entry text can include basic HTML formatting, which I covered in Topic 12, "Using the Content Module." It can also include the special <!--pagebreak--> tag, which breaks your entry into multiple pages for easier reading. I also discussed that tag in Topic 12. Quickly review these basic formatting tags:

  • <br> creates a line break. Use two in a row to create a new paragraph, separated from the previous one by a blank line.

  • <b> boldfaces text. Just pick whatever you want to be boldfaced and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • You can surround paragraphs with the special <p>paragraph</p> tags. Doing so eliminates the need to use the <br> tags because paragraphs are automatically separated by some whitespace.

  • The <!--pagebreak--> tag, which can be used only in certain areas of PHP-Nuke (and which isn't a standard HTML tag at all, but rather something special PHP-Nuke utilizes), breaks long content into multiple pages. PHP-Nuke will automatically provide Next and Previous links, allowing users to navigate through your material very easily.

Another useful tag, especially within encyclopedias, is the image tag. It looks like this: <img src="http://www.mywebsite.com/images/mypicture.gif">. The src portion points to a graphic file that's living on a Web server someplace, which means that the image tag enables you to insert a picture into your text. This is an especially useful function within encyclopedia entries, where a good picture can easily save you from having to type a long description of something.


Using Encyclopedias

When users enter the Encyclopedia module, they start with a list of available, active encyclopedias. Within each one, they'll see a screen something like the one in Figure 14.3. As you can see, PHP-Nuke provides a set of alphabetical links, allowing users to quickly jump to any section of the encyclopedia. Users can also search for specific terms. Notice that, in Figure 14.3, only the F link is underlined. That means this encyclopedia contains only entries starting with F; when other entries are added, those letters will automatically become links as well.

Figure 14.3. Looking for encyclopedia entries.

[View full size image]

Sidebar . FRIDGE

Do you ever feel sorry for the folks who used to print encyclopedias? Are any of them still in business? I guess most of them are making electronic versions on CD and DVD these days. I remember my parents buying a whole set of encyclopedias for me when I was little. Right about the time I graduated from high school, CD-ROMs were becoming popular and you could get an entire encyclopedia on one. Today even CDs and DVDs are becoming obsolete as far as reference materials go, since the Internetincluding sites built on PHP-Nukeprovide more timely and comprehensive information that's easier to find.

Turns out, you can go to a Web site like www.eb.com, the Web site for Encyclopedia Britannica, and sign up to access their encyclopedias right from the Internet. And they'll even ship you a printed set of encyclopedias, if you have a few feet of empty bookshelf space in your house that you're dying to fill.

Unlike some other areas of PHP-Nuke, where users can submit their own entries (such as for downloads and Web links), users cannot directly submit their own encyclopedia entries. Users who want to suggest an entry will have to e-mail it to you, and you'll have to enter the information yourself into the encyclopedia.

There is an alternative, however, if you have a small number of users who will be regularly contributing to or helping you maintain your encyclopedias. I'll cover this in more detail in Topic 46, "Administering Users and Admins," but here's the short version:

On the Administration Menu, you can select Edit Admins. The other term for an admin, at least as far as PHP-Nuke is concerned, is author. If you want another user to be able to manage your encyclopedias for you, simply create a new administrator for that user, and grant them only the Encyclopedia permission by clicking the appropriate check box. Note that admin accounts are separate from other user accounts; your encyclopedia manager will have to go directly to the admin.php page on your Web site and log on using his admin account, even if he is already logged on to your Web site in general with his regular user account. Again, I'll cover that confusing detail in Topic 46.


Chapter 15. Using the FAQ Module

Like most other PHP-Nuke modules, the FAQ module is administered through the FAQ item on the Administration menu. You'll need to start by creating at least one FAQ category, since all actual FAQ entries must live within a category. Figure 15.1 shows the Add a New Category section of the FAQ administration module.

Figure 15.1. Creating a new FAQ category.

[View full size image]

Once you've got that initial category (or a set of them) created, you can begin adding entries. I'd strongly suggest coming up with some good categories that aren't overly broad; ideally, no one category should have more than 1520 entries because many more than that will make it more difficult for people to find the FAQ they're after. Good, precise, narrow categories will help users quickly drill down and find the FAQ that they need.

The main FAQ Administration page will list all of the categories you've already created, as you can see in Figure 15.1. To add content to a category, just click that category's Content link. Figure 15.2 shows where you enter the new entry's question and answer text. Keep in mind that you can use HTML tags to format the answer. Here's a quick rundown of the common HTML tags you might use:

  • <br> creates a line break. Use two in a row to create a new paragraph, separated from the previous one by a blank line.

  • <b> boldfaces text. Just pick whatever you want to be boldfaced, and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • You can surround paragraphs with the special <p>paragraph</p> tags. Doing so eliminates the need to use the <br> tags, because paragraphs are automatically separated by some whitespace.

  • The <!--pagebreak--> tag, which can be used only in certain areas of PHP-Nuke (and which isn't a standard HTML tag at all, but rather, something special PHP-Nuke utilizes), breaks long content into multiple pages. PHP-Nuke automatically provides next and previous links, allowing users to navigate through your material very easily.

  • To create images in your FAQ answer, use a tag like this: <img src="http://www.mywebsite.com/images/mypicture.gif">. The src portion points to a graphic file that's living on a Web server someplace, which means the image tag allows you to insert a picture into your text.

Figure 15.2. Creating a new FAQ entry.

[View full size image]

Once you've created a FAQ entry, you'll see it listed in the content section for its category, as shown in Figure 15.3. Notice that you're given links to edit the FAQ entry or to delete it from the category altogether. Also notice that the entire FAQ is listed, allowing you to preview your HTML formatting, if you used any, and to quickly read it over for typos.

Figure 15.3. Managing existing entries.

[View full size image]


Using FAQs

Your users will access your FAQs through the FAQ module. They'll start with a list of available categories. When they click one, they'll see a screen like the one in Figure 15.4. Notice that all of the questions are listed first, for easy reference; clicking a question takes you straight to the answer.

Figure 15.4. Viewing a FAQ.

[View full size image]

Users don't have any interaction with FAQs, meaning that they can't report one as "wrong," and they can't submit their own FAQs. You may, however, have one or two users who help you maintain the FAQ section on your Web site. There's a way to give them permissions to be a sort of FAQ Adminor, as PHP-Nuke might call it, a FAQ author.

On the Administration menu, you can select Edit Admins. The other term for an admin, at least as far as PHP-Nuke is concerned, is author. If you want another user to be able to manage your FAQs for you, simply create a new administrator for that user, and grant that person only the FAQ permission by clicking the appropriate check box. Note that admin accounts are separate from other user accounts; your FAQ admin will have to go directly to the admin.php page on your Web site and log on using that person's admin account, even if he is already logged on to your Web site in general by using his regular user account. Topic 46, "Administering Users and Admins," is all about providing users with admin access to various portions of your Web site, so if that's of interest to you, be sure to check it out.


Chapter 16. Using the Feedback Module

The Feedback module is one of the very few modules that require no administration. It does, however, offer a minor security-related issue. As shown in Figure 16.1, the module allows users to send feedback to you regarding your site.

Figure 16.1. Asking your users for their feedback.

[View full size image]

The main problem with this module is that it provides no verification or validation of anything the user types in, including the Your Name and Your E-mail fields. In other words, anyone with access to the module can type anything they like. Because the form accepts data through the standard HTTP protocol form-handling techniques, it's possible for someone to write a small script or program that automatically submits multiple bogus feedback messages. The end result? Your administrative e-mail box fills up with spam, and you won't even know who's doing it.

As written, there's not much you can do to improve the Feedback module. However, there are some things you can do to minimize the chances for its abuse:

  • Don't use it. Many administrators prefer to provide a Web site feedback forum in the Forums module, where users can leave feedback and receive replies from you. For example, Figure 16.2 shows a forum used for this purpose on my Web site, www.scriptinganswers.com. A benefit of this technique is that I can post replies to my users' feedback, allowing everyone to see.

    Figure 16.2. Using a discussion forum to solicit feedback.

    [View full size image]

  • Restrict access. You can configure the Feedback module to be accessible only by registered members of the site. This won't eliminate any of the module's problems, but it may reduce the chances that the module will be abused to spam you. To restrict access, simply modify the module in the Modules item of the Administrative menu.

  • Make the module invisible. Again, this is a form of "security through obscurity," which means that it isn't helping to fix the Feedback module's problems, but it is making the module slightly more difficult to abuse. If you edit the module's properties so that it isn't visible, it won't appear on the Modules block (which acts as sort of a main menu). You can provide links to the module yourself by accessing http://yoursite/modules.php?name=Feedback, providing your users with access to the module.

My recommendation? Disable the module completely. Users are better served by a "feedback" discussion forum, which gives you much more flexibility for replying to them, discussing their suggestions, and so forthall of which makes you a more visible, caring Webmaster who'll earn your users' loyalty.


Chapter 17. Using the Journal Module

The Journal module provides your users with a sort of online diary, which, in this day and age, everyone is calling a "Web log," or blog, for short. Visually, the Journal module is a part of the Your Account module, although journals can be enabled or disabled independently of that module. Figure 17.1 shows the Journal module's main page, which provides links to the directory of all user journals, your own journal, and a listing of the 20 most recently updated journals.

Figure 17.1. The main Journal module page.

[View full size image]


Updating Your Journal

Clicking on Your Journal lists your current journal entries and provides a link to add a new entry. Figure 17.2 shows the Add Journal Entry page: Provide a title for the entry, and then enter the entry text. As noted on the page, HTML tags are fine, and you should wrap paragraphs in the <p> and </p> tags to provide the proper line breaks in between paragraphs. You can also select an icon to go with your entry, if desired. Finally, you have the option to make each entry public or private: Only you can view private entries, while public entries are accessible to everyone who has access to the Journal module.

Figure 17.2. Adding a journal entry.

[View full size image]

HTML tags allow within journal entries the usual culprits:

  • <b> boldfaces text. Just pick whatever you want to be boldfaced, and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

    UNDER THE HOOD

    Blogscan be fun, but they're not always free. The fact that PHP-Nuke includes a blog feature (although it's called a journal) is often overlooked, but it's a great service to offer to your users. Commercial blog hosts like www.blog.com charge as much as $9 a month for a blog (although basic service is free); you may consider making your Journal module available to subscribers who pay for the feature.

    Like most everything else in PHP-Nuke, journals take up database space. Your Web host may (and probably does) place an upper limit on howmuch database space you can use, and journals don't automatically delete old entries, so they can contribute to a filled-up database. Just keep an eye on your users' journal utilization, and be prepared to make journals a paid portion of your site or to shut off the feature, if necessary. But don't fret too much at first: A 500-word journal entry takes up only about 3,000 bytes of information. You can fit well over 300 of these entries in a megabyte of database space.

  • To create images in your journal entry, use a tag like this: <img src="http://www.mywebsite.com/images/mypicture.gif">. The src portion points to a graphic file that's living on a Web server someplace, which means the image tag enables you to insert a picture into your text.

It probably makes the most sense to make your journal entries public; after all, that's pretty much the point of the whole module. However, making an entry private does allow you time to edit the entry and get it perfect before making it public. As shown in Figure 17.3, you can edit (or delete) any of your own entries; the list of entries conveniently indicates which ones are currently public or private.

Figure 17.3. Listing journal entries for editing or deletion.

[View full size image]


Other Users' Journals

The Journal Directory, accessible from the Journal module's main page, lists all available journals. Figure 17.4 shows the list, which provides access to the journal (by clicking the user's name or the binoculars icon) and provides the capability to view a member's profile or send a private message. Viewing another member's journal is much like viewing your own, except that you can't edit or delete their entries.

Figure 17.4. The Journal directory.

[View full size image]

The fun part about journals is that they can contain anything. They don't have to relate to the site at all; they could relate to a user's other personal interests, hobbies, and so forth, or they might just contain the user's opinions on politics, religion, books, or whatever. As shown in Figure 17.5, you can write a comment about the journal entry and share your own thoughts or opinionsmuch as you can do with other, standalone blogs on the Web.

Figure 17.5. Viewing another user's journal entry.

[View full size image]

You'll also notice a Send This Journal to a Friend link. This isn't a feature you can disable, but it does present a potential security issue you should be aware of. This feature allows users to send the text of a journal entry to another e-mail address. Users are asked to supply their own name and e-mail address, along with the name and e-mail address of their friend; however, none of this information is verified. It's easy for an unscrupulous user to send journals to anyone and to mask their identity when doing so. Restricting access to the Journals module to registered users may help reduce the likelihood of this type of abuse occurring, since hopefully your own loyal users won't use your Web site to send spam to other individuals.


Chapter 18. Using the Members List Module

The Members List module isn't one of PHP-Nuke's most exciting pieces. Figure 18.1 shows it in all its glory.

Figure 18.1. The Members List module.

[View full size image]

Simply put, this module lists all the members who have registered on your site. It provides a couple of message-sending functions, including the capability to send a private message (via the Private Messages module), send an e-mail, or visit the member's Web site (assuming one has been entered into his profile). It also lists the member's location (if provided in the member profile) and lists the number of Forums posts the member has contributed.

As you can see from the visual appearance of the module, which is slightly different from the rest of PHP-Nuke, the Members List is actually a function of the integrated phpBB software, which is better know as the Forums module. That's why the Members List module also includes buttons labeled Forum FAQ and so forth.

One major problem I have with this module is that it exposes members' e-mail addresses, which is just plain rude. The E-mail button shown in Figure 18.1 is an HTML mailto: link, which means that clicking the E-mail button pops up a preaddressed window from your e-mail software, allowing you to immediately send an e-mail to that member. However, less scrupulous individuals can write software utilities that scape (or harvest, as they put it) the e-mail addresses from a Web page generated by the Members List module. In other words, you could be exposing your members' e-mail addresses to anyone, which is just plain rude. For that reason, I recommend always disabling the Members List module. You can do so from the Modules section of the Administration menu in PHP-Nuke. At the very least, you should restrict access so that the Members List module can be accessed only by other registered users of your site, but ask yourself how much you really know about the registered users of your site. Can you be sure one of them isn't a spammer, come to harvest e-mail addresses from your site?

One valid use of the Members List module is its capability to show the top 10 members according to Forums posts, meaning that you can quickly see who your most active Forums users are. You might use that list to send those members a special reward, or at least a thank-you e-mail. But you don't need to enable the Members List module for that functionality to work; as the administrator of the site, you can access it any time you want to.

UNDER THE HOOD

By the way, you might notice that not every member of your site is listed in this module. That's because PHP-Nuke actually contains two lists of members. The first list contains everyone who's registered for your site but not yet responded to the confirmation e-mail that PHP-Nuke sent them. This is the list of temporary users.

Once a user responds to that confirmation e-mail, he becomes a regular, active user and shows up in the Members List module.


Chapter 19. Using the News Module

The News module is perhaps one of the most used and most important modules within PHP-Nuke. Typically, it's the module you'll select for your site's home page, making it the first thing users see when they visit your site. The News module has a number of different faces, depending on how it's being used. Figure 19.1 shows the primary version of the News module, which is what appears on the home page of a site.

Figure 19.1. The News module on a site's home page.

[View full size image]

As you can see, the News module displays multiple stories. Each story has a headline and a topic icon, which visually represents the topic that the story is associated with. Each story has story text, which is a sort of a lead-in paragraph or two. By clicking the story's Read More link (when present), users can view the story's extended text. As shown in Figure 19.2, the extended text version of the News module displays a single story, along with its complete text.

Figure 19.2. The News module's extended text view of a story.

[View full size image]

The extended text version also includes some important blocks in the right column that override any blocks that you've configured to appear there. Three of these so-called system blocks are displayed:

  • Related Links. This block provides links to other stories in the current story's topic, as well as other stories posted by the user who posted this story. This block also displays your site's most-read story from the current topic.

  • Article Rating. This block allows users to rate the story, giving it anywhere from one to five stars. Each story's average score is displayed on the main News module on the home page.

  • Options. This block includes links to generate a printer-friendly version of the story, and an option to send the story to a friend via e-mail. Administrators will also see options to add a story or to edit or delete the displayed story.

At the bottom of the story are any user-posted comments (assuming that you've allowed them in your site's Preferences), and a link for users to post a new comment, if desired.

There's a hidden trick, too: Clicking the topic icon takes you to yet another News module page, this time displaying the latest stories in that topic, as shown in Figure 19.3. This page also includes a search field at the top, allowing users to search for stories within this topic that contain particular search terms, or keywords.

Figure 19.3. Displaying stories from a particular topic.

[View full size image]

By the Way

PHP-Nuke is incredibly inconsistent about referring to stories. I'll try to use the term stories consistently, but in PHP-Nuke, you may see them called news, news articles, or just plain articles. They're all the same thing, though.


Administering Stories

You may browse the Administration menu for a few moments looking for icons labeled Stories or News or something. You won't find one. PHP-Nuke's author felt that news administration was so important that it appears right on the main Administration menu page, below the menu icons, as shown in Figure 19.4. You'll notice a list of the last 20 articles, allowing you to edit or delete them. If you need to edit or delete an article (see, there I go, calling them articles instead of stories) other than one of the last 20, you'll need to know its ID number.

Figure 19.4. Story administration from the Administration menu.

[View full size image]

Frankly, the easiest way to find a story's ID number is to go read the story on your site. While you're looking at the story, make a note of the URL shown in your browser's address line. Typically, it'll be something like http://www.scriptinganswers.com/cms2/modules.php?name=News&file=article&sid=3. That last number3, in this caseis the story ID (sid=3). Punch that into the Story ID text box at the bottom of the Administration menu, select either Edit or Delete from the adjacent drop-down box, and you're in business.


Writing a New Story

There are two ways to get yourself into writing a new story: Click the Add Story icon on the Administration menu, or click the New Story link from the Administration block that appears in either the right or left columns (depending on where you put it). Either way, you'll start with the Add New Article screen, shown in Figure 19.5.

Figure 19.5. Adding a new story to the News module.

[View full size image]

Start by providing a title, or headline, for your story. Next you'll select a topic, a category, and associated topics. I'm not going to cover those right now; PHP-Nuke is a little complex about topics and categories, so I'm going to get to that a bit later in this discussion. Bear with me, and for now just remember that this is where you'll select these things.

Next, you decide whether your story will appear on the home page by selecting the appropriate Publish in Home option. However, if you selected Articles as the category for your story, it will always appear on the home page, whether you like it or not. You'll then have to decide whether you want to allow users to post comments for your story. If you say "Yes," they'll be able to do so only if you've enabled comments as a part of your site-wide preferences.

Finally, you're into your story itself. The Story Text box is for your lead-in paragraph; as always, you can use basic HTML tags to format your story. The Extended Text box is for the rest of your story and can also use HTML. Don't repeat your lead-in paragraph in the Extended Text box; when someone selects the Read More link for your story, the resulting Web page displays both the story text and the extended text automatically. Here's a quick reminder of the HTML tags you're most likely to use:

  • <b> boldfaces text. Just pick whatever you want to be boldfaced, and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • Wrap paragraphs in <p> and </p> tags, or use the <br> tag to create a single line break. Using <br><br> will create two line breaks, giving some whitespace between paragraphs. If you don't use one of these two techniques, the paragraphs in your story will run together and be difficult to read!

  • To create images in your story, use a tag like this: <img src="http:// www.mywebsite.com/images/mypicture.gif">. The src portion points to a graphic file that's living on a Web server someplace, which means that the image tag enables you to insert a picture into your text.

Now you have an option to program the story. Be sure to select Yes if you want to! I forget to do that all the time. If you select No, your story goes live immediately and can be viewed by users on your site; if you select Yes, you choose the day, month, year, hour, and even minute on which your story will go live. Pay close attention to the date: PHP-Nuke wants the date in the day-month-year format commonly used in Europe, not the month-day-year format more often used in the USA. I can't tell you how many times I've scheduled something to appear on March 4, only to have it not show up until April 3. Oops.

Your last optionand this is only if you don't schedule the story to appear at a later timeis to attach a poll. Polls have a title and then up to 12 options that users can select. If you leave the poll information blank, your story won't get a poll; fill it in, and the poll will appear with your story. I cover polls in more detail in Topic 27, "Using the Surveys Module."

By the Way

Your users can submit their own stories for publication, through the Submit_News module (provided, of course, that you've enabled that module). I cover how to work with those submissions in Topic 50, "Working with Submissions," along with the other types of content your users can submit to you.

That's it! Scroll back up a bit and click OK to preview your story and see what it will look like on the site. At that time, you can make any edits that are necessary, select Post Story from the drop-down list box that previously contained Preview Story, and click OK again to post your story. The main administration page lists all programmed stories (articles), so you can easily see which ones are coming up on your site.


Topics and Categories

PHP-Nuke stories are always associated with both a category and a topic. Topics aresurprise, surprisemanaged from the Topics module, which I discuss in Topic 29, "Using the Topics Module." Each PHP-Nuke topic has an associated graphical icon, which you'll need to upload to your Web server to use.

Categories, on the other hand, are administered fromof all placesthe Add Story page I just finished discussing. Go back to that page, and you'll notice that the Category drop-down list box has Add, Edit, and Delete links right next to it. Categories don't have graphics associated with them; they're just a word or very short phrase.

Here's how this whole topic/category business works out: Every story has both a primary topic and a primary category (stories can also have associated topics, but that controls only the links that appear in the Related Links block that appear when you read the story's extended text). So, imagine that you create three topics for your site: Recipes, Tips, and Tutorials. Now suppose you create four categories: Appetizers, Entrees, Desserts, and Utensils. These topics and categories form a sort of grid:

RECIPES | TIPS | TUTORIAL
Appetizers |  |
Entrees |  |
Desserts |  |
Utensils |  |

Each story, then, represents one of the cells in that grid: a combination of topic and category. Some category/topic combinations might not make sense; for example, a story about utensil recipes doesn't sound very likely. But that's okay because you'll simply never select that combination when writing a story. All PHP-Nuke sites also have a category named Articles, which is meant to be a sort of generic category for news items.

How do you decide what to make for topics and what to make for categories? It really depends on how you want your site to look. Remember that topics get a nice graphical icon, so the main organizational elements of your site should be topics. Categories should be used to represent, perhaps, a secondary level of organization.

In terms of appearance on the site, categories play an important role. Take a look at Figure 19.6, which shows how the category appears as a part of the story's headline when viewing the extended text (this screen shot is from my other site, ScriptingAnswers.com, which is a technical site for Microsoft Windows administrators).

Figure 19.6. The relationship of categories and topics.

[View full size image]

Clicking on the topic icon, of course, produces results like the one shown in Figure 19.3. Clicking the category name, on the other hand, produces a page with the same format, as shown in Figure 19.7, but shows stories from the same category, regardless of their topic. In fact, Figure 19.7 shows two different topics of stories, all listed because they're part of the same category.

Figure 19.7. Clicking category name rather than topic icon.

[View full size image]


Chapter 20. Using the Private Messages Module

The Private Messages module is actually a part of the phpBB software, which is embedded in and integrated with PHP-Nuke to provide the Forums module's functionality. That doesn't mean anything especially important, but it does mean that the Private Messages module will look a bit different than some other modules because it's really coming from software that was written by someone else. Figure 20.1 shows the main page of the Private Messages module. As you can see, it's sort of like a mini e-mail system, totally contained within your site.

Figure 20.1. The main Private Messages module page.

[View full size image]

It's often easiest to think of Private Messages as a form of e-mail, in fact, although there's no actual e-mail server and you can't use an e-mail program like Microsoft Outlook Express to access your private messages. You have an Inbox, a Sentbox (for messages you've sent), an Outbox, and a Savebox (for messages you want to retain). Each has a quota, which specifies the maximum number of messages you can store. It's not many; this module isn't intended to be a robust e-mail service. Rather, it is intended for basic, quick communications between site members.

Obviously, since private messages are a person-to-person thing, anonymous users can't effectively use this module because they'd have no way to retrieve messages. I recommend configuring this module, via the Modules section of the Administration menu, to provide access only to registered users.


Sending a Message

Operating this module is pretty straightforward. Click New Post to create a new message. As shown in Figure 20.2, the text-input area is more sophisticated than most others in PHP-Nuke (primarily because this entire module was pulled from that phpBB software I mentioned earlier, which is also available as a standalone product). Users can type text, apply basic formatting like boldface and italics, and so forth. Text can be formatted to look like program code, and images can be more readily linked to without having to learn HTML. Little smilies and whatnot (emoticons, to use the correct jargon) can be inserted, and you can even use HTML formatting, if you've a hankering to do so.

Figure 20.2. Sending a private message.

[View full size image]

The one trick, perhaps, is that you have to know the username of the user who will receive your message. This isn't their e-mail address, either; you need to know the username they've registered on the Web site. A Find a Username button pops up a helpful window that enables you to search for usernames; you'll also see usernames used throughout PHP-Nuke, such as on stories, on Forum posts, and so forth. In fact, in any other module based on phpBBsuch as the Forums and Members List modulesyou can usually click on a user's name to send a private message.

There are two places where users are informed they have private messages waiting. One is at the top of the Forums Index, which is the first page you see when entering the Forums module. The second is in the Who's Online block, which you can choose to add to your site's layout. This block displays a message, "You are logged as name. You have x private message(s)." This message informs users who they're logged in as (assuming that they are, in fact, logged in; if they're not, they're displayed as anonymous), and how many messages, if any, they have waiting.

Sidebar . FAQ

I typed an e-mail address in the To line of a private message, and it didn't work. Why?

It wants a member name from your site, not an e-mail address. The Private Messages module doesn't send e-mail, per se; it sends internal messages using PHP-Nuke's Forums module. Messages can be sent only to registered (or subscribed) users, not to anyone in general, and you need to type the member's name without any kind of @ sign or domain name.

How will users know they have a new private message?

Typically, they'll need to look in the Who's Online block, if you're using it, or at the top of the page in the Forums section. In theory, users can select to be notified via pop-up windows when they get a new private message, but, in reality, most browsers these days block pop-up windows, so that notification feature won't work.


Chapter 21. Using the Recommend Us Module

Unfortunately, this is another module that I'm going to put in the same category as the Feedback and Members List modules, which I'm recommending you disable.

The Recommend Us module's purpose is innocuous enough. As shown in Figure 21.1, your users simply enter their name and e-mail address (which is already filled in by PHP-Nuke for registered users), and then enter the name and e-mail address of a friend. A canned message about your site is then sent to said friend, inviting them to check out your site.

Figure 21.1. The Recommend Us module.

[View full size image]

The problem is that users can type anything they want for these names and addresses, meaning that they can have your site sending e-mail to anyone and have that e-mail appear to be coming from anyone. Because the module uses plain HTML forms to collect this data, it can also be fooled into accepting "recommend us" submissions from automated software programs, which can send literally hundreds of e-mails an hour from your site. Every one of those e-mails will include your site address, too, making it easy for irritated recipients to track you down and scream at your service provideran action that can get your site pulled offline pretty fast, in some cases.

If you insist on using this module, restrict it to registered users only, who may be less likely to get you into this kind of hot water. I recommend, however, that you take the safe route and disable this module completely.


Customizing the Message

Some areas of PHP-Nuke are too darn difficult to customize, but that's the price for localization. See, all of the text strings in PHP-Nuke modules are pulled from language-specific files, which PHP-Nuke grabs based on the current user profile. If you look at your site's files and folders, you can browse to modules\Recommend_Us\language, and you'll see the 30-odd files that come with PHP-Nuke.

Use a text editor (like Windows Notepad) to open whichever language you understand. Fortunately, the Recommend Us module uses very few text strings, so the language files aren't huge; you should be able to easily find the strings used to create the "come check us out" message. Here are the contents of the English language file for this module:

define("_SEND","Send");
define("_FYOURNAME","Your Name:");
define("_FYOUREMAIL","Your E-mail:");
define("_FFRIENDNAME","Your Friend's Name:");
define("_FFRIENDEMAIL","Your Friend's E-mail:");
define("_HELLO","Hello");
define("_YOURFRIEND","Your Friend");
define("_RECOMMEND","Recommend this Site to a Friend");
define("_INTSITE","Interesting Site:");
define("_OURSITE","considered our site");
define("_INTSENT","interesting and wanted to send it to you.");
define("_FSITENAME","Site Name:");
define("_FSITEURL","Site URL:");
define("_FREFERENCE","The reference to our site has been sent to");
define("_THANKSREC","Thanks for recommending us!");

The final e-mail message has a subject of Interesting Site, and the e-mail message reads something like "User's name considered our site interesting and wanted to send it to you," along with the site's name and URL. Frankly, odds are most people's spam filters will catch this e-mail and block it anyway (it contains phrasing frequently used in spam), offering yet another reason to just disable the Recommend Us module and be done with it.


Chapter 22. Using the Reviews Module

The Reviews module enables you and your users to post product reviews. These reviews can be anything you like: books, merchandise, even services. Of course, you'll want to have reviews related to the overall content of your site; a site devoted to computer games, for example, would quite sensibly have reviews of those games. A site on cooking might include reviews on cookware, cookbooks, and so forth.

Figure 22.1 shows the Reviews section of the Administration menu, which is where you configure the title and description of your Reviews module. Be specific about what you want reviewed so that your users will be able to contribute meaningful reviews that fit in with your site's overall purpose.

Figure 22.1. Setting up the Reviews module.

[View full size image]


Writing a Review

Both you and your users can submit reviews by going directly into the Reviews module itself; there's no administration piece for writing a new review. Click the Write a Review link to begin writing a new review. You can provide a title for the reviewed product, as well as the review text. To encourage detailed reviews, PHP-Nuke does request that reviews be at least 100 words long, as shown in Figure 22.2.

Figure 22.2. Writing a new review.

[View full size image]

The text of the review can contain the usual common HTML tags for formatting, plus a special tag used to break the review into multiple pages:

  • <br> creates a line break. Use two in a row to create a new paragraph, separated from the previous one by a blank line.

  • <b> boldfaces text. Just pick whatever you want to be boldfaced, and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • You can surround paragraphs with the special <p>paragraph</p> tags. Doing so eliminates the need to use the <br> tags because paragraphs are automatically separated by some whitespace.

  • You can add images like this: <img src="http://www.mywebsite.com/ images/mypicture.gif">. The src portion points to a graphic file that's living on a Web server someplace, which means the image tag enables you to insert a picture into your text.

  • The <!--pagebreak--> tag, which can be used only in certain areas of PHP-Nuke, breaks long content into multiple pages. PHP-Nuke automatically provides next and previous links, allowing users to navigate through your material very easily.

After the review text, users provide their name and e-mail address, and rate the product on a scale of 1 to 10 (with 10 being the best). They can optionally provide a link to the product's home page on the Web (and, if they choose to do so, must also provide a descriptive title for the link). The review can contain the URL of a product image.

If you, the administrator, submit a review, it goes live immediately. Reviews submitted by other users go on hold until you approve them through the Reviews administration section (that's the same place where you set up the Reviews module title and description).


Reviewing Reviews

Figure 22.3 shows the Reviews module with a review entered. Unfortunately, the Reviews module makes poor use of PHP-Nuke's color schemes; I had to pick a different theme to have the review titles readable. In PHP-Nuke's default theme, the review titles are printed in black on a dark blue background, making them practically impossible to read. If you plan to use the Reviews module, be sure to check out how it looks under various themes before settling on a theme for your site.

Figure 22.3. The Reviews module list of reviews.

[View full size image]

The Reviews module lists the 10 most popular reviews (based on how many users look at them) and the 10 most recent reviews (giving new reviews a chance to be seen). Users can then click any letter of the alphabet to be taken to a separate list of reviews starting with that letter. Figure 22.4 shows this page, which also lists the reviews' authors and the reviewers' scores for the products. Clicking on the arrow graphics re-sorts the list on that column, in either ascending or descending order, depending on which arrow you click.

Figure 22.4. Listing reviews by letter.

[View full size image]

One thing to keep in mind is that review titles should be actual product titles, not phrases like "Cool product!" Using product titles will help ensure that the reviews get properly categorized and are easier for other users to locate alphabetically; you can modify the titles of any reviews your users submit to ensure that those reviews comply with this naming standard.


Chapter 23. Using the Search Module

The Search module is the only practical way to find half the content on a busy PHP-Nuke site. Don't get me wrongthe other modules are great. But the News module, for example, lists only 10 or so stories on your home page, and selecting a specific topic or category gets you only the latest 10 or so stories. If users want to find something posted in a specific month, they can use the Stories Archive module, which lists your site's content by month, but how likely is it that users will know what month to check out?

Thus, the Search module. Figure 23.1 shows the module's main page, which is simplicity itself: Users simply enter a keyword or phrase and then decide what they want to search. The search can be restricted to specific topics or categories, or to specific authors (more on that in a bit). The search can also be restricted to a time range, from one or two weeks ago to one to three months ago. Users can also choose to search stories, comments, or reviews, or they can search for specific users. Note that you can't search journal entries or any other types of content on your sitejust stories, comments, reviews, and users (well, actually you can eventually search downloads and Web links, too, which I'll get to in a second).

Figure 23.1. The Search module.

[View full size image]


Search Results

Figure 23.2 shows a typical search results page, listing two results for a story search. The bottom of the results page (not shown in the figure) can be a bit confusing because it starts with the word More, almost implying that you can click it for more search results.

Figure 23.2. Search results displayed.

[View full size image]

Not quite, though. If your search results don't all fit on one page (PHP-Nuke displays only 10 hits per page, by default), you'll get a link titled Next Matches at the bottom of the page. That More section is really more search options, in case your search didn't return something useful: PHP-Nuke offers to repeat your search in the Downloads module, in the Web Links module, on Google, or in Google Groups.


Author, Author!

The author selection bit is a bit misleading. Let's say, for example, that a user named Henry submits a story to your site using the Submit News module. You review the story, make a few corrections (Henry never did understand HTML all that well), and approve the story for posting. That makes you the author, not Henry. Kind of annoying, actually.

So how do you get additional authors? You actually have to make additional administrators, which PHP-Nuke also calls authors. You do so using the Edit Admins item on the Administration menu, something I'll cover in a lot more detail in Topic 46, "Administering Users and Admins." However, the short story is that administrators (or authors, or whatever) are a separate set of user accounts on your site. When you make an administrator, you can determine what they are an administrator of. For example, by making someone an administrator just of articles, you give him the ability to post new stories without you getting to review them. This user then is the "author of record" for those stories and shows up in the Authors drop-down list box in the Search module.

It's likely that you'll grant this authority only to someone who spent a great deal of time helping you with your site; it wouldn't make sense to make every user on your site an author. So, unfortunately, the Search module doesn't provide an easy way to look for stories that were submitted by a specific user. Kind of annoying, but there it is.


Chapter 24. Using the Sections Module

The Sections module is kind of an extension of the News module. Sort of. It actually offers an alternative place to create content for your sitecontent that doesn't show up on the home page. You start by setting up one or more sections, using the Sections item on the Administrative menu. Figure 24.1 shows that you just need to enter a section name and a graphic filename; the graphic must be located in your site's /images/sections folder, and you're responsible for putting it there yourself (PHP-Nuke won't automatically upload it from your local computer).

Figure 24.1. Adding a section.

[View full size image]

Once you've added a section, the administrative module expands so that you can also enter new articles. As shown in Figure 24.2, you just enter a title, select an appropriate section, and then enter the content. As with most PHP-Nuke content, you can use a variety of basic HTML tags to format your article:

  • <br> creates a line break. Use two in a row to create a new paragraph, separated from the previous one by a blank line.

  • <b> boldfaces text. Just pick whatever you want to be boldfaced, and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • You can surround paragraphs with the special <p>paragraph</p> tags. Doing so eliminates the need to use the <br> tags because paragraphs are automatically separated by some whitespace.

  • You can add images like this: <img src="http://www.mywebsite.com/ images/mypicture.gif">. The src portion points to a graphic file that's living on a Web server someplace, which means the image tag enables you to insert a picture into your text.

  • The <!--pagebreak--> tag, which can be used only in certain areas of PHP-Nuke, breaks long content into multiple pages. PHP-Nuke automatically provides next and previous links, allowing users to navigate through your material very easily.

Figure 24.2. Writing a new article for the Sections module.

[View full size image]

This administrative page also provides a place to edit past articles: The 20 most recent ones are listed for your convenience, along with Edit and Delete links. For anything beyond those 20, you'll need to know the article ID number to edit it. The easiest way to get the article ID number is to read the article itself and look at the URL in your Web browser's address line. It'll look something like http://www.scriptinganswers.com/cms2/modules.php?name=Sections&op=viewarticle&artid=1. The article ID is that last number, following artid=. Figure 24.3 shows a sections article as it appears to your users, who can access it through the Sections module.

Figure 24.3. Viewing a sections article.

[View full size image]


Sections? News? Content?

PHP-Nuke certainly provides a lot of places for you to post content. Which should you use? That all depends on your specific needs. Here are some recommendations:

  • Use the News module, which I covered in Topic 19, "Using the News Module," for content that should appear on your home page. While home page publication is optional for news items, the News module is the default home page module and PHP-Nuke is really designed to stay that way.

    Keep in mind that news stories (or articles, or whatever you want to call them) are organized using an overlapping system of topics and categories, which means that news articles can be classified more granularly. News articles are also automatically archived by the Stories Archive module, making it easy to locate past stories by their month of publication.

  • Use the Sections module for content that can be organized by a single category, since that's all the Sections module provides for. Content won't be published on the home page and won't be accessible through a monthly archive, but the content can have slightly more robust formatting (the <!--pagebreak--> tag) and content doesn't rotate "out of view" the way news articles do.

    Also, the Sections module makes it easier to wade through larger quantities of content. The News module displays only 10 stories at a go, making it necessary to use the Search module or the Stories Archive module to track down older content.

  • The Content module also organizes by a single level of categorization and provides access to larger lists of available content. Content categories don't have associated graphics the way the Sections categories do, so that's a visual consideration. Otherwise, quite frankly, the Content module isn't that different from the Sections module. They do differ in how they visually present their lists of categories and such, but that's about it. I covered the Content module in Topic 12, "Using the Content Module."


Chapter 25. Using the Statistics Module

In Topic 10, "Controlling Access to Modules," I showed you how to control access to different modules. Specifically, I showed you how to configure a module so that only administrators can access the module, effectively hiding that module from all other users. The Statistics module is the very module I had in mind for administrator-only access.

Figure 25.1 shows the Statistics module's main page. As you can see, it isn't providing information that would be terribly interesting to most of your users, although this information can be very useful to you. There's no actual harm in letting everyone access this module, but your site menu will be less cluttered if you remove access to modules that don't really provide some value to your users.

Figure 25.1. The Statistics module's main page.

[View full size image]


Basic Statistics

The main page provides three separate statistics. The first is a breakdown of the Web browsers used to visit your site. PHP-Nuke 7.3 recognizes six types of Web browser:

  • Microsoft Internet Explorer (MSIE)

  • Netscape (which includes Mozilla and spin-offs like FireFox)

  • Opera

  • Konqueror

  • Lynx

  • Search engine robots or spiders

Also included is an Unknown category for other browsers. PHP-Nuke recognizes browsers based on the agent string sent along by every Web browser when requesting a page from your site.

How is this information useful to you? Suppose you want to create some fancy new page that uses the <MARQUEE> HTML tag to make a section of scrolling text. That tag is a feature invented by Microsoft for Internet Explorer (IE); while some other browsers do support it, most don't. Checking your site statistics, you might see that 30 percent of your users are using a browser other than IE, meaning that those 30 percent might be unable to properly view your fancy new page. Knowing what software your users are relying on can help you make these important design decisions.

Next, PHP-Nuke lists the percentage of users using a specific operating system. Keep in mind that some browsers, even IE, run on multiple operating systems; knowing what operating systems your users rely on can help you make other important design decisions. It might also affect decisions about your site's content. For example, if you run a computer gaming site and realize that a quarter of your users are running Linux or some UNIX variant, you might want to start including appropriate coverage of games for those operating systems.

The operating system is identified to PHP-Nuke in the same user agent string that the Web browser is. PHP-Nuke recognizes the following operating systems:

  • Microsoft Windows

  • Linux variants (all lumped under "Linux")

  • Apple Macintosh

  • FreeBSD (a UNIX variant)

  • SunOS (a UNIX variant)

  • IRIX (a UNIX variant)

  • BeOS

  • IBM OS/2

  • AIX (a Unix variant)

And, of course, there's an Unknown category for everything else. I've found that PHP-Nuke has about an 80 percent success rate at properly recognizing the operating system; the failures aren't PHP-Nuke's fault at all, but rather the fault of some browsers to send a proper user agent string and the fault of some operating systems to consistently identify themselves.

The basic stats wind up with miscellaneous information, including the following:

  • Registered users

  • Active authors (for example, administrators)

  • Stories published

  • Active topics

  • Posted comments

  • Sections you have defined

  • Articles published in sections

  • Items in Web links

  • Categories in Web links

  • News submissions waiting for your approval


Detailed Statistics

Clicking the View Detailed Statistics link at the top of the page takes you to a second page, shown in Figure 25.2, which breaks down site traffic by time periods.

Figure 25.2. The Statistics module's Detailed Statistics page.

[View full size image]

At the top of this new page you'll see your busiest month, day, and hour, all based on hits, or page requests, to the Web site. Following that is a breakdown of hits by year, then day, and then hour. The monthly breakdown is always for the current year; the daily breakdown is for the current month, and the hourly breakdown is for the current day. You can click a month name or date to see breakdowns for that time period. For example, clicking November will show you a daily breakdown for November; clicking 5 will show you an hourly breakdown for the fifth of the month.

Why is this information important? Keep in mind that the most successful Web sites are the ones that have the freshest content. New content is what keeps users coming back. I recommend trying to have at least one new posting every day where your Web site is frequently visited. You can publish all the news items you want, for example, but use the article scheduling feature to spread out your content over several days so that the Web site always has something new.

When to publish new content depends on when your visitors are looking at the site. If weekday lunchtimes are your busiest hour, schedule new content to appear just before then. If nobody shows up on Fridays, don't waste content on those dayssave it for the following Monday. PHP-Nuke's detailed statistics can help you spot these visiting trends and take advantage of them to plan your site's growth or even maintenance: Don't plan to take your site offline to upgrade to a new version of PHP-Nuke during your site's peak access times. Wait until an hour when you traditionally have few or no users, and perform the upgrade then.


Chapter 26. Using the Stories Archive Module

The Stories Archive module is worth enabling if you use the News module at all. Stories Archive requires no administration or maintenance, making it a hassle-free way to provide some much-needed functionality to your site. Figure 26.1 shows what the module looks like on my site at ScriptingAnswers.com.

Figure 26.1. The Stories Archive module.

[View full size image]

Clicking on a monthor the All Stories linkbrings up a list of articles, as shown in Figure 26.2. As you can see, this is a much more compact list than the News module uses, and it doesn't include topics/categories, icons, or anything else. The list is sorted by the posting date of each article. At the bottom of the list, the module repeats the monthly listenabling you to quickly jump to another month or show all storiesas well as the Search text box. Searching is a quick way to find stories with a specific keyword in them.

Figure 26.2. Detailed list of stories from a particular month.

[View full size image]

If you're using the News moduleand who isn't?you should be using the Stories Archive module. Remember that News stories will rotate off your home page eventually; only the newest 10 stories are shown by default. Even clicking on a topic or category shows only 10 stories, making the Stories Archive module the only way to browse older stories. It's also the only way to get a comprehensive list of every story posted to your site.


Chapter 27. Using the Surveys Module

PHP-Nuke is slightly inconsistent in its terminology, using both surveys and polls to refer to the same thing. I'll stick with surveys unless I'm quoting something from PHP-Nuke that uses polls. You can start working with these by selecting the Surveys/Polls item in the Administration menu (see, even the admin item can't decide which term to use). Figure 27.1 shows the entry screen where you create a new survey.

Figure 27.1. Creating a new survey.

[View full size image]

Surveys are simple animals: Just provide a title and up to 12 potential answers that your users can choose from. That's it. When creating a new survey, you also have the option to create a new News story to announce the survey: The entry form for a new news story (described in Topic 19, "Using the News Module," by the way) is repeated underneath the new survey area of the page. Closer to the top of the page, you'll find the Delete Polls and Edit Polls links, which, as you might expect, let you delete or edit existing polls. I mean, surveys.

Editing a pollsurveyis a bit unlike editing other items in PHP-Nuke. As you can see in Figure 27.2, you select the survey you want by using a radio button, and then you click the Edit button. You're presented with a screen that's remarkably like the Add a Survey screen, except that here you can't create a news story along with the survey, since the survey already exists and was presumably announced (if you wanted to) when you originally created it.

Figure 27.2. Editing a survey.

[View full size image]

Deleting a survey works the same: Select the survey by using the radio button and then click Delete.


Using Surveys

When users visit the Surveys module, they'll start with the list Past Surveys, which is every survey on the site. Clicking one reveals the actual survey screen, shown in Figure 27.3, where users can select an answer to the survey or check out the survey results.

Figure 27.3. Responding to a survey in the Surveys module.

[View full size image]

You might wonder why the survey is formatted to fit into such a small space. It's because PHP-Nuke really intends surveys to be displayed in a block. If a survey is attached to a news story (something I explained in Topic 19), the survey appears alongside the story in the right column. Freestanding, unattached surveys are intended to be displayed in the Surveys block, which in Figure 27.4 I have positioned near the top of the right column.

Figure 27.4. The Surveys block on the home page.

[View full size image]

Notice that the block displays the most recently created survey but provides a Polls link that takes users to the complete list of past surveys, as if they had clicked the Surveys module directly. In fact, because surveys are intended to be accessed through this block, I recommend hiding the Surveys module itself (I explained how in Topic 10, "Controlling Access to Modules"). Doing so doesn't change anyone's access to the Surveys module, but it does keep the module from showing up in your site's main menu. There's no point in having the module in your main menu, really, since the module is accessible through the Surveys block. By the way, I discussed block basics in Topic 8, "Choosing Blocks," if you need a quick refresher on how to enable and position the Surveys block. I cover blocks, including built-in blocks like the Survey block, in Topic 37, "Selecting and Using Built-In Blocks."

Sidebar . FAQ

How do I make a multiquestion survey?

You can't using the default Surveys module. Surveys (or polls) have one, and only one, question. You can have multiple surveys running, but there's no way to string them all together into a complete, multiquestion, censuslike survey.


Chapter 28. Using the Top Module

The Top module (usually displayed as Top 10 in the Modules block, which serves as your site's main menu) is more for fun and bragging than any useful purpose (not that fun and bragging aren't useful, of course). As shown in Figure 28.1, this module simply displays a bunch of top lists for your site, including these:

  • Most read stories

  • Most commented stories

  • Most read articles in the Sections module

  • Most voted polls

  • Most active authors

  • Most read reviews

  • Most downloaded files

  • Most read pages

Figure 28.1. The Top module in action.

[View full size image]

The module provides a good way for your users to see what's hot on your Web site, and it contains links to each listed item. Unfortunately, this does have the effect of making listed items even more popular, at the expense of other items that aren't listed. Kind of like recess back in school, right? The good kids got picked first for teams, giving them more experience and making it more likely they'd be picked the next time. A vicious circle, but you can always disable the Top module if you don't approve.

The Top module doesn't have a separate administration section; as shown in Figure 28.2, all you can do is configure it to be a Top 10, Top 8, or Top Some Other Number module by editing your site's preferences and modifying the Number of Items in Top Page value.

Figure 28.2. Configuring the Top module.

[View full size image]

Here's one trick to using the Top module: If you're trying to get users to register for your site, consider making the Top module your home page module (do so by selecting Put in Home, under Modules Administration). Then restrict access to the News, Downloads, Sections, and Reviews modules to registered users only. Anonymous users will be able to see the Top 10 (or top whatever) list in the home page, but when they click on an item, it'll tell them they have to register to see the whole thing. So you'll have a kind of teaser on the home page, but you will still get folks to register to see anything. One advantage to registering users is that you'll have their e-mail addresses, which you can use to send newsletters (something I cover in Topic 49, "Sending an e-Newsletter").


Chapter 29. Using the Topics Module

I talked briefly about the Topics module in Topic 19, "Using the News Module," because topics are directly related to the News module. Check out the home page of www.phpnuke.org (PHP-Nuke's official Web site), shown in Figure 29.1, and you'll see that each news story on the home page has a related topic, as indicated by the topic icon to the upper left of the story.

Figure 29.1. Topic icons in news stories.

[View full size image]

These topic icons are defined in the Topics module, which is accessible from the Administration menu. As shown in Figure 29.2, you can select your own graphic for each topic you create, and you can also create and delete topics from within this administrative page. Note that you can select only topic icons that are listed in the Topic Image drop-down list box; this list box automatically lists any graphics that appear in the \images\topics directory of your Web site. So, to use a new topic icon, you must first upload the graphic to that location. Then you can assign the graphic to a topic that you create.

Figure 29.2. Managing the topics on your Web site.

[View full size image]

You'll want to upload topic icons as one of the first things you do on your site because PHP-Nuke comes with only one icon, which is for PHP-Nuke itself. Probably not appropriate for your site, unless you're doing a site on PHP-Nuke! Note that you shouldn't use any graphics that appear on other Web sites unless you first obtain the owner's permission to do so. For example, the owner of www.phpnuke.org specifically requests that people not use his topic icons on their own sites.


Making a Topic Icon

While hardcore graphic design is a bit beyond the scope of this book, you'll find that you can make fairly decent topic icons without a lot of work. The first thing to remember is that topic icons should be no more than about 70 pixels in width or height, although they can be smaller and they don't need to be any specific size. In fact, different icons on your site can be slightly different sizes, although your site will look more consistent if they're all roughly the same size.

To make an icon from scratch, you need a graphics tool. Microsoft Windows comes with a bare-bones tool called Paint, which you can access by opening the Start menu, selecting Run, typing mspaint, and clicking OK. Start by selecting Attributes from the Image menu and entering a width and height of 70. Make sure the Pixels radio button and the Colors radio button are selected. Use the drawing tools to make a basic icon, like the one shown in Figure 29.3 (no comments pleaseI'm a writer, not an artist).

Figure 29.3. Making a simple icon in Windows Paint.

[View full size image]

A variety of tools for drawing circles, squares, or brush strokes are on the left side of the Paint window; select colors from the palette below. Tool optionssuch as drawing an empty circle instead of a filled oneappear below the tool buttons themselves, once you've selected a tool.

When you're finished with your masterpiece, save it using Save As from the File menu. Be sure to select GIF or JPEG from the Save As Type drop-down list when saving your file; those are the only two formats that Paint offers that PHP-Nuke will accept. GIF is far and away the better choice, as it creates smaller files, but you may need to select JPEG if your icon is a photo or something else with a lot of subtle color variations.

You can also start with a larger picture or photo that you (legally) obtain from somewhere else. To do so, simply open an existing file in Paint (using Open from the "File menu). It starts out at whatever size the original image is supposed to be; you need to reduce it to topic icon size. Start by getting the image's current width and height by pressing Ctrl+E. Suppose, for example, that the original image is 2,048x1,536. That's big. Haul out a calculator (or open Windows Calculator). Divide your desired width and height (say, 70) by the current width and height. For example, 70÷2,048 is about .03, which is 3 percent. Then 70÷1,536 is about .04, or 4 percent. Take the smaller of those two values: 3 percent.

Time to shrink the image. To do so in Paint, select Stretch/Skew from the Image menu (or press Ctrl+W). Enter your percentage, such as 3 in this example, for both Horizontal and Vertical. This ensures that your image shrinks evenly, without becoming vertically or horizontally squashed. The result, shown in Figure 29.4 for my original 2,048x1,536 image, is a 62x47 image that's the perfect size for a topic icon. Save it as a GIF or JPEG, and you're ready to go.

Figure 29.4. The image reduced to a perfect icon size of 62x47.

[View full size image]


Using the Topics Module

Users have direct access to the Topics module, which looks something like Figure 29.5. Each topic is displayed in a box, along with its icon; also listed is the topic name, the total number of items, and the total number of times the topic's items have been read. Adjacent is a listing of the topic's articles. This is an easy, straightforward way for users to access past stories for a particular topic.

Figure 29.5. Using the Topics module to read articles from a specific topic.

[View full size image]

Users can also click the topic icon for an expanded list of articles within that topic, or they can use the Search text box to enter a search keyword. The search will be conducted across all news stories.


Chapter 30. Using the Web Links Module

The Web Links module provides a handy place for youand your usersto collect links to other Web pages, most likely ones related to your site's overall subject matter. You'll probably begin in the Web Links section of the Administration menu, where you'll start by adding one or more main categories for links. Once you have some main categories created, the page will appear as shown in Figure 30.1, providing areas for entering subcategories and actual links.

Figure 30.1. Administering Web links.

[View full size image]

Subcategories are easy to create: Just enter a name and a brief description, and indicate what main category the subcategory will belong to. Links are almost as easy, requiring a link title and URL (which must start with http://), a category (which can be a main category or a subcategory), and a description. You should also include your name and e-mail address as the person who added this link. Links added in this fashion are active immediately, since you're the administrator.


Using Web Links

When users visit the Web Links module, they start at the "top" of the list, with the main categories you've created. As shown in Figure 30.2, both main categories and subcategories are listed; category descriptions are shown only for main categories, although descriptions are optional. Clicking on any category or subcategory takes you to a list of links; clicking a main category also redisplays the subcategories. Figure 30.3 shows that next level of detail. Notice that any category with new links has a New icon, helping to attract users' attention.

Figure 30.2. Main category listings for Web links.

[View full size image]

Figure 30.3. Displaying main category links (if any) and the subcategories.

[View full size image]

Users will eventually drill their way down to the actual links, where they can click the link to be taken away to the linked Web page (which opens in a new browser window), or they can offer a numeric rating (one to five stars) for the link. Users can also click Report Broken Link if they find a link that doesn't appear to be working.

Finally, users have the ability to submit their own links, via the Add Link option at the top of each page in the Web Links module. Users are required to provide a title for the link, its URL, a description, and their own contact information. Links submitted by regular users are not made active immediately; you get to review those links and approve them yourself.

When logged on to your site as administrator, look for the Waiting Content module, which appears near the bottom of the left column of blocks, by default. You'll see three items related to Web links: Waiting Links, Mod. Links, and Broken Links. Here's what they're for:

  • Waiting Links show you all user-submitted links. You can visit the links and approve or reject the submission.

  • Mod. Links are links that users have submitted for modification. You can review the edits and approve or reject them.

  • Broken Links are ones users believe to be broken. You have the option to edit the link, try it for yourself, delete the link, or ignore the user's report. In my experience, users sometimes report a broken link by mistake. Often the linked site may just be temporarily unavailable, so by the time you review the broken link report, everything is okay again. In that case, just select the "Ignore" option.

By the way, I cover all of this in more detail in Topic 50, "Working with Submissions," which explains how to work with the various types of content and reports that users can submit to you on your Web site.


Advanced Link Administration

The Web Links administration module provides a couple other advanced functions, which are available as links at the top of the Web Links administration page. The first, Clean Links Votes, simply clears out the user ratings for Web links, resetting every link's score back to zero. You can use this if you've recently added a bunch of new links and don't want older links that have already been rated to be the only ones showing up on the Most Popular links list that users can access within the Web Links module.

The second, Validate Links, doesn't do quite what you think. It doesn't run out and make sure that every link in your database is real and valid; all it does is make sure that your links look like a valid link. That may not be its intended purpose, but that's what it does. For example, check out Figure 30.4, where I've asked PHP-Nuke to validate three links. Two of them are properly formatted (they start with http://) links using bogus domain names; the third is improperly formatted (doesn't start with http://), and the fourth is using a completely bogus URL (www.steaks.prpogo, which isn't a legitimate domain name). Although none of the sites is real (the domain names aren't even registered), only the badly formatted one shows up with any problems.

Figure 30.4. Validating Web links.

[View full size image]

While the error message shown implies that PHP-Nuke is actually checking to see if it can get a numeric Web site address from the URL provided, it is, in fact, doing no such thing, so you can't rely on it to automatically find broken links for you.

Sidebar . FAQ

I want my Web Links module to be open to anonymous users, but I want only registered users to be able to submit links. How do I do it?

You need to reprogram PHP-Nuke because it doesn't work like that by default. You can always open the module to anonymous users and just ignore any links submitted by anonymous users. Remember that you get to review submitted links before they go into the database for other users to see.

Half my Web links don't work, but the PHP-Nuke verification shows that they're all okay. What gives?

Dunno. I suggest checking your links yourself; I'm not sure what PHP-Nuke's "verification" process does (as I discussed in this topic); it'll show obviously bad links as those that work correctly.


Chapter 31. Using the Your Account Module

The Your Account module is perhaps one of the most critical modules in all of PHP-Nuke. Figure 31.1 shows the Your Account module as a user sees it after clicking Your Account in your site's Modules block (which serves as a main menu).

Figure 31.1. The Your Account module's home page.

[View full size image]

The actual appearance of the module differs on your site; for one thing, themes can apply different graphics than the ones shown here, which are part of the default DeepBlue theme. Also, disabling features removes buttons. For example, if you disable the Private Messages module, the Messages button goes away from the Your Account screen.

Here's what the various buttons allow users to do:

  • Your Info. This page allows users to enter their name, contact information, instant messaging addresses, and other personal information. If entered, this information can be accessed by most site visitors, but entering the information is completely optional.

    Users can also configure a variety of options, such as whether they receive a newsletter from your site (the default is to not receive one), whether they are notified of replies in the Forums, and other options. Users can also change their login password on this page and configure their avatar.

    An avatar is a small graphic logo that represents a user, appearing next to that user's posts in the Forums. Users can upload a photo of themselves, for example, or select one of the many cartoon graphics included with PHP-Nuke.

  • Your Home. This page allows users to configure some options for the home page. Users can select an alternate number of news stories for the front page rather than the site default (usually 10). Users can also activate a personal menu, which is a block that appears, by default, in the top of the right column. This personal menu can contain any text the user likes, including HTML formatting. Users can create HTML-formatted links to create a menu of hyperlinks to other Web sites or to specific pages within your site. Figure 31.2 shows an example personal menu, which simply says "ARGH!"

    Figure 31.2. Each user can have a personal menu on your site.

    [View full size image]

  • Comments. This page allows users to configure how comments appear to them on your site. They can select a display mode, and hide anonymous comments or comments with low ratings. Users can also configure long comments to be abbreviated, requiring them to click a Read More link to see the entire comment and allowing more comments to fit on a single Web page.

  • Webmail. The Webmail module has actually been discontinued in newer versions of PHP-Nuke, although older versions upgraded to a newer version still have it. Essentially, the module provides a Web e-mail reader. The module is considered defunct; you can disable it, if it's present on your site, in your site's preferences.

  • Messages. This button provides a link to the Private Messages module, which I covered in Topic 20, "Using the Private Messages Module."

  • Journal. This button provides a link to the Journal module, which I covered in Topic 17, "Using the Journal Module."

  • Themes. This button allows users to select their own theme for your site from the list of themes installed on your Web server. Note that this functionality can be disabled, something I cover in the next topic.

    One danger in allowing users to select their own themes is that your site might be tweaked to work perfectly with one theme but won't look so hot with others. I recommend either disabling users' ability to select alternate themes for themselves or deleting any themes that make your site look particularly unattractive, leaving only the themes you consider to be viable alternatives to the site's main default theme.

  • Logout/Exit. Pretty self-explanatory, this logs the user off your site. To access any modules that require site registration, the user has to log back in again.

The main page of the Your Account module also provides other user information, such as the number of points the user has earned by participating in your site (a concept I cover in Topic 46, "Administering Users and Admins"). There's also a personal headlines reader: Users can select from several predefined RSS newsfeeds and see their headlines. Or, users can type an RSS newsfeed URL and see the headlines. If you've enabled broadcast messages in your site's preferences, users can send a broadcast message, which is displayed to all site users for 10 minutes, and can see the number of private messages they have waiting.

Broadcast messages, by the way, are displayed in a rather hard-to-miss fashion, as shown in Figure 31.3. The exact display is theme dependent (and some themes don't include the capability), but in general, you've got the message displayed in a bright red box at the top of the screen. You can disable broadcast messages for your entire site, and individual users can also turn them off using the link at the bottom of the message. Each user sees a broadcast message only once: Subsequent visits to the home page, even within the 10-minute period that the broadcast is "alive," don't display the message again.

Figure 31.3. Public, or broadcast messages, appear at the top of the home page.

[View full size image]


Pros and Cons

The built-in Your Account module is nice, but it's missing some much-needed functionality. The user administration capabilities provided with PHP-Nuke, in particular, are really horrible. The folks at NukeScripts.net (NSN) have developed a replacement Your Account module that provides slightly more user functionality and a lot more administrative functionality; I cover that module in the next topic, since it's one of the most popular add-ins for PHP-Nuke.


Chapter 32. Adding the NSN Your Account Tweak

In the previous topic, I mentioned that PHP-Nuke is somewhat lacking in user-management features. The basic Edit Users item on the Administration menu simply lets you enter a user's nicknameyou did memorize all of your users' names, right?and either modify or delete them. It's hardly a rewarding administrative experience, which is why so many administrators choose to use NSN Your Account Tweak, a free add-on from the folks at www.NukeScripts.net.


Obtaining the Tweak

To get the tweak, visit the Web site and head into the Downloads section (you need to register for a free account on the Web site first). Find the version of the Your Account tweak that matches your version of PHP-Nuke (search the Downloads section for "YAT" or "Your Account"). This is really, really important. While the folks at NukeScripts are (as of this writing) working on a "universal" tweak for any version of PHP-Nuke, right now you need to download the tweak that matches your version of PHP-Nuke. Also, if you later upgrade your version of PHP-Nuke, you'll need to upgrade your version of the Your Account tweak to match; however, upgraded tweak versions usually follow new PHP-Nuke versions by a month or more. Also note that many of the tweak versions are listed as "alpha," meaning they're not officially finished. Most Web site administrators use them anyway, but just be advised: If your Web site is critical to your income or well-being, this software might not be ready for prime time.

Okay, you've downloaded the tweak (let's call it YAT, for shortsounds funkier). Remember…

  • You need a version of YAT that matches your version of PHP-Nuke.

  • Don't upgrade PHP-Nuke until you obtain an upgraded, matching version of YAT, too.

  • Many YAT versions are listed as alpha, which means you're potentially on your own if they breakor, at least, you shouldn't expect emergency support.

Before you go any further, now's the time to back up your Web site and its database. If you're using your own server, follow whatever usual backup procedures you have. If your site is hosted by a hosting company, ask them how to perform a backup. Remember that PHP-Nuke's Administration menu includes a Backup Database item that will download a backup to your local computer.


Installing the Tweak

Installing YAT is straightforward, and it comes with complete directions for doing so. You start by copying several files to various locations on your Web site: Just follow the instructions included with YAT to the letter. Then you visit a specific Web page on your site to install YAT into your PHP-Nuke database. Again, follow the directions included with YAT; they change from version to version, so I won't repeat them here since I'd likely be getting them wrong for at least one major version.

When you're finished, you should see a new Edit Users icon on your site's Administration menu. Actually, whenever I install YAT, I wind up with two icons: the old PHP-Nuke one and the new YAT icon. But both go to the same YAT-modified administration page, so it's okay.


Cha-Cha-Cha-Changes!

YAT changes a lot about how your site operates. Your users, for example, will notice a new button under the Your Account module: Deactivate Account. This option (which you can disable) allows users to deactivate their membership with your Web site. As an administrator visiting the Your Account module, you also have options to deactivate or suspend users, preventing them from logging on and displaying an "Account Suspended" message if they try.

Most of the changes, however, are under the Administration menu's Edit Users option, which I mentioned earlier and which is shown in Figure 32.1. This option now presents a sort of submenu, offering the ability to manually add a user; see active, regular, deactivated, and suspended users; see users waiting for confirmation; and search for usersno more remembering usernames!

Figure 32.1. The main page for the NSN Your Account Tweak (YAT).

[View full size image]


Configuring YAT

Probably the most important new areaand the first thing you should look at after installing YATis the Users Configuration screen. This page offers a number of configuration options:

  • Allow User Registration. If set to No, this prevents users from registering for your site.

  • Require Admin Approval. If set to Yes, this requires you to manually approve all new registrations.

  • Allow User Self-Deactivation. If set to Yes, this allows users to deactivate their own user accounts via the aforementioned new button in the Your Account module.

  • Server Can Send Mail? Set this to Yes if your server is capable of sending e-mail; most are.

  • Notify Admin of User Registration. Set this to Yes to receive an e-mail each time someone registers for your site. This is a good idea if you're requiring manual approval for new accounts so that you know someone's asked to join your site.

  • Notify Admin of User Deactivation. If this is set to Yes, you'll receive an e-mail when users deactivate themselves. You might use this as a prompt to follow up and find out why that user decided to leave.

  • Use E-mail Activation? Set this to Yes to enable PHP-Nuke's default confirmation technique, which requires users to receive and respond to an e-mail to activate their new account on your site.

  • Allow User E-mail Change. If set to No, users won't be permitted to change their registered e-mail address on your site. Generally, that's not a good idea: You'll want your users to be able to stick with you even if they change e-mail addresses.

  • Validate E-mail Changes. I recommend setting this option to Yes so that any user e-mail address changes can be automatically verified by your site.

  • Allow User Theme Selection. Set this to No to prevent users from selecting their own theme for your Web site. Doing so forces them to use the theme you've selected, which can help preserve your site's look and feel.

  • Use Security Code? This refers to the graphical security code PHP-Nuke uses by default. The idea behind the code is that humans can read the code and re-enter a short number, but automated processes (like hacker utilities) trying to access your site will have a tougher time doing so. You can set the security code to be completely off (No Checking) or to be used at registration, login, or both. I do recommend the Registration Only option, since it helps keep automated processes from signing up for accounts on your Web site, which can then be used to post spam in your forums or other content areas.

  • Suspend Users After. Set this to 0 to keep registered users active forever; set it to another number to automatically suspend accounts that are inactive after a specified number of weeks.

  • Temp Accounts Expire After. This controls how long PHP-Nuke waits for users to respond to the confirmation e-mail sent to new account registrations. I recommend setting this to a reasonable value, such as 14, so that users who don't respond after two weeks are removed from the database without being activated.

  • # of Users to List Per Page. Several of YAT's functions allow you to see lists of users on your site; the more users you list per page, the longer it will take PHP-Nuke to construct the list. A setting of 50 or 100 is usually sufficient.

  • Blocked Username Strings. This sets a list of strings, one per line, that cannot be used as usernames on your site. You might include names or words you find offensive, for example, or that might mislead other users.

  • Blocked Mail Domains. This sets a list of domain names, one per line, that cannot be used in the e-mail addresses of registered users. You might, for example, block mail domains like hotmail.com if you don't want users signing up with a hotmail.com user account. That'd be an unusual case, though; typically, you wouldn't block any domains.

  • Username Min Length, Username Max Length, Password Min Length, and Password Max Length. These all set minimum and maximum lengths for usernames and passwords. I recommend that usernames be between 5 and 25 characters (25 is the max PHP-Nuke can handle), and that passwords be between 6 and 20 characters. Shorter passwords will be easier for hackers to figure out, allowing them to log on to your Web site under someone else's account.

Phew. What a list! Actually, some of those optionslike when to use the graphical security codearen't unique to YAT; they're part of PHP-Nuke itself. YAT simply provides a Web-based user interface to set these options; PHP-Nuke, by default, requires you to edit the config.php file located at the root of your PHP-Nuke Web site.


Using YAT

Figure 32.2 shows the next cool feature of YAT: searching for users. You can access this screen by clicking Search Users from YAT's main administration menu. You have three drop-down lists and a text box to use for searching:

  • Find allows you to choose a table in your database, which is where user information is stored. The Main Users table contains all activated users; the Temp Users table holds those users who have registered but not yet confirmed their accounts. Searching the Temp Users table produces results that allow you to, among other things, activate accounts manually or have PHP-Nuke resend the standard account activation e-mail.

  • By allows you to decide what to search on. You can search by username, e-mail address, or user ID (which is a number assigned by PHP-Nuke to each account).

  • Match specifies what the search will look for: Equal To searches for exactly what you type in the Query box; Like searches for something similar to what you type in the Query box. For example, selecting Like and typing don returns donj,donjones , and don in the list of results (assuming those are all users on your site, of course.

Figure 32.2. Using YAT to find user accounts.

[View full size image]

You also have the ability to look directly at lists of users. For example, I regularly click Waiting Users to view the contents of the Temp Users table. As shown in Figure 32.3, you can see each user's username and e-mail address (I've blanked these out in the screen shot), the date they requested an account, and a list of options: Resend, Activate, User Details, Modify, and Deny. You can select one action on one user and click the corresponding OK button to take that action with that user. You can't take action with more than one user at a time, unfortunately.

Figure 32.3. Listing waiting users.

[View full size image]

Listing deactivated users provides different possible actions: User Details, Modify, and Remove. List the "regular users" (all active and deactivated users) or the "active users," and you'll be able to see User Details, as well as Modify, Promote, Suspend, and Deactivate. Promote is a cool option: It turns a user into an administrator. As shown in Figure 32.4, you can select which areas of your site you want the user to be able to administer, including articles, content, downloads, and more, and they'll receive those permissions.

Figure 32.4. Promoting a user to have administrator permissions.

[View full size image]

All in all, YAT provides better functionality for administrators, while preserving much of the original PHP-Nuke user interface that's exposed to your site's users.

Sidebar . FAQ

Why would a user want to deactivate his account?

Sometimes users just decide to part ways with a Web site. You may have sent one too many e-mail newsletters, or perhaps your site's content isn't interesting to that user anymore. Deactivation is a user's way of saying goodbye, usually more or less for good.


Chapter 33. Adding the Events Calendar Module

This is a third-party module that I've used on my Web site at www.ScriptingAnswers.com. It provides a great calendar module and comes with several blocks that list upcoming events on every page of your site. I especially like the scrolling block, which has a neat smooth-scrolling effect almost like a marquee or something.

You can obtain the module from http://phpnuke.holbrookau.net/modules.php?name=Downloads&d_op=viewdownloaddetails&lid=10&ttitle=Event_Calendar_2.13. Be sure to search around on the site's Downloads section for a more recent version, although this version was the most recent as of this writing. This particular module is written for PHP-Nuke 7.0, although I have no problems using it on v7.2 on ScriptingAnswers.com (actually, I use 2.12 of the module on ScriptingAnswers.com). Related downloads, including other versions of the module, are available at http://phpnuke.holbrookau.net/modules.php?name=Downloads&d_op=viewdownload&cid=2.

By the Way

If you find that these links don't work, just visit the main Web site ( http://phpnuke.holbrookau.net ) and visit the Downloads section.

The Event Calendar includes full installation instructions, which, as with most add-in modules, consist of copying a few files to your Web site and running a special Web page to set up your site's database to meet the new module's needs. After installing the module and setting up the database, you should find the module listed along with your other modules under the Modules item on PHP-Nuke's Administration Menu. You should also see an icon on the Administration menu for the Event Calendar.

I should probably point out that there are dozens of other calendar modules for PHP-Nuke. Event Calendar, however, is a popular one, and it provides a lot of flexibility along with an attractive user interface that fits into most PHP-Nuke sites. Search Google for "phpnuke calendar module" if you'd like to look for alternatives. Like many excellent PHP-Nuke modules, Event Calendar is free, although I'm sure the author would not object to donations if you find the module useful.


Administering Event Calendar

Figure 33.1 shows the administration menu for Event Calendar. Note that you don't actually create calendar entries here; you do that from within the module itself. Your users can submit events, too, and you'll see those submissions listed on the Administration menu, waiting for your approval.

Figure 33.1. Administering the Event Calendar.

[View full size image]

UNDER THE HOOD

You're installing four different things with the Event Calendar, and with many other add-in modules. (Well, four.) The first set of files goes under your site's Modules folder, and these files provide the actual module that your users will access. The second set of files goes under the Admin/Modules folder, and this is the set of files that provides the administrative interface. The third set of files, destined for theBlocks folder of your site, provides the various blocks that come with Event Calendar. Finally, the fourth installation bit is the database, which is installed by running a special Web page, which you'll usually placetemporarilyin the root of your Web site. Be sure to delete that page after running it, since it does represent a security risk if it's left sitting there.

Here's a rundown of your administrative options:

  • Moderate Calendar Events? If set to No, new user-submitted entries are made active immediately, without waiting for your approval.

  • Allow Event Comments? This allows users to leave comments for specific events on your calendar.

  • How Are Multiday Events Shown? Events that span multiple days can be displayed as text, listed on each day of the event, or displayed as a bar image kind of like Microsoft Outlook does. I find that the bar looks a little cooler.

  • Time Display Format. You can select 24-hour or 12-hour formatting for times.

  • Date Display Format. Select either the D/M/Y format popular in Europe (and elsewhere) or the M/D/Y format commonly used in the U.S.

  • Open Events in a New Window? If set to Yes, users who click on an event name will see the event details in a new pop-up browser window. Otherwise, the event displays in the same window, like most other hyperlinks.

  • Appointment Block Times. This allows you to list the times that appear on your calendar, in 24-hour HH:MM:SS format. The default is to list one-hour blocks from 8:00 a.m. to 6:00 p.m., but you can change this.

  • Colors and Formatting. These options let you enter specific colorsin hexadecimal formatfor the calendar displays. You can also customize the appearance by modifying the table properties, such as the space between cells in the month view.


Using Event Calendar

You'll do most of the "heavy lifting" in Event Calendar right in the module itself, which is shown in its default monthly view in Figure 33.2.

Figure 33.2. Event Calendar's starting monthly view.

[View full size image]

You're provided with handy links for creating a new event or switching among month, day, and year views. You can also jump to a specific date by selecting the date in the drop-down box and clicking Jump. Finally, a graphical button provides access to a more printer-friendly version of the page for users who prefer a hard copy. Note that the graphics shown in Figure 33.2 are custom; all I did was simply replace the graphics that came with Event Calendar with ones I preferred for my site.

Day view, shown in Figure 33.3, lists each of the day's "appointment blocks" in a separate line, with any related events listed underneath. An Events view, to the side, lists any day-long events. Figure 33.4 shows the useful Year view, which highlights days that have events in an alternate color. The color used depends on the events themselves, as you'll see in a moment.

Figure 33.3. Day view provides a detailed break-down of a day's events.

[View full size image]

Figure 33.4. Year view provides an overview of events for the entire year.

[View full size image]

When you create a new event, you'll provide several pieces of information:

  • A subject. Users are encouraged to provide clear, specific descriptions.

  • A topic. This is the list of topics from the Topics module in PHP-Nuke, which I discussed in Topic 29, "Using the Topics Module." The use of this list of topics rather than a separate list of event categories is a bit annoying. I tend to lump all of my events in my News topic simply because I came up with my topic list to suit my site's articles, not my Event Calendar.

  • The event's starting date and time, and ending date and time. You can also indicate all-day events by selecting the appropriate check box.

  • A color. Users will probably misuse this feature, selecting whatever color they like, but you can edit their submissions and come up with a standardized color scheme. I use red for Webcasts, green for conferences, and so forth.

  • An event description. This can include HTML formatting.

Administrators aren't given special privileges with Event Calendar: You need to approve your own submissions once they're complete.

Note that v2.13 of the module adds some cool administrator functionality. Waiting calendar submissions show up in the Waiting Content block along with other submissions, and you have the ability to create calendar administrators, much as you can create administrators for other specific areas of your site. Version 2.13 also lets you configure your own category names, which is nice. I should upgrade <grin>.


Calendar Blocks

As I mentioned, the module comes complete with a bunch of blocks that display upcoming events in the left or right columns of your site. These blocks are unfortunately named Calendar1, Calendar2, and so forth; you add them to your site's display using the Blocks item on the Administration menu, but first you need to figure out which one is which. Here's a cheat sheet:

  • Calendar1 shows events for only the current day.

  • Calendar2 is a monthly calendar with a daily events list.

  • Calendar3 is the cool scrolling list of upcoming events.

  • Calendar4 is the monthly calendar again, with links and a day/month view selection.

  • Calendar5 is an enhanced version of Calendar3.

  • Calendar6 is the same as Calendar4 but is designed to be a Center Block that appears at the top or bottom of your page, either above the module content or below it.

Some of the blocks are configurable, meaning they have options inside that you can edit to change their behavior or appearance. Figure 33.5 shows Calendar5.php opened in Windows Notepadnot, unfortunately, a pretty sight for the uninitiated.

Figure 33.5. Editing a calendar block in Windows Notepad.

[View full size image]

In this one, you'll see some comments that give you some clues to what can be customized. Here's a section of the file, with the parameter in question boldfaced:

/*
Indicate here the numbers of days of events you want to have scrolled
*/
$days_to_see = 10;
$noun="days";
if ($days_to_see == 1) {
$noun="day";
}

Changing the 10 to a 20 lists 20 days of upcoming events in the block instead of 10 days. Most of the rest of the file is incomprehensible unless you spend a lot of late nights working in the PHP programming language (that'd be me, by the way), so don't mess with it. General rule: You'll find the configurable stuff at the beginning of the file, with comments (surrounded by /* and */) telling you what to do.

Sidebar . FAQ

Can I use this module to give each user a private calendar?

No. I haven't run across any PHP-Nuke modules that do that, although that doesn't mean one doesn't exist out there somewhere. The Calendar module I cover here, at any rate, has just the one calendar for the entire site, so it's like a public calendar that you might find on the bulletin board in an office lunchroom.


Chapter 34. Adding the Amazon.com Module

Yet another useful add-in module! Actually, one used to be included in some versions of PHP-Nuke, but not anymore. There are about a billion Amazon modules for PHP-Nuke; I'll be describing NukeAmazon (you can search Google for that term to find it), which I use on ScriptingAnswers.com. The author's home page is at http://preciogasolina.com/modules.php?name=Downloads&d_op=viewdownload&cid=1, where you can download the module.

The module is a bit difficult to explain, but perhaps easier if you see it in action. Figure 34.1 shows the module as a user might see it, with a specific product listed. The idea is that the module knows your Amazon.com affiliate ID (which you can obtain on Amazon.com if you don't have one), which allows any purchases made through your Web site to earn you a few bucks.

Figure 34.1. The Amazon.com module in action.

[View full size image]

The module even includes a block that can feature products right on your home page for more exposure. Installation of the module follows the usual pattern: Copy files as directed and run the special Web page that sets up your database as directed. The download comes with complete instructions, which you must follow to the letter.


Administering NukeAmazon

Administration for NukeAmazon isn't difficult: You set some initial configuration items, like your affiliate ID, and then select several products that you want to use. You'll see how that fits together in a moment.


Using NukeAmazon

This is where the fun begins. The main page is shown (partially) in Figure 34.2. The different product icons pull in products from Amazon.com, right on your Web site, that match the category clicked, as shown in Figure 34.3. You'll also notice your featured products at the bottom of the page, on the left, drawing users' attention to them.

Figure 34.2. The Amazon.com module's main page.

[View full size image]

Figure 34.3. Browsing products on Amazon.com through your Web site.

[View full size image]

Sort of the whole strategy is to keep users on your site so that everything they buy through Amazon gets credited to your affiliate account.

Sidebar . FAQ

What's an affiliate ID?

Amazon.com's affiliate program allows you to sort of act as their salesperson, selling their products and earning a commission on those sales. An affiliate ID is simply your ID number with Amazon, which must be passed along with each sale you make to ensure you're properly credited for the sale. This PHP-Nuke module takes care of passing the ID; visit www.amazon.com/affiliate to sign up for the program or learn more about it.

Amazon does change its payment structure and overall affiliate program on a quarterly basis, so be sure to check in often to see what the latest plan looks like.


Chapter 35. Making Your Own Simple HTML Module

Suppose you want a module on your site that just displays some static HTML text. Maybe it's a Contact Us page, but you don't want to put the page up as part of the Content module. Instead, you want users to be able to access something like www.mysite.com/modules.php?name=ContactUs and get the appropriate page. This is a useful way to post content that always needs to be on your site, such as an About Us page or a Privacy Policy page, especially when that content doesn't change very often.

No problem. You just need to make your own module.

PHP-Nuke actually comes with a module named Addon_Sample, which you can access on your own. Figure 35.1 shows the module's default content, which isn't that fancy. Actually, the add-on does a lot more than just display static HTML, but it's a good start for making a module that just does that.

Figure 35.1. The Addon_Sample module's default content.

[View full size image]

Start by browsing to the modules/Addon_Sample folder on your Web site. Notice that it contains three files: Copyright.php,F2.php , and Index.php. Ignore the first two and let's concentrate on Index.php. Open that file in Windows Notepad (or, if you have a PHP script editor, use that; I use an editor named PrimalScript, which you can obtain at www.primalscript.com). Scroll to the bottom of the file, where you'll find something like this:

switch($func) {

    default:
    AddonSample();
    break;

    case "one":
    one();
    break;

    case "two":
    two();
    break;
}

This is present in every PHP-Nuke module. It's setting up the possible conditions for the module: Going to modules.php?name=Addon_Sample&op=one executes a function named one(); going to just modules.php?name=Addon_Sample, with no op in the URL, executes a function named AddonSample(). For our purposes, we just want that default action in the AddonSample() function to display some static text.

So let's start editing. First, make a copy of the entire Addon_Sample folder, and name it ContactUs. Then edit the ContactUs/Index.php file so that the bottom of the file reads as follows:

switch($func) {

    default:
    AddonSample();
    break;

}

Locate the following code and delete it from Index.php:

function one() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php) function \"one\"<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=index\">Go to index.php</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");

}

function two() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php) function \"two\"";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=index\">Go to index.php</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");

}

That removes the two functions, one() and two(), that we're not going to be using. What you now have is more or less the bare minimum for a PHP-Nuke module:

[View full width]

<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$module_name = basename(dirname(__FILE__));

$index = 1;

function AddonSample() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php)<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=index&amp;func=one
  \">Function One</a>";
    echo "<li> <a href=\"modules.php?name=$module_name&amp;file=index&amp;func=two
  \">Function Two</a>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=f2\">Call to file f2.php</a>";
    echo "</ul>";
    echo "You can now use Administration interface to activate or deactivate any module.
   As an Admin you can always "
         ."access to your Inactive modules for testing purposes.";
    CloseTable();
    include("footer.php");
}

switch($func) {

    default:
    AddonSample();
    break;

}

?>

All that business in the middle, the AddonSample() part, is where your static Contact Us HTML needs to go. You want to leave everything up to and including the OpenTable(); line, and you need to leave the CloseTable(); line and everything that follows it. Those two lines are responsible for drawing the PHP-Nuke themed elements, and your HTML content goes in between them. Here's an example:

function AddonSample() {
    global $module_name;
    include("header.php");
    OpenTable();
      echo "To contact us:<br>"
          ."<br>"
          ."E-mail contacts@daisyrecipestation.org, or <br>"
          ."Call 1-800-EAT-FOOD from 9am to 9pm Alaskan time.";
    CloseTable();
    include("footer.php");
}

Notice how this goes together:

  • I start with an echo statement, which is followed by, in quotes, the HTML I want to display.

  • The first line does not include a semicolon at its end.

  • Subsequent lines start with a period and then more HTML in quotes. They do not end in a semicolon. These lines effectively continue the echo statement, allowing it to break across several lines in the file so they're easier to read.

  • The last line ends in a semicolon, indicating the end of the echo statement and the end of the HTML that I want to display.

Delete the Copyright.php and F2.php files from the ContactUs folder. Make sure the remaining file is named index.php, with all lowercase letters. Copy the entire folder up to the modules folder of your Web site. Now when you go into the Modules item on your site's Administration menu, you'll see that a new module named ContactUs is available. You can activate it and make it available on your site.


A Shortcut

There's an even easier way, if all you want to do is display static HTML inside a module. Create a new folder with your module's name (such as AboutUs or whatever). Type the following code inside a file named index.php:

<?php
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
$index = 1;
function AddonSample() {
    global $module_name;
    include("header.php");
    OpenTable();
       include("modules/modulename/myhtml.html");
    CloseTable();
    include("footer.php");
}

switch($func) {
    default:
    AddonSample();
    break;
}

?>

Be sure to fill in the correct information for the boldfaced items: modulename should be the name of your module (the same name as the folder you just created, and be sure to use the same upper- and lowercase letters as you did in the folder name); myhtml.html should be the name of a plain HTML file stored in your new module folder. Copy the new module folder into your site's modules folder, and you'll have an instant static HTML module. You can edit the HTML file whenever you like, and index.php will just pull it in whenever a user visits that module.


Chapter 36. Making Your Own Dynamic Module

In the previous topic, I showed you how to make a basic custom module that displays static HTML text, either by including the text within an echo statement or by simply having the module include an existing static HTML file (which may be easier for you).

Now, I want to go a bit deeper into how PHP-Nuke modules actually work. I'm not going to show you how to become a PHP programmer, here, but it will help if you've got some PHP experience or other programming experience. If you want to actually make your own dynamic modules, you'll definitely need some PHP programming skills, and there are a number of books on the market that can help you pick up those skills. My goal here isn't to show you how to create a dynamic module (since whatever I showed you probably wouldn't do something you wanted), but rather to show you how PHP-Nuke's modules must be built to work properly.


The Basic Structure

All PHP-Nuke modules are loaded by a file called modules.php, which lives in the root of your Web site. Visit any page on your site (other than administrative pages), and you'll see that the URL of each page begins with something like www.mysite.com/modules.php?name=ModuleName. ModuleName always corresponds to a specific folder in the modules folder of your site: www.mysite.com/modules.php?name=Sections refers to modules/Sections, while www.mysite.com/modules.php?name=Forums refers to modules/ Forums, and so forth. When you access a module, it's the modules.php page that actually loads; it then runs out and grabs the index.php file from the appropriate module folder. Note that module names are case sensitive: If the module's folder name is Sections, it must be referred to as www.mysite.com/modules.php?name=Sections, not www.mysite.com/modules.php?name=sections.

So the actual guts of any module lives in a file named index.php, within the folder named after that specific module. PHP-Nuke ships with a module named Addon_Sample, which contains an index.php file, a file named f2.php, and a file named copyright.php. The index.php file contains the following code:

[View full width]

<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$module_name = basename(dirname(__FILE__));

$index = 1;

function one() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php) function \"one\"<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=index\">Go to index.php</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");

}

function two() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php) function \"two\"";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=index\">Go to index.php</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");

}

function AddonSample() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Addon Sample File (index.php)<br><br>";
    echo "<ul>";
    echo "<li>
<a href=\"modules.php?name=$module_name&amp;file=index&amp;func=one\">Function One</a>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=index&amp;func=two
  \">Function Two</a>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;file=f2\">Call to file f2.php</a>";
    echo "</ul>";
    echo "You can now use Administration interface to activate or deactivate any module.
   As an Admin you can always "
         ."access to your Inactive modules for testing purposes.";
    CloseTable();
    include("footer.php");
}

switch($func) {

    default:
    AddonSample();
    break;

    case "one":
    one();
    break;

    case "two":
    two();
    break;

}

?>

Let me break that down a bit:

  • The page starts with a short if statement that checks to see if the module's index.php page is being accessed through modules.php, as is proper, or if it's being accessed directly. Modules that are accessed directly display "You can't access this file directly" and then quit processing.

  • The variable $module_name is set to the folder name that the index.php file lives in. In this case, it is Addon_Sample since that's the name of the folder containing this file.

  • Three functions are listed: one(), two(), and AddonSample(). These functions do not do anything (meaning that they will not execute) unless they are explicitly called. So, the first time running through this file, PHP-Nuke skips all three functions.

  • Last is a switch construct, which decides what to do next. There are three possibilities:

    • The page is accessed with the URL modules.php?name= Addon_Sample&func=one, in which case $func contains one. The select construct matches that to case one and executes the one() function.

    • The page is accessed with the URL modules.php?name= Addon_Sample&func=two, in which case, $func contains two. The select matches that to case two and executes the two() function.

    • The page is accessed with some other URL, which might not include a &func= portion at all. In this case, the select construct will not be able to match either of the existing case conditions; it instead uses the default condition and executes AddonSample().

It's this last select construct that decides which of the three functionsone(),two() , or AddonSample()to execute.

In many other PHP-Nuke modules, you'll see the switch construct at the bottom using $op instead of $func; you'll also notice that most PHP-Nuke module URLs contain something like modules.php?name=modulename&op=something.


Multifile Modules

Most PHP-Nuke modules, then, do all of their work from within a single PHP file. The file is set up with multiple functions to handle different operations. The Sections module, for example, can display a section list, display individual articles, and so forth; this is all accomplished by having multiple functions in one file named modules/Sections/index.php.

But what if you want to use multiple files in a module? You can. Addon_Sample actually demonstrates this by including a second file, named f2.php. To link to this file, you use something like modules.php?name=Addon_Sample&file=f2. If the f2.php file contains multiple functions, you can use something like modules.php?name=Addon_ Sample&file=f2&func=whatever to specify the specific function you want; f2.php would need to contain a switch($func) construct to evaluate the &func" portion of the URL and execute the appropriate function within the file.


A Basic Dynamic Module

Let's say you want to create a dynamic ContactUs module that displays either e-mail or mailing address information. You want the following URLs to work:

  • modules.php?name=ContactUs&which=mail should display mailing address info.

  • modules.php?name=ContactUs&which=email should display e-mail info.

  • modules.php?name=ContactUs should display links for either e-mail or mailing address, linking back to the ContactUs module with the appropriate parameter.

Here's a file that does that:

<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$module_name = basename(dirname(__FILE__));

$index = 1;

function snailmail() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Our address is:";
    CloseTable();
    include("footer.php");

}

function email() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Our e-mail address is:";
    CloseTable();
    include("footer.php");

}

function MainMenu() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Which do you want?<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;which=email\">E-Mail Address</a>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;which=mail\">Mailing Address</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");
}

switch($which) {

    default:
    MainMenu();
    break;

    case "mail":
    snailmail();
    break;

    case "email":
    email();
    break;

}

?>

Notice some common bits of each function:

  • They begin by declaring the variable $module_name as a global. This is required for all functions.

  • They include the pages header.php and footer.php. This is required: header.php must be included before the module outputs any text, and footer.php must be included as the last thing the module does.

  • They use the OpenTable() and CloseTable() functions, which draw the themed elements of the PHP-Nuke site. This is required, and all of the module's content must appear in between these two function calls.


Working with User Input

Let's expand that last example a bit. Say that you want the e-mail page not to display an e-mail address at all, but rather to collect some user information and do something with it (maybe store it in a database or send it as an e-mail). Here's the new page:

<?php

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$module_name = basename(dirname(__FILE__));

$index = 1;

function snailmail() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Our address is:";
    CloseTable();
    include("footer.php");

}

function email() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "<form action=\"modules.php?nameContactUs\" method=\"post\">";
    echo "Your name: <input type=\"text\" size=\"20\" name=\"username\">";
    echo "<input type=\"submit\" name=\"submit\">";
    echo "<input type=\"hidden\" value=\"process\" name=\"which\">";
    echo "</form>";
    CloseTable();
    include("footer.php");

}

function process($username) {
    global $module_name;
    include("header.php");
    OpenTable();
      echo "You entered ".$username
    CloseTable();
    include("footer.php");
}

function MainMenu() {
    global $module_name;
    include("header.php");
    OpenTable();
    echo "Which do you want?<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;which=email\">E-Mail Address</a>";
    echo "<li><a href=\"modules.php?name=$module_name&amp;which=mail\">Mailing Address</a>";
    echo "</ul>";
    CloseTable();
    include("footer.php");
}

switch($which) {

    default:
    MainMenu();
    break;

    case "mail":
    snailmail();
    break;

    case "email":
    email();
    break;

    case "process":
    process($username);
    break;
}

?>

Now, the email() function is displaying an HTML form. Here are the important elements of that:

  • The form's action sends it right back to this same module.

  • A text input box named username is collecting the user's name.

  • A hidden field named which contains the value process. This takes the place of a URL containing &which=process.

Now check out the switch construct at the end. A new case has been added to deal with the which=process possibility. This situation calls the process() function, passing a variable named $username. Notice that this variable name corresponds exactly with the input box name, username. That's how PHP-Nuke makes the match: Whatever the user typed is passed in the variable $username.

The process() function accepts $username and then displays its output, which makes use of that variable. Of course, you could write the process() function to send an e-mail, store something in a database, or whatever you like. That's a bit beyond the scope of this book, however.


Databases

This book isn't about database programming, but if you are familiar with that concept, I want you to know how PHP-Nuke makes databases accessible. If these terms and concepts are meaningless to you, just skip ahead to the next topic.

To query one or more rows from the PHP-Nuke database, use something like this:

$result = $db->sql_query("SELECT field1, field2 FROM table")

The variable, $result, contains the queried rows. To get them out, use something like this:

While list($field1, $field2) = $db->sql_fetchrow($result) {
  /* code here */
}

$field1 contains the first column's data; $field2 contains the second column's data. This construct repeats once for each row of data that $result contains. You can see how many rows that is by executing this:

$numrows = $db->sql_numrows($result)

The $db object variable is defined by PHP-Nuke and is available in all modules. You will, however, need to explicitly declare it within each function of a module:

Global $db

Sidebar . FAQ

Do I have to have an index.php for each module folder?

Yes. If you don't, PHP-Nuke won't do anything when you try to access that module.

Where can I find out more about creating modules for PHP-Nuke?

www.phpnuke.org is the best place to start. The online "PHP-Nuke HOWTO" document, available at that Web site, contains more details on how to create custom blocks and modules. Searching the Web (using a search engine like Google) can also turn up some helpful hints.

I do recommend becoming more familiar with your database server (typically MySQL), since a lot of what you need to know to make custom modules is really the MySQL query language and MySQL administrative tasks. The site www.mysql.org contains information and documentation on MySQL, and there are a number of excellent books on the market that cover MySQL.


Chapter 37. Selecting and Using Built-In Blocks

I love blocks. They add flavor to your site, and they're a great way to remind users of all the great content on your site. PHP-Nuke includes a number of built-in blocks that act as "teasers," alluding to content elsewhere on your site and luring users in.

Sidebar . FRIDGE

Alluding was on my word-a-day calendar today, and I've been dying to use it. Yesterday was antidisestablishmentarianism, and I'm still looking for someplace to wedge that into the text.

To use the built-in blocks, go into the Administration menu and click Blocks. You'll see something like Figure 37.1.

Figure 37.1. Building a new block for your site.

[View full size image]

Fill in the Title field, but leave the RSS/RDF File URL field blank. You're not creating an RSS block; you're using a built-in block. Those are listed in the File Name drop-down list. These choices are included with PHP-Nuke:

  • Advertising. This block displays banners that were created as block banners (rather than page-wide banners).

  • Big Story of Today. This block displays the title of the most-read article on your site for the day.

  • Categories Menu. This block displays the categories you've defined on your site, allowing users to quickly see articles related to each.

  • Content. This block displays the titles of the items in the Content module.

  • Encyclopedia. This block displays entries from the Encyclopedia module.

  • Ephemerids. This block displays ephemerids, which are those "on this day in 1913" type of trivia bits. You set up ephemerids using the Ephemerids item on the Administration menu.

  • Forums. This block displays the titles of the last several posts in your forums.

  • Languages. This block allows users to select their preferred language for the site.

  • Last 5 Articles. This block displays the five most recent stories from the News module.

  • Last Referrers. This block displays the last few sites that referred people to your Web site.

  • Login. This block provides a shortcut for users wishing to log in, or wishing to register for an account on your site.

  • Modules. This is a "main menu" block, displaying all active modules configured to display in the Modules block. It also displays a link to the home page of your site.

  • Old Articles. This block displays items from the Stories_Archive module.

  • Random Headlines. This block displays random headlines from the News module.

  • Reviews. This block displays items from your site's Reviews module.

  • Search. This block provides a shortcut into the Search module, allowing users to quickly search your site for content.

  • Subscription. This block provides a quick shortcut to your subscription page, which you set up in the site preferences.

  • Survey. This block displays the most recent survey, allowing users to quickly respond to the poll.

  • Top10 Downloads. This block displays the titles of the ten most-downloaded items from the Downloads module.

  • Top10 Links. This block displays the titles of the ten most-visited items in the Web Links module.

  • Total Hits. This block displays the total number of visits, or hits, to your Web site.

  • User Info. This block displays basic information about the user who's logged on.

Pretty neat, huh? What I really like about the built-in blocks is that they help users realize what your site has to offer. A PHP-Nuke site can have a lot going on: Reviews, Content, News, Downloads, and more. Normally, only the Modules block gives any insight into the site's possibilities and features; by using some of these additional blocks, you can hint at the breadth of content and features your site offers, tempting users to explore and check things out.


Chapter 38. Using RSS Newsfeed Blocks

Let's talk about RSS, shall we? RSS stands for, depending on who you ask, Really Simple Syndication. The whole idea behind it is that sites can expose their content for syndication by other Web sites. Essentially, a site posts a special XML-formatted version of its content headlines. Other sites can download that XML and display those headlines as links back to the original site.

An example might be a better way to explain this. Swing over to http://news.yahoo.com, and scroll down to nearly the bottom of the page, shown in Figure 38.1. Notice that they have a complete section, News via RSS, with items that carry an XML icon. Other sites use an RSS icon, but the results are the same.

Figure 38.1. Exploring RSS newsfeeds at news.yahoo.com.

[View full size image]

Click on one of these RSS or XML items, and you'll see a page like the one shown in Figure 38.2 (it'll look different in different Web browsers).

Figure 38.2. An RSS news file.

[View full size image]

This XMLthat's what you're looking atdescribes the site and its headlines, and provides URLs, or links, back to the full news story. You can use an RSS aggregator, such as SharpReader (www.sharpreader.com), to download these RSS files, or feeds, and display them on your computer. You can also use PHP-Nuke.

What you need to do is to find an RSS feed that you want displayed in a block on your Web site. Figure 38.2 shows an RSS URL from Yahoo! News, which is http://rss.news.yahoo.com/rss/business. Go into the Blocks item in your PHP-Nuke Administration menu. As shown in Figure 38.3, provide a title for the block and fill in the RSS URL that you copied from your Web browser. Set the block's position and, if desired, expiration, and hit Create Block. The results are shown in Figure 38.4: a listing of headlines from Yahoo! News. Clicking a headline takes you straight to the Yahoo! site, where the full story is displayed. By default, PHP-Nuke downloads the headlines every hour; you can change that in the block's configuration, if desired.

Figure 38.3. Creating an RSS newsfeed block.

[View full size image]

Figure 38.4. Viewing an RSS newsfeed block.

[View full size image]

Notice in Figure 38.3 that the text box for the RSS URL has an adjacent drop-down list and a Setup link. Here's how that works: PHP-Nuke comes bundled with a bunch of RSS URLs, which are listed in the drop-down list. You can just select one of these when creating an RSS newsfeed block rather than typing your own URL. You can click the Setup link to add your own RSS URLs to the drop-down list box. Why bother?

Because users can also set up their own private RSS newsfeed in the Your Account module. They, too, get to select from the drop-down list of preconfigured RSS URLs, so you might want to populate that list with RSS URLs that pertain to your site. If you're stuck trying to find URLs that pertain to your site's topic, check out an RSS directory like the one at www.2rss.com, which lists RSS URLs by category.

And here's an especially cool feature: You have your own RSS feed. Other Web sites can visit www.yoursite.com/backend.php, and they'll get an RSS newsfeed of your site's News module articles. Remember, all they get is the headlines; they have to actually visit your site to read the whole story, which can help drive attendance to your site. Figure 38.5 shows the RSS feed from my sample Web site at www.scriptinganswers.com/cms2; you can see some of the News items on the site listed here in the XML.

Figure 38.5. An RSS news file produced by PHP-Nuke.

[View full size image]

So that you can get a better idea of how this RSS stuff works, here's a sample RSS file:

<rss version="0.91">
 <channel>
  <title>Daisy&#039;s Recipe Station</title>
  <link>http://yoursite.com</link>
  <description>PHP-Nuke Powered Site</description>
  <language>en-us</language>
  <item>
   <title>New Cookware from Revelie!</title>
   <link>
    http://yoursite.com/modules.php?name=News&file=article&sid=3
   </link>
  </item>
  <item>
   <title>Computers and Cooking</title>
   <link>
    http://yoursite.com/modules.php?name=News&file=article&sid=2
   </link>
  </item>
  <item>
   <title>Apple Pies</title>
   <link>
    http://yoursite.com/modules.php?name=News&file=article&sid=1
   </link>
  </item>
  </channel>
</rss>

The file begins with the title, URL, and description of your site: These are all set up in the site's Preferences administration module. The site's default language is also configured in Preferences. Next is an <item> tag for each News item included in the feed; each <item> includes a headline in the <title> tag and the URL to the full story in the <link> tag. And that's it!

Why bother including RSS newsfeeds on your site? First, they're a great way to add some extra content to your site, thus attracting more users, without doing any work. They're a service to your users, helping them to stay informed about whatever topic your site focuses on. Try not to get carried away, of course; one or, at most, two RSS blocks are more than sufficient for most sites.

Sidebar . FAQ

My RSS blocks are outdated. Why?

PHP-Nuke can be configured to reload the RSS content every hour, every 24 hours, or for other intervals. PHP-Nuke stores, or caches, the content in its database so that PHP-Nuke doesn't have to go get the RSS content for each user who visits your Web site. This behavior significantly improves PHP-Nuke's performance, but it also means that your RSS newsfeeds can be a few hours out of date from time to time (which is unusual, most sites don't update their RSS feeds more than every hour or so).

Where can I get an RSS newsreader to test my own RSS feeds?

There are lots of RSS readers, or aggregators, out there; try searching Google for one. You can also grab Thunderbird from www.mozilla.org; it's a combination e-mail client, news reader, and RSS aggregator that's great for testing PHP-Nuke's RSS capabilities.

Okay, I'll bite. What's XML?

XML stands for eXtensible Markup Language. Really, it's just a set of rules for creating languages like RSS. XML is interesting because it creates self-describing data. In other words, when you look at an RSS document like the previous one, it's pretty easy to pick out the titles because each one is surrounded by <title> and </title>. Those elementscalled tagsare self-descriptive. XML is just the set of rules that says you have to have an opening (<title>) and closing (</title>) tag, for example.

Where can I find more RSS newsfeeds?

Search for them. They're constantly changing, and no one site is a complete directory to them all. Hop on Google and search for "RSS feed," throwing in any keywords that describe the topics you're interested in.


Chapter 39. Adding Third-Party Blocks

Unlike third-party add-on modules, which often require more extensive installation procedures (as in copying files and running a script to set up the database), installing a third-party block is usually just a matter of copying a file. One file. No, really, I mean it: one file. You copy it to your site's Blocks folder. That makes the block available on the drop-down list for new blocks, just as if the new block was built right into PHP-Nuke. Nothing could be easier.

That said, this topic is suddenly looking a bit short. I mean, "copy the file and you're done" is easy, but it doesn't help you actually find third-party blocks, now, does it? One place to start looking is at www.phpnuke.org, where they have an entire news topic devoted to add-ons and blocks. You can visit www.phpnuke.org/modules.php?name=News&new_topic=41 for the latest add-ons (which includes blocks), or www.phpnuke.org/modules.php?name=News&new_topic=43 for the latest blocks. People tend to post new blocks under both categories, so check them both out.

Many third-party blocks connect to external Web services to bring new content to your site, such as the Unsigned Band Web Releases Random Artist block, which displays random unsigned bands on your Web site (great for a music site). You can view the block at www.unsignedbandweb.com/blocks/randomartistblock.jpg. Other neat blocks include these:

  • A Google search block at www.globaleshop.biz/gsearch.zip makes Google searching accessible from your Web site.

  • The Flash-based main menu block at http://kenetix.net/ is more configurable than PHP-Nuke's built-in Modules block. This includes additional files you have to copy into the Admin folder of your site, giving you a new administration module from which you configure the new main menu.

  • Yet another Google blockthere are tons of thesethe one at www.sergids.com/inici/modules.php?name=Downloads&d_op=viewdownload&cid=2&newlang=english has some nice features, including customization.

  • If you want your blocks to be collapsible, allowing your users to click a block to hide or show it, check out www.truden.com/modules.php?name=Downloads&d_op=viewdownloaddetails&lid=164&.

  • The block at www.nukelancers.com/modules.php?name=Downloads enables your Web site to offer multilingual translation services to your users, using AltaVista's translation service.

  • Remind your users to keep their antivirus software updated; blocks for various antivirus applications are available at www.cms.lxirc.net/modules.php?name=Downloads&d_op=viewdownloaddetails&lid=1279&ttitle=RAV_Anti_Virus_Block#dldetails and www.irc.lxirc.net/modules.php?name=Downloads&d_zop=viewdownload&cid=14.

  • Display the top five posters in your Forums module in a cool scrolling block, at www.prime1now.com/downloads-cat3.html.

  • Encourage users to use their journals by listing the titles of the most recent journal entries. This is a conspicuously missing block from PHP-Nuke, which provides built-in blocks related to most other modules. See www.indodigest.com/indonesia-news-346.html.

The links I've provided here are to the file downloads themselves; you may be asked to register for a free user account on these authors' Web sites before you'll be able to download anything. Most also provide a preview of the block so that you can see what it looks like prior to downloading; read the download description for these details.


Chapter 40. Making Your Own Simple HTML Block

Blocks are those fun, useful little sections of content shown in the left (and right, if you have one) columns of your site. A simple block that just displays static HTML might be useful for short messages, for advertising, or even as a main menu, replacing the built-in Modules block. PHP-Nuke comes with a Sample_Block.php block, in the Blocks folder of your site, that shows how crazy-simple a block can be:

<?php

/**********************************************************************/
/* PHP-NUKE: Web Portal System                                        */
/* ===========================                                        */
/*                                                                    */
/* Copyright (c) 2002 by Francisco Burzi                              */
/* http://phpnuke.org                                                 */
/*                                                                    */
/* This program is free software. You can redistribute it or modify   */
/* it under the terms of the GNU General Public License published by  */
/* the Free Software Foundation; either version 2 of the License.     */
/**********************************************************************/

if (eregi("block-Sample_Block.php",$_SERVER['PHP_SELF'])) {
    header("Location: index.php");
    die();
}

$content = "Here goes the content you want in your new block";

?>

As you can see, something like 75 percent of this block is comments, and there are only five lines of code. The first four lines simply check to make sure the block is being loaded by another page of the site, not being accessed directly; these four lines should be copied over to any blocks you create.

The next line shows, with an almost Zen-like efficiency, how blocks work: You put your content into a variable named $content. That's it. If you were to load this sample block into your Web site (by using the Blocks administration module), it would look like Figure 40.1.

Figure 40.1. The sample block displayed on the home page.

[View full size image]

I mean, seriously, that's easy stuff.


Using Static HTML

I mentioned that you can make your own main menu. Normally, your site would just use the provided Modules block, which PHP-Nuke automatically formats into a main menu. It lists all active modules that are configured to show in the Modules block, making a simple yet effective main menu. At one time, I had my site at www.scriptinganswers.com using a completely custom menu, though. I started in Microsoft FrontPage, building the menu out of graphics I'd created and linking each graphic to a module of my site. The resulting HTML, which I copied out of FrontPage, looked like this:

[View full width]

<center>
<img border=\"0\" src=\"images/menu/MenuStack_01.png\" ><br>
<img border=\"0\" src=\"images/menu/MenuStack_02.png\" ><a href=\"modules
  .php?name=News&new_topic=3\"><img border=\"0\" src=\"images/menu/MenuStack_03.png\" alt=
  \"VBScript, WSH, WMI, &amp; ADSI\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_04.png\" ><a href=\"modules
  .php?name=News&new_topic=4\"><img border=\"0\" src=\"images/menu/MenuStack_05.png\" alt=
  \"Commandline scripts\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_06.png\" ><a href=\"modules
  .php?name=News&new_topic=5\"><img border=\"0\" src=\"images/menu/MenuStack_07.png\" alt=
  \"MSH scripts\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_08.png\" ><a href=\"modules
  .php?name=Submit_News\"><img border=\"0\" src=\"images/menu/MenuStack_09.png\" alt=\"Submit
   content\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_10.png\" ><br>
<img border=\"0\" src=\"images/menu/MenuStack_11.png\" ><a href=\"modules
  .php?name=News&new_topic=2\"><img border=\"0\" src=\"images/menu/MenuStack_12.png\" alt=
  \"Announcements\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_13.png\" ><a href=\"modules.php?name=Forums
  \"><img border=\"0\" src=\"images/menu/MenuStack_14.png\" alt=\"Discussion forums\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_15.png\" ><a href=\"modules
  .php?name=Downloads\"><img border=\"0\" src=\"images/menu/MenuStack_16.png\" alt=
  \"Downloads\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_17.png\" ><a href=\"modules
  .php?name=Web_Links\"><img border=\"0\" src=\"images/menu/MenuStack_18.png\" alt=\"Web
   links\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_19.png\" ><br>
<img border=\"0\" src=\"images/menu/MenuStack_20.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=1\"><img border=\"0\" src=\"images/menu/MenuStack_21.png
  \" alt=\"About Don / Contact info\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_22.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=2\"><img border=\"0\" src=\"images/menu/MenuStack_23.png
  \" alt=\"Don's books &amp; e-books\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_24.png\" ><a href=\"modules
  .php?name=Calendar\"><img border=\"0\" src=\"images/menu/MenuStack_25.png\" alt=\"Training
   &amp; Events Calendar\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_26.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=3\"><img border=\"0\" src=\"images/menu/MenuStack_27.png
  \" alt=\"Consulting services\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_28.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=4\"><img border=\"0\" src=\"images/menu/MenuStack_29.png
  \" alt=\"Public speaking\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_30.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=5\"><img border=\"0\" src=\"images/menu/MenuStack_31.png
  \" alt=\"Public &amp; Private Training\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_32.png\" ><br>
<a href=\"modules.php?name=Content&pa=showpage&pid=1\">
<img border=\"0\" src=\"images/menu/MenuStack_33.png\" width=\"47\" height=\"38\" alt=
  \"Contact\"></a><a href=\"modules.php?name=Your_Account\"><img border=\"0\" src=\"images
  /menu/MenuStack_34.png\" alt=\"Your Account\"></a><a href=\"modules.php?name=Search\"><img
   border=\"0\" src=\"images/menu/MenuStack_35.png\" width=\"42\" height=\"38\" alt=\"Search
  \"></a><a href=\"index.php\"><img border=\"0\" src=\"images/menu/MenuStack_36.png\" width=
  \"48\" height=\"38\" longdesc=\"Home\"></a>
<img border=\"0\" src=\"images/menu/MenuStack_37.png\"><a href=\"modules.php?name=Journal
  \"><img border=\"0\" src=\"images/menu/MenuStack_38.png\" alt=\"Journal\"></a><a href=
  \"http://www.scriptinganswers.com/shop\"><img border=\"0\" src=\"images/menu/MenuStack_39
  .png\" alt=\"Online Store\"></a><a href=\"modules.php?name=Private_Messages\"><img border=
  \"0\" src=\"images/menu/MenuStack_40.png\" alt=\"Private Messages\"></a><img border=\"0\"
   src=\"images/menu/MenuStack_41.png\">
</center>

Don't worry about the crazy way the text wraps from line to line; FrontPage did it that way and didn't seem to care. So how do I convert this into a block for use in PHP-Nuke? I have to type exactly 21 additional characters. Before the HTML, I typed this:

<?php
$content = "'

And after it, I typed this:

";
?>

The resulting file looks like this:

[View full width]

<?php
$content = "<center>
<img border=\"0\" src=\"images/menu/MenuStack_01.png\" ><br>
<img border=\"0\" src=\"images/menu/MenuStack_02.png\" ><a href=\"modules
  .php?name=News&new_topic=3\"><img border=\"0\" src=\"images/menu/MenuStack_03.png\" alt=
  \"VBScript, WSH, WMI, &amp; ADSI\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_04.png\" ><a href=\"modules
  .php?name=News&new_topic=4\"><img border=\"0\" src=\"images/menu/MenuStack_05.png\" alt=
  \"Commandline scripts\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_06.png\" ><a href=\"modules
  .php?name=News&new_topic=5\"><img border=\"0\" src=\"images/menu/MenuStack_07.png\" alt=
  \"MSH scripts\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_08.png\" ><a href=\"modules
  .php?name=Submit_News\"><img border=\"0\" src=\"images/menu/MenuStack_09.png\" alt=\"Submit
   content\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_10.png\" ><br>
<img border=\"0\" src=\"images/menu/MenuStack_11.png\" ><a href=\"modules
  .php?name=News&new_topic=2\"><img border=\"0\" src=\"images/menu/MenuStack_12.png\" alt=
  \"Announcements\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_13.png\" ><a href=\"modules.php?name=Forums
  \"><img border=\"0\" src=\"images/menu/MenuStack_14.png\" alt=\"Discussion forums\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_15.png\" ><a href=\"modules
  .php?name=Downloads\"><img border=\"0\" src=\"images/menu/MenuStack_16.png\" alt=
  \"Downloads\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_17.png\" ><a href=\"modules
  .php?name=Web_Links\"><img border=\"0\" src=\"images/menu/MenuStack_18.png\" alt=\"Web
   links\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_19.png\" ><br>
<img border=\"0\" src=\"images/menu/MenuStack_20.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=1\"><img border=\"0\" src=\"images/menu/MenuStack_21.png
  \" alt=\"About Don / Contact info\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_22.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=2\"><img border=\"0\" src=\"images/menu/MenuStack_23.png
  \" alt=\"Don's books &amp; e-books\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_24.png\" ><a href=\"modules
  .php?name=Calendar\"><img border=\"0\" src=\"images/menu/MenuStack_25.png\" alt=\"Training
   &amp; Events Calendar\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_26.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=3\"><img border=\"0\" src=\"images/menu/MenuStack_27.png
  \" alt=\"Consulting services\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_28.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=4\"><img border=\"0\" src=\"images/menu/MenuStack_29.png
  \" alt=\"Public speaking\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_30.png\" ><a href=\"modules
  .php?name=Content&pa=showpage&pid=5\"><img border=\"0\" src=\"images/menu/MenuStack_31.png
  \" alt=\"Public &amp; Private Training\"></a><br>
<img border=\"0\" src=\"images/menu/MenuStack_32.png\" ><br>
<a href=\"modules.php?name=Content&pa=showpage&pid=1\">
<img border=\"0\" src=\"images/menu/MenuStack_33.png\" width=\"47\" height=\"38\" alt=
  \"Contact\"></a><a href=\"modules.php?name=Your_Account\"><img border=\"0\" src=\"images
  /menu/MenuStack_34.png\" alt=\"Your Account\"></a><a href=\"modules.php?name=Search\"><img
   border=\"0\" src=\"images/menu/MenuStack_35.png\" width=\"42\" height=\"38\" alt=\"Search
  \"></a><a href=\"index.php\"><img border=\"0\" src=\"images/menu/MenuStack_36.png\" width=
  \"48\" height=\"38\" longdesc=\"Home\"></a>
<img border=\"0\" src=\"images/menu/MenuStack_37.png\"><a href=\"modules.php?name=Journal
  \"><img border=\"0\" src=\"images/menu/MenuStack_38.png\" alt=\"Journal\"></a><a href=
  \"http://www.scriptinganswers.com/shop\"><img border=\"0\" src=\"images/menu/MenuStack_39
  .png\" alt=\"Online Store\"></a><a href=\"modules.php?name=Private_Messages\"><img border=
  \"0\" src=\"images/menu/MenuStack_40.png\" alt=\"Private Messages\"></a><img border=\"0\"
   src=\"images/menu/MenuStack_41.png\">
</center>";
?>

I saved the file as MainMenu.php in the Blocks folder of my site. Then I just selected that block in the Blocks administration module and added the block to my site. Shazam, new static HTML block. I know people are all the time telling you how simple things are, but this really is that simple.

Sidebar . FRIDGE

Speaking of people who lie about how simple things are, I recently bought one of those assemble-it-yourself computer desks. Now, I've put these pieces of furniture together before, and while it usually isn't much fun, it's not exactly nuclear engineering, either. But this "simple to assemble" desk had something like 4.2 million parts, and the instructions consisted of one exploded diagram showing every piecenone of which was labeledfitting together. Yeah, right. I got it together, though, and it's one of the largest ashtrays I've ever owned, although I'm still not sure why an ashtray needs cord management piping. Oh, wait….

To take a simpler-looking example, suppose you just wanted a block that invites people to visit another Web site you've got. Here's what you'd do:

<?php

if (eregi("block-Sample_Block.php",$_SERVER['PHP_SELF'])) {
    header("Location: index.php");
    die();
}

$content = "Visit <a href=\"http://www.mysite.com\">My site!</a>";

?>

That's it. I do want you to notice something in particular: The process of assigning content to the $content variable requires that your content be enclosed in double quotes. See the quotes at either end? The line must also end in a semicolon, although the line can happily take up more than one actual line of text if it's really long.

Sometimes, however, you need to use double quotes as part of your content. In the previous example, the <a> tag requires double quotes around the URL that I want to link to. Those double quotes must be preceded by the backslash (\) character, a process called escaping. The backslash basically tells PHP to not worry about the next character and to not treat it like a double quote mark. You'll notice the same technique usedquite liberallyin my main menu example that I showed you earlier.

Anyway, once you've finished your block, save it in a PHP file in the Blocks folder of your site, and you're ready to go.


Or, There's the Extra-Easy Way

Try this: Go into PHP-Nuke's Administration menu. Click on Blocks. You'll see something like Figure 40.2. Type a name for your block. Open FrontPage or whatever HTML editor you like, and make some static HTML content. Copy the actual HTML to the system clipboard (in FrontPage, click on the Code tab, press Ctrl+A, and then press Ctrl+C). Click inside the Content box shown in Figure 40.2, and press Ctrl+V to paste the HTML code. Finish configuring the block and click Create Block.

Figure 40.2. Creating a block in PHP-Nuke.

[View full size image]

Poof, you've just created a static HTML block with no programming at all. PHP-Nuke will display whatever you paste into the Content box, just as if you'd followed the steps I showed you earlier for creating a static HTML block. But you don't have to create a file; PHP-Nuke stores your content in the database. Which way should you use? Doesn't matter. Use whichever you like.


Chapter 41. Making Your Own Dynamic Block

Making blocks, as you learned in the previous topic, is easy. Crazy-style easy. Making a dynamic block isn't much harder than making a simple HTML block, in fact. For example, you may already know that PHP-Nuke allows you to assign points to users who participate in your site by posting content, comments, and so forth; I wanted a block that would show the current top five point earners, to encourage other users to participate. Here's the block I wrote:

<?php

if (eregi("block-Top10_Downloads.php",$_SERVER['PHP_SELF'])) {
 Header("Location: index.php");
 die();
}

global $prefix, $db;
$content = "Currently in the lead:<br><br>";

$a = 1;
$sql = "SELECT username FROM ".$prefix."_users WHERE "
 ."user_id > 2 AND user_id <> 150 ORDER BY points "
 ."DESC LIMIT 0,5";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
 $title2 = ereg_replace("_", " ", $row[username]);
 $content .= "&nbsp;&nbsp;$a: $title2<br>";
 $a++;
}
$content .= "<br>Prize awarded monthly to the top user! "
 ."Earn points by participating in the "
 ."<a class=\"blockcontent\" href=\"modules.php?name="
 ."Forums\">Forums</a>, ";
$content .= "<a class=\"blockcontent\" "
 ."href=\"modules.php?name=Submit_News\">submitting scripts"
 ."</a>, adding to your <a class=\"blockcontent\" "
 ."href=\"modules.php?name=Journal\">Journal</a>, ";
$content .= "visiting our sponsors, and more!";
$content .= " <a class=\"blockcontent\" "
 ."href=\"modules.php?name=Your_Account\">Check "
 ."your points</a> anytime.";
?>

This is a pretty short section of code. The first few lines just check to make sure that the page isn't being accessed directly; if it is, the user is redirected to the site's home page. This is really just a precaution to help prevent users from individually accessing pages of the site, since not all pages are accessible to all users. By ensuring that this block is accessed only by another page on the site (usually modules.php, which loads only those blocks that the current user is allowed to see), I'm better protected against blocks being shown inappropriately.

if (eregi("block-Top10_Downloads.php",$_SERVER['PHP_SELF'])) {
 Header("Location: index.php");
 die();
}

Next, I define a couple of variables, and I start building the content for the block. Blocks don't ever use PHP's echo statement to output text; they always build a variable named $content. Other pages that load blocks expect $content to be populated with whatever the block wants to show. Here, I start by simply putting some static HTML text into the $content variable:

global $prefix, $db;
$content = "Currently in the lead:<br><br>";

Next comes the dynamic part of the block. I execute a SQL query against my site's database, querying the usernames in order of their point totals. I limit the query to five users, and I specifically exclude user IDs 1, 2, and 150, which are my user IDs on the site. No need for me to compete with my users!

Next, a while loop steps through each of the five users who are returned by the query and adds their names to the block's $content variable. If you're not at all familiar with PHP programming, this may look like gibberish; pick up a good book on PHP if you're interested in learning more about the language. From a PHP-Nuke standpoint, the only special thing here is the $db variable. This is an object variable (fellow PHP geeks will know what that means), and it represents the database functionality built into PHP-Nuke. $db->sql_query executes a SQL query; $db->sql_fetchrow retrieves the next row from that query. The practical upshot of this code is to produce a numbered list of five users, in descending order of points total.

$a = 1;
$sql = "SELECT username FROM ".$prefix."_users WHERE "
 ."user_id > 2 AND user_id <> 150 ORDER BY points "
 ."DESC LIMIT 0,5";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
 $title2 = ereg_replace("_", " ", $row[username]);
 $content .= "&nbsp;&nbsp;$a: $title2<br>";
 $a++;
}

The rest of the block is fairly boring, simply adding more static content to the $content variable:

$content .= "<br>Prize awarded monthly to the top user! "
 ."Earn points by participating in the "
 ."<a class=\"blockcontent\" href=\"modules.php?name="
 ."Forums\">Forums</a>, ";
$content .= "<a class=\"blockcontent\" "
 ."href=\"modules.php?name=Submit_News\">submitting scripts"
 ."</a>, adding to your <a class=\"blockcontent\" "
 ."href=\"modules.php?name=Journal\">Journal</a>, ";
$content .= "visiting our sponsors, and more!";
$content .= " <a class=\"blockcontent\" "
 ."href=\"modules.php?name=Your_Account\">Check "
 ."your points</a> anytime.";

That finishes the block. You'll notice that the block doesn't attempt to do anything with the $content variable; it's sufficient simply to stuff it full of whatever you want shown, and PHP-Nuke takes care of the rest.

Blocks are among the simplest components of PHP-Nuke. Installing a block is simplicity itself: Copy it into the site's Blocks folder, and you're done. You then can select the block in the Blocks administration module, adding the block to your site.

So, here's a quick rundown of how to build a dynamic block:

  1. Start with an empty PHP page.

  2. Add code that populates a variable named $content with whatever you want shown.

  3. Save the file in the site's Blocks folder.

  4. Add the block to the site.

Obviously, you need to know some PHP programming to produce dynamic blocks, and this book isn't here to help you become a PHP programmer. There are tons of other books that can help you do that; browse through them online or at your favorite bookstore, and find one you like. PHP-Nuke provides that special $db variable that you can use to access database functionality, which is about the only special thing a block usually needs to do.


Part III. PHP-Nuke Administration

Team LiB

Part III: PHP-Nuke Administration

Administering Stories and Topics

Backing Up Your Site and Database

Administering Banners

Administering Content

Administering Users, Admins, and Groups

Reviewing HTTP Referrers

Administering Messages

Sending an e-Newsletter

Working with Submissions

Administering Surveys and Polls

Understanding Themes

Installing a Third-Party Theme

Tweaking a Theme to Meet Your Needs


Chapter 42. Administering Stories and Topics

I've already covered the basics of story and topic administration in Topics 19, "Using the News Module," and 29, "Using the Topics Module." In this chapter, I want to cover the basic administrative steps in a bit more detail and also provide some strategies for effectively using this important part of your Web site.


Understanding the Structure

Remember that stories in PHP-Nuke form a major portion of the product and are the focus of several modules. The basic unit, a story, can be regarded as a news story, an explanatory piece, a tutorial, or some other piece of written text. Shorter pieces of text are the intended use, since there's no provision to insert page breaks (as you can with both the Sections and Content modules). These various modules affect stories:

  • The News module, which is the module that is most often used as the home page module. It displays your ten most recent stories, including their lead-in text, an icon, and a link to the remainder of the story. This module is also responsible for displaying stories full page in their entirety, and handling the addition of comments to stories as well as user ratings of stories.

  • The Stories_Archive module, which is nothing more than a specialized listing of available stories, categorized by the month in which they were published. Any story actually viewed is done so in the News module, which is linked into by the Stories_Archive module's listings.

  • The Submit_News module, which allows users to enter their own story submissions for your editing and approval.

  • The Search module, which can search, among other things, the text of stories, making it easier for users to find the content they want to view.

  • The Topics module, which displays stories organized by topic. As with the Stories-Archive module, this module is just a specialized way of listing stories; anyone actually viewing a story is transferred into the News module to do so.

No other set of modules within PHP-Nuke is so tightly integrated, nor does any other portion of PHP-Nuke have so many modules dealing with the same content. That alone means there's some strategy involved in getting stories properly positioned on your site.

Also understand that the intended use of these modules is to handle time-sensitive content, such as news (in the literal sense of the word). Only the ten most recent stories are displayed through the News module or Topic module; archived content is available in a list organized by month, as is appropriate for time-related content like news stories. These stories don't lend themselves well to permanent archival and access by anything other than month of publication. That means these modules aren't the best choice for long-term content like tutorials, which may be accessed for years to come, or recipes, or song lyrics, or game strategies, or anything else that has a lifespan beyond a month or two. That content is better organized by the Sections or Content modules, which allow you to define your own categories for organizing your content and make that content available on a permanent basis.


Planning User Access to Stories and Topics

User access isn't a problem if you want your stories to be available to all users, including anonymous ones, who visit your site. However, getting users to register for access to your site may be crucial to the way your site operates. For example, you may want users to register so that you can capture their e-mail addresses and send them a monthly e-newsletter; you may want them to register so that you can track their visits more readily and use that demographic information appropriately. Whatever your reasons, planning user access to stories can be particularly difficult.

The News module creates most of the difficulty because it's usually the module you place in your home page, meaning it can't be restricted to just registered users. Unfortunately, the News module is also the module used to view all stories. That makes for a simple equation: If the News module is in the home page, you can't restrict access to stories.

There are ways around that restriction, however. For example, take a look at Figure 42.1. Here, I've used the Modules administration to place the Topics module in the home page rather than the News module.

Figure 42.1. Placing the Topics module in the home page.

[View full size image]

As you can see, the home page still displays messages at the top; that's a function of the home page itself, not the News module that used to live in the home page. Underneath is a list of all my site's topics and the most recent stories for each topic. This provides access to the content in a fashion similar to the News module, but in a somewhat more organized list. The most recent stories are displayed, which, to me, is the important thing.

Now that the News module isn't in the home page, I can restrict it, as shown in Figure 42.2, making it available only to registered users of my site. This doesn't affect the list of stories in the Topics module, but remember my short structural lesson: The Topics module just lists stories; it links to the News module to display those stories. If an anonymous user visits my site, that user sees the home page shown in Figure 42.1; if he clicks on a story, however, he sees Figure 42.3, which denies access to the now-restricted News module and encourages the user to register for an account.

Figure 42.2. Restricting the News module.

[View full size image]

Figure 42.3. Access denied: The News module is now restricted.

[View full size image]

You might also put a completely different module in the home page, although I don't recommend doing so. News stories are too easily ignored, and they typically represent an important part of your site, so having them listed in the home page is a key element.

Another trick for restricting News access is to make a copy of the entire News module folder (in the Modules folder of your site) and simply rename it. Call it News_Home or something. Put that module in your home page, and then restrict access to the original News module. Your home page will contain the original News module's display of the most recent stories, but users who click the Read More link will be taken to the original News module, which you've restricted.


Managing Topics

Each news story on the home page has a related topic, as indicated by the topic icon to the upper left of the story. These topic icons are defined in the Topics module, which is accessible from the Administration menu. As shown in Figure 42.4, you can select your own graphic for each topic you create, and you can also create and delete topics from within this administrative page. Note that you can select only topic icons that are listed in the Topic Image drop-down list box; this list box automatically lists any graphics that appear in the \images\topics directory of your Web site. So, to use a new topic icon, you must first upload the graphic to that location. Then you can assign the graphic to a topic that you create.

Figure 42.4. Managing the topics on your Web site.

[View full size image]

You'll want to upload topic icons as one of the first things you do on your site because PHP-Nuke comes with only one icon, which is for PHP-Nuke itself. Probably not appropriate for your site, unless you're doing a site on PHP-Nuke! Note that you shouldn't use any graphics that appear on other Web sites unless you first obtain the owner's permission to do so. For example, the owner of www.phpnuke.org specifically requests that people not use his topic icons on their own sites.


Creating and Scheduling Stories

Use the Add New Article screen to write a new story. You can access this by clicking New Story on the Administration block, which shows up whenever you're logged into your site as an administrator. You can also visit the Administration menu, where you'll find a New Story icon.

Start by providing a title. Be descriptive; titles like "Hey, this is cool" don't really draw readers in. Think newspaper headlines: "Thousands Cheer for New Apple Pie Recipe" or something really catchy.

Next, select the topic and then a category. You can think of categories as sort of subtopics; to add, edit, or delete a category, just click the appropriate links to the right of the Category drop-down list. Categories aren't related to a single topic; all of the topics on your site share the same categories.

Let's say you have the following topics: Desserts, Entrees, Appetizers, and Sides. Now suppose you create the following categories: News, Recipes, Meal Plans, Tips, and the default, Articles. Now suppose you post a new apple pie recipe: That's in the Desserts topic, in the Recipes category. What about a news article on new heirloom apples? News topic, Articles category. Not every topic-category combination will make sense (Entrée News?), but you don't have to use them.

When readers view an article, they'll be able to cross-link to a list of other articles in the same category or topic, so categories and topics really just provide a way of organizing articles according to two separate lists. That way, readers can quickly get a list of Recipes, or read everything you've written about Entrees.

Your next option is whether this story will appear in the home page (assuming you've set up the News module, or a copy of it, to be in the home page). You can also choose to activate or deactivate comments for the story, although for comments to be active, the sitewide preference must also be enabled.

For Story Text, enter a short lead-in paragraph, which appears under the story's headline. The Extended Text box should contain the remainder of your story. Finally, you have the option to program the story, meaning you can keep it in reserve and have it automatically appear on a specified date at a specified time. When you're all done, you can preview your story to see what it will look like, and then go ahead and post it for all to see.


The User's Views

Users have a few different ways to see the stories on your site. The first, shown in Figure 42.5, is the News module itself, which lists the most recent stories, their lead-in text, and a link to read more. The Topics module, shown in Figure 42.1, shows the same stories organized by topic, although it shows only their headlines. The Stories_Archive module shows stories organized by month, making a larger number of headlines accessible at the same time.

Figure 42.5. Viewing news stories in the News module.

[View full size image]

Always remember that your users can have all of these different views available to them, unless you disable the modules that produce these views (disabling Stories_Archive, for example, eliminates the ability for users to see a monthly breakdown of stories). Most important, perhaps, is the ability for a user to always click on a category name, or topic name, or icon to get a list of stories in that category or topic. That ability to cross-link by topic or category makes it important to have a well-thought-out strategy for your topics and categories.


Topic and Category Strategies

Remember that topics and categories represent a sort of grid for content categorization. Topics have associated icons and are listed in the News module. Categories are usually thought of as a sort of subtopic, although every topic on your site shares the same list of categories. You should select topics that represent the main areas of categorization that your users will expect, based on your site's subject. Categories should represent a further breakdown. Sometimes the difference between the two isn't all that obvious. Here are some examples:

  • Music sites might use topics like Lyrics, New Releases, and Concerts. That's because your users will probably want to focus on news stories that cover one or more of these topics, so by making these topics (rather than categories), you'll be able to associate icons with them and present an organized list of all concerts, for example, by using the Topics module. Categories, then, might break down music genres: Rock, Country, Folk, and so forth.

  • A site on politics might include topics for Rumors, Announcements, News, and so forth. Again, these are major subject areas that will attract readers' interest. By using the Topics module, a user could quickly find the latest Rumors. Categories might break things down by Candidate, Party, State, City, and so forth.

  • A site on computer games would probably include topics like New Releases, Tips, Rumors, and Demos. Once again, these are the major interest areas for users; categories could help define genres like Sports, Fighting, Role-Playing, and Action.

Always try to make your topics things that users might want to see a complete list of, and use categories to break them down into organized pieces.

Sidebar . FAQ

Why does PHP-Nuke come with only a"PHP-Nuke"topic icon?

Because that's all PHP-Nuke's author wanted to include. He specifically asks, in fact, that you not use the similar-looking icons that he uses on www.phpnuke.org; you'll need to come up with your own graphics to use as topic icons.

Can I use an ICO file as a topic icon?

No. Topic icons have to be in one of the three common Web formats for all users to be able to see them. Those three formats are JPG, PNG, and GIF. Other graphic formats, like ICO, BMP, and so forth, may work for some users, but they may not work for all users. Also, other formats tend to create larger files than the three Web-friendly formats, meaning that your topic icons will take unusually long to download to your users' computers.


Chapter 43. Backing Up Your Site and Database

Oh, no! You just tried to log on to your site and it's gone! What can you do? How can you get it back? Unfortunately, it's too late to ask: Disaster has already struck. You should have read this topic beforehand so that you'd be ready.

Assuming, however, that disaster hasn't already struck, you're reading this at a good time. First, you should be aware that many Web hosting companies regularly back up their customers' Web sites and databases. If your site is being hosted, ask your provider if they perform backups, and find out in advance what you'd have to do to get them to restore your site in the event of a disaster.

PHP-Nuke also has a database-backup feature built right in. You'll find it on the Administration menu, as shown in Figure 43.1. It's labeled Backup DB. There's no configuration or anything when you click this icon; the site creates the backup and then immediately downloads it to your local computer for safekeeping.

Figure 43.1. Selecting the Backup DB icon on the Administration menu.

[View full size image]

Should the worst occur and you actually need that backup, here's what to do with it: You'll need to delete every table in your PHP-Nuke database and insert the tables that are in the backup instead. Yikes! Exactly how you do that depends on precisely what database engine you're using with PHP-Nuke; MySQL, for example, will allow you to simply import the backup as a big query (the backup is just a giant text file). Most database engines will do that, actually. What you'll need is a way to actually accomplish that import, which is something your hosting provider (if you're using one) must give you. Most will provide a Web-based administration tool; in the case of MySQL, it's called phpMyAdmin. As shown in Figure 43.2, you start by selecting every existing table's check box and selecting Drop from the drop-down list (it says With Selected to start) at the bottom of the page.

Figure 43.2. Selecting tables to drop for a MySQL database.

[View full size image]

With all of your tables dropped, go back to the top of the page and click the SQL tab. Then, as shown in Figure 43.3, click the Browse button and find your backup file. MySQL should auto-import it and execute it, which might take a while. In fact, if your backup is bigger than 2MB or so, this technique won't work; you'll have to get your backup file onto your server via FTP and ask a server administrator (at your hosting company, if you use one), to import the file using MySQL's command-line tool.

Figure 43.3. Importing the backup query to restore your data.

[View full size image]

Carbon Monoxide Alert!

When you select Drop from the list, you don't have to click any other buttons: MySQL drops the tables. Don't do this unless you know you have a good backup!

The command line goes something like this: mysql h servername u username p databasename < backup_filename. Cryptic, huh? Just have the server guy fill in the italicized bits with the proper information, and you'll be okay.

Now, this backup process is only half the battle: the database. You should also make a regular backup of PHP-Nuke's files, which is most easily accomplished through FTP using some sort of batch FTP application that can copy your entire site's files down to your local computer all at once. I use a freeware application called BatchFTP (www.batchftp.net) that does the trick. Because most of PHP-Nuke's changes occur in the database, you should have to do a file backup just once every few months or so, and definitely before and after any PHP-Nuke version upgrades. Database backups can't be performed too often; weekly is enough for a slow site, but nightly is better for a busy site. Given how long it takes to make a backupa few secondsversus how long it would take to re-create all your hard work if the site crashed, it's probably worth the time to just make the backup.

Sidebar . FAQ

I'm hosting my site with a hosting company. They make backups, right?

Don't assume they doask. Ask how often they're made and what you have to do to get the backup restored in the event of a problem. Some hosts make daily backups, but they use them only if an entire serverwhich may contain multiple Web sitescrashes. The backups might not be for your use at all, which means you're on your own for making backups of your individual site.


Chapter 44. Administering Banners

Banners can play an important role in your site. Whether you're advertising for yourself or accepting ads from others, banners can be a way to help produce income from your site. Many companies offer affiliate programs, paying you whenever someone buys something from them as a result of clicking a banner ad on your site. Still others might be willing to pay you to place an ad on your site, hoping to reach the audience that visits your site. Whatever your reasons, PHP-Nuke gives you an effective way to manage banners through a built-in banner display system.


About Banners

PHP-Nuke recognizes two types of banners: normal banners, which appear at the top of each page, as shown in Figure 44.1; and block banners (or ads), which appear only in the Advertising block (which you can add to your site; see Topic 37, "Selecting and Using Built-In Blocks," for details). There's no fixed size for these banners; to keep them from overwhelming your page, however, you should keep normal ads to about 468x60 pixels (which is the standard size for horizontal banner ads). Block ads do well at about 100120 pixels in width, and no more than 300 pixels high. For consistency, try to keep your normal ads all about the same size and your block ads all about the same size.

Figure 44.1. The black rectangle demonstrates where a normal banner appears.

[View full size image]


Banner Administration

Click the Banners icon in the Administration menu to manage your banners. You start as shown in Figure 44.2, by creating one or more clients. These represent people whom you display ads for, and you can definitely create a client to represent yourself. As shown, you enter the client's basic information and also a login name and password. Vendors can use this information to log in and check their own banner statistics on your site.

Figure 44.2. Creating a banner client.

[View full size image]

With at least one client created, you can begin adding banners. Banners are associated with a client. As shown in Figure 44.3, you provide a URL to the banner graphic, a URL where the user should go if the banner is clicked, and an alternate text. The alternate text is displayed if the banner graphic isn't available for some reason (which is usually temporary). Note that both the banner and click URLs should start with "http://" if they point to a Web server other than your own. I suggest having your clients keep their banners on their own Web servers; doing so helps conserve your Web server's bandwidth, which most hosting companies charge for. However, note that some Web browsers allow users to block banners that come from servers other than your own; these users won't see your banners if the banners are hosted on a different Web server.

Figure 44.3. Adding a banner to your site.

[View full size image]

You can also enter the number of impressions a banner will receive. This is the number of times the banner will be displayed; you may want to sell banner space based on impressions (say, $100 for 10,000 impressions). After the requested number of impressions has been delivered, the banner will self-deactivate (you can always reactivate it later, if desired). Enter 0 for unlimited impressions, meaning the banner will remain active until you either delete it or manually deactivate it through the Banners Administration module.

Be sure to pay attention to the type of banner you add: Block banners will appear only if you've added the Advertising block to your site.


Banner Clients

Banner clients can log in to www.yoursite.com/banners.php?op=login using the username and password you created for them when you set up their banner client account (you can also edit that account to see or change the password if they forget). As shown in Figure 44.4, clients can see the number of times their banner has been shown, the number of impressions remaining, the number of times the banner has been clicked, and the percentage of impressions that result in a click (the % Clicks column, also called the clickthrough ratio in the banner biz). A link allows clients to have these statistics e-mailed to them at the e-mail address in their banner client profile.

Figure 44.4. Viewing client banner statistics.

[View full size image]


Banners and Subscribers

PHP-Nuke recognizes three types of users on your site: registered, anonymous, and subscribed. Subscribed users are those who pay for access to your site, and you typically restrict access to one or more modules on your site to those subscribers. Because you're making money from these users, you may want to remove banner advertising from your site for these users. One way to do so is to use only the Advertising block and block banners rather than normal banners. As shown in Figure 44.5, you can create the Advertising block so that it is visible to All Visitors, and then remove Subscriber Visibility. Banners will then appear in the block for everyone except your paid users.

Figure 44.5. Hiding advertising from subscribers.

[View full size image]


Suggestions for Using Banners

Why bother with banners? Sometimes they can help drive traffic to your site. For example, you might agree to display a banner for one Web site, while they agree to display a banner for yoursan agreement often referred to as a link exchange or a banner exchange. You might even have such a great site that folks are willing to pay you to display their banners on your site. Fantastic! If you've got users paying to access your site, you can hide the banners so that paying users get an ad-free experience (something paying users often expect and almost always enjoy).


Chapter 45. Administering Content

In Topic 12, "Using the Content Module," I covered basic content administration and usage. In this chapter, I review administration and go a bit further in detail with it, and help you develop some strategies for using the content in your site. Remember that the Content and Sections modules are the only two places where you can keep categorized content long term; the News module is designed to rotate older content into a monthly archive, which is more difficult to access by topic or category. Also, since the Sections module is being phased out of PHP-Nuke (to my disappointment; see Topic 67, "Last-Minute Changes," for details), the Content module will be your main place for long-term content storage.


Content Administration

The Administration menu provides a Content icon that allows you to manage the content on your server. This section begins with a list of existing content items, although at first the list (obviously) is empty. Next, the section contains two text boxes, which are used to add new content categories, as shown in Figure 45.1.

Figure 45.1. Adding a content category.

[View full size image]

Note that these categories are unique to the Content module; they're different from categories you may have set up for news stories, FAQs, and so forth. Right below the Add a Category section is the Edit Category section, which includes a drop-down list of all the categories you've created. The categories in the Content module don't include graphical icons; they're designed to be descriptive, text-based categories (which is one reason I like the Sections module better).

Finally, there's the Add a New Page section, the top part of which is shown in Figure 45.2.

Figure 45.2. Adding a new content page.

[View full size image]

Adding a new page is easy. Start with the page's title and then select its category. Note that the Category drop-down list box won't be displayed if you haven't yet defined any content categories (which you don't need to do; you can have uncategorized content on your site). After selecting a category, you can provide a subtitle for the page. Keep it short; this will appear on the Content module's listing of available pages, and an especially long subtitle will make the listing difficult to read. The subtitle should just provide some additional clue to what the content is about.

You then have three large text boxes for the page's actual content: Header Text, Page Text, and Footer Text. You can also include a short signature at the end. Here's how all of this fits together:

  • The title and subtitle appear on each page of the content.

  • The header appears on the first page of the content. You can format this text with HTML tags, if you like.

  • The footer appears on the last page of the content. You can also format this text with HTML tags.

  • The signature appears on the last page of the content and is right-justified. HTML tags can be used to format this text also.

  • The page text can be split to appear on multiple pages. Just add the text <!--pagebreak--> where you want the text to be broken into pages. You can also add HTML formatting to the page text.

The basic HTML tags that you can use in your content include these:

  • <br> creates a line break. Use two in a row to create a new paragraph, separated from the previous one by a blank line.

  • <b> boldfaces text. Just pick whatever you want to be boldfaced and surround it with <b> and </b>.

  • <i> works similar to boldfacing, except that it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • You can surround paragraphs with the special <p>paragraph</p> tags. Doing so eliminates the need to use the <br> tags because paragraphs are automatically separated by some whitespace.

Probably the other main tag you'll want to use is to create hyperlinks. First, select the text that you want to be the link. Try to make it descriptive; if you're linking to a Web page about a book, make the book's title the link rather than providing text that just says "Click here." Or, if you're linking to another Web site, make the site's name the link.

Once you've figured out which text will be the link, surround it with <a>anchor</a> tags (which, in this case, would make the word anchor the hyperlink). Now you just need to add to the opening <a> tag to make it a working link. If the site you're linking to is, for example, www.phpnuke.org, you'd build a link like this: <a href="http://www.phpnuke.org">to the PHP-Nuke Web site</a>. Be sure you always start the URL with "http://".

The last option you'll select for a new content page is whether to activate it. Please note that all content can be accessed at any time; deactivated content is simply not listed, meaning you have to know the content's exact URL to see it.


Content Strategies

Having used PHP-Nuke for some time, I've developed some strategies for using the Content module that might help you make more effective use of it on your own site:

  • Come up with good categories. More than 1215 items in a category is too many because the list of items becomes too long to read. Try to come up with smaller, shorter categories. For example, instead of a Lyrics category that contains the words to every song ever written, try creating categories like Lyrics: 19701975 or Lyrics: Milli Vanilli, which are much more specific.

  • Create a General Information category to hold items that include information about your site, how to contact you, and so forth.

  • If your site uses a checkout system to sell goods, you may need Thank You and Approved pages for the checkout system to link back to. Create these pages in the Content module and then deactivate them. The checkout system can still link back to their actual URLs, but the items won't show up in the list of items your users see.

  • Break longer items into pages, using the <!--pagebreak--> tag. Ideally, one page of content shouldn't occupy more than two screens' worth of height, or about 6080 lines of text. Anything longer starts to turn into a mass of text that's hard to read. I try to place my page breaks so that the end of each page roughly coincides with the end of the blocks in the left column of my page. That way, the site looks more consistent and professional.

  • Preview your pages thoroughly before activating them. I like to type my content in Microsoft FrontPage, which offers a spell-checker and easier formatting tools. I can then go into its Code tab and copy the actual HTML (everything between the <body> tag and the </body> tag) to the Clipboard, and then paste it into the Content module. That way everything is nicely formatted and spell-checked, and I didn't have to get the HTML tags right by myself.


Chapter 46. Administering Users, Admins, and Groups

Users, administrators (admins), and groups represent important components of your Web site. Users, of course, are registered (or subscribed) individuals who access your site using their username and password. Adminswhich PHP-Nuke sometimes refers to as authorshave administrative control over all or a portion of your Web site. Groups is a relatively new feature in PHP-Nuke, one that can be used to reward active members of your site.

By the Way

Please note that I highly recommend the use of the NSN Your Account module, which I describe in Topic 32, "Adding the NSN Your Account Tweak," because it vastly improves your user management options. NSN also offers NSN Groups, which enhances the group functionality in PHP-Nuke (which I describe in this topic).


All About Users

The Edit Users icon on the Administration menu allows you to add new users or manage existing ones, assuming you know their username (or nickname). Users can, of course, add themselves through the site's registration process. Once added to the database, users are considered registered. A user may also optionally become subscribed if you provide a means to do so. Access to various site modules and blocks can be restricted to registered or subscribed users, allowing you to control which users have access to what content on your site.

Users can maintain their own profilessuch as their contact information, interests, and other datathrough the Your Account module. Part of their profile is an option to subscribe to your newsletter, which is something PHP-Nuke allows you to send (sort ofI discuss it in Topic 49, "Sending an e-Newsletter").


All About Groups

You probably think that groups are something into which you place users. Not exactly. If you go into the Administration menu and click on Users Groups, you'll see a screen like the one shown in Figure 46.1. While you can create a group, you can't decide who goes into itat least, not directly. Instead, you specify the minimum number of points required to attain membership in the group. Any user with that many points automatically "joins" the group.

Figure 46.1. Creating a user group.

[View full size image]

So where do points come from? A bit farther down on the Users Groups screen, you decide where points come from by telling PHP-Nuke how many points to award for various activities on your site. Everything from creating journal entries to simply viewing pages on the site can be worth a given number of points; users who perform these actions receive the associated number of points and are eligible for whatever groups you've set up. See Figure 46.2.

Figure 46.2. Assigning points to site activities.

[View full size image]


Creating a User Group

By the way, an irritating point about the current version of PHP-Nuke: When assigning point values, you have to enter the points and click the Update button on the same line. You can't update more than one point value at a time.

So what good is group membership? Hop over to the Modules administration and edit a module. Any module. I'll pick the Members_List module. As shown in Figure 46.3, you can restrict access to certain modules to registered users who belong to a specific group. This allows you to reward members by allowing them into additional sections of your Web site. This can be especially useful with third-party modules that offer additional features and functionality. Or, to use a built-in module as an example, you might allow members to visit the Download section of your site only if they've participated enough to earn 50 points. Give out 10 points for each Forums post, and users will be able to download files after contributing just 5 posts in the Forums.

Figure 46.3. Restricting module access to a specific group.

[View full size image]

Users can be members of more than one group; a user with 100 points, for example, will belong to both your 100-point group and your 50-point group, if you've set up such groups.


All About Admins

PHP-Nuke contains a completely separate list for administrators. Anyone accessing your site's admin.php page is required to provide administrator credentials; the normal site user login won't work. However, you can set it up so that administrators who are also users of your site have the same username and password for both their user account and their admin account. I like the way the NSN Your Account tweak (YAT) implements this: A drop-down list allows you to "promote" a user to admin. Behind the scenes, YAT is just copying the user's username and password into the administrator list, creating a new admin with the same name and password as the user you "promoted."

Without YAT, however, you can still create admins. Just click on Edit Admins in the Administration menu and, as Figure 46.4 shows, simply type their name, nickname (which they'll use to log in), e-mail, and password. You check boxes to indicate which areas the new admin will have control over. These check boxes, then, allow you to delegate control over specific areas of your site to "helper administrators." Any admin who has the Super User check box selected will have full control over the site, so there's no need to check any additional check boxes for them.

Figure 46.4. Creating an admin.

[View full size image]

You can also use the Edit Admins module to delete or edit existing adminsor, as PHP-Nuke sometimes calls them, authors.


Chapter 47. Reviewing HTTP Referrers

HTTP is the protocol used by Web servers to transmit content to Web browsers, and used by Web browsers to transmit requests to Web servers. When you click on a link in your Web browser, the Web browser not only sends a request for the desired page, but it also sends the location where the link was located. This is called the referrer. For example, if you're on www.website.com and you click a link that points to www.mysite.com, the Web server at www.mysite.com is told that www.website.com was the referring Web site.

Working with referrers gives you a view of where users are coming from. For example, if Google shows up as a frequent referrer to your site, it's because you're showing up high in Google's search results, which is a great thing. PHP-Nuke allows you to view your refers through the HTTP Referrers icon on the Administration menu. The results, shown in Figure 47.1, aren't complex: It's just a listing of referrers. There's no aggregation, so if one Web site referred 100 users to you, it shows up 100 times.

Figure 47.1. Reviewing HTTP referrers.

[View full size image]

Because PHP-Nuke doesn't do any kind of aggregation or statistics on referrers, you're really just going to be reviewing it to get a sense of where your users are coming from. If you're hosting your site with a Web hosting service, they may provide more detailed reports that include better statistics; if you're hosting your own server, you can purchase Web server log analyzers that will produce these statistics for you (two popular packages are Webtrends and Webalizer).

By the Way

You'll see referrers spelled referers almost everywhere in PHP-Nuke. Be patient. In the original specification for tracking referrers, the author spelled it referers (check out www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14), and the spelling stuck.

Why should you care about referrers? Let's say you agree to trade links with another Web site: You'll put a link to their site on your page, and they'll reciprocate with a link back to yours. If that other site never shows up in your referrers list, they may not have put the link up, or it may not be helping drive traffic to your site. On the other hand, if that other site shows up constantly in your referrers list, then that site is a good source of new users for your site. You might consider bargaining for a banner ad or something, which might attract even more attention.


Modifying Referrer Preferences

You can modify your site's preferences to control HTTP referrer logging. As shown in Figure 47.2, you can decide whether you want to track HTTP referrers at all and, if so, how many you want to maintain in the database. Once the maximum number is reached, PHP-Nuke stops logging new referrers until you manually clear the list through the HTTP Referrers icon on the Administration menu (use the Delete Referrers button at the bottom of the page).

Figure 47.2. Setting up options for HTTP referrers.

[View full size image]

Sidebar . FAQ

Why is the same referrer listed multiple times on the report?

PHP-Nuke doesn't add up referrers; it simply displays each one that comes through. So if one Web site refers 200 users to your site, you'll see that Web site listed 200 times in the referrers section.

Why are some of the referrer URLs so strange looking?

PHP-Nuke records the exact URL that was clicked for the user to reach your site. Many Web sites may code their links to look something like http://www.mywebsite.com/links.asp?linkid=465&host=34; these special links allow the other Web site to track how many people click through to your site.


Chapter 48. Administering Messages

Messages are a way for you to get special announcements and information right in front of your users. Messages always appear at the top of the home page of your site and can be created to appear to all users, registered users, only anonymous users, and so forth. Figure 48.1 shows a message at the top of the home page at www.scriptinganswers.com/cms2.

Figure 48.1. Viewing messages on the home page.

[View full size image]

Messages are administered through the Messages icon on the Administration menu. Figure 48.2 shows the Add a Message screen, where you provide a title and the content for your message. You can use HTML formatting in the message's content; here's a quick rundown of the HTML tags you're likely to use:

  • <b> boldfaces text. Just pick whatever you want to be boldfaced and surround it with <b> and </b>.

  • <i> works similar to boldfacing, but it italicizes. Whatever you want to be in <i>italics</i> should be surrounded by these tags.

  • <u> handles underlining; just surround text with the tags to make that text <u>underlined</u>.

  • Wrap paragraphs in <p> and </p> tags, or use the <br> tag to create a single line break. Using <br><br> creates two line breaks, leaving some whitespace in between paragraphs. If you don't use one of these two techniques, the paragraphs in your story will run together and be difficult to read.

  • To create images in your message, use a tag like this: <img src="http://www.mywebsite.com/images/mypicture.gif">. The src portion points to a graphic file that's living on a Web server someplace, which means the image tag allows you to insert a picture into your text.

Figure 48.2. Creating a new message.

[View full size image]

Keep in mind, however, that your messages appear before any other content on your home page, so you should strive to keep your message short.

You can configure messages to expire after 1, 2, 5, 15, or 30 days, or make a message unlimited, meaning it will display until you manually delete it or deactivate it. Messages can be configured to display to all users of your site, only to anonymous users, only to registered users, only to administrators, or only to subscribed users. An "only anonymous users" message, for example, might suggest that users register for your site and describe the wonderful benefits of doing so.

You con configure multiple messages; as shown in Figure 48.3, these appear stacked at the top of your home page. Only you, the administrator, see that last line of each message, which reads something like [ View: All Visitors - Unlimited - Edit ]. That's just a reminder to you about who can see the message, how long it has to go before it deactivates (in this example, it's unlimited), and a link to edit the message. You can also go right into the message-administration screen to edit messages, delete them, or deactivate them.

Figure 48.3. Stacking messages on the home page.

[View full size image]


Chapter 49. Sending an e-Newsletter

PHP-Nuke contains a very rudimentary administrative module for sending e-newsletters to your members. Select Newsletter from the Administration menu, and you'll see something like Figure 49.1.

Figure 49.1. Sending an e-newsletter.

[View full size image]

As you can see, you provide a subject for your newsletter and then the content (which should not include HTML tags). You can elect to send it only to those users specifically subscribed to your newsletter or to all of your userseven those who have not asked to receive it and those who have specifically requested that you not send it to them. Obviously, I don't recommend the latter, unless you have a bona fide "darn good reason" to be e-mailing all of your users.

PHP-Nuke sends the e-mail by querying all of your users' e-mail addresses. It then goes into a big loop, sending the e-mail to each one, one at a time. If you have ten users, it takes about 5 seconds to do, or maybe even less. A hundred users might take 2530 seconds. And that's where the problem sets in: Most Web servers are configured so that PHP pages can execute only for 30 seconds. Afterward, the page is terminated, meaning only the first hundred or so users receive an e-mail newsletter.

Another problem is that the newsletter can contain really only text; PHP-Nuke doesn't encode the outgoing e-mail to contain HTML. You can put HTML in there, and most mail readers will figure it out, but it's not the "proper" way to do it. Also, sticking HTML into a text e-mail is something a lot of spammers do, meaning your outgoing newsletter might be tagged by some spam filters and some of your users might never even see it.

So what can you do? Well, as of this writing, I'm not aware of any add-on newsletter modules that fix the problem. The only solutions, then, are awkward, mainly involving exporting user e-mail addresses from PHP-Nuke and into a third-party bulk mailer application (which you may have to pay for), a process that's so cumbersome you'll try it only once before giving up in disgust.


A Working Newsletter

I can offer you a solution that's not super pretty, but it does integrate with PHP-Nuke. It's a replacement for the existing admin/modules/newsletter.php; this works only with versions of PHP-Nuke prior to v7.5, since changes to the structure in 7.5 make this unworkable (maybe by then PHP-Nuke will have something better built in). I'm using this on my v7.2 site with no problems.

You need to make some changes to your PHP-Nuke database first, which means getting access to the database. Hopefully, your hosting provider (if you're using one) can show you how to do that, often through a Web-based interface.

You need to run the following SQL statements in your SQL management interface to create two new tables:

CREATE TABLE 'nuke_sanews_config' (
  'NewsText' text NOT NULL,
  'NewsHTML' text NOT NULL,
  'NewsFrom' varchar(255) NOT NULL default '',
  'NewsType' varchar(4) NOT NULL default 'text',
  'NewsSubject' varchar(255) NOT NULL default ''
) TYPE=MyISAM;
CREATE TABLE 'nuke_sanews_send' (
  'SendID' int(11) NOT NULL auto_increment,
  'SendEmail' varchar(255) NOT NULL default '',
  'SendSuccess' tinyint(4) NOT NULL default '0',
  PRIMARY KEY  ('SendID')
) TYPE=MyISAM AUTO_INCREMENT=1722 ;

This syntax is valid for MySQL databases but also should work for most other databases with perhaps some minor tweaking; get a SQL guru to help you, if need be.

Next is the entire text of a replacement admin/modules/newsletter.php file; be sure to back up the old file before putting this in its place. Also note a couple of caveats: First, this file isn't localized and doesn't use PHP-Nuke's language files. It's hard-coded in English, so if you want to translate it, that's up to you (and you're welcome to do so). Second, if you want to download this rather than typing it, you can do so from www.scriptinganswers.com/download/newsletter.zip. But I can't provide technical support for the file; you're on your own there, just as you are with PHP-Nuke itself.

So here's the script, which I interrupt briefly to explain what's going on. Don't worry about the line breaks you see; you can type this in exactly as is (please download itI hate to think of anyone typing all this), and it'll work.

[View full width]

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/*                                                                      */
/* Modified to send bulk email and to have add'l sending options        */
/* by Don Jones www.scriptinganswers.com. Not localized (English only). */
/*                                                                      */
/* You're welcome to modify this or localize it. I don't provide any    */
/* support whatsoever for this script. Have fun with it.                */
/*                                                                      */
/************************************************************************/

if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$aid = trim($aid);
$result = $db->sql_query("select radminnewsletter, radminsuper from ".$prefix."_authors
   where aid='$aid'");
list($radminnewsletter, $radminsuper) = $db->sql_fetchrow($result);

if (($radminnewsletter==1) OR ($radminsuper==1)) {

include("admin/modules/functions_mail.php");

/*********************************************************/
/* Sections Manager Functions                            */
/*********************************************************/

Following is the code that draws the initial page, which is shown in Figure 49.2. You can type the e-mail address that the newsletter is sent from, as well as a subject. You can enter the number of new news stories (articles), downloads, and so forth; these will be linked in the newsletter to draw users' attention to them.

Figure 49.2. Sending an e-newsletter: Don's way.

[View full size image]

Then you provide both a text and HTML-formatted version of your newsletter. In both versions, put the phrase %NewArticles% someplace; it will be replaced with the list of new news stories. Similarly, %NewDownloads% is a placeholder for the list of downloads, and so forth. You can then decide to send a text e-mail, an HTML-only e-mail (not recommended, as it will often be tagged as spam), or both (recommended and the default). You can test your newsletter by sending it just to one address, or you can select from sending it to all subscribed users or all users on your site. Then just click Send.

[View full width]

function newsletter() {
    global $prefix, $user_prefix, $db, $adminmail, $sitename;
    include("header.php");
    GraphicAdmin();
    $srow = $db->sql_numrows($db->sql_query("select * from ".$user_prefix."_users where
   newsletter='1'"));
    $urow = $db->sql_numrows($db->sql_query("select * from ".$user_prefix."_users"));
    $urow--;
    OpenTable();
    echo "<center><font class=\"title\"><b>"._NEWSLETTER."</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"content\"><b>"._NEWSLETTER."</b></font></center>"
."<br><br>"
."<form method=\"post\" action=\"admin.php\">"
."<b>From:</b> <input type=\"text\" name=\"NewsFrom\" size=\"40\"
value=\"$adminmail\">"
."<br><br>"
."<b>Subject:</b> <input type=\"text\" name=\"NewsSubject\" size=\"40\"
value=\"Our Newsletter\">"
."<br><br>"
."<b>Include links to the following:</b><br>"
."New Articles: <input type=\"text\" name=\"NewArticles\" size=\"4\"
value=\"5\"> (replaces %NewArticles%)<br>"
."New Downloads: <input type=\"text\" name=\"NewDownloads\" size=\"4\"
value=\"5\"> (replaces %NewDownloads%)<br>"
."New Weblinks: <input type=\"text\" name=\"NewLinks\" size=\"4\"
value=\"5\"> (replaces %NewLinks%)<br>"
."New Sections: <input type=\"text\" name=\"NewSamples\" size=\"4\"
value=\"5\"> (replaces %NewSamples%)"
."<br><br>"
."<b>Text version:</b><br><textarea name=\"NewsText\" cols=\"50\"
rows=\"10\"></textarea>"
."<br><br>"
."<b>HTML version:</b><br><textarea name=\"NewsHTML\" cols=\"50\" rows=\"10
  \">&lt;HTML&gt;&lt;BODY&gt;&lt;/BODY&gt;&lt;/HTML&gt;</textarea>"
."<br><br>"
."<b>Send what?</b><br>"
."<input type=\"radio\" name=\"format\" value=\"text\"> Text only<br>"
."<input type=\"radio\" name=\"format\" value=\"html\"> HTML only
(not recommended)<br>"
."<input type=\"radio\" name=\"format\" value=\"both\" checked> Both"
."<br><br>"
."<b>Send to whom?</b><br>"
."<input type=\"radio\" name=\"type\" value=\"test\" checked> Just this address: <input
   type=\"text\" name=\"TestAddress\" size=\"40\"><br>"
."<input type=\"radio\" name=\"type\" value=\"subscribed\">
"._ANEWSLETTER." ($srow "._SUBSCRIBEDUSERS.")<br>"
."<input type=\"radio\" name=\"type\" value=\"all\"> "._MASSMAIL."
($urow "._USERS.")"
."<br><br>"
."<input type=\"hidden\" name=\"op\" value=\"newsletter_send\"><br>"
."<input type=\"submit\" value=\"Send\">"
."</form>";
    CloseTable();
    include("footer.php");
}

Following is the code that sets up the newsletter to be sent. This pulls the list of downloads, links, and news stories, and constructs the content of your e-mail newsletter. It also pulls the e-mail addresses that the newsletter will go to and puts them into one of the two database tables you created earlier.

[View full width]

function newsletter_send($TestAddress, $NewsFrom, $NewsSubject, $NewArticles,
   $NewDownloads, $NewLinks, $NewSamples, $NewsText, $NewsHTML, $format, $type) {
    global $user_prefix, $prefix, $sitename, $db, $nukeurl, $adminmail;
    $subject = stripslashes($NewsSubject)."";
    $textcontent = stripslashes($NewsText)."";
$htmlcontent = stripslashes($NewsHTML)."";

/* Get new downloads */
$dl = $db->sql_query("SELECT lid,title FROM ".$prefix."_downloads_downloads ORDER BY lid
   DESC LIMIT 0,".$NewDownloads);
$dltext = "";
$dlhtml = "<ul>";
while(list($lid,$title) = $db->sql_fetchrow($dl)) {
$dltext .= "* ".$title.chr(13).chr(10);
$dlhtml .="<li><a
href=\"http://www.scriptinganswers.com/cms/modules.php?name=Downloads&d_
op=viewdownloaddetails&lid=".$lid."\">".$title."</a></li>";
}
$dlhtml .="</ul>";

/* Get new links */
$wl = $db->sql_query("SELECT cid,title FROM ".$prefix."_links_links ORDER BY lid DESC
   LIMIT 0,".$NewLinks);
$wltext = "";
$wlhtml = "<ul>";
while(list($lid,$title) = $db->sql_fetchrow($wl)) {
$wltext .= "* ".$title.chr(13).chr(10);
$wlhtml .="<li><a href=\"http://www.scriptinganswers.com/cms/modules
  .php?name=Web_Links&l_op=viewlink&cid=".$lid."\">".$title."</a></li>";
}
$wlhtml .="</ul>";

/* Get new articles */
$na = $db->sql_query("SELECT sid,title FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 0
  ,".$NewArticles);
$natext = "";
$nahtml = "<ul>";
while(list($lid,$title) = $db->sql_fetchrow($na)) {
$natext .= "* ".$title.chr(13).chr(10);
$nahtml .="<li><a href=\"http://www.scriptinganswers.com/cms/modules
  .php?name=News&file=article&sid=".$lid."\">".$title."</a></li>";
}
$nahtml .="</ul>";

/* Get new sections */
$sa = $db->sql_query("select artid,title FROM ".$prefix."_seccont ORDER BY sid DESC LIMIT
   0,".$NewSamples);
$satext = "";
$sahtml = "<ul>";
while(list($lid,$title) = $db->sql_fetchrow($sa)) {
$satext .= "* ".$title.chr(13).chr(10);
$sahtml .="<li><a href=\"http://www.scriptinganswers.com/cms/modules.php?name=Sections&op=
viewarticle&artid=".$lid."\">".$title."</a></li>";
}
$sahtml .="</ul>";

/* Paste downloads, links, articles into text and HTML */
$textcontent = str_replace("%NewArticles%",$natext,$textcontent);
$htmlcontent = str_replace("%NewArticles%",$nahtml,$htmlcontent);
$textcontent = str_replace("%NewLinks%",$wltext,$textcontent);
$htmlcontent = str_replace("%NewLinks%",$wlhtml,$htmlcontent);
$textcontent = str_replace("%NewDownloads%",$dltext,$textcontent);
$htmlcontent = str_replace("%NewDownloads%",$dlhtml,$htmlcontent);
$htmlcontent = addslashes($htmlcontent);
$textcontent = addslashes($textcontent);

/* what format are we sending? */
switch($format){
case "text":
$formattype="text";
$htmlcontent="";
break;
case "html":
$formattype="html";
$textcontent="";
case "both":
$formattype="both";
}

/* save configuration to database */
$q = $db->sql_query("DELETE FROM ".$prefix."_sanews_config");
$sql = "INSERT INTO ".$prefix."_sanews_config (NewsType,NewsFrom,NewsSubject,NewsText
  ,NewsHTML) VALUES"
."(\"".$formattype."\",\"".$NewsFrom."\",\"".$NewsSubject."\",\"".
$textcontent."\",\"".$htmlcontent."\")";
$q = $db->sql_query($sql);

/* clear send-to table */
$q = $db->sql_query("DELETE FROM ".$prefix."_sanews_send");

/* populate send-to table */
if($type=="test"){
$sql = "INSERT INTO ".$prefix."_sanews_send (SendEmail) VALUES('".$TestAddress."')";
}
else {
$sql = "INSERT INTO ".$prefix."_sanews_send (SendEmail) select user_email FROM "
  .$user_prefix."_users";
if($type=="subscribed"){
$sql .= " WHERE newsletter = 1";
}
}
$q = $db->sql_query($sql);

/* begin sending */
    Header("Location: admin.php?op=massmail_send");

}

Here's the function that displays when the newsletter has been properly sent:

function newsletter_sent() {
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>"._NEWSLETTER."</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"content\"><b>"._NEWSLETTER."</b></font><br><br>";
    echo "<b>"._NEWSLETTERSENT."</b></center>";
    CloseTable();
    include("footer.php");
}

This is the function that actually sends a newsletter. It uses the same type of loop that the old PHP-Nuke newsletter module did, but it sends to only ten addresses at a time. Each address is marked as successful in the database; after sending to ten addresses, the page asks the Web server to reload the page. This is how the page bypasses the 30-second limit: The page continually reloads itself, and each reload gets its own 30-second limit. Using the page, your browser will just seem to run and run and run, but that's okay. If any errors occur, just hit Refresh in your browser; the script won't resend the newsletter to any addresses that have already been successfully processed.

[View full width]

function massmail_send() {
    global $user_prefix, $prefix, $sitename, $db, $nukeurl, $adminmail;

/* output headers which will cause a reload upon completion */
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<center>";

/* retrieve names that need to be sent */
$tosend = $db->sql_query("SELECT SendID FROM ".$prefix."_sanews_send WHERE SendSuccess = 0");
echo "<br><br>Remaining: ".$db->sql_numrows($tosend)."<br><br>(page will redirect in a
   moment)</center>";

/* finished? */
if($db->sql_numrows($tosend) == 0) {
    echo "<script language=\"javascript\">\n";
    echo "<!--\n";
    echo "window.location.href = \"admin.php?op=newsletter_sent\"\n";
    echo "// -->\n";
    echo "</script>\n";
    die();
}

/* retrieve configuration */
$config = $db->sql_query("SELECT NewsType,NewsFrom,NewsSubject,NewsText,NewsHTML FROM "
  .$prefix."_sanews_config");
$row=$db->sql_fetchrow($config);

/* string prep */
$newstype = $row['NewsType'];
$newsfrom = stripslashes($row['NewsFrom']);
$newssubject = stripslashes($row['NewsSubject']);
$newshtml = stripslashes($row['NewsHTML']);
$newstext = str_replace(chr(13).chr(10),"\n",$row['NewsText']);

/* retrieve number of names in batch */
$batchsize = 10;
$tosend = $db->sql_query("SELECT SendID, SendEmail FROM ".$prefix."_sanews_send WHERE
   SendSuccess = 0 LIMIT 0,".$batchsize);

/* go through names in batch */
while(list($uid,$email) = $db->sql_fetchrow($tosend)) {

$msg = new Email($email, $newsfrom, $newssubject);
switch($newstype) {
case "text":
/* build headers and content - TEXT ONLY */
$msg->TextOnly = true;
$msg->Content = $newstext;
break;

case "html":
/* build headers and content - HTML ONLY */
$msg->TextOnly = false;
$msg->Content = $newshtml;
break;

case "both":
/* build headers and content - TEXT and HTML */
$msg->SetMultipartAlternative($newstext, $newshtml);
break;
}

/* send */
#echo "<br>".$newstext."<br><br><pre>".$newshtml."</pre>";
$result = $msg->SendMail();
echo "<br>".$email.":".$result;

/* mark as successful */
$q = $db->sql_query("UPDATE ".$prefix."_sanews_send SET SendSuccess = 1 WHERE SendID = "
  .$uid);
}

/* reload page */
    echo "<script language=\"javascript\">\nv;
    echo "<!--\n";
    echo "window.location.href = \"admin.php?op=massmail_send\"\n";
    echo "// -->\n";
    echo "</script>\n";
    #echo "<br><br><a href=\"http://www.scriptinganswers.com/cms/admin
  .php?op=massmail_send\">MANUAL ADVANCE</a>";

}

Finally, the page winds up with the standard PHP-Nuke structure that coordinates all of the previous functions:

[View full width]

switch ($op) {

    case "newsletter":
    newsletter();
    break;

    case "newsletter_send":
    newsletter_send($TestAddress, $NewsFrom, $NewsSubject, $NewArticles, $NewDownloads,
   $NewLinks, $NewsText, $NewsHTML, $format, $type);
    break;

    case "massmail_send":
    massmail_send();
    break;

    case "newsletter_sent":
    newsletter_sent();
    break;

}

} else {
    echo "Access Denied";
}

?>

And that's it. Now you can send an e-mail newsletter to almost any number of users, right within PHP-Nuke.

Sidebar . FAQ

Help! The newsletter script here doesn't work.

It was written for PHP-Nuke 7.2, using an unmodified installation of PHP-Nuke. Other versions may not work correctly. Double-check your version number.

Also understand that using PHP-Nuke to send mass e-mails isn't the best use of the software. If you have a large mailing list, consider using a free or commercial service like Topica (www.topica.com) to manage your mailing list. They're better set up to handle bigger lists, although they don't integrate directly with PHP-Nuke yet.


Chapter 50. Working with Submissions

PHP-Nuke includes a number of areas where users can submit content to your site. If you're logged into your site as an administrator, you'll see the Waiting Content block, usually on the left side (unless you've moved it). It's pictured in Figure 50.1.

Figure 50.1. The Waiting Content block.

[View full size image]

This block lists waiting news stories (submissions), reviews, links, modified links, broken links, downloads, modified downloads, and broken downloads. You can click any item to be taken straight to the submissions in question, where you can work with them.


Submitted News Stories and Reviews

Figure 50.2 shows the submitted stories waiting for your approval, and Figure 50.3 shows a specific submitted story opened for editing (you get to this screen by clicking the title of any submitted story).

Figure 50.2. Stories waiting for your approval.

[View full size image]

Figure 50.3. Editing a submitted story.

[View full size image]

The submitted story first appears in preview form, where you can see the article as it would look posted on your site (this one isn't very good, is it?). You can edit the poster's name, the article's title, its topic and associated topics, and its category. You can also decide whether the article will be published in the home page and whether you'll allow comments for it. Farther down the page, you can edit the lead-in story text and its extended text, and you also have a box where you can type editorial notes. As with all stories, you can then program it to appear at a specific date and time, if you like, and you can preview the story to see any changes you've made. You can also attach a poll to the article, something your users don't have the option to do when submitting it. If you just don't like the story at all, you can delete it from the list of submitted stories, using the (Delete) link provided.

Submitted reviews look substantially similar to news stories, except that they, of course include the fields associated with a review, such as a product image link or hyperlinks.


Links and Downloads

Figure 50.4 shows a waiting download link; waiting Web links look pretty much the same. You have the option to change any of the details submitted by the user, and a Check link allows you to quickly verify that the download or link is working as submitted.

Figure 50.4. Working with submitted downloads.

[View full size image]

Your users can also edit the details of a download or link, which creates a modification request. Figure 50.5 shows a download modification request; Web link requests look substantially similar. You're shown the "before" and "after" view of the modification so that you can decidevia the appropriate linkswhether to accept or ignore the changes. You can't edit the changes; if you don't like the proposed modifications but agree that some modification is required, you need to ignore the modification request and manually edit the download or link.

Figure 50.5. Working with download-modification requests.

[View full size image]

Clicking the Broken Downloads or Broken Link link in the Waiting Content block takes you to the page where users report "broken" links, where you can check the download or link for yourself. You can click the link or download's name to try to download it on your own, and then click either the Ignore, Edit, or Delete links, as appropriate. The Ignore link removes the broken download or link report, meaning either there was no problem or you've fixed the link. Edit takes you into the link or download's details so that you can fix it, and Delete simply removes both the broken download or link report and the download or link that was reported.


Other Submissions

Some third-party modules also allow users to submit data; these modules may provide their own Waiting Content blocks or some similar functionality. Some of them will even modify the Waiting Content block, but you should be wary of those. Unlike other blocks, Waiting Content is produced by the mainfile.php file, a file which contains many of PHP-Nuke's critical functions. Most third-party modules that want to update the Waiting Content block won't give you an all-new mainfile.php (that would be a bad idea, since it's such a critical file). Instead, they'll give you instructions for manually modifying mainfile.php and pasting their code into the appropriate place. If you're not comfortable doing so, then don't; most modules will work fine, but you might have to remember to manually check them for new submissions from time to time.


Chapter 51. Administering Surveys and Polls

Surveys, pollsas I mentioned in Topic 27, "Using the Surveys Module," PHP-Nuke uses the two terms interchangeably. To get started, you need to create a survey: Select the Surveys/Polls item in the Administration menu. Figure 51.1 shows the entry screen where you'll create a new survey.

Figure 51.1. Creating a new survey.

[View full size image]

Surveys are simple animals: Just provide a title and up to 12 potential answers that your users can choose from. That's it. When creating a new survey, you also have the option to create a new news story to announce the survey: The entry form for a new news story (described in Topic 19, "Using the News Module," by the way) is repeated underneath the new survey area of the page. Closer to the top of the page, you'll find the Delete Polls and Edit Polls links, which, as you might expect, let you delete or edit existing surveys.

Editing a survey is a bit unlike editing other items in PHP-Nuke. As you can see in Figure 51.2, you select the survey you want by using a radio button, and then you click the Edit button. You're presented with a screen that's remarkably like the Add a Survey screen, except that you won't be able to create a news story along with the survey, since the survey already exists and was presumably announced (if you wanted to) when you originally created it.

Figure 51.2. Editing a survey.

[View full size image]

Deleting a survey works the same: Select the survey by using the radio button and click Delete.


Survey Strategies

Surveys can be a quick and easy way to get users more involved with your Web site, without requiring much effort for them to do so. One strategy is to always keep a fresh survey showing on each page of your Web site; you can do so by adding the Survey block to either the left or right columns of the page. Because of its formatting, the Surveys block is an excellent candidate for the Center Up or Center Down positions, which display a block at the top or bottom of the page, respectively, rather than in one of the side columns. Figure 51.3 shows the Center Up position.

Figure 51.3. Putting a survey in the middle of the page.

[View full size image]

Try to put up a new survey once a week, just so there's something fresh for users to respond to. Rename the Surveys module (using Modules in the Administration menu) to something more interesting, like Voting Booth or Your Opinion Counts! You can also consider releasing your surveys with an attached news story so that, for example, a news story each Monday announces a new survey and provides some background information. A survey on favorite rose varieties, for example, might accompany a short piece on a new variety that's doing well in the market.

Keep your surveys fun, to encourage users to respond. Make sure they fit into your site's overall subject, too; a music site, for example, shouldn't run polls about political opinions. Your users come to your site for a reason, which is usually the site's subject matter; keep surveys focused on that subject matter, and users will respond. If you find that users aren't responding to your surveys, try boosting the number of points you give for responses (see Topic 46, "Administering Users, Admins, and Groups," for details on doing so), and post a news story that explains your point system to users and points out how simply responding to a survey can help increase point totals. Be careful there, though, because unscrupulous users can simply respond to a survey multiple times, both "stuffing the ballot box" and artificially increasing their point totals at the same time.

If your users really take a liking to surveys, you might consider disabling PHP-Nuke's built-in Surveys module in favor of a more robust third-party one. phpESP-survey, described at http://sourceforge.net/projects/phpesp/, is a freely available survey tool that, while not integrated with PHP-Nuke, provides more robust statistics and reporting and can be easily integrated into a PHP-Nuke module. In fact, a version of it called Nuke-phpESP is available at http://phpnuke.org/modules.php?name=Downloads&d_op=viewdownload&cid=70, and it should plug right into most versions of PHP-Nuke.

Sidebar . FAQ

How can I make a survey that has multiple questions?

You can't, using PHP-Nuke's included Surveys module. You may want to investigate some of the free and commercial Web sites that allow you to host opinion polls; search Google for "online survey poll" for some current selections.


Chapter 52. Understanding Themes

PHP-Nuke themes are fairly complicated critters; in this topic (and the next couple as well), I introduce you to their basic structure and show you both how you can use themes produced by others and how you can tweak them to meet your needs. I also show you the basics of creating your own theme, although I need to warn you: Theme construction requires fairly good HTML knowledge, including a firm grasp of Cascading Style Sheets (CSS). This book isn't going to teach you HTML and CSS, although there are plenty of other books that can. I'm going to assume you know HTML and CSS; if you start getting into material that reads as gobbledygook, just skip ahead until it starts making sense again!


Theme Basics

Themes all live in your site's Themes folder, with one subfolder per theme. The theme's name is determined by its folder name. Only one file is required in a theme, and that's theme.php. It must appear under the theme's folder. The theme's folder can also include additional files, as needed, including graphics, which are often stored in a subfolder named Images.

theme.php isn't an HTML file, usually. Instead, it's a PHP program, or script, that constructs various portions of the PHP-Nuke interface. Every PHP-Nuke page includes theme.php for the selected theme and asks it to create the HTML for any onscreen elements, such as tables, headers, and so forth.

theme.php must provide certain functions because PHP-Nuke calls these functions and expects each theme to provide them:

  • themeheader() draws the top of the page.

  • themefooter() draws the bottom of the page.

  • themeindex() formats the stories on the home page.

  • themearticle() formats individual news stories.

  • themesidebox() formats blocks.

  • OpenTable() draws the first part of a module, including its title bar.

  • CloseTable() finishes a module.

Additionally, CloseTable2() and OpenTable2() functions are required. These draw a table at a specific pixel width rather than at 100 percent, as the original OpenTable() and CloseTable() functions do.

So, to draw a page, PHP-Nuke first calls on themeheader() and then makes several calls to themesidebox() for the left blocks. Calls to OpenTable() and CloseTable() draw the module content, followed by calls to themesidebox() for the right-side blocks. Finally, themefooter() is called to finish the page.


An Example Theme

As an example, check out this theme.php example. I'll throw in explanations along the way. The first part defines some global colors, using hexadecimal color codes. It also includes a file named tables.php, which contains the OpenTable() and CloseTable() functions. By the way, don't worry about lines that seem to wrap to the next line; PHP-Nuke is okay with that.

<?php

$bgcolor1 = "#FFFFFF";
$bgcolor2 = "#FFFFFF";
$bgcolor3 = "#FFFFFF";
$bgcolor4 = "#FFFFFF";
$textcolor1 = "#000000";
$textcolor2 = "#000000";
$nameoftheme = "Blue";

include("themes/Blue/tables.php");

Here's the themeheader() function. Notice that this includes a file named banners.php, which handles rotating ad banners on the site.

[View full width]

function themeheader() {
    global  $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl,
   $anonymous;
    if ($banners == 1) {
    include("banners.php");}

        cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = "Anonymous";
    }

Here, the script begins defining and outputting the page's main HTML. Here you see the HTML <body> tag, which specifies things like the overall background color.

[View full width]

    echo "<body background=\"themes/Blue/images/background.png\" bgcolor=\"#000000\" text=
  \"#FFFFCC\" leftmargin=\"10\" topmargin=\"10\" marginwidth=\"10\"
marginheight=\"10\">";

    if ($username == "Anonymous") {
    $theuser = "<a class=\"header\" href=\"modules.php?name=Your_Account&op=new_user
  \">Register</a>";
    } else {
    $theuser = "$username";
    }

                        $datetime = "<script type=\"text/javascript\">\n\n"
            ."<!--   // Array ofmonth Names\n"
            ."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."
  \",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."
  \",\""._OCTOBER."\",
\""._NOVEMBER."\",\""._DECEMBER."\");\n"
            ."var now = new Date();\n"
            ."thisYear = now.getYear();\n"
            ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
            ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" +
   thisYear);\n"
            ."// -->\n\n"
            ."</script>";

In the following code, you can see that a file named header.html is being loaded. This theme actually uses static HTML files for most of the theme's elements, making it easier to work with those elements in an HTML editor like Microsoft FrontPage. header.html contains the initial HTML table, the site's logo, and so forth.

Notice that the function also calls the PHP-Nuke public_message() function, which displays the messages you've configured to display at the top of the page.

Then you'll see a call to block(left), which asks PHP-Nuke to provide the full content for the left column. Next, the file left_center.html is included. It contains only a couple of HTML tags: It closes the table cell that makes up the left column of blocks, and it creates the table that makes up the center module content.

                $public_msg = public_message();
    $tmpl_file = "themes/Blue/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    blocks(left);
    $tmpl_file = "themes/Blue/left_center.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

The following is the function that draws the bottom of the page, themefooter(). Notice that this includes a file named center_right.html, which closes up the bottom of the module content and begins the table cell that holds the right column of blocks. Then the script asks PHP-Nuke to build the right blocks via a call to blocks(right), after which the footer of the pagecontained in footer.htmlis included.

function themefooter() {
    global $index, $foot1, $foot2, $foot3, $foot4, $copyright, $totaltime, $footer_message;
    if ($index == 1) {
    $tmpl_file = "themes/Blue/center_right.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    blocks(right);
    }
    $tmpl_file = "themes/Blue/footer.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
                    echo "<center>\n";
        $footer_message = footmsg();
            echo "</center>\n";
            echo "<br>\n";
}

This function draws the news stories for the front page. You can see toward the end that it uses another HTML file, story_home.html, to provide the majority of the HTML formatting; this function is passedby PHP-Nukeall the information about the story (time, title, informant, and so forth); this function simply formats that information as desired.

[View full width]

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes,
   $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $tipath;
    if ($notes != "") {
    $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
    $notes = "";
    }
    if ("$aid" == "$informant") {
    $content = "$thetext$notes\n";
    } else {
    if($informant != "") {
        $content = "<a href=\"modules
  .php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">
$informant</a> ";
    } else {
        $content = "$anonymous ";
    }
    $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
    }
    $posted = ""._POSTEDBY." ";
    $posted .= get_author($aid);
    $posted .= " "._ON." $time $timezone ($counter "._READS.")";
    $tmpl_file = "themes/Blue/story_home.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

Similar to the previous function, themearticle() accepts the story details in variables and then creates a formatted display. It uses an HTML file named story_page.html to contain most of the formatting, and then it simply adds in the story's details and text.

[View full width]

function themearticle ($aid, $informant, $datetime, $title, $thetext,
$topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid, $tipath;
    $posted = ""._POSTEDON." $datetime "._BY." ";
    $posted .= get_author($aid);
    if ($notes != "") {
    $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
    $notes = "";
    }
    if ("$aid" == "$informant") {
    $content = "$thetext$notes\n";
    } else {
    if($informant != "") {
        $content = "<a href=\"modules
  .php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">
$informant</a> ";
    } else {
        $content = "$anonymous ";
    }
    $content .= ""._WRITES.":<br><br>$thetext<br>$notes\n";
    }
    $tmpl_file = "themes/Blue/story_page.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

This short function draws a single block. PHP-Nuke provides the block's title and content in variables; this script uses an HTML file named blocks.html to provide the formatting. This is the same technique used by the previous functions, but it might be easier to understand here since this is such a short function.

function themesidebox($title, $content) {
    $tmpl_file = "themes/Blue/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

?>

Here's the HTML contained in blocks.html. See how the HTML itself contains $content and $title? That's where the block's title and contents, as passed in by PHP-Nuke, are inserted. This technique allowed me to create this file in FrontPage and to just type $title and $content where I wanted those elements to appear. I can change the theme at any time by just changing blocks.html and the other static HTML files; they serve as templates and contain most of the theme's actual formatting.

<!--- Begin block -->
<table border="0" width="180" id="block" cellspacing="0" cellpadding="0">
    <tr>
        <td valign="top" bgcolor="#4c71bd" class="blocktitle" width="180">
        $title</td>
    </tr>
    <tr>
        <td valign="top" width="180" class="blockcontent">$content</td>
    </tr>
    <tr>
        <td valign="top" height="20" width="180">&nbsp;</td>
    </tr>
</table>
<!-- End block -->

Of course, not all themes work this way. In the next topic, I show you how to work a third-party theme into your site, and after that, I show you how to tweak a theme that you've acquired to meet your needs. Hopefully, this topic has given you some idea of how a theme is built, although I certainly don't expect you to start constructing one from scratch!


Chapter 53. Installing a Third-Party Theme

Adding themes to your Web site is simplicity itself: Simply copy the folder provided with the theme into the Themes folder of your site. So, if you have a new theme called Rainbow, simply copy the Rainbow folder into the Themes folder. Doing so makes the theme available for selection either in your site's preferences or, if you allow users to select their own theme, in the users' Your Account module.

Many Web sites that host PHP-Nuke themes provide graphical previews of them so that you can see the theme before downloading and installing it. Figure 53.1 is an example of such a preview.

Figure 53.1. Previewing themes at TheThemes.net.

[View full size image]


Theme Tips

There are a number of things to consider when selecting a theme:

  • Obviously, consider the overall look. Does it fit well with your subject matter? Does it convey the impression that you want people to have of your site? A corporate site is often best with bold colors and a white background; computer gaming sites favor darker backgrounds and intricate graphics.

  • Is the theme a one- or two-column theme? Some themes provide only a left or right column of blocks; that's fine if you design your site for that. But if you have a lot of blocks, two columns of themone left, one rightwill make each page more compact and usable.

  • Does the theme use Flash? Some themes incorporate Macromedia Flash animations. While these can look cool, they do require users to have the Flash player installed. Many do, but some don't; consider your audience before selecting a theme that incorporates Flash.

  • How easily can the theme be customized? Commercial themes (ones you pay for) should come with source graphics, often in Photoshop format, so that you can make any changes you like.

  • Is the theme exclusive? Exclusive themesones sold only to youare more expensive, but nobody else will have a site like yours. If you don't pick an exclusive theme, at least try to pick one that doesn't look like every other site on the Web; your site should have its own look and identity.

  • How wide is the theme? Most users today have at least 800x600 resolution, although 1,024x768 is increasingly common. IT professionals and computer hobbyists may have a significantly higher resolution. A theme designed for 800 pixels wide will look tiny on a 1,280x1,024 monitor; on the other hand, design your site for 1,200x800, and users stuck at 800x600 will be scrolling up, down, left, and right to see everything. Know your audience and, when in doubt, aim for the lowest common denominator.

  • Check out every aspect of your site in a theme. Remember that some pagesnotably, the Reviews moduleuse odd color combinations that may be unreadable. At least be willing to tweak the theme, if necessary, to overcome any color problems.

Sidebar . FAQ

Are there any themes designed for the visually impaired?

I've not personally seen any, but some may exist. You need to carefully define what visually impaired means. For example, someone with difficulty making out small images or text may prefer to use a magnification utility like the one included in newer versions of Microsoft Windows; someone with difficulty distinguishing among colors may not need a special theme at all if you can pick a theme that avoids their problem colors.

Other accessibility concerns include theme size. For example, a user who has trouble manipulating a mouse may find it especially difficult to scroll horizontally a great deal, meaning you'll want to design your site to avoid horizontal scrolling. As always, knowing your audience and accepting feedback from your users is important.

One site that sells commercial themes is www.templatemonster.com. They have an entire section of PHP-Nuke themes, ranging from a few free ones to ones costing $100 or more. While they might not be your choice for buying a theme, they do offer enough variety that you can start to form some opinions about what you like and don't like about themes, allowing you to make a better final choice for your site.

Why not use one of PHP-Nuke's dozen or so built-in themes? Only because your site will look pretty generic. Most new PHP-Nuke sites use one of the default themes, so they're widely recognized by Web users.


Chapter 54. Tweaking a Theme to Meet Your Needs

If you're like meeven a little bitwhat you really want to know about this theme stuff is "How do I get one up and running as quickly as possible?" I admire you: You're a person of action. Let's do it.

The absolute, flat-out easiest way to quickly customize a theme to meet your needs is to just change the graphics and colors. In other words, find a theme that has the basic layout you like, and then modify its graphics and colors to suit you. I use the Sunset theme, which is included with PHP-Nuke, as an example. You'll find this theme, not surprisingly, in the Themes folder of your PHP-Nuke Web site, in a subfolder namedyou knew thisSunset. The theme has one main file, theme.php, a Style subfolder, and an Images subfolder.


Modifying Text Elements

The Style subfolder has only one important file, named style.css. Let's start there. The contents of the file are as follows (ignore the funny way the lines wrap because PHP-Nuke ignores it, too):

[View full width]

FONT        {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 10px}
TD      {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 10px}
BODY        {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 10px}
P       {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 10px}
DIV     {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 10px}
INPUT       {BORDER-TOP-COLOR: #000000; BORDER-LEFT-COLOR: #000000; BORDER-RIGHT-COLOR:
   #000000; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px;
   FONT-SIZE: 10px; BORDER-BOTTOM-WIDTH: 1px; FONT-FAMILY: Verdana,Helvetica;
   BORDER-RIGHT-WIDTH: 1px}
TEXTAREA    {BORDER-TOP-COLOR: #000000; BORDER-LEFT-COLOR: #000000; BORDER-RIGHT-COLOR:
   #000000; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px;
   FONT-SIZE: 10px; BORDER-BOTTOM-WIDTH: 1px; FONT-FAMILY: Verdana,Helvetica;
   BORDER-RIGHT-WIDTH: 1px}
SELECT      {BORDER-TOP-COLOR: #000000; BORDER-LEFT-COLOR: #000000; BORDER-RIGHT-COLOR:
   #000000; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px;
   FONT-SIZE: 10px; BORDER-BOTTOM-WIDTH: 1px; FONT-FAMILY: Verdana,Helvetica;
   BORDER-RIGHT-WIDTH: 1px}
FORM        {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 10px}
A:link          {BACKGROUND: none; COLOR: #004080; FONT-SIZE: 10px; FONT-FAMILY: Verdana,
   Helvetica; TEXT-DECORATION: underline}
A:active        {BACKGROUND: none; COLOR: #004080; FONT-SIZE: 10px; FONT-FAMILY: Verdana,
   Helvetica; TEXT-DECORATION: underline}
A:visited       {BACKGROUND: none; COLOR: #004080; FONT-SIZE: 10px; FONT-FAMILY: Verdana,
   Helvetica; TEXT-DECORATION: underline}
A:hover         {BACKGROUND: none; COLOR: #004080; FONT-SIZE: 10px; FONT-FAMILY: Verdana,
   Helvetica; TEXT-DECORATION: underline}
.title      {BACKGROUND: none; COLOR: #000000; FONT-SIZE: 14px; FONT-WEIGHT: bold;
   FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none}
.content    {BACKGROUND: none; COLOR: #000000; FONT-SIZE: 10px; FONT-FAMILY: Verdana,
   Helvetica}
.block-title    {BACKGROUND: none; COLOR: #FFFFFF; FONT-SIZE: 10px; FONT-FAMILY: Verdana,
   Helvetica}
.storytitle     {BACKGROUND: none; COLOR: #363636; FONT-SIZE: 12px; FONT-WEIGHT: bold;
   FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none}
.storycat   {BACKGROUND: none; COLOR: #FFFFFF; FONT-SIZE: 10px; FONT-WEIGHT: bold;
   FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: underline}
.boxtitle   {BACKGROUND: none; COLOR: #363636; FONT-SIZE: 10px; FONT-WEIGHT: bold;
   FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none}
.boxcontent     {BACKGROUND: none; COLOR: #000000; FONT-SIZE: 10px; FONT-FAMILY: Verdana,
   Helvetica}
.option     {BACKGROUND: none; COLOR: #000000; FONT-SIZE: 10px; FONT-WEIGHT: bold;
   FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none}
.tiny       {BACKGROUND: none; COLOR: #000000; FONT-SIZE: 10px; FONT-WEIGHT: normal;
   FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none}

Gobbledygook, right? Not so! First you have to learn how to pick this thing apart. Each style element consists of a name and then several style properties enclosed in curly braces. So the following is a single style element:

[View full width]

INPUT       {BORDER-TOP-COLOR: #000000; BORDER-LEFT-COLOR: #000000; BORDER-RIGHT-COLOR:
   #000000; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px;
   FONT-SIZE: 10px; BORDER-BOTTOM-WIDTH: 1px; FONT-FAMILY: Verdana,Helvetica;
   BORDER-RIGHT-WIDTH: 1px}

The stuff in the braces is pretty easy to figure out:

  • The top border will be black (#000000).

  • The left, right, and bottom borders will also be black.

  • The borders will be 1 pixel thick.

  • The font will be 10 pixels high.

  • The font family, or name, is Verdana, by preference. Users who don't have that font can use the more generic Helvetica, which is a standard sans-serif font.

Easy, right? All of those style properties apply to an element named INPUT, which means the <INPUT> HTML tag. In other words, all input fieldstext boxes, buttons, and whatnotwill be displayed using these style parameters. You'll notice additional elements for TD, which covers table cells; BODY, which is the main body text for a page; and so forth. You don't need to mess with these beyond changing the colors (the #000000 means black) and, if you like, the font sizes. You can also add a style property, FONT-COLOR=#00000, to specify a font color of black (or whatever color you prefer). Just remember to keep each style property separated by semicolons, as shown in the previous example.

How can you make colors? Well, all color, as you learned in school, is composed of red, green, and blue, which is sometimes called RGB (we're referring to additive, or light-based, color, as produced by a computer monitor). So in #000000, you're getting zero parts red, zero parts green, and zero parts blue, for black. It's hexadecimal, so the numbers go from the usual 0 to 9 and then A to F, with A representing 10, B 11, and so forth. #FFFFFF represents full-on red, green, and blue, which makes white. #FF0000 is pure red, #00FF00 is pure green, #0000FF is pure blue. What do you get when you mix #FF0000 and #0000FF? Red and blue make purple, or #FF00FF. You get the idea. Play around.

You'll also see elements in style.css that start with a period, such as this one:

[View full width]

.boxtitle   {BACKGROUND: none; COLOR: #363636; FONT-SIZE: 10px; FONT-WEIGHT: bold;
   FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none}

This is a special type of element called a class. You modify it in exactly the same way, so you don't really even need to worry about the different. But if you're interested, here it is: Most of PHP-Nuke's pages are made up of HTML tables. The <TD> tag is the basic unit of a table and specifies a single table cell. You'll notice that the style.css file has only one TD element (and it can have only one), but PHP-Nuke displays many different types of tables. Text in a block, for example, is different than the text in the middle of the page, yet both are made up of <TD> tags. What gives?

The trick is that PHP-Nuke (well, each theme, really) draws tables with classes attached. So a tag named <TD class="boxtitle"> won't display using the normal TD style from style.css; it displays with the style specified for .boxtitle, shown earlier. So, as you can see, you need to do a bit of experimentation. Simply modify style.css, upload it over the existing one, and view your Web site. Decide which of your changes worked and which didn't, and repeat the process until you're happy with the final result. By modifying the style.css file, you can control the appearance of textual elements, such as (obviously) text, form controls, buttons, and so forth. Modifying graphics takes a slightly different approach.


Modifying Graphical Elements

The style's Images folder contains all of its graphics. For example, Figure 54.1 shows the logo.gif file from the Sunset theme. Figure 54.2 shows where that graphic fits into the theme: at the top of each page.

Figure 54.1. The logo.gif graphic file.

[View full size image]

Figure 54.2. logo.gif as it appears on the site.

[View full size image]

So, if you want to change the site's logo as it appears at the top of the page, simply provide a new logo.gif in place of the old one. You're on your own for coming up with a new graphic, but here's a tip: Some graphics in PHP-Nuke themes can be of any size; logo.gif is one of them (more or less; obviously, something truly enormous wouldn't look good). Some graphics, however, need to remain at their specific size.

For example, notice the Modules block in Figure 54.2? It has nice, blue, rounded corners. If I right-click precisely on that rounded corner and select Properties from my browser's pop-up menu, I'll see that the image's location is www.scriptinganswers.com/cms2/themes/Sunset/images/right4.gif, its width is 5 pixels, and its height is 19 pixels. This is all useful information: If I want to change that graphic, I now know that I need to change the righ4.gif file. I also know that my replacement should be 5x19 to fit within the same place in the theme; anything bigger or smaller might mess up the theme.

As I said, you're on your own for actually coming up with graphics. If you're not very good with the graphics thing (many folks aren't, which is why graphics designers have jobs), start with a theme that's mostly text based and uses very few graphics. That way, you won't have much to change when tweaking the theme to meet your needs.

Sidebar . FAQ

Is changing a theme difficult?

It can be, especially if you've never worked with HTML. Some themes are constructed from multiple files, which makes it tough to figure out exactly where you'd make a change. I recommend starting off with a preconstructed theme (many are included with PHP-Nuke, for example) and then make small changes, one at a time, so that you can see the results of those changes on your Web site. If you spend some time experimenting, you'll eventually get the hang of it. Remember to make a backup copy of any theme you modify so that you always have the option of copying the original theme back in and undoing all of your changes.


Part IV. The PHP-Nuke Forums

Team LiB

Part IV: The PHP-Nuke Forums

Managing Forums and Categories

Managing Forums Settings

Using a Forum

Moderating a Forum

Managing Forums Security

Maintaining the Forums


Chapter 55. Managing Forums and Categories

PHP-Nuke's Forums module is actually an entirely other piece of software, called phpBB, that has been integrated into PHP-Nuke. In fact, selecting the Forums item on the Administration menu takes you into a decidedly different-looking screen, shown in Figure 55.1.

Figure 55.1. The Forums administration menu.

[View full size image]

For now, click on Management in the Forum Admin section on the left side of the screen. This takes you into the basic Forums administration, where you need to start by creating a new category. Remember that the Forums module is organized into categories, each of which can contain multiple forums, which can, in turn, contain multiple topics, or conversations. Forums are generally fairly narrow in focus, which helps keep conversations on track; categories serve to organize forums around some logical theme.

For example, in Figure 55.2, you can see that I've created four broad categories: Recipes, Restaurants, Products, and Special Diets. These broadly organize the various forums in those subject areas. Under each category, I have a box that lets me create a new forum in that category; at the bottom is another box allowing me to create a new category.

Figure 55.2. Setting up Forums categories.

[View full size image]

Also notice that you can use Move Up and Move Down to change the order in which your categories are listed. Figure 55.3 shows the screen you're taken to when you create a new forum within a category. Here, you provide a brief text description of the forum, which will help users understand its subject.

Figure 55.3. Creating a new forum within a category.

[View full size image]

You can also change the forum's status: A locked forum is one that only administrators can access; an unlocked forum is the usual kind, allowing users to read and post new topics. You also have the option of enabling autopruning. This function checks every specified number of days and removes topics that haven't been posted to in a specified number of days. In Figure 55.3, I'm configuring this forum to remove all topics that have been inactive for 30 or more days, although I'm checking only every 90 days. That means an inactive topic could sit around for as long as 90 days before being removed. The values you specify depend on your users and your site: Especially busy sites should remove inactive topics more frequently, to conserve database room. Otherwise, it's nice to leave topics sitting around longer so that new users have something to review when they join your site.

Figure 55.4 shows the final result in the users' view of the Forums module. Note that categories containing no forums are not displayed; only those categories with at least one active forum are displayed in this page. Users cannot post directly to a category; they can post only to forums, and categories serve to organize those forums.

Figure 55.4. What users see in the Forums module.

[View full size image]

Here's a tip: If you think there's a chance that users might be confused about where to post something, offer advice in the forums' descriptions. For example, in the description for my Desserts forum, I've suggested that diabetic recipes might be better posted elsewhere. These topics help users to keep their posts in the right spot, and that helps other users find the information they're looking for. You can, of course, return to any category or forum later by clicking the Edit button in the Forum Administration screen, allowing you to rename forums or categories, or allowing you to change autopruning settings or forum status settings.

You're not ready to start using your forums yet. Sorry about that. Before your Forums module will behave correctly, you need to configure several general administration parameters, which I cover in the next topic.

Sidebar . FAQ

Do I have to create categories for my forums?

Yes. You need to have at least one category, which, if you like, can contain all of your forums. However, using categories to organize your forums can help users select the most appropriate forum for their discussions, which will help keep conversations focused and on track.

Can I change category names later?

Absolutely! You can rename categories or forums any time you like. Just go back into the forums management page and select the category or forum that you want to rename.


Chapter 56. Managing Forums Settings

The Forums module comes with several general administration areas that you'll need to configure. However, most of these are one-time settings, meaning you can configure them and then forget them. You'll find the various general administration sections on the Forums module's main administration screen, under the General Admin section on the left side.


Avatar Management

Avatars are little graphics shown next to a user's posts within the Forums. Avatars can be photos, cute little cartoons, or anything else; users select their own avatars through the Your Account module. PHP-Nuke comes with an avatar gallery, which is a bunch of cartoon-style avatars that users can select from; you can also allow users to upload their own avatars (although doing so can present security concerns; see Topic 65, "Securing PHP-Nuke," for suggestions).

The Forums module's Avatar Management section simply allows you to delete these user-upload avatars if they're no longer in use within the forums. Doing so can free up a small amount of disk space, since these avatars are stored on your server.


Backup Database and Restore Database

These options only back up or restore Forums-related data; using this option can sometimes be quicker than backing up the entire PHP-Nuke database. However, because the Forums are so tightly integrated into the rest of PHP-Nuke, there is some danger in restoring just the Forums data, so it doesn't make much sense to back up just the Forums data. I recommend that you check out Topic 43, "Backing Up Your Site and Database," for information on backing up and restoring the entire PHP-Nuke database, and I recommend that you do that instead of using the Forums module's Backup or Restore options.


Configuration

Here's the big section of general administration. In this section, shown in Figure 56.1, you'll configure all of the Forums module's most important settings:

  • Domain Name. This is your domain name, such as www.mysite.com.

  • Server Port. This is your server's HTTP port. About 99.999 percent of the time, the default value of 80 will be correct, and you shouldn't change this unless you know darn well what you're doing. Entering an incorrect value can make your Forums module inaccessible.

  • Script Path. Leave this at the default of /modules/Forums unless, again, you know darn well what you're doing.

  • Site Name. This should be the same as your domain name, unless you'd like to provide a more English-looking name. For example, if your domain is named luv2binfl.com, you might name the site Love To Be In Florida, since that's clearer. Do not leave this at the default MySite.com because it can prevent your Forums from working correctly and result in access deniedtype errors for your users.

  • Site Description. Enter anything you like here in the way of a brief description of your site.

  • Disable Board. This option allows you to disable the Forums module for maintenance. Only administrators will be given access.

  • Enable Account Activation. Leave this set to None; PHP-Nuke handles user account activation.

  • User E-mail Via Board. I recommend leaving this at Disabled; turning it on allows users to send e-mail to one another via the Forums module, which can be a kind of security risk. Users could potentially spam other users via your site, which isn't something you want to allow.

  • Flood Interval. Some users will attempt to automatically post topics to your Forums; often these posts are for mortgages, pornography, and other spam-related messages. Spammers often use software to post these messages; the Flood Interval can curb their effectiveness by requiring users to wait a specified number of seconds in between posts. A real user would never be impacted by the default of 15 seconds because it would take them that long to read a post and formulate a reply; automated software, on the other hand, will have yet another speed bump in the way of spamming your site.

  • Topics Per Page and Posts per Page. These settings govern how many topics or posts are displayed at a time; the defaults create a good screenful of information for your users.

  • Posts for Popular Threshold. This is the number of posts a topic must receive to be considered "popular" and receive the special Popular icon in the topic listings.

  • Default Style. Don't change this option; PHP-Nuke governs the theme of the Forums module. Note that the Forums module does use a different set of theme files than the rest of PHP-Nuke, but a PHP-Nuke theme can include these theme files (many do).

  • Override User Style. Leave this at Yes to prevent users from selecting their own theme for the Forums module.

  • Default Language. This simply affects the default display of the Forums module; it doesn't translate posts. PHP-Nuke ships with language files for several languages.

  • Date Format. The default of D M d, Y g:i a displays dates as "Mon Jan 02, 2003 3:02 p.m." You can change this format; refer to http://us2.php.net/date for the various letter codes you can use and for a description of what they display. For example, to display dates and times as "01/02/2003 15:02," you would use d/m/Y H:i instead.

  • System Time Zone. Indicate the time zone that your server is in. If your server is hosted by someone, ask for the appropriate setting here.

  • Enable Forum Pruning. Set this to Yes to enable autopruning, which I discussed in the previous topic. The default, No, prevents old topics from ever being removed from the database.

  • Cookie Domain. This should match your domain name.

  • Cookie Name. Don't use the default; doing so can create login issues for your users. I recommend setting this to your domain name, without any leading "www" or any trailing "com," "net," "org," or whatever.

  • Cookie Path. Leave this at the default of /.

  • Session Length. This governs the number of seconds a user can be inactive before the Forums module realizes they've gone away. This contributes to the display, on the main Forums module screen, of how many users are online at once. The default, 1 hour (3,600 seconds) is usually fine.

  • Private Messaging. I recommend setting this to the same setting as the Private_Messages module in PHP-Nuke itself.

  • Max Posts. These three settings control how many posts a user can have in their Inbox, Sentbox, or Savebox within private messaging. Lower these from their defaults of 100 to help conserve database space.

  • Max Poll Options. Users can attach polls to their forum posts; this controls the maximum number of options the poll can have. These are totally separate from the PHP-Nuke Surveys module.

  • Allow HTML. I recommend setting this to No; see Topic 65 for details. Allowing HTML can open certain security vulnerabilities that are best left closed; users can still use special BBCode tags instead of HTML to format their messages.

  • Allowed HTML. If you allow HTML, list the tags (separated by commas) you'll allow users to post. The default of b,i,u,pre allows HTML tags that are functionally the same as the BBCode tags provided in the Forums module.

  • Allow BBCode. This alternative to HTML allows users to perform simple formatting on their messages; it is recommended over HTML.

  • Allow Smilies. If this is enabled, the Forums module will provide some built-in emoticons, or smilies, that users can add to their posts.

  • Smilies Storage Page. Leave this at the default to use the smiley graphics that come with PHP-Nuke.

  • Allow Signatures. Users can define a standard signature, which the Forums module inserts at the end of their posts, if you allow signatures.

  • Maximum Signature Length. If you allow signatures, limit them to 255 characters or less, to keep posts from becoming bloated with oversize signatures.

  • Allow Username Changes. Set this to No; PHP-Nuke doesn't deal well with username changes, although the phpBB software that makes up the Forums does allow the option.

Figure 56.1. The Forums module's General Configuration screen.

[View full size image]

The next few settings cover avatars, which I explained earlier. You can enable various types of avatars; I recommend allowing gallery and remote avatars, but not allowing avatar uploading. That being said, you can leave everything else at the defaults to use PHP-Nuke's built-in avatar gallery.

The COPPA settings aren't used by PHP-Nuke; this functionality is included in the basic phpBB software so that minors have a way of submitting parental approval to use a set of forums. However, because user registration is accomplished through PHP-Nuke, not phpBB, this functionality isn't available to you.

Finally, the E-mail settings aren't critical. Fill in the Admin Email address, and leave everything else at the default; most of this functionality in phpBB is overridden by PHP-Nuke, which you configure elsewhere.


Mass E-mail

This function allows you to send an e-mail to your Forums module users; I recommend using PHP-Nuke's Newsletter module instead (covered in Topic 49, "Sending an e-Newsletter"). The Newsletter module ain't great, but the Forums module's Mass E-mail function isn't appreciably better.


Smilies

You can enable or disable smilies in the General Configuration (discussed earlier); this option from the Forums module's Administration menu allows you to add, edit, and remove individual smilies. As shown in Figure 56.2, quite a few smilies are included with PHP-Nuke. You can also see the text that must be typed for the Forums module to insert the smiley; for example, typing :D within a forum post results in a big smiley face being inserted in place of the :D.

Figure 56.2. The smilies included with PHP-Nuke.

[View full size image]


Word Censors

You can censor out offensive words in the Forums module. Generally, you'll enter these words along with a replacement. For example, if you find the word Belgium offensive (not that I do), you'd enter something like what I've done in Figure 56.3. Any occurrences of Belgium will be replaced by Be****m within forum posts. What, you thought I'd use an actual offensive word? This is a family book!

Figure 56.3. Configuring a censor list.

[View full size image]


Chapter 57. Using a Forum

Using the Forums module is pretty straightforward once it's set up (as I described in the previous two topics). Users start out on a screen that looks something like Figure 57.1, showing the available categories (Recipes and Restaurants) and the available forums.

Figure 57.1. The main Forums module screen.

[View full size image]

Also notice that this screen shows the number of private messages the user has waitingnone, in this example. Finally, links are provided to the in-forum search feature, the user's profile within the forums, and so forth.

Icons are used to indicate forums' status:

  • A white icon indicates that no new posts have been made since the user's last visit.

  • A yellow icon indicates new posts in a forum.

  • A lock indicates that the forum is inaccessible to ordinary users.

Keep in mind that the icons can be changed as part of a theme.


Posting a Topic

Within a forum's topic listing, users can click the New Topic button to start a new conversation. As shown in Figure 57.2, you provide a title, or subject line, and then the body of your post. At any time, you can highlight a section of text and click one of the buttons: B to turn the highlighted text boldface, I for italics, U for underline; Quote to format the text as a quotation; Code to format the text as program code; and so forth. Scrolling down a bit allows you to enter a poll question and one or more poll options (answer choices) to attach to your posting.

Figure 57.2. A new forum topic.

[View full size image]

After entering the post, users either can preview it to see what it would look like with all the formatting applied or can just post it. Figure 57.3 shows the final message, which now includes a Post Reply button, allowing a reader to add to the conversation. Also notice the Quote button, which allows another user to create a reply with the original message already filled in and formatted as a quote. This technique allows replies to include a small portion of the original text, helping to set the context for the reply. The user who posted a message, along with moderators, will see an Edit button, allowing the message to be edited. The X button, also available to the poster and moderators, erases the message but not the entire topic.

Figure 57.3. Viewing a forums post.

[View full size image]

Posting a reply works just like posting a new message, except that the original conversation is available in a scrolling box, allowing the poster to review the conversation thus far and, if desired, copy short passages of text out of it.


Reading the Forums

Another posting option, given to administrators and moderators, is to post an announcement or a sticky. The option is located just above the Add a Poll option when posting a new topic; as shown in Figure 57.4, these receive special treatment in the topics listing.

Figure 57.4. Listing the topics in a forum.

[View full size image]

Figure 57.4 shows the topic listing users see when they click on a forum name from the main Forums module screen. Sticky posts remain at the top of the list and receive a special message icon; use stickies to keep a particular topic, like forum rules, at the top of the topics list. Similarly, announcements receive a special icon and show up at the top of the list. Other icons include these:

  • A yellow icon for topics with a recent reply

  • An animated yellow icon for posts that have enough replies to qualify as "popular"

  • A white icon for posts with no new replies since your last visit

  • An animated white icon for "popular" posts with no new replies

  • A yellow lock for locked topics with new replies

  • A gray lock for locked topics with no new replies

The Mark All Topics Read link marks all topics with new replies as having been read, meaning the new replies will now be considered old replies, and the topics will appear with the appropriate white icon rather than a yellow icon.

Here's a tip: Clicking on the small icon just after the user's name, under the Last Post column, takes you directly to the latest reply in the topic. It's a quick way, especially in long topics, to get to the most recent material.


Other Forums Options

The Forums module also contains its own search feature, accessible through the Search link at the top of most pages in the module. This search function is quite advanced, allowing users to search for specific keywords, a particular author, and so forth. Searching can be restricted to a particular forum or category, to posts within a certain time range, and so forth. The search can also look at topic titles and text, or just the text, and results can be sorted in a variety of ways.

The Forum FAQ is prepopulated with answers to frequently asked questions regarding the Forums module. Unfortunately, most of these FAQs are more applicable to the standalone phpBB software from which the Forums module is derived, not to PHP-Nuke itself. Personally, I went into my site's theme files and found the Forum FAQ link by searching for that text, and then I deleted the link, thereby removing the functionality.

Users can also access their forum profile, which extends the normal PHP-Nuke profile normally accessible through the Your Account module. In addition to the normal Your Account profile data, the forum profile allows users to configure a number of forum-specific options:

  • Users can elect to be notified via e-mail whenever someone replies to a topic to which the user has posted.

  • Users can be notified when new private messages are received and can elect to receive those notifications in a pop-up window (which is disabled by most browsers' pop-up blockers, unless the browser is told to allow pop-up windows for your site).

  • Users can configure a signature and have it automatically appended to their posts.

  • Users can individually disallow HTML or BBCode, provided you've allowed one or both in the forum configuration.

  • Users can select an avatar image for themselves, by either uploading one, selecting one from the gallery, or providing the URL to one, depending on which avatar method you've allowed in the forum configuration.

Sidebar . FAQ

Why would I allow HTML or BBCode?

HTML is a great way for experienced users to produce better-formatted messages, meaning they can add boldface and so forth to their posts. However, HTML can also be used to include client-side scripts in posts, despite PHP-Nuke's attempt to filter out the script-related HTML tags. BBCode was invented to provide basic HTML-like formatting, without the potential dangers. If you use PHP-Nuke's built-in formatting buttons for boldface, italics, and so forth, you'll see BBCode. It produces text like [b]this[/b] (which would make the word this boldface).

What are avatars?

Avatars are small graphics (usually about 80 pixels wide and 80 pixels high) that represent a user. Users might choose from an appropriate cartoon, use a small photo of themselves, or even display something that represents a favorite hobby, like a football or a chef's hat. While avatars can make your forums more personable and fun, they do have a potential downside: Nobody gets to preview the avatar graphic, so it's possible for users to upload a graphic that's offensive or inappropriate. If that happens, ask the user to change her avatar, or disable her user account.


Chapter 58. Moderating a Forum

Moderators help take some of the burden off of managing the forums (assuming, that is, that you're not the only moderator). Moderators generally make sure that the forums are being used appropriately, deleting inappropriate messages, and moving messages, if necessary, into a more appropriate forum. In the next topic, I show you how to make a user into a moderator, but keep in mind that, as the site administrator, you're automatically considered a moderator in the Forums module.

Generally, only moderators have the ability to post stickies and announcements, two tasks I described in the previous topic. Moderators' other primary capabilities come from a set of four icons shown at the bottom of each topic. You can see them in Figure 58.1, underneath the link Watch This Topic for Replies. Keeping in mind that some PHP-Nuke themes replace these icons (so they might look a bit different on your site), here's what they do:

  • The X icon deletes the entire topic, including the original post and all replies.

  • The Arrow icon moves the topic into a different forum. When doing so, you have the option to leave a shadow topic behind in the original forum. The shadow topic shows up in the original forum's topic lists, as shown in Figure 58.2 (with the phrase "Moved" in the title), but it links to the topic in its new location. The purpose of the shadow is to help users who've been posting to the topic find it in its new location.

    Figure 58.2. Moving a topic and leaving a shadow topic behind.

    [View full size image]

  • The Lock icon locks the topic, preventing future replies but leaving the topic in-place as a read-only reference for users.

  • The Broken icon splits a topic. Sometimes topics will grow too large to read easily, or they'll diverge from their original subject. The split option allows a moderator to create a new topic, in a different forum or the same forum. The split topic can contain only selected posts from the original topic (thus moving off-topic posts into a new topic with an appropriate title), or the split can start at a specific post and contain all subsequent posts (thus moving posts that went off on a tangent).

Figure 58.1. Moderator options are shown below each topic.

[View full size image]

Additional, per-post moderator options are available in the header of each posting. There are three:

  • An Edit button, which allows a moderator to edit a post. This is often done to remove or tone down objectionable content.

  • An X button, which deletes just that post, leaving the remainder of the topic intact.

  • An IP button, which displays the IP address of the person who posted the message. The IP display actually lists the total number of posts from that IP address and a list of all users who have been seen using that IP address. It's not unusual for multiple users to be associated with a single IP address; services like America Online frequently aggregate their users behind a relatively small pool of IP addresses. One cool option is the Look Up IP Address link shown next to each listed address: This option resolves the IP address and gives you some clue to who that address belongs to; the owner will generally be an Internet service provider (ISP) like a phone company, a cable company, America Online, Earthlink, or similar entity.

Moderatorsincluding youhave some great abilities to keep your forums organized. Try recruiting some trustworthy, active users from your site to be moderators. By moving topics or splitting them as appropriate, your forums will remain better organized, easier to read, and easier to use, all of which encourage your users to use the forums more frequently.

Sidebar . FAQ

Why is moderating necessary?

Sometimes it isn't. If your users are well behaved and follow your rules, you might never need to use your moderating powers. On the other hand, moderating is sometimes needed to remove inappropriate posts, move posts that have gone off-track into a more appropriate forum, and so forth.

How many moderators can I have?

As many as you want. Some especially large, busy sites may have an assigned or volunteer moderator for each forum, allowing one person to keep on top of that forum to make sure it remains organized and that the discussion stays on-track.


Chapter 59. Managing Forums Security

The Forums module has its own flexible (and slightly complex) security system built right in. You access the first part of this system by selecting Permissions, under Forum Admin, on the Forums module's main Administration menu. You then select a forum to work with.

By default, forums are in Simple Permissions mode, which allows you to make the forum available to the following:

  • Everyone (Public) who has access to the Forums module.

  • Registered users only.

  • Registered users only, with the forum itself hidden. Users must know its direct URL to access it.

  • Moderators only.

  • Moderators only, with the forum hidden.

  • Administrators only.

  • Administrators only, with the forum hidden.

The idea behind hidden forums is that they won't tempt users who don't have access to them.


Advanced Permissions

Putting a forum into Advanced Permissions mode results in the screen shown in Figure 59.1. Here, you can select ALL, REG (for registered users), MOD (for moderators), or ADMIN (for administrators) for each of several possible activities:

  • Viewing topics in the topic list

  • Reading topics' text

  • Posting a new topic

  • Replying to a topic

  • Editing a topic

  • Deleting a topic

  • Posting sticky topics

  • Posting announcement topics

  • Voting in attached polls

  • Attaching polls to a topic

Figure 59.1. Advanced Permissions mode in the Forums module.

[View full size image]

These give you the flexibility to set up forum permissions almost any way you want.


User Permissions

A way to get more specific with permissions is to select Permissions under User Admin. Here, you can control per-forum permissions on a per-user basis. For example, Figure 59.2 shows a user being given moderator permissions over a specific forum.

Figure 59.2. Managing per-user permissions.

[View full size image]

Once again, an advanced mode is available, providing more complete and granular control over the specific permissions assigned to a user.


Group Permissions

Managing permissions on a per-user basis, however, can be time-consuming and error-prone, simply because you have to enter so much information that you're bound to make a mistake eventually. That's why the Forums module also supports group-based permissions. Under Group Admin, you can select Management to create groups, modify their membership, and so forth. By default, only one group exists: Moderators. Each group has a description and a user assigned as the group's moderator. Groups can be open, meaning they're shown to all users and users can elect to join them, or closed, meaning they're shown but users can't add themselves. You can also designate groups as hidden, making them available only to you for management purposes.

Groups can be granted permissions in much the same way as individual users, making the group and its members moderators of a specific forum.

How do you get users into groups? There are a couple of ways. As I've mentioned, for open groups, users can add themselves, using the Usergroups link at the top of most Forums module pages. You can also manually edit a user's group memberships by selecting Management under the Users item on the left side of the Forums module's administration page. Note that, in the latest version of PHP-Nuke, some of the group-management options still aren't working correctly; you may run into some SQL errors from time to time. In those cases, try to work around the problem as best you can until the module is updated.


What's a Moderator?

Members of the default Moderators group are, by default, considered moderators of every forum you create. That means they can perform forum-moderation tasks, which I discussed in Topic 58, "Moderating a Forum."


Chapter 60. Maintaining the Forums

Other than the day-to-day Forums module moderation I discussed in Topic 58, "Moderating a Forum," the Forums module doesn't require much in the way of maintenance. The one thing you'll want to do on occasion, however, is prune the forums. You can set PHP-Nuke to do this automatically on a per-forum basis (see Topic 55, "Managing Forums and Categories," for instructions), or you can do it manually.

Just click Pruning under Forum Admin on the Forums module's main administration menu. You can prune all the forums or select a specific one. As shown in Figure 60.1, you specify the number of days that you consider a topic to be inactive; the pruning process removes topics that have been inactive for that long.

Figure 60.1. Pruning the Forums module.

[View full size image]

So how does this work? Let's say I post a topic to a forum and it's incredibly popular. People post replies to it over and over, keeping it going for a year. Then one day everyone loses interest. Thirty days go by without a single reply. If I then prune that forum (or all forums) and specify an age of 30 days, my popular post will be gone.

Regular pruning is a good idea. Like trees, pruning helps cut away dead material and make room for new material to grow. Personally, I recommend the hands-off approach: Configure your forums to autoprune, and stop worrying about it.

Sidebar . FAQ

What happens if I don't prune the forums?

Nothing horrible. If you don't prune occasionally, your database will continue to grow in size, since it's the database that contains the forums discussions' actual text. If disk space isn't a concern, you can prune much less often, especially if your forums aren't very active. However, larger databases will also become slower over time, which is another reason to prune at least every so often.


Part V. Advanced PHP-Nuke Topics

Team LiB

Part V: Advanced PHP-Nuke Topics

Fixing Common Errors

Moving a PHP-Nuke Site to a New Host

Creating a Pay Subscription Site

Working with the PHP-Nuke Database

Securing PHP-Nuke

Upgrading PHP-Nuke

Last-Minute Changes


Chapter 61. Fixing Common Errors

This topic is all about what to do when something goes wrong, at least for the common things that happen to PHP-Nuke.


Installation Errors

These errors will typically occur while trying to run PHP-Nuke's setup script, which creates the PHP-Nuke database and populates it. Note that many hosting provides don't give their users enough permissions to run this script; in those cases, you need to get the hosting provider to install PHP-Nuke for you. Many provide a Web-based control panel that will do this; simply ask your provider what you should do to get PHP-Nuke running if it isn't immediately apparent to you.

You're Getting Database Errors

These usually take the form of a cryptic message containing phrases like fetch_row or something; they're usually indicative of a database connection error. Check to make sure that you've entered the correct server name (often just localhost if the database server is the same as the Web server), username, and password. Also, as described earlier, make sure you've actually got permissions to be creating new databases and whatnot.

You Added a Module, and You Can't Access it

Check the file permissions of the new module. Make sure the folder of the module, and its files, are set to give World or Everyone the Read permission. If you're accessing your site's files through an FTP client (like my favorite, BatchFTP, from www.batchftp.com), just right-click the file or folder and select Properties to check the permissions.

You Can't Log In Because the Graphical Security Code Is Missing

Yeah, this is a pain. The most likely cause is that your server (or hosting provider) didn't install a PHP library known as GD, which is responsible for producing that graphical image. You need to either install it (on your server) or talk to your host (to get them to install it on theirs). These days, this is a pretty rare error, but it does crop up.

You can also create a simple PHP page on your Web site. Name it info.php, and put the following text in it:

<?php
Echo phpinfo();
?>

Then point your Web browser to that Web page. Scroll down a bit until you see a line labeled GD Support and one named GD Version; if you see them, you've got it. If not, you don't. You can also manually disable the security code requirement by opening the config.php file that came with PHP-Nuke and changing the $gfx_check variable to equal zero (0). Then you should be able to log on.

Your Users Aren't Getting Confirmation E-mails

This is your server's fault. Its mail server isn't configured correctly. Either fix it, if it's your server, or talk to your hosting provider about the problem. Once it's fixed, you can use the NSN Your Account Tweak to resend those missing confirmation e-mails. Or, if you don't have the tweak, there's a special module at http://ravenphpscripts.com/download-file-59.html that can resend all of the confirmation e-mails.

Your Users Can't Access the Forums; They Get "Invalid Session"

You need to configure the Forums module, which is done within it. Modify the settings and set the cookie domain so that it matches your site's domain. Also change the cookie name to match your Web site's name, without the "www" and "com" portions of the Web site's name (so www.mysite.com would have a cookie name of mysite).

You Erased Your Admin Account or Lost the Password

Oh, dear. One fix for this is to go put the user back into the Authors table of PHP-Nuke manually; I discuss the basics of that in Topic 64, "Working with the PHP-Nuke Database." Set the password column to dc647eb65e6711e155375218212b3964 (you'd best type that carefully), and log in with the password Password; then immediately change your password to something more creative and less easy to guess. This is a good tip from the PHP-Nuke HOWTO at http://phpnuke.org/modules.php?name=PHP-Nuke_HOWTO&page=administrator-password-lost.html.

For a forgotten password, delete all existing entries in the Authors table, and then point your Web browser to the admin.php page of your site. You'll be prompted to create a new admin user. Make certain you use a different name than the last user, which you just deleted, to keep things working smoothly.


Day-to-Day Errors

I don't mean to imply that PHP-Nuke has a lot of daily errors! But these errors are more common in the normal course of things rather than specifically during installation or just afterward. Most commonly, errors occur because of database corruption, in which case the best solution is to restore your database (or a single table) from backup, a task I discussed in Topic 43, "Backing Up Your Site and Database." You do make regular backups, right?

For other errors, your best bet is probably to search the forums at www.phpnuke.org. Odds are, someone else had the problem and has fixed it, and you can take advantage of their brilliance. Or, if nobody seems to have run into your special issue, post a new message and ask for help. But please look for the solution before posting; folks on Forums get understandably irritated when they're asked to answer the same question ten times for ten different people just because they're all too lazy to go looking for the answer.


Chapter 62. Moving a PHP-Nuke Site to a New Host

The time may come when you're ready to move your site to a new servereither your own, or a new hosting service. Perhaps you've simply outgrown your old server and need a beefier one, or perhaps you've found a less expensive hosting service that you want to use. No problem: PHP-Nuke is a relatively easy thing to move around. Start by making a backup of your entire database and of all your site files.


Moving Your Site

Start by uploading your site files to their new location. If you're using a hosted service, you may have to do this by using the IP address assigned to you by the hosting service, because your domain name (something like www. mywebsite.com) will still be pointing to your old server.

Next, you need to restore your site database to the new server's database server. Generally, this is something your new hosting company should be happy to help you within fact, some hosting companies will handle the entire database- and file-move process for you, which is a definite feature you should look for when considering a new hosting service. If you're running your site from your own server, simply use your database server's administration tools to back up the database from the old server and restore it to the new server. Consult the database administration tools' documentation for details (for example, if you're running the MySQL database software, you can check www.mysql.org for documentation on backing up and restoring databases).

You'll probably feel the urge to test your new site, but testing at this point can be difficult. After all, your domain name is still pointing to the old server, not the new one. In general, you can conduct a basic test simply by typing your new server's IP address (remember, if you're using a hosting service they'll have given you your address when you signed up; if you're hosting your own server then you should already know its IP address) into the address bar of your Web browser. That'll usually get you to your site, but because you're using an IP address and not your domain name, everything (like sending e-mail) might not work correctly.

A more comprehensive test would be to modify your computer's hosts file. On a Windows computer, it's located in \ Windows\ System32\ Drivers\ Etc. Open the file in Windows Notepad; it'll usually contain only one entry: 127.0.0.1 localhost. Simply add another entry, first listing your new server's IP address, then a space, and then your full domain name (www.mywebsite.com, for example). Save your changes, and you may need to restart your computer. On Windows XP and Windows 2000 computers, you can open a command line window and run ipconfig /flushdns instead of restarting. Now you should be able to type your domain name into a Web browser and get the new server, because the hosts file is providing the correct new IP address. When you're done testing, be sure to put the hosts file back the way you found it! Normally, the Internet Domain Name System (DNS) will provide the IP address, not the hosts file.


Moving Your Domain Name

The big trick to a server (or hosting service) move is changing the Internet DNS to point your domain name to your new server's IP address instead of the old one's. Exactly how you go about doing this depends entirely on one factor: where your domain name "lives."

You see, your domain name has to "live" on two specific DNS servers, which are generally maintained by your hosting company (if you're using one) or your Internet service provider (ISP). Whoever maintains those DNS servers has to change them to have your new server IP address, rather than your old one. If you're hosting your own servers, you may be able to accomplish this yourselfcheck with your ISP or network administrator, and if you're also hosting your own DNS servers, check the DNS software documentation.

If you're hosting with a hosting service, however, your old service probably won't continue handling DNS for you after you've left them. Your new hosting service will probably be able to pick up DNS, but now you'll also have to tell the whole Internet that not only has your site changed places, but so has your DNSthe means by which everyone finds your site to begin with. That's okay, because the Internet has a process for moving domain names between DNS servers, too. This is something your new hosting service will definitely have to help out with, however, because there are several combinations of situations they may have to deal with. You may have to pay them an additional fee, as well, to move your domain name to their servers.


Chapter 63. Creating a Pay Subscription Site

Somewhere in versions 7.0 or 7.1, PHP-Nuke gained the ability to handle subscriptions. In other words, registered users pay you a fee to gain special access to your Web site for a specified period of time, after which their subscription expires and they go back to being a regular user. Earlier, I showed you that module and block access could be restricted to allow only subscribers in (check out Topics 10, "Controlling Access to Modules," and 37, "Selecting and Using Built-In Blocks").

So how do users get to be subscribers? Well, for starters, their entry in the PHP-Nuke users table (which I briefly discuss in the next topic) is marked as Subscriber. Also, the user gets an entry in the Subscriptions table, listing the user's expiration date. After that, PHP-Nuke handles the rest.

So how do you get the tables updated? One way is manually: Go to the Administration menu, click Edit Users, and enter the username to modify (this is easier if you have the NSN Your Account Tweak, which I covered in Topic 32, "Adding the NSN Your Account Tweak"). As shown in Figure 63.1, you can set the user to be a subscriber for a period of one to ten years.

Figure 63.1. Making a user a subscriber.

[View full size image]

If you'll have only a few subscribers, that's not so bad. But it might be nice to have something more automated. For example, PayPal (www.paypal.com) is a popular credit cardprocessing service, and they offer recurring subscription sales capabilities. You can automate your site so that PayPal automatically notifies PHP-Nuke when a subscriber signs up, and notifies PHP-Nuke again when the subscriber renews or cancels. You just need to plug something into PHP-Nuke to accept those notifications and update the PHP-Nuke database appropriately.

To do so, you'll just need to create a new PHP page that examines the HTTP headers coming from the PayPal secure server. Perform a modulus check on the incoming key to ensure the integrity of the data, and then rip the data into individual variables. This all happens in post-back, of course, so you'll have to make sure… oh, wait. What a pain that all is.

Head over to www.nukescripts.net, the folks who brought you the NSN Your Account Tweak. They make a commercial PayPal add-in for PHP-Nuke, which they sell for a paltry $5. The add-in actually works with their NSN Groups add-in, which sort of supplants the PHP-Nuke subscription system and gives you more flexibility.

Other plug-ins accomplish the same thing. One, aMember (http://membership.cgi-central.net/scripts/amember/), works with PHP-Nuke and with a variety of payment providers, including PayPal, 2Checkout, CCBill, and more. It costs moreabout $140 for the standalone product, which doesn't include the PHP-Nuke integrationbut it does have a lot more flexibility and capability. If you really are a PHP guru and want to write your own scripts to automate the subscription process, check with your payment processor. For example, PayPal provides a page at www.paypal.com/cgi-bin/webscr?cmd= p/pdn/intro-outside that teaches developers how to integrate with their Instant Payment Notification (IPN) system; other payment processors should provide similar documentation if they have this capability.

Once you've got your users marked as subscribers, you simply need to create content areas for them by marking specific modules or blocks as Subscribers Only in the Modules and Blocks portions of the Administration menu.

Sidebar . FAQ

How does PayPal work?

Generally, they keep between 2 and 4 percent of whatever you charge and then pass the rest on to you. They use a system called Instant Payment Notification (IPN) to inform your Web site that a subscription was purchased; that's how the PayPal module from NukeScripts.Net is able to instantly add new subscribers to specified user groups.

If you're interested in PayPal, check them out. Carefully read their terms and conditions because some Web sites (typically those offering mature content, although there are other restricted categories) aren't permitted to use their services.


Chapter 64. Working with the PHP-Nuke Database

Do you care about databases? Can't get enough? This is the chapter for you. However, if you couldn't care less, feel free to skip this chapter. Under normal circumstances, you'll never need to mess around directly with the database, and doing so is a little bit like pulling on random wires under the hood of your car: You can break stuff. But if you're comfortable with databases, it might be useful for you to understand how PHP-Nuke's is laid out.

For the purposes of illustration, I'm going to assume some things about you. First, you're using MySQL as your database engine. That's common enough to be a good assumption, although if it's not true for you, you'll still understand and be able to use most of what follows. Second, you're accessing your database through a Web-based graphical interface like phpMyAdmin, which is shown in Figure 64.1. Most hosting providers will offer this to you as a part of their service.

Figure 64.1. Accessing MySQL via phpMyAdmin.

[View full size image]

PHP-Nuke has about a ton of tables. Each table has a prefix, usually "nuke_," and then a main table name. Here's what they do:

  • Authors contains the administrators for your site, including their permissions.

  • Autonews contains news items that are scheduled to be published but haven't been published. These items are copied into the Stories table when published.

  • Banner stores banners defined on your site.

  • Bannerclient lists the banner clients for your site.

  • Bb_auth_access includes authorization and access information for the forums.

  • Bbbanlist lists users banned from the forums.

  • Bbcategories lists the forum categories.

  • Bbconfig contains the forums configuration.

  • Bbdisallow lists disallowed users in the forums.

  • Bbforum_prune lists the forums pruning schedule, which is used to remove old topics from the forums.

  • Bbforums lists the forums in the forums.

  • Bbgroups lists the user groups in the forums.

  • Bbposts contains the header information about each forum post.

  • Bbposts_text contains the text of each forum post.

  • Bbprivmsgs lists private message headers.

  • Bbprivmsgs_text lists the text for private messages.

  • Bbranks lists the various user ranks you set up, based on the number of posts a user has contributed.

  • Bbsearch_results, Bbsearch_wordlist, and Bbsearch_workdmatch list data for searches in the forums.

  • Bbsessions lists the current users accessing the forums.

  • Bbsmilies lists the "smilies" available in the forums.

  • Bbthemes lists the themes available in the forumsargely overruled by PHP-Nuke's own theme system.

  • Bbthemes_name lists the names of the themes in the forums (see Bbthemes, above).

  • Bbtopics lists the topics in the forums.

  • Bbtopics_watch lists the topic watches that users have defined for themselves in the forums. This list allows the forums to notify a user when someone posts to a "watched" topic.

  • Bbuser_group defines the users who belong to specific forums groups.

  • Bbvote_desc holds the polls that can be attached to forums posts.

  • Bbvote_results holds the results of forums polls.

  • Bbvote_voters holds the users who have responded to forums polls.

  • Bbwords lists words that aren't to be used in the forums.

  • Blocks defines the active blocks on the site, along with their location.

  • Comments holds comments to news stories.

  • Config holds the basic PHP-Nuke configuration parameters.

  • Confirm holds confirmation codes for users.

  • Counter holds basic statistics for the Statistics module.

  • Downloads_categories lists the categories you define for the Downloads module.

  • Downloads_downloads lists the actual downloads in the Downloads module.

  • Downloads_editorials holds editorials added to the Downloads module.

  • Downloads_modrequest lists modification requests for the Downloads module.

  • Downloads_newdownload lists user-submitted downloads to the Downloads module.

  • Downloads_votedata lists user ratings of downloads in the Downloads module.

  • Encyclopedia lists categories for the Encyclopedia module.

  • Encyclopedia_text lists the actual Encyclopedia module entries.

  • Ephem holds ephemerals for the Ephemerals module.

  • Faqanswer lists entries for the FAQ module.

  • Faqcategories lists FAQ categories for the FAQ module.

  • Groups defines the user groups and their point levels.

  • Groups_points defines the points awarded for specific actions on the site.

  • Headlines stores RSS newsfeeds so that PHP-Nuke doesn't have to pull them down for each user.

  • Journal stores Journal module entries.

  • Journal_comments stores user comments for journal entries.

  • Journal_stats stores use ratings for journal entries.

  • Links_categories stores categories for the Web Links module.

  • Links_editorials stores editors you add to the Web Links module.

  • Links_links stores entries in the Web Links module.

  • Links_modrequest contains modification requests for the Web Links module.

  • Links_newlink contains user-submitted entries for the Web Links module.

  • Links_votedata contains user ratings for the Web Links module.

  • Message stores the messages you define in the Administration menu.

  • Modules lists the available modules, their access permission, and so forth.

  • Pages contains the entries for the Content module.

  • Pages_categories contains the categories for the Content module.

  • Poll_check lists the IP address and time for each poll response.

  • Poll_data lists responses for polls.

  • Poll_desc lists the description for polls.

  • Pollcomments lists user comments for polls.

  • Popsettings is used by the now-defunct Webmail module.

  • Public_messages lists public broadcast messages.

  • Queue contains user-submitted news stories.

  • Referrer is used to store referrers to your site.

  • Related lists stories that are related to other stories.

  • Reviews holds all content for the Reviews module.

  • Reviews_add lists user-submitted entries for the Reviews module.

  • Reviews_comments lists comments for the Reviews module.

  • Reviews_main defines the name and description of the Reviews module.

  • Seccont contains the content of the Sections module.

  • Sections lists the categories in the Sections module.

  • Session lists currently active sessions on the site.

  • Stats_date, Stats_hour, Stats_month, and Stats_year hold statistics for the Statistics module.

  • Stories holds the News module's content.

  • Stories_cat defines news categories.

  • Subscriptions holds information on expired usersspecifically, their expiration date.

  • Topics defines the topics used by the News module.

  • Users lists all active users of the site.

  • Users_temp lists all users awaiting confirmation to become active.

Whew. Obviously, this is for version 7.3 as upgraded from v6.9; your list of tables may vary slightly. Also, as you add modules like the Event Calendar or add-ins like the NSN Your Account Tweak, they'll add more tables for their own purposes. Few modules will modify existing PHP-Nuke tables, though, which is a good thing since it helps keep PHP-Nuke "pure" and prevents problems with future PHP-Nuke upgrades, which will assume the PHP-Nuke tables are at their defaults.

So what good is this information? Here's an example: Every month, I reset the group points earned by all of my users. Right now, I'm doing that manually by running a query, as shown in Figure 64.2. This resets the point totals for the following month's point-earning contest.

Figure 64.2. Running a query in phpMyAdmin.

[View full size image]


Chapter 65. Securing PHP-Nuke

PHP-Nuke has a bit of a nasty reputation when it comes to security, but it's not all bad news. For one, later versions7.3 and beyondreally correct a lot of bugs. A forthcoming version, 7.5 (which should be out by the time you read this), promises to focus heavily on security.

So how bad is it? Well, I don't know that a Fortune 500 company wants to run their public, commercial Web site on PHP-Nukebut PHP-Nuke was never designed with that in mind. One technique is to ban the IP addresses of folks who try to hack your Web site, a feature being added to PHP-Nuke in the 7.4 to 7.5 timeframe (although PHP gurus can modify the PHP-Nuke files in earlier versions to add IP banning). You can also talk to your Web hosting service about banning IP addresses; some may offer a feature for doing so.

Another way is to disable uploads to your Web site. PHP-Nuke includes only a couple of upload capabilitiesnamely, in the forums' avatar graphics. Disable that feature, and you'll close a lot of potential vulnerabilities (see the topics on Forum Administration for details on doing so).

A good way to test for vulnerabilities is to run the current version of the analyze.php script, which you simply upload to your Web site and then visit as if it were a normal Web page (point your Web browser to it, in other words). You can get the script from http://phpnuke.org/modules.php?name=PHP-Nuke_HOWTO&page=test-scripts.html or http://nukecops.com/downloads-file-13-details-Analyzer.html.

By the Way

The Nuke Cops Web site, www.nukecops.com, is a great site to visit regularly. It's the official site of the PHP-Nuke development team, so lots of goodies tend to pop up there.

Keep in mind that a PHP-Nuke Web site has a number of vulnerability points, and you'll need to regularly check for security updates to each of them:

  • PHP-Nuke itself. Download fixes from www.phpnuke.org or www.nukeresources.com.

  • Your database engine, which is typically MySQL. Go to www.mysql.com for details, or, if you're using a hosting provider, ask them to install any outstanding security fixes.

  • Your Web server, which is usually Apache. Hosting providers should be installing the latest fixes for you; ask them if they have. The official Web site, www.apache.org, highlights recent fixes.

  • The PHP-Nuke language, which is documented at www.php.net. Again, this is something a hosting provider should keep updated, if you're using one.

  • Your server operating system, which varies. Hosting providers will need to keep this up-to-date.

Another security trick: Open your site's config.php file and change the security key from the default. In fact, do this as soon as you start using your site. You can change the $sitekey variable to contain anything you want, but don't leave it at the default, and don't use a simple word or phrasemake it at least as long as it started out.

In the forums, disable HTML and enable BBcode. BBcode provides similar formatting features while avoiding the security concerns associated with HTML in forums posts. To help eliminate file uploads, remove the modules/WebMail/ mailattach.php file (it won't be present unless you've installed or upgraded from an older version). You'll find a number of other good security tips at http://phpnuke.org/modules.php?name=PHP-Nuke_HOWTO&page=security-measures.html.

Scared yet? Let's look at the absolutely worst-case scenario: Your site is hacked. Depending on the hacker, three things can occur:

  • The hacker will learn information about your site, up to and including encrypted user passwords. Using relatively straightforward (although somewhat time-consuming) techniques, hackers can turn encrypted passwords into clear-text passwords. Because many users will use the same password everywhere on the Internet, the hacker could then attempt to log on to other Web sites, impersonating your users.

  • Slightly less bad, the hacker defaces your Web site. This can be undone by resorting to your backups. You did make backups, right? I showed you how in Topic 43, "Backing Up Your Site and Database."

  • Similarly, the hacker could wipe out your Web site. See Topic 43 for details on restoring your site from your backups. I know you made backups.

How much of this is a problem? Well, obviously, giving away your user passwords is pretty bad. But honestly, it's why your users should use different passwords for each site, no matter how painful that is. Try to help your users understand that, and you'll be doing them a big favor. Having your Web site wiped out or defaced is bad, but how bad depends on the Web site. If you're just using the Web site to share information on games or cooking, it'll be more frustrating that catastrophic; if you use PHP-Nuke to host an ultrasecure Web site where CIA spies check in, then you're probably kidding yourself. Use something different (but send me your site address first, please).

The very, very, very best thing you can do is to upgrade to new versions of PHP-Nuke, since each incorporates new security fixes. I'm pretty lazy about upgrading, skipping two to three versions at a time. But you'll do better because you care about security. I cover upgrading in Topic 66, "Upgrading PHP-Nuke," by the way, and you'll find it to be a fun and invigorating process. Well, at least not a difficult process.

So is that all I have to say about security? Well, um, yeah. It's not that security isn't importantbelieve me, I get on top of tables all the time and yell about itit's just that it's complicated. Stuff like cross-site scripting, path disclosure, and so forth is interesting only if you're in the industry. If you're just planning to use PHP-Nuke to put up a small portal site with a few thousand users or so, you're probably going to be fine, as long as you follow some of the practical advice I outlined here, keep updated on PHP-Nuke versions, and select a Web host that'll work to keep their software patched and updated.

Another consideration is that, while PHP-Nuke doesn't have perfect security, there's not much you're going to be able to do about it. It is what it is; you kind of have to either accept the product as is and continue to upgrade as it gets better, or you'll have to decide not to use it. PHP-Nuke has continued to become more and more secure, but it will probably always have flaws. All software has flaws. The ever-changing nature of PHP-Nuke makes it difficult to even keep up with the flaws that have been fixed, although www.phpnuke.org is a good place to start reviewing that information.


Chapter 66. Upgrading PHP-Nuke

New versions of PHP-Nuke are released every few months. Generally, each new version introduces one or two major new features, a bunch of bug fixes and minor improvements, and so forth. Old, unused modules may be removed, while newer modules are added.

By the Way

When you upgrade to a new version, your modules never disappear. So if you're using the WebMail module, which isn't included in new versions of PHP-Nuke, that module will continue to exist after the upgrade. The upgrade simply won't fix any bugs or anything that may be present in the module, but the old version of the module will continue to work.

Because upgrading your site can be a major undertakinghundred of files have to be uploaded to your site, for exampleyou probably won't upgrade to every new version. Personally, I wait about every three to four versions to upgrade, unless there's some killer new feature that I just have to have on my site.

The upgrade process is pretty simple. First, back up your site and its database. If I could print just one thing in giant red, blinking text with hooting alarms, that'd be it. Use any means at your disposal to back up the site's files. If you're hosting your own server, it'll be easy; if you're using a hosting service, try software like BatchFTP (www.batchftp.com) to download all of your site's files onto your local computer. Back up your database, too, using either PHP-Nuke's built-in routines for doing so or other means provided by your hosting service. Topic 43, "Backing Up Your Site and Database," addresses backup procedures in more detail.

I'm really not kidding. Don't even read any further until you've got a backup. Seriously.

Second, you need to get the new version's files onto your Web server (download the new version from www.phpnuke.org). You backed up the old files, right? Okay. If you host your own server, you can usually decompress the new version of PHP-Nuke right onto your Web server. Versions are typically distributed in ZIP files, which can be decompressed into the individual files quite easilyconsult your system documentation for details on doing so. If you're hosting your site with a service provider, you will probably need to download the ZIP file to your local computer and extract it there. Use a program like WinZIP (www.winzip.com) to extract the ZIP file into its individual files; on Windows XP and higher, simply right-click the ZIP file and select the Extract option from the pop-up menu.

The ZIP file expands into a set of subfolders: Only the ones named HTML and Upgrade need to be copied to your Web site. The HTML subfolder actually contains the new PHP-Nuke version: the Modules folder, the Admin folder, the Blocks folder, and so forth. Use a program like BatchFTP to copy these up to your Web site. The Upgrade folder should be uploaded to your server as well and placed into the top-level folder.

Next, you need to upgrade your database. To do so, run every upgrade script that's applicable. So, if you're currently on version 6.9 of PHP-Nuke and you're upgrading to version 7.3, you'll run these scripts in this order:

  1. upgrade69-70.php

  2. upgrade70-71.php

  3. upgrade71-72.php

  4. upgrade72-73.php

To run the script, just provide the correct path to it in a Web browser: www.yoursite.com/upgrade/7.x/upgrade72-73.php, for example. Run each upgrade script in order to apply the necessary database changes. Figure 66.1 shows the folder structure PHP-Nuke uses for the upgrade scripts.

Figure 66.1. Upgrade scripts for PHP-Nuke.

[View full size image]

Finallyand this is really importantdelete the entire Upgrade folder from your Web site. Once the upgrade is complete, it doesn't need to be there, and it could present a security risk for it to remain on your sitesomeone else could run those scripts and mess up your database something fierce.

So those are the basic steps: back up, copy files, run upgrade scripts, delete upgrade scripts. Then, of course, you'll want to test your site to make sure everything's working properly. Deactivate any new modules you don't want to use (or don't have time to set up right now), and you should be ready to go.


Chapter 67. Last-Minute Changes

As promised, PHP-Nuke continues to evolve. As I was finishing the manuscript for this book, version 7.4 was just released, although you can continue to download earlier versions (remember, I covered v7.3 in this book).

Version 7.4 introduces some interesting changes:

  • The Ephemerids module and block, which not many folks used, has been removed, although you can still download it separately and add it on as a "third-party" module and block.

  • The Sections module, which I quite like, has been eliminated and merged into the Content module. I don't like that because the Sections module provided, in my opinion, a more attractive navigation interface. I do understand that the Content and Sections modules pretty much overlapped one another in terms of functionality, though.

  • An IP addressbanning system was added, allowing you to ban specific IP addresses from accessing your site. This has been a popular add-in function for many sites, especially where the administrators take exception to a particular user or catch someone trying to hack their site.

By the time you read this bookit takes a long time to cut down the trees necessary to print itversion 7.5 will be out, introducing a score of new bug fixes, minor cosmetic changes, and probably a few major changes like the ones listed earlier. That's the beauty of PHP-Nuke: It continues to evolve and grow to meet the demands of its users.

Early word, for example, is that v7.5 will restructure the module administration so that each module's administration is self-contained. That's a major structural change in PHP-Nuke, which currently separates modules and their administrative functions into separate folder hierarchies. Does that mean this book is useless? Naw. Most of the administration will still work the same, it'll just be laid out differently in the folders of your site. Installing new modules will be a bit different, too. And you don't have to upgrade immediately. Lots of sites out there are still back on v6.9, which was very stable and offered a lot of great functionality. It's often easier to find add-on modules and blocks for older versions because they've been around longer. In fact, before upgrading PHP-Nuke, you must make sure that every add-in module and block that you have is compatible with the new version, and that can sometimes take the add-ins' authors a few months to figure out.


Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]


SYMBOL

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

# of Users to List Per Page option (YAT Users Configuration screen)
$content variable 2nd
$db object variable
$module_name variable 2nd
2Checkout


A

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

access control
anonymous users
Content module
registered users
setting up 2nd
subscribed users
types of sites 2nd
accessing
forums
common errors
modules
common errors
accessing forum profiles
Forums module 2nd
Activate (Add a New Block section, Administration menu)
Activate Ultramode setting (Administration Menu, General Site Info section)
configuration
activation
content pages
activation options for users
configuration
ActiveSync
Add a New Download section (Downloads Administration screen)
Add a New Encyclopedia Term entry page
Add a New Page section (Administration Menu)
Add a Survey screen 2nd
Add Link option (Web Links module)
Add New Article screen
writing stories 2nd 3rd 4th 5th
Add Story icon (Administration Menu)
adding
third-party blocks
additive color
Addon-Sample module
Addon_Sample module 2nd 3rd 4th
shortcut
AddonSample() function
admin accounts
common errors 2nd
Admin folder
admin.php page
administration
admins 2nd
banners 2nd 3rd 4th
alternate text
applications
clients 2nd
impressions
users
categories 2nd 3rd
content
activating new pages
adding new pages 2nd
categories 2nd
HTML tags 2nd
strategies for using Content module 2nd
Events Calendar module 2nd
forums 2nd 3rd
maintenance 2nd 3rd
managing settings 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th
moderators 2nd 3rd 4th
security system 2nd 3rd 4th 5th 6th 7th 8th
groups 2nd
messages
configuration 2nd
HTML tags 2nd
NukeAmazon
polls 2nd
stories 2nd
creating and scheduling stories 2nd
managing topics 2nd
topic and category strategies 2nd
understanding structure 2nd
user access 2nd
user's views 2nd
surveys 2nd 3rd
multiple questions
Survey block
topics 2nd
creating and scheduling stories 2nd
managing topics 2nd
topic and category strategies 2nd
understanding structure 2nd
user access 2nd
user's views 2nd
user groups 2nd
users 2nd
Administration Menu
Add a New Page section
Banners icon
Blocks Administration screen 2nd 3rd
configuration
Banners Options section
General Site Info section 2nd
Miscellaneous Options section
Multilingual Options section
Content icon
Edit Admins
Edit Admins icon
Edit Users icon
Encyclopedia Manager
Forums icon
HTTP Referrers icon
Messages icon
module management (Module section) 2nd
Newsletter icon
Reviews section
story administration 2nd
Surveys/Polls icon
Surveys/Polls item
Users Groups icon
Administrative Menu
Section item
administrator credentials
Administrator E-mail setting (Administration Menu, General Site Info section)
configuration
administrators
admins
administration 2nd
advanced link administration (Web Links module) 2nd
Advanced Permissions mode
Forums module security system 2nd
Advertising block 2nd
affiliate ID
affiliate programs
NukeAmazon
After Expiration (Add a New Block section, Administration menu)
agent strings
aggregators
RSS newsfeed blocks
All Stories link (Stories Archive module)
Allow Anonymous to Post setting (Administration Menu, General Site Info section)
configuration
Allow BBCode option (Forums module General Configuration screen)
Allow Event Comments? option (Events Calendar module administration)
Allow HTML option (Forums module General Configuration screen)
Allow Signatures option (Forums module General Configuration screen)
Allow Smilies option (Forums module General Configuration screen)
Allow User E-mail Change option (YAT Users Configuration screen)
Allow User Registration option (YAT Users Configuration screen)
Allow User Self-Deactivation option (YAT Users Configuration screen)
Allow Username Changes option (Forums module General Configuration screen)
Allowed HTML option (Forums module General Configuration screen)
alpha tweak versions
alternate text
banners
alternatives to PHP-Nuke 2nd
Amazon block
Amazon.com module 2nd
NukeAmazon
administration
affiliate program
applications 2nd
aMember
anonymous users
access control
antivirus applications
blocks
Apache
installation information
Apache Web server
hosting PHP-Nuke
applications
banners
Events Calendar module 2nd
creating events
forums
accessing forum profiles 2nd
Forum FAQ
posting topics 2nd
reading forums 2nd
search feature
NukeAmazon 2nd
Appointment Block Times option (Events Calendar module administration)
Arrow icon (moderators)
Article Rating block
articles 2nd [See also stories]
Articles default category
writing stories
associated topics
writing stories
associated topics (stories)
Author's e-mail
adding downloads
Author's name
adding downloads
Authors 2nd 3rd
authors
Search module 2nd
Authors table
Autonews table
autopruning
AvantGo module 2nd
configuration 2nd
customization 2nd
avatar gallery
avatars
managing forums settings 2nd


B

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

b tag 2nd 3rd
manual formatting of stories
back-end configuration
Backup database option
managing forums settings 2nd
Backup DB 2nd
backups
database-backup feature
Backup DB 2nd
upgrading PHP-Nuke
bandwidth
hosting plans 2nd
banner ads
Banner table
Bannerclient table
banners 2nd
administration 2nd
alternate text
clients 2nd
impressions
applications
configuration
users
Banners icon (Administration Menu)
Banners Options section (Administration Menu)
configuration
banners.php
basic statistics (Statistics module) 2nd
basic structure
dynamic modules 2nd 3rd
BatchFTP
Bb_auth_access table
Bbbanlist table
Bbcategories table
BBCode
BBcode
Bbconfig table
Bbdisallow table
Bbforum_prune table
Bbforums table
Bbgroups table
Bbposts table
Bbposts_text table
Bbprivmsgs table
Bbprivmsgs_text table
Bbranks table
Bbsearch_resultstable
Bbsessions table
Bbsmilies table
Bbthemes table
Bbthemes_name table
Bbtopics table
Bbtopics_watch table
Bbuser_group table
Bbvote_desc table
Bbvote_results table
Bbvote_voters table
Bbwords table
Big Story block
Big Story of Today block
blank pages
installation
troubleshooting
Blocked Mail Domains option (YAT Users Configuration screen)
Blocked Username Strings option (YAT Users Configuration screen)
blocks 2nd 3rd
Advertising
Amazon
Article Rating
Big Story
built-in 2nd 3rd
Advertising
Big Story of Today
Categories Menu
Content
Encyclopedia
Ephemerids
Forums
Languages
Last 5 Articles
Last Referrers
Login
Modules
Old Articles
Random Headlines
Reviews
Search
Subscription
Survey
Top10 Downloads
Top10 Links
Total Hits
User Info
Content
dynamic 2nd
building content 2nd
defining variables
direct page access
installation
SQL query
while loop
Encyclopedia
Ephemerid
Ephemerids
version 7.4 changes
Events Calendar module 2nd
Forums
HTML
creating your own 2nd 3rd 4th 5th 6th
Languages
Last 5 Articles
Last Referrers
Login
management 2nd 3rd
Modules 2nd
Old Articles
Options
Related Links
Reviews
RSS
RSS newsfeed blocks 2nd 3rd
locating
locating aggregators
outdate blocks
viewing
Search
selection
Subscription
subscription
Survey 2nd
Surveys
system (story's extended text) 2nd
third-party
adding
Top 10 Downloads
Top 10 Links
Total Hits
User Info
versus modules
Waiting Content
Who's Online 2nd
private messages waiting message
Blocks Administration menu 2nd 3rd
Blocks folder
Blocks table
blog
blogs
br tag 2nd 3rd
manual formatting of stories
broadcast messages
Broadcast Messages activation option (users)
Broken Downloads link 2nd
Broken icon (moderators)
Broken Link link
Broken Links (Waiting Content module)
built-in blocks 2nd 3rd
Advertising
Big Story of Today
Categories Menu
Content
Encyclopedia
Ephemerids
Forums
Languages
Last 5 Articles
Last Referrers
Login
Modules
Old Articles
Random Headlines
Reviews
Search
Subscription
Survey
Top10 Downloads
Top10 Links
Total Hits
User Info
built-in themes
buttons
Your Account module 2nd 3rd


C

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Cascading Style Sheets [See CSS]
categories 2nd 3rd
content administration 2nd
downloads
News module 2nd
topics administration 2nd
Categories Menu block
Category
adding downloads
category selction
writing stories
CCBill
Censor options
configuration 2nd
check boxes
Super User
classes
customizing themes
Clean Links Votes option (Web Links module)
clients
banners 2nd
CloseTable() function 2nd
CloseTable2() function
color
customizing themes
Colors and Formatting option (Events Calendar module administration)
comments
configuration
user-posted (stories)
Comments page (Your Account module)
Comments table
commercial themes
common errors
day-to-day errors
installation
accessing forums
accessing modules
confirmation e-mails
database errors
erased admin accounts 2nd
missing graphical security codes 2nd
companies
hosting 2nd
competitors 2nd
Config table
config.php file
editing 2nd
Gfx_chk parameter 2nd
configuration
AvantGo module 2nd
forums 2nd 3rd
messages 2nd
NSN Your Account Tweak 2nd 3rd
site preferences
back-end configuration
banner options
Censor options 2nd
comments
footer messages 2nd
General Site Info section (Administration Menu) 2nd
graphics
Miscellaneous options
multilingual features
stories submissions 2nd
User options
Confirm table
confirmation e-mails
common errors
content
adding
Content module 2nd 3rd
administration
activating new pages
adding new pages 2nd
categories 2nd
HTML tags 2nd
strategies for using Content module 2nd
custom dynamic blocks 2nd
deactivated
posting
Sections module 2nd
subcategories
Content (Add a New Block section, Administration menu)
Content block 2nd
Content icon (Administration Menu)
Content module 2nd
accessing content
adding new content 2nd 3rd
editing
strategies for use 2nd
content-management systems 2nd
control (access control)
anonymous users
Content module
registered users
setting up 2nd
subscribed users
types of sites 2nd
control panels
installation
Cookie Domain option (Forums module General Configuration screen)
Cookie Name option (Forums module General Configuration screen)
Cookie Path option (Forums module General Configuration screen)
COPPA settings
cost
hosting plans
Counter table
CSS
(Cascading Style Sheets)
custom blocks
creating simple HTML block
shortcut
static HTML 2nd 3rd 4th
dynamic blocks 2nd
building content 2nd
defining variables
direct page access
installation
SQL query
while loop
custom modules
creating simple HTML module 2nd 3rd 4th
dynamic modules
basic structure 2nd 3rd
databases
multifile modules 2nd
resources
sample 2nd 3rd
user input 2nd 3rd
customization
AvantGo module 2nd
messages
Recommend Us module 2nd
themes 2nd
graphical elements 2nd
text elements 2nd 3rd


D

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

database creation
installation
database error messages
database errors
database servers
installation requirements
database-backup feature
Backup DB 2nd
databases 2nd
creating dynamic modules
tables 2nd 3rd
Date Display Format option (Events Calendar module administration)
Date Format option (Forums module General Configuration screen)
Day view (Events Calendar module)
day-to-day errors
db folder
Deactivate Account button
deactivated content
deactivation
user accounts
decompression of package
installation
dedicated servers
Default Language option (Forums module General Configuration screen)
Default Style option (Forums module General Configuration screen)
Default Theme setting (Administration Menu, General Site Info section)
configuration
Delete link 2nd
Sections module
Delete Polls link
Delete Polls link (Surveys module)
deleting
surveys/polls
deleting Upgrade folder
Description
adding downloads
Detailed Statistics page (Statistics module)
dialog boxes
Windows File Properties
Disable Board option (Forums module General Configuration screen)
doenloads
categories
domain name
moving site to new server
Domain Name option (Forums module General Configuration screen)
domain name registration
hosting plans 2nd
downloads
management
Downloads module 2nd
subcategories
submissions 2nd
user-submitted 2nd
viewing
Downloads Administration screen
Add a New Download section
Downloads module 2nd
download management 2nd
download space limit
setting up 2nd 3rd
uploading files
user-submitted downloads 2nd
Downloads_categories table
Downloads_downloads table
Downloads_editorials table
Downloads_modrequest table
Downloads_newdownload table
Downloads_votedata table
dynamic blocks 2nd
building content 2nd
defining variables
direct page access
installation
SQL query
while loop
dynamic modules
basic structure 2nd 3rd
databases
multifile modules 2nd
resources
sample 2nd 3rd
user input 2nd 3rd
dynamic Web pages


E

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

e-mail accounts
hosting plans
E-mail button (Members List module)
e-newsletters 2nd
sending
function displaying properly sent newsletter
function sending newsletter 2nd
structure that coordinates functions 2nd
versions prior to v7.5 2nd 3rd 4th 5th 6th
troubleshooting
echo statement
Edit Admins (Administration Menu)
Edit Admins icon (Administration Menu)
Edit button
moderators
Edit button (Forums module)
Edit link 2nd
Section module
Edit Polls link
Edit Polls link (Surveys module)
Edit Users icon (Administration Menu)
editing
config.php file 2nd
Gfx_chk parameter 2nd
Content module
surveys
surveys/polls
email() function
Enable Account Activation option (Forums module General Configuration screen)
Enable Forum Pruning option (Forums module General Configuration screen)
Encyclopedia block 2nd
encyclopedia entries
Encyclopedia Manager (Administration Menu)
Encyclopedia module 2nd 3rd
encyclopedia entries
Encyclopedia table
Encyclopedia_text table
Ephem table
Ephemerid block
Ephemerids block
version 7.4 changes
Ephemerids module
version 7.4 changes
erased admin accounts
common errors 2nd
error messages
database
errors
day-to-day errors
installation
accessing forums
accessing modules
confirmation e-mails
database errors
erased admin accounts 2nd
missing graphical security codes 2nd
events
Events Calendar module
Events Calendar module 2nd
administration menu 2nd
applications 2nd
creating events
blocks 2nd
installation
obtaining
Expiration (Add a New Block section, Administration menu)
Extended Text box 2nd
Extended Text text box
eXtensible Markup Language [See XML]


F

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

FAQ module 2nd
viewing FAQs 2nd
Faqanswer table
Faqcategories table
Feedback module 2nd 3rd
minimizing abuse 2nd
feeds [See RSS;newsfeed blocks]
feeds (RSS)
File link
adding downloads
File size
adding downloads
Filename (Add a New Block section, Administration menu)
files 2nd
index.php 2nd
echo statement
mainfil.php
uploading
Downloads module
Flash-based main menu block
Flood Interval option (Forums module General Configuration screen)
folders 2nd
footer messages
configuration 2nd
Footer Text text box 2nd
footers
forgotten passwords
formatting stories
manual formatting
text boxes
Forum Administration screen
Forum FAQ
Forums module
forums 2nd 3rd
accessing
common errors
applications
accessing forum profiles 2nd
Forum FAQ
posting topics 2nd
reading forums 2nd
search feature
maintenance
pruning forums 2nd
managing settings
avatars 2nd
Backup database option 2nd
configuration 2nd 3rd
mass e-mail function
Restore database option 2nd
smilies
word censors
moderators 2nd 3rd
necessity
security
BBcode
security system
Advanced Permissions mode 2nd
group-based permissions 2nd
per-user permissions 2nd
Simple Permissions mode 2nd
Forums block 2nd
Forums icon (AdministrationM Menu)
Forums Index
private messages waiting message
Forums module 2nd
applications
accessing forum profiles 2nd
Forum FAQ
posting topics 2nd
reading forums 2nd
search feature
Avatar Management section 2nd
Backup database option 2nd
maintenance
pruning forums 2nd
managing forums settings
configuration 2nd 3rd
mass e-mail function
moderators 2nd 3rd
necessity
Restore database option 2nd
security system
Advanced Permissions mode 2nd
group-based permissions 2nd
per-user permissions 2nd
Simple Permissions mode 2nd
smilies
word censors
FTP
(File Transfer Protocol)
functionality equirements
installation 2nd
functions
AddonSample()
CloseTable() 2nd
CloseTable2()
email()
one()
OpenTable() 2nd
OpenTable2()
process()
public_message()
themearticle() 2nd
themefooter() 2nd
themeheader() 2nd 3rd
themeindex()
themesidebox() 2nd
two()
Functions column (Blocks Administration menu)


G

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

General Configuration screen (Forums module)
General Site Info section (Administration Menu)
configuration 2nd
Gfx_chk parameter
setting preferences 2nd
global colors
theme.php sample
Google block
Google search block
graphical elements
customizing themes 2nd
graphical security codes
common errors 2nd
graphics
configuration
group-based permissions
Forums module security system 2nd
groups
administration 2nd
NSN Groups
Groups table
Groups_points table


H

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

hackers 2nd
Header Text text box 2nd
headlines (stories)
Headlines Reader activation option (users)
Headlines table
hits
Hits
adding downloads
Home page
adding downloads
hosting
backup features
companies 2nd
comparison of hosting plans 2nd
bandwidth 2nd
domain name registration 2nd
e-mail accounts
price
setup fees
space 2nd
cost
nightly backups
overage charges
refund guarantees
self-hosting
virtual server plans
Web hosts
hosts file
HotSync
How Are Multiday Events Shown? option (Events Calendar module administration)
HTML
(Hypertext Markup Language)
HTML blocks
creating your own
shortcut
static HTML 2nd 3rd 4th
HTML formatted version of newsletter
sending e-newsletters
HTML module
creating your own 2nd 3rd 4th
shortcut
HTML tags
content administration 2nd
message administration 2nd
HTTP
referrers 2nd
modification of preferences 2nd
multiple listings
URLs
HTTP Referrers icon (Administration Menu)
Hypertext Markup Language [See HTML]


I

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

I tag 2nd 3rd
i tag
manual formatting of stories
icons
topics
ID numbers (stories)
if statement
creating dynamic modules
Ignore link 2nd
IIS
(Internet Information Services)
Images folder
customizing theme graphical elements
impressions
banners
Inbox (Private Messages module)
include function
Includes folder
index.php file 2nd
echo statement
initial database structure
installation
installation 2nd
blank pages
troubleshooting
building initial database structure
control panels
custom dynamic blocks
database creation
decompression of package
downloading version
editing config.php file 2nd
Gfx_chk parameter 2nd
errors
accessing forums
accessing modules
confirmation e-mails
database errors
erased admin accounts 2nd
missing graphical security codes 2nd
Events Calendar module
minimum levels of functionality 2nd
NSN Your Account Tweak 2nd
changes that occur on site
required components 2nd
site preference configuration
back-end configuration
banner options
Censor options 2nd
comments
footer messages 2nd
General Site Info section (Administration Menu) 2nd
graphics
Miscellaneous options
multilingual features
stories submissions 2nd
User options
superusers 2nd
third-party themes
selecting theme 2nd
Instant Payment Notification [See IPN]
Internet Information Services [See IIS]
Internet Service Providers [See ISPs]
IP address banning system
version 7.4 changes
IP button
moderators
IPN
(Instant Payment Notification)
ISPs
(Internet Service Providers)


J

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Journal button (Your Account module)
Journal Directory 2nd
Journal module 2nd
Journal Directory 2nd
updating journal entries
Journal table
Journal_comments table
Journal_stats table


K

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Konqueror


L

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Language folder
language selection
site configuration
Languages block 2nd
Last 5 Articles block 2nd
Last Referrers block 2nd
light-based color
links
submissions 2nd
Links_categories table
Links_editorials table
Links_links table
Links_modrequest table
Links_newlink table
Links_votedata table
Linux
installation information
Linux-based operating system
hosting options
Local Time Format setting (Administration Menu, General Site Info section)
configuration
localized PHP-Nuke
locating
RSS newsfeed blocks
Lock icon (moderators)
Login block 2nd
logo
logo.gif file
logos
customizing themes
Logout/Exit button (Your Account module)
Lynx


M

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Main Users table (YAT administration menu)
mainfil.php file
maintenance
forums
pruning forums 2nd
management
blocks 2nd 3rd
downloads
Downloads module 2nd
modules 2nd
topics 2nd
manual formatting
stories
Mark All Topics Read link
MARQUEE HTML tag
mass e-mail function
managing forums settings
Max Poll Options option (Forums module General Configuration screen)
Max Posts option (Forums module General Configuration screen)
Maximum Signature Length option (Forums module General Configuration screen)
Members List module 2nd 3rd
memory
versus storage 2nd
Message table
messages
administration
configuration 2nd
HTML tags 2nd
broadcast
customization
Recommend Us module 2nd
sending
Private Messages module 2nd
Messages button (Your Account module)
Messages icon (Administration Menu)
Microsoft Internet Explorer [See MSIE]
Microsoft scripting
Miscellaneous options
configuration
Miscellaneous Options section (Administration Menu)
configuration
mobile devices
AvantGo module
Mod Links (Waiting Content module)
Moderate Calendar Events? option (Events Calendar module administration)
moderators
managing forums 2nd 3rd
necessity
modification
HTTP referrer preferences 2nd
modifications
theme graphical elements 2nd
theme text elements 2nd 3rd
module content
Module section (Administration Menu)
module management 2nd
modules 2nd 3rd 4th 5th
access control
anonymous users
registered users
setting up 2nd
subscribed users
types of sites 2nd
accessing
common errors
Addon-Sample
Addon_Sample 2nd 3rd 4th
shortcut
Amazon.com 2nd
NukeAmazon 2nd 3rd 4th
AvantGo 2nd
configuration 2nd
customization 2nd
Content 2nd
accessing content
adding new content 2nd 3rd
editing
strategies for use 2nd
Downloads 2nd
download management 2nd
download space limit
setting up 2nd 3rd
uploading files
user-submitted downloads 2nd
dynamic
basic structure 2nd 3rd
databases
multifile modules 2nd
resources
sample 2nd 3rd
user input 2nd 3rd
Encyclopedia 2nd 3rd
encyclopedia entries
Ephemerids
version 7.4 changes
Events Calendar 2nd
administration menu 2nd
applications 2nd 3rd
blocks 2nd
installation
obtaining
FAQ 2nd
viewing FAQs 2nd
Feedback 2nd 3rd
minimizing abuse 2nd
Forums 2nd
applications 2nd 3rd 4th 5th 6th 7th 8th 9th
Avatar Management section 2nd
Backup database option 2nd
maintenance 2nd 3rd
managing forums settings 2nd 3rd 4th
mass e-mail function
moderators 2nd 3rd 4th
Restore database option 2nd
security system 2nd 3rd 4th 5th 6th 7th 8th
smilies
word censors
HTML
creating your own 2nd 3rd 4th 5th
Journal 2nd
Journal Directory 2nd
updating journal entries
management 2nd
Members List 2nd 3rd
News 2nd 3rd
administering stories 2nd
affect on stories
categories 2nd
restricting
topics 2nd
writing stories 2nd
Private Messages 2nd 3rd 4th
sending messages 2nd
Private_Messages
Recommend Us 2nd
customizing messages 2nd
Reviews 2nd
reviewing reviews 2nd
writing reviews 2nd
Search 2nd
affect on stories
authors 2nd
search results page 2nd
Sections 2nd 3rd
posting content 2nd
version 7.4 changes
selection 2nd 3rd
Statistics 2nd 3rd
basic statistics 2nd
Detailed Statistics page
Stories Archive
Stories_Archive
affect on stories
Submit News
Submit_News
affect on stories
Surveys 2nd 3rd
Past Surveys list
Surveys block
third-party modules
submissions 2nd
Top 2nd 3rd 4th
top lists
Topics 2nd 3rd 4th
affect on stories
applications 2nd
topic icons 2nd
versus blocks
Waiting Content
submissions 2nd 3rd 4th 5th
Web Links 2nd
advanced link administration 2nd
category listings for Web links 2nd
Web_Links
WebMail 2nd
Your Account 2nd
buttons 2nd 3rd
Your_Account
Modules block 2nd 3rd
Modules folder
Modules table
moving site to new server 2nd 3rd
domain name
MSIE
(Microsoft Internet Explorer)
multifile modules
creating dynamic modules 2nd
multilingual features
configuration
Multilingual Options section (Administration Menu)
configuration
multipage layout
content
multiple listings
HTTP referrers
multiquestion surveys
MySQL
installation information
MySQL database server
hosting PHP-Nuke


N

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Netscape
New Post link
sending private messages
New Story link (Administration block)
news [See also stories]
news articles [See also stories]
News module 2nd 3rd
administering stories 2nd
affect on stories
categories 2nd
restricting
topics 2nd
writing stories 2nd
news stories
newsfeed blocks (RSS) 2nd 3rd
locating
locating aggregators
outdate blocks
viewing
newsfeeds (RSS)
Newsletter icon (Administration Menu)
nightly backups
hosting plans
Notify Admin of User Deactivation option (YAT Users Configuration screen)
Notify Admin of User Registration option (YAT Users Configuration screen)
NSN
(NukeScripts.net)
NSN Groups
NSN Your Account Tweak
configuration 2nd 3rd
NSN Your Account tweak
creating admins
NSN Your Account Tweak
installation 2nd
changes that occur on site
obtaining 2nd
searching for users 2nd
NSN-Nuke
NukeAmazon
administration
affiliate program
applications 2nd
NukeScripts.net [See NSN]
Number of Items in Top Page setting (Administration Menu, General Site Info section)
configuration
Number of News Items in Home activation option (users)


O

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

obtaining
Events Calendar module
NSN Your Account Tweak 2nd
Old Articles block 2nd
one() function
Open Events in a New Window? option (Events Calendar module administration)
OpenTable() function 2nd
OpenTable2() function
Opera
operating systems
installation requirements
recognized by PHP-Nuke
Options block
OSC2Nuke
Outbox (Private Messages module)
outdate blocks
RSS newsfeed blocks
overage charges
hosting plans
Override User Style option (Forums module General Configuration screen)


P

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

page requests
Page Text text box 2nd
pagebreak tag 2nd 3rd
Pages table
Pages_categories table
Paint tool (Microsoft Windows)
palm devices
AvantGo module
Password Max Length option (YAT Users Configuration screen)
Password Min Length option (YAT Users Configuration screen)
passwords
forgotten passwords
Past Surveys list (Surveys module)
pay subscription sites 2nd
PayPal 2nd 3rd
PDAs
(personal digital assistants)
AvantGo module
per-user permissions
Forums module security system 2nd
permissions
Advanced Permissions mode
Forums module security system 2nd
group-based permissions
Forums module security system 2nd
per-user permissions
Forums module security system 2nd
personal digital assistants [See PDAs]
PHP-Nuke Club
phpBB
phpESP-survey
phpMyAdmin
plans for hosting
comparison chart 2nd
bandwidth 2nd
domain name registration 2nd
e-mail accounts
price
setup fees
space 2nd
cost
nightly backups
overage charges
refund guarantees
virtual server plans
points (groups) 2nd
Poll_check table
Poll_data table
Poll_desc table
Pollcomments table
polls 2nd 3rd [See also surveys]
deleting
editing
multiquestion
stories
Popsettings table
Position (Add a New Block section, Administration menu)
Position column (Blocks Administration menu)
Post Reply button (Forums module)
posting content
Sections module 2nd
posting topics
Forums module 2nd
PostNuke
Posts for Popular Threshold option (Forums module General Configuration screen)
Posts per Page option (Forums module General Configuration screen)
preconstructed themes
preferences
configuration
back-end configuration
banner options
Censor options 2nd
comments
footer messages 2nd
General Site Info section (Administration Menu) 2nd
graphics
Miscellaneous options
multilingual features
stories submissions 2nd
User options
HTTP referrers
modifying 2nd
previewing
themes
price
hosting plans
Private Messages module 2nd 3rd 4th
sending messages 2nd
Private Messaging option (Forums module General Configuration screen)
Private_Messages module
process() function
profiles
users
Program name
adding downloads
programming
stories 2nd
programming stories
pruning forums 2nd
public_message() function
Public_messages table


Q

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Queue table
quota
Quote button (Forums module)


R

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Random Headlines block
Read More link (news module)
reading forums
Forums module 2nd
Really Simple Syndication [See RSS]
Recommend Us module 2nd
customizing messages 2nd
Referrer table
referrers (HTTP) 2nd
modification of preferences 2nd
multiple listings
URLs
Refresh time (Add a New Block section, Administration menu)
refund guarantees
hosting plans
registered users 2nd
access control
Related Links block
Related table
Report Broken Link (Web Links module)
Report Broken Link link
Require Admin Approval option (YAT Users Configuration screen)
require_once function
required components
installation 2nd
resources
creating dynamic modules
Restore database option
managing forums settings 2nd
restricting
News module
results page (Search module) 2nd
reviewing
reviews
Reviews module 2nd
reviews
reviewing
Reviews module 2nd
submissions 2nd
writing
Reviews module 2nd
Reviews block 2nd
Reviews module 2nd
reviewing reviews 2nd
writing reviews 2nd
Reviews section (Administration Menu)
Reviews table
Reviews_add table
Reviews_comments table
Reviews_main table
robots
RSS
(Really Simple Syndication) 2nd
blocks
feeds
newsfeed blocks 2nd 3rd
locating
locating aggregators
outdate blocks
viewing
newsfeeds
RSS/RFS file URL (Add a New Block section, Administration menu)


S

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

sample
creating dynamic modules 2nd 3rd
Sample_Block.php block 2nd
Savebox (Private Messages module)
scaping e-mail addresses
Members List module
scheduling
stories 2nd
script
sending e-newsletters 2nd
Script Path option (Forums module General Configuration screen)
scripting
Microsoft scripting
scripts
upgrading PHP-Nuke
Search block 2nd
search engine robots
search feature
Forums module
Search module 2nd
affect on stories
authors 2nd
search results page 2nd
search results page (Search module) 2nd
Search text box
searching for users
NSN Your Account Tweak 2nd
Seccont table
Sections item (Administrative Menu)
Sections module 2nd 3rd
posting content 2nd
version 7.4 changes
Sections table
security 2nd
forums
BBcode
Forums module
Advanced Permissions mode 2nd
group-based permissions 2nd
per-user permissions 2nd
Simple Permissions mode 2nd
hackers 2nd
testing vulnerabilities
upload capabilities
selection
blocks
modules 2nd 3rd
themes 2nd
Send This Journal to a Friend link
sending e-newsletters 2nd
troubleshooting
versions prior to v7.5
function displaying properly sent newsletter
function sending newsletter 2nd
required SQL statements
script for replacement file 2nd
set up of newsletter
structure that coordinates functions 2nd
text and HTML formatted version of newsletter
sending messages
Private Messages module 2nd
Sentbox (Private Messages module)
Server Can Send Mail? option (YAT Users Configuration screen)
Server Port option (Forums module General Configuration screen)
server-side scripting
servers
moving site to new server 2nd 3rd
domain name
Session Length option (Forums module General Configuration screen)
Session table
setting up
access control 2nd
Downloads module 2nd 3rd
setup fees
hosting plans
SharePoint Portal Server (Microsoft)
SharpReader
shortcut
creating simple HTML blocks
Simple Permissions mode
Forums module security system 2nd
site backup
database-backup feature
Backup DB 2nd
Site Description option (Forums module General Configuration screen)
Site Language setting (Administration Menu, General Site Info section)
configuration
Site Logo setting (Administration Menu, General Site Info section)
configuration
Site Name option (Forums module General Configuration screen)
Site Name setting (Administration Menu, General Site Info section)
configuration
site preference configuration
back-end configuration
banner options
Censor options 2nd
comments
footer messages 2nd
General Site Info section (Administration Menu) 2nd
graphics
Miscellaneous options
multilingual features
stories submissions 2nd
User options
Site Slogan setting (Administration Menu, General Site Info section)
configuration
Site Start Date setting (Administration Menu, General Site Info section)
configuration
Site URL setting (Administration Menu, General Site Info section)
configuration
smilies
managing forums settings
Smilies Storage Page option (Forums module General Configuration screen)
space
hosting plans 2nd
spiders
SQL query
custom dynamic blocks
SQL statements
requirements for sending e-newsletters
static HTML
creating simple HTML blocks 2nd 3rd 4th
statistics 2nd
Statistics module 2nd 3rd
basic statistics 2nd
Detailed Statistics page
Stats_date table
Stats_hour table
Stats_month table
Stats_year table
Status column (Blocks Administration menu)
sticky (announcement)
storage
versus memory 2nd
stories
administration 2nd
creating and scheduling stories 2nd
managing topics 2nd
topic and category strategies 2nd
understanding structure 2nd
user access 2nd
user's views 2nd
associated topics
configuring submission 2nd
extended text
system blocks 2nd
formatting
manual formatting
text boxes
headlines
News module 2nd
programming 2nd 3rd
story text
submissions 2nd
topic icons
writing
Add New Article screen 2nd
News module 2nd
Stories Archive module
Stories in Old Articles Box setting (Administration Menu, General Site Info section)
configuration
Stories Number in Home setting (Administration Menu, General Site Info section)
configuration
Stories table
Stories_Archive module
affect on stories
Stories_cat table
Story Text box
Story Text text box
structural changes
version 7.5
structure
dynamic modules 2nd 3rd
stories and topics administration 2nd
style properties
customizing themes
Style subfolder
style.css file
style.css file
subcategories
downloads/content
submissions
links and downloads 2nd
stories and reviews 2nd
third-party modules 2nd
Submit News module
Submit_News module
affect on stories
subscribed users 2nd
access control
removing banner advertising
subscribers
banners
pay subscription sites 2nd
Subscription block 2nd
subscription blocks
Subscriptions table
Super User check box
superusers 2nd
Survey block 2nd 3rd
surveys 2nd 3rd 4th [See also polls]
deleting
editing 2nd
multiple questions
multiquestion
Survey block
Surveys block
Surveys module 2nd 3rd
Past Surveys list
Surveys block
Surveys/Polls icon (Administration Menu)
Surveys/Polls item (Administration Menu)
Suspend Users After option (YAT Users Configuration screen)
switch construct
creating dynamic modules
system blocks (story's extended text) 2nd
System Time Zone option (Forums module General Configuration screen)


T

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

tables 2nd 3rd
tags
b 2nd 3rd
manual formatting of stories
br 2nd 3rd
manual formatting of stories
HTML
content administration 2nd
message administration 2nd
i 2nd 3rd
manual formatting of stories
MARQUEE
pagebreak 2nd 3rd
TD
u 2nd 3rd
manual formatting of stories
TD tags
Temp Accounts Expire After option (YAT Users Configuration screen)
Temp Users table (YAT administration menu)
temporary users list (Members List module)
terminology
articles
banner ads
blocks
footers
logo
messages
module content
modules 2nd
news stories
themes
topics
user accounts 2nd
administrators
anonymous users
registered users
subscribed users
text
wwriting stories
text (stories)
extended text
system blocks 2nd
story text
text boxes
Extended Text
Footer Text
Header Text
Page Text
Story Text
text elements
customizing themes 2nd 3rd
themearticle() function 2nd
themefooter() function 2nd
themeheader() function 2nd 3rd
themeindex() function
themes 2nd 3rd 4th 5th
built-in
customizing 2nd
graphical elements 2nd
text elements 2nd 3rd
installation
third-party themes 2nd 3rd
theme.php 2nd
sample 2nd 3rd 4th 5th
visually-impaired 2nd
Themes button (Your Account module)
Themes folder
themesidebox() function 2nd
third-party block
adding
third-party modules
Events Calendar 2nd
administration menu 2nd
applications 2nd 3rd
blocks 2nd
installation
obtaining
submissions 2nd
third-party themes
installation
selecting theme 2nd
Time Display Format option (Events Calendar module administration)
Title (Add a New Block section, Administration menu)
Title column (Blocks Administration menu)
titles
writing stories
Top 10 Downloads block
Top 10 Links block
top lists (Top module)
Top module 2nd 3rd 4th
top lists
Top10 Downloads block
Top10 Links block
topic icons 2nd 3rd
topic icons (stories)
Topic Image drop-down list box 2nd
Topica
topics
administration 2nd
creating and scheduling stories 2nd
managing topics 2nd
topic and category strategies 2nd
understanding structure 2nd
user access 2nd
user's views 2nd
News module 2nd
posting
Forums module 2nd
writing stories
Topics module 2nd 3rd 4th
affect on stories
applications 2nd
topic icons 2nd
Topics Per Page option (Forums module General Configuration screen)
Topics table
Total Hits block 2nd
transfer rates
troubleshooting
database error messages
installation issues
blank pages
two() function
Type column (Blocks Administration menu)


U

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

u tag 2nd 3rd
manual formatting of stories
Unsigned Band Web Releases Random Artist block
updating
journal entries
Upgrade folder
deleting
upgrading PHP-Nuke 2nd
backup
database upgrade
deleting Upgrade folder
getting files onto Web server
upload capabilities
security
uploading files
Downloads modules
URLs
HTTP referrers
Use E-mail Activation? option (YAT Users Configuration screen)
Use Security Code? option (YAT Users Configuration screen)
user access
stories and topics administration 2nd
user accounts 2nd
administrators
anonymous users
deactivation
registered users
subscribed users
User E-mail Via Board option (Forums module General Configuration screen)
user groups
administration 2nd
User Info block 2nd
user input
creating dynamic modules 2nd 3rd
User options
configuration
user's views
stories and topics administration 2nd
user-posted comments (stories)
user-submitted downloads 2nd
Username Max Length option (YAT Users Configuration screen)
Username Min Length option (YAT Users Configuration screen)
users
administration 2nd
banners
profiles
Users Configuration screen (YAT) 2nd
Users Groups icon (Administration Menu)
users of PHP-Nuke 2nd
Users table
Users_temp table


V

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

Validate Downloads link (Downloads administration page)
Validate E-mail Changes option (YAT Users Configuration screen)
Validate Links option (Web Links module)
Version
adding downloads
versions 2nd
7.4 2nd
7.5
structural changes
installation requirements 2nd
upgrading PHP-Nuke 2nd
backup
database upgrade
deleting Upgrade folder
getting files onto Web server
View Detailed Statistics link (Statistics module)
viewing
downloads
FAQs 2nd
RSS newsfeed blocks
views
user's views
stories and topics administration 2nd
virtual server plans
Visible To column (Blocks Administration menu)
Visible to Subscribers? (Add a New Block section, Administration menu)
visually-impaired
themes 2nd
vulnerabilities
security testing


W

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

w User Theme Selection option (YAT Users Configuration screen)
Waiting Content block
Waiting Content module
submissions
links and downloads 2nd
stories and reviews 2nd
Waiting Links (Waiting Content module)
Web browsers
recognized by PHP-Nuke
Web hosts
Web Links module 2nd
advanced link administration 2nd
category listings for Web links 2nd
Web logs
Web portal systems
Web servers
installation requirements
Web_Links module
WebMail module 2nd
Webmail page (Your Account module)
WebSphere (IBM)
Weight column (Blocks Administration menu)
while loops
custom dynamic blocks
Who Can View This? (Add a New Block section, Administration menu)
Who's Online block 2nd
private messages waiting message
Windows File Properties dialog box
Windows Notepad
WinZIP
word censors
managing forums settings
Write a Review link (Reviews module)
writing
reviews
Reviews module 2nd
stories
News module 2nd
writing stories
Add New Article screen 2nd


X

Team LiB

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

X button
moderators
X button (Forums module)
X icon (moderators)
XML
(eXtensible Markup Language)


Y

Team LiB
Previous Section

Index

[SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y]

YAT
(Your Account tweak)
configuration 2nd 3rd
creating admins
installation 2nd
changes that occur on site
obtaining 2nd
searching for users 2nd
Your Account module 2nd
buttons 2nd 3rd
Your Account tweak [See YAT]
Your Home page (Your Account module)
Your Info page (Your Account module)
Your_Account module

Team LiB
Previous Section