Home Web Development Building Websites with PHP-Nuke

Building Websites with PHP-Nuke

books-svg-icon Book
eBook $22.99 $15.99
Print $32.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $22.99 $15.99
Print $32.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    An Introduction to PHP-Nuke
About 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.
Publication date:
November 2005
Publisher
Packt
Pages
320
ISBN
9781904811053

 

Chapter 1. An Introduction to PHP-Nuke

PHP-Nuke is a free tool to manage the content of dynamic websites. To be more specific, PHP‑Nuke is an open-source content management system. In fact, you could say it is 'the' open-source content management system. Since it is vastly popular, a number of other similar systems have sprung from it, and even similar systems based around very different technologies that owe nothing to it in terms of code have added 'Nuke' to their name as homage.

Although the first paragraph conveys something of the history and grandeur of PHP-Nuke, it doesn't answer the basic question of what it can actually do for you.

PHP-Nuke allows you to create a dynamic, community-driven website with minimum effort and programming knowledge. To get the most out of PHP-Nuke, a knowledge of web development will prove to be useful, but even then, PHP-Nuke is written in the PHP scripting language (as can be deduced from the name), which is probably the most popular and straightforward language for creating websites and web applications.

The first PHP-Nuke release in June 2000 was created by a developer named Francisco Burzi to power his site, Linux Preview. Since then, PHP-Nuke has evolved under his guidance to the system it is today.

PHP-Nuke is truly one of the Internet's legendary applications. In this chapter, we will take our first look at PHP-Nuke, understand what it can do, find out where to go for further resources, and briefly discuss the site we will create in this book.

What PHP-Nuke Can Do for You

PHP-Nuke is ideal for creating community-driven websites.

The 'community' part of 'community-driven' means that the site is geared towards a particular group of people with similar interests. Maybe this community is concerned with wine making, flowers, programming, zombie films, or even dinosaurs. Maybe the community is actually a group of customers of a particular product. Of course, we are talking about an online community here.

Whatever the community is into, the site can be structured to hold information relevant to the members; maybe it will be news stories about a forthcoming zombie film, links to other zombie sites, reviews, or synopses of other zombie films.

The 'driven' part of 'community-driven' suggests that the information available on this site can be extended or enhanced by the members of the community. Members of the community may be able to shape what is on the site by posting comments, contributing or rating stories, and participating in discussions. After all, communities are made up of people, and people have views and opinions, and often like to express them!

This is exactly what PHP-Nuke enables. More than being just a website, a PHP-Nuke site provides a rich and interactive environment for its visitors.

The best bit is, you don't have to be an expert programmer to achieve all this. With only rudimentary knowledge of HTML, you can engineer a unique-looking PHP-Nuke website.

The Visitor Experience

The standard installation of PHP-Nuke provides many features for its visitors. Some of them are:

  • Searchable news articles, organized into topics

  • Ability of visitors to create an account on the site, and log in to their own personal area

  • Ability of visitors to rate articles, and create discussions about them

  • Straw polls and surveys

  • Ability of visitors to submit their own stories to be published on the site

  • An encyclopedia, in other words, a collection of entries organized alphabetically

  • A catalog of web links or downloadable files

  • Discussion forums

  • Ability of visitors to select their own look for the site from a list of different 'themes'

  • RSS syndication of your articles to share your content with other sites

This is not a complete list either. And these are only some of the features that come with the standard installation. PHP-Nuke is a modular system; it can be customized and extended, and there is a huge range of third-party customizations and extensions to be found on the Internet. Any of these can add to the range of features your site provides.

The Management Experience

As a potential 'manager' of a PHP-Nuke site, as you read through the list of features above you may think they sound rather attractive, but you might also wonder how you will handle all of that.

PHP-Nuke provides a web-based management interface. You, as the manager of the site, visit the site and log in with a special super user, or site administrator, account. After this, from the comfort of your web browser, you run the show:

  • You can add new information, and edit, delete, or move existing pieces of information.

  • You can approve articles submitted by the user to be shown on the site.

  • You can decide the features of the site.

  • You can control what is displayed on the pages.

  • You can control who is able to see what.

With the possibility of adding so much to the site, you might think it will be difficult to keep track of everything, and make sure that everything is linked. This is also done for you by PHP-Nuke, and it creates navigation menus for the visitor, and displays lists of articles and other information, automatically setting up the links for visitors to move from one place to another.

Of course, PHP-Nuke cannot do everything you imagine, and it has its limitations. For example, PHP-Nuke is very good for adding text content to the site. However, it is not so good (in the default setup) for adding images and other resources to the site; it supports them once they are available, but the management interface does not really help with adding them. To add images and other resources such as Flash movies or banners, you will need to access the web server directly using an FTP client.

However, the power and flexibility PHP-Nuke offers you to manage a complex website would be difficult to achieve without many, many hours of careful programming.

 

What PHP-Nuke Can Do for You


PHP-Nuke is ideal for creating community-driven websites.

The 'community' part of 'community-driven' means that the site is geared towards a particular group of people with similar interests. Maybe this community is concerned with wine making, flowers, programming, zombie films, or even dinosaurs. Maybe the community is actually a group of customers of a particular product. Of course, we are talking about an online community here.

Whatever the community is into, the site can be structured to hold information relevant to the members; maybe it will be news stories about a forthcoming zombie film, links to other zombie sites, reviews, or synopses of other zombie films.

The 'driven' part of 'community-driven' suggests that the information available on this site can be extended or enhanced by the members of the community. Members of the community may be able to shape what is on the site by posting comments, contributing or rating stories, and participating in discussions. After all, communities are made up of people, and people have views and opinions, and often like to express them!

This is exactly what PHP-Nuke enables. More than being just a website, a PHP-Nuke site provides a rich and interactive environment for its visitors.

The best bit is, you don't have to be an expert programmer to achieve all this. With only rudimentary knowledge of HTML, you can engineer a unique-looking PHP-Nuke website.

The Visitor Experience

The standard installation of PHP-Nuke provides many features for its visitors. Some of them are:

  • Searchable news articles, organized into topics

  • Ability of visitors to create an account on the site, and log in to their own personal area

  • Ability of visitors to rate articles, and create discussions about them

  • Straw polls and surveys

  • Ability of visitors to submit their own stories to be published on the site

  • An encyclopedia, in other words, a collection of entries organized alphabetically

  • A catalog of web links or downloadable files

  • Discussion forums

  • Ability of visitors to select their own look for the site from a list of different 'themes'

  • RSS syndication of your articles to share your content with other sites

This is not a complete list either. And these are only some of the features that come with the standard installation. PHP-Nuke is a modular system; it can be customized and extended, and there is a huge range of third-party customizations and extensions to be found on the Internet. Any of these can add to the range of features your site provides.

The Management Experience

As a potential 'manager' of a PHP-Nuke site, as you read through the list of features above you may think they sound rather attractive, but you might also wonder how you will handle all of that.

PHP-Nuke provides a web-based management interface. You, as the manager of the site, visit the site and log in with a special super user, or site administrator, account. After this, from the comfort of your web browser, you run the show:

  • You can add new information, and edit, delete, or move existing pieces of information.

  • You can approve articles submitted by the user to be shown on the site.

  • You can decide the features of the site.

  • You can control what is displayed on the pages.

  • You can control who is able to see what.

With the possibility of adding so much to the site, you might think it will be difficult to keep track of everything, and make sure that everything is linked. This is also done for you by PHP-Nuke, and it creates navigation menus for the visitor, and displays lists of articles and other information, automatically setting up the links for visitors to move from one place to another.

Of course, PHP-Nuke cannot do everything you imagine, and it has its limitations. For example, PHP-Nuke is very good for adding text content to the site. However, it is not so good (in the default setup) for adding images and other resources to the site; it supports them once they are available, but the management interface does not really help with adding them. To add images and other resources such as Flash movies or banners, you will need to access the web server directly using an FTP client.

However, the power and flexibility PHP-Nuke offers you to manage a complex website would be difficult to achieve without many, many hours of careful programming.

 

What Exactly is PHP-Nuke?


PHP-Nuke is a collection of PHP scripts that run on a web server, connect to a database, and display the retrieved data in a systematic way. In other words, PHP-Nuke is a data-driven PHP web application.

PHP-Nuke can be downloaded for free, and then installed to your local machine for testing and development. The files and the database can be uploaded to a web hosting service, so that your site will be available to anyone on the Internet. There are even web hosting services that offer PHP‑Nuke installation at the click of a button.

Modular Structure

PHP-Nuke is built around a 'core' set of functions, which perform mundane tasks such as selecting what part of the application the user should be shown, checking who the user is, and what they can do on the site. The thing that makes PHP-Nuke exciting to the world is the set of modules that comes with it. These modules provide the real functionality of the site, and include ones for news and article management, downloads, and forums, among others. The modules can be switched on and off with ease, and other modules can be added to the system.

There is no shortage of third-party modules on the Internet, and you can find a PHP-Nuke module for almost any imaginable purpose.

Themed Interface

The look of a PHP-Nuke site is controlled by a theme. This is a collection of images, colors, and other resources, and instructions that determine the layout of the page. A new theme can be selected, and your site will be transformed immediately. Visitors with a user account on the site are able to select their own personal theme.

Multi-Lingual Interface

PHP-Nuke comes with many language files. These contain translations of standard elements on the site interface. The availability of these translations reflects the international nature of the PHP‑Nuke community.

 

PHP-Nuke as an Open-Source Content Management System


We used the expression 'open-source content management system' earlier in the chapter to describe PHP-Nuke. Let's take a closer a look at this term.

Open Source

PHP-Nuke is free, and it is also open source. After downloading PHP-Nuke, all the source code of the application is there in front of you. This means, if you are so inclined, you can dig around to see how it works, or check why something is not working as it should. PHP-Nuke is not a perfect application (what is?), and there will always be parts that do not work as they should. Since there are many people using PHP-Nuke on the Internet, the problem is usually spotted and the solution is posted on one of the PHP-Nuke forums.

Another advantage of having the source of the application (the code) available to you is that you can modify (hack!) it, or extend it in whichever way you choose.

PHP-Nuke is released under a license, the GNU General Public License (GPL). The GPL bestows much freedom in the way that you can work with PHP-Nuke, and it also brings along some restrictions. The ins and outs of the GPL are pretty complex, and we aren't even going to attempt an in-depth discussion of the consequences of this. For more information about the GPL visit http://en.wikipedia.org/wiki/GPL.

The GPL should always be respected. The GPL is one of the cornerstones of the Free Software movement, which was set up to promote rights to use, modify, and redistribute computer programs. The GPL offers you almost complete freedom in your use of the software, and means, basically, that PHP-Nuke will not be going away. Even if some future version of it were to become completely commercial, the existing code could be taken and modified to create a new version, also released with a GPL license. This process, known as forking, accounts for a number of the PHP-based content management systems that can be found on the Web today. A number of other established systems, such as XOOPS and PostNuke, began life as 'forks' of PHP-Nuke, and have evolved in their own particular direction.

There are a couple of restrictions with PHP-Nuke, involving copyright messages. For example, the copyright message displayed at the foot of each page should not be removed from your page:

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may
redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.

If you wish to remove this message (and others like it), you should visit http://php-nuke.org to find out about the commercial license. You should not find these requirements restricting your use of PHP-Nuke.

Content Management System

We have spoken a lot about adding and editing 'information' on a website. A broader term for information here would be 'content'. To summarize our earlier discussions of PHP-Nuke, it allows you to manage the content of your site. In other words, it's a content management system.

According to Wikipedia, a Content Management System (CMS) is a 'system used to organize and facilitate collaborative creation of documents and other content' (http://en.wikipedia.org/ wiki/Content_management_system).

Well, it is difficult to define content management system and avoid the words 'a system for managing content'!

You can think of a content management system as playing three roles:

  • Capturing content

  • Maintaining and Organizing content

  • Servingcontent

Capturing the content is usually done by users entering data in forms in a web browser. This content is then stored in a database for later retrieval. Serving the content allows the right data to be selected, sorted, and ordered, and then displayed to the visitor in a coherent and consistent way.

PHP-Nuke achieves all of these. Visitors or the site administrator can input content from a range of places on the site. This content can be maintained and organized from the web-based administration interface by the site administrator. When a visitor requests a page from the site, PHP-Nuke will determine which content should be displayed and how it should be ordered. It then handles the output of the content, along with the rest of the page.

 

Getting Help in the PHP-Nuke Community


PHP-Nuke has a substantial user base. There is a large group of people who run PHP-Nuke sites, develop extensions to PHP-Nuke, and create visual customizations, among other activities. All this leads to a vibrant community that pushes the product forward, helps to address the problems faced by people working with PHP-Nuke, and offers support and encouragement to users.

There are a number of sites dedicated to PHP-Nuke that contain a range of PHP-Nuke resources, such as add-ons, bug fixes and patches, tutorials, and so on. You will also find the option of paid support for PHP-Nuke, and since PHP-Nuke is such a popular and widespread application, it will not be difficult to find a PHP developer who has experience of working with PHP-Nuke.

Each of these sites is well worth a visit to see what they offer:

  • http://phpnuke.org: This is the home of PHP-Nuke, run by Francisco Burzi, the creator and maintainer of PHP-Nuke. From here, you can download the latest version of PHP-Nuke. This is also a good place to find news of the latest offerings from the PHP-Nuke community, including new sites running on PHP-Nuke.

  • http://www.nukecops.com: There is a particularly large forum here, with many posts on problems encountered by PHP-Nuke users. If you find yourself with a problem, then the Nukecops.com forums are a good bet to find a solution.

  • http://www.nukeresources.com: This is the home of the PHP-Nuke patches that we will use when installing PHP-Nuke. There is also an extensive list of downloads here, as well as a number of tutorials.

  • http://www.karakas-online.de/EN-Book/: This is the PHP-Nuke HOWTO. This is a massive collection of tips and tricks for working with PHP-Nuke, solving common problems, and useful hacks. This document is also found on a number of other PHP-Nuke websites as the PHP-Nuke HOWTO.

  • http://thethemes.cc/: This is a site with dozens of PHP-Nuke themes aimed at gaming sites.

  • http://ravenphpscripts.com/: NukeSentinel, a security add-on for PHP-Nuke, can be found here.

Many of the PHP-Nuke sites will have links to other recommended PHP-Nuke sites. In addition to providing valuable resources and information, all these sites will give you a good idea of what it is possible to accomplish on a PHP-Nuke site.

 

The Dinosaur Portal


We're going to create an example site, the Dinosaur Portal, as we move through the book. The Dinosaur Portal does not have an extensive list of requirements; we simply want to create a site with features such as a structure for adding dinosaur-related stories and a place for entering information about various dinosaurs. We also want to make sure that the site looks very distinctive, and is fun.

The Dinosaur Portal is based around the premise that 'just because you haven't seen a dinosaur, it doesn't mean they've all died out'. It will be a place where people can explore a range of rather fantastical theories about dinosaurs and their interactions with other life forms.

A web portal is a site that is a gateway to other resources on the Internet (or possibly an intranet). The features of PHP-Nuke are ideal for creating web portals, and the Dinosaur Portal will be a gateway to a whole host of eclectic, dinosaur-based resources.

 

Summary


This first chapter has introduced PHP-Nuke. PHP-Nuke is an open-source content management system; you can also think of it as a free tool for managing the content of websites.

We looked at what PHP-Nuke offers in terms of a visitor experience, and also what this will mean for the person who is in charge of maintaining the site. PHP-Nuke has functionality to make site maintenance easy, and the site can be run from a web-based interface. We found out about the PHP-Nuke community, and where to go for help or further PHP-Nuke resources.

The chapter concluded with a quick description of the Dinosaur Portal—the site we are going to create in this book. We are ready to begin on this journey, so the next step is to actually get PHP‑Nuke up and running.

Building Websites with PHP-Nuke
Unlock this book and the full library FREE for 7 days
Start now