Book Image

Building Websites with PHP-Nuke

Book Image

Building Websites with PHP-Nuke

Overview of this book

PHP-Nuke is a free tool for managing the content of a dynamic website. As one of the most popular applications on the Internet, PHP-Nuke has grown into a complex, powerful tool with an extraordinary range of features, and a loyal community of supporters. Through a web-based interface, users can edit and manage their site without the need for knowledge of web programming. PHP-Nuke is ideal for running a community-driven website, where visitors create accounts, comment and interact with the site, and contribute material in an easily managed fashion. PHP-Nuke has many of the features you would want from a website such as news stories, ratings, comments, discussion forums, and its look can be easily controlled with the use of themes. If you want to create a powerful, fully-featured website in no time, this book is for you. This book will help you explore PHP-Nuke, putting you in the picture of what it offers, and how to go about realizing this. Throughout the book we develop an example site, as you are taken on a detailed tour of the features of PHP-Nuke. You will be introduced to the main components of PHP-Nuke, and learn how to manage them. You will develop the skills and confidence to manage all types of content on the site, and also understand how users work and interact with the site. To make sure that you create a site that looks the way you want it to, the book covers customizing themes to help define your look for your pages. Although PHP-Nuke allows you to accomplish much without doing any web programming, to extend your site you will need to get your hands dirty with some coding. The book leads you through adding custom code to PHP-Nuke, and shows you how PHP-Nuke puts pages together, and the functions it uses for the fundamental operations of the site.
Table of Contents (15 chapters)
Building Websites with PHP-Nuke
Credits
About the Author
Preface
Installing XAMPP

Preface

PHP-Nuke is a free tool to manage the content of dynamic websites, and allows you to create a dynamic, interactive website with minimum effort and programming knowledge.

As one of the most popular applications on the Internet, PHP‑Nuke has grown into a complex, powerful tool with an extraordinary range of features, and a loyal community of supporters. Users can edit and manage their site through a web-based interface, without the need for any knowledge of web programming. PHP‑Nuke is ideal for running a community-driven website, where visitors create accounts, contribute material, and interact with the site.

This book is packed with practical steps for you to learn how to build your own website with PHP‑Nuke. From the basics of installing and configuring PHP-Nuke, you will learn how to manage your site, add content to it, and then customize its look.

What This Book Covers

The book begins with an overview of PHP‑Nuke; what it is, and what it can do to help you build your own community-driven website. We shall learn all the features and functionality provided by PHP‑Nuke by developing an example site, the Dinosaur Portal, as we progress through this book.

In Chapter 2, you will learn how to install and configure PHP-Nuke, apply patches, and also create the database. At the end of this chapter you will have a fully operational PHP‑Nuke site, ready to go!

In Chapter 3 you will begin to explore the many features of PHP-Nuke, create the super user (an all-powerful administrator of the site), and make your first modifications to the site. You will also learn about the ways in which PHP-Nuke restricts access to the site.

Chapter 4 introduces you to the administration area of PHP-Nuke, which allows you to manage your site from the comfort of your web browser. You'll see how to configure your site, back up the database, and manage blocks and modules.

Your site is created for visitors and Chapter 5 shows you how to manage them. You will learn how to create users, explore the Your Account module, which is the user's private 'space', and set up other administrators to perform limited administrative tasks on the site.

Chapter 6 is where we really start adding content to the site. In this chapter, we have a thorough walkthrough of story management, from both the visitor and administrator viewpoint. A story is PHP-Nuke's most versatile type of content, and we explore how to add, edit, and manage stories, and the features that allow visitors to interact with the stories.

Chapter 7 covers some of the other standard modules for adding content in PHP-Nuke. The Content, FAQ, Encyclopedia, Web Links, Downloads, and Reviews modules are all covered in this chapter, from both the visitor and administrator viewpoint. Each of these modules handles a different type of content, and you will see the functionality they offer for visitors to interact with the content, and also how each module organizes its content.

PHP-Nuke has a fully featured discussion board module, the Forums module. In Chapter 8, you will take a tour of setting up a new forum, assigning moderators, and setting permissions to these forums.

Before Chapter 9, you've been working with the standard-looking PHP-Nuke site. In Chapter 9, it's time to unleash your creativity and create a new look for the site. This is done through customizing a PHP-Nuke theme. In this chapter, we race through a range of customizations, from changing the site logo, to adding and styling a navigation bar, creating new blocks, and changing the format of stories on the homepage, among others. This chapter features a lot of coding in HTML and CSS, in addition to some changes to PHP files, and there are clear instructions to help you through.

Chapter 10 shows you how to program PHP-Nuke to create new blocks and modules. You will see how PHP-Nuke handles page requests, data access, and language files. You will also see how code is organized in a module for both the visitor end and the administrator end.

Appendix A has a walkthrough of installing the XAMPP package, which provides a working installation of PHP, MySQL, and Apache, ready configured for you to test your PHP-Nuke site on.

What You Need To Use This Book

You will need access to an installation of PHP-Nuke. PHP‑Nuke can be freely downloaded from www.php-nuke.org, and there are more details of how to do this in Chapter 2. PHP-Nuke requires a working installation of PHP, MySQL, and the Apache web server to run. In Appendix A, you will find instructions on how to download the XAMPP package, which has all of these ready configured.

Basic knowledge of HTML will help if you intend to explore customizing your own theme, and a basic knowledge of PHP will help if you want to get the most from Chapter 10.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

There are three styles for code. Code words in text are shown as follows: "… the database access variables, $prefix and $db, and it needs the module name, $module_name."

A block of code will be set as follows:

if ($numrows)
{
$row = $db->sql_fetchrow($result);
$dino_title = $row['title'];
$image = $row['image'];
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:

if ($numrows)
{
$row = $db->sql_fetchrow($result);
$dino_title = $row['title'];
$image = $row['image'];
}

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".

Note

Tips, suggestions, or important notes appear in a box like this.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to, making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata have been verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.