12 min read

Your Site, Your Database

The database that we created when we installed PHP-Nuke is PHP-Nuke’s storage repository.

That may sound like a rather trivial remark; we know PHP-Nuke is a database-driven web content management system. However, it is worth understanding the nature of what PHP-Nuke stores. PHP-Nuke stores not only information about registered users of the site, and such things as your news stories, features about you, your company, or your club, your photos and other images, but also stores all the information about your site and the content it holds.

In its database, PHP-Nuke stores such things as the name of your site, the site URL, the site logo, how many stories are displayed on the front page, whether users can comment anonymously on stories, the footer text displayed at the bottom of the page, how many people have read the stories, the voting information about stories, and also what layout and choice of colors are used to display the site. There are many, many more things PHP-Nuke squirrels away into its database, but the point in general is that your site is determined by the contents of its database.

This may sound rather overwhelming, particularly if you are new to databases—but this is precisely where the real power of PHP-Nuke lies. You don’t have to be a MySQL master or know anything about the finer points of database theory; in fact, you generally won’t be touching the database yourself. PHP-Nuke has a powerful web-based administration tool that lets you control and maintain your site. Through it you are effectively managing the database but this is happening behind the scenes and it is not something that you need to overly concern yourself with.

Visiting the Administration Area

With PHP-Nuke’s awesome administration tool, you manage your site through your browser, controlling almost every aspect of its behavior, as well as adding and maintaining the content that is displayed. This doesn’t mean that anyone can mess with your site; access to the administration area is restricted. You, the super user, as head of administrators have supreme power and can even appoint other people to act as limited administrators, with specific abilities to moderate and approve content for certain parts of the site.

PHP-Nuke’s administration area can sometimes feel too comprehensive and often be overwhelming, occasionally counterintuitive in its behavior. This is the jungle we will beat our way through in the next few articles of the series, and in fact, it’s where you will spend most of your PHP-Nuke life (the administration area, not these articles!).

The first thing to do is to log in to the administrator account. Enter the following URL into your browser:

http://localhost/nuke/admin.php

If you are not already logged in, you will be prompted for the administrator username and password created in the previous article—Your First Page with PHP-Nuke. Enter these and click the Login button to proceed.

Once you log in, you will be in the administration area and are confronted with two monstrous administration menus in the center of the screen:

Building Websites with PHP-Nuke

This is the central hub of the administration interface. Each of the icons you see on screen is a link to specific parts of the administration area, responsible for the control and management of particular features. If you scroll down the page, you will find some panels with information about the current home module, how many users are online, and some details of recently published stories, although at the moment, there is not much to see in any of these displays since we have no content or users!

The top menu of the administration interface, the Administration Menu, has icons for general ‘system’ management functions. These control the ‘core’ operations of PHP-Nuke, such as:

  • Block and module management
  • Database backup and optimization
  • Banner management, users and user groups, and newsletters
  • Site configuration
  • Logging out of the administrator account

The lower menu, Modules Administration, has icons that take you through to the administration areas of individual modules. There is also another logout link.

Note that if you are using a version of PHP-Nuke earlier than 7.5, there is only one large menu, the Administration Menu, and this contains all the above icons mixed in together.

The two-menu split emphasizes the division of labor for managing a PHP-Nuke.

  • The top menu has tasks for maintaining and configuring the site.
  • The bottom menu has tasks for maintaining and configuring individual modules.

First experiences of the administration menu are often perplexing—you click on one of the images and the page reloads, but nothing seems to have happened. The menus are still there in the middle of your page, grinning at you. (Particularly the rather gruesome looking IP Ban icon; you may begin to believe its eyes follow you around the room.)

What you’re actually after is displayed below the menus. By default, the administration menus are always displayed at the top of the page in the administration area; the action you’re trying to do is contained in the panels underneath, and you will generally have to scroll down to get at what you want. Possibly, if your screen resolution is sufficiently high and your browser window sufficiently sized, then you won’t get this problem, but for most of us, we will find ourselves wondering if anything has happened.

The advantage of these ever-present menus is that if you suddenly find yourself needing to switch to another task, you simply scroll back up to the top of the page and click on the desired icon.

If you want to return to the administration homepage at any point, you can either enter the URL of the administration homepage (http://localhost/nuke/admin.php) or if you glance to the left-hand side of your page, you will see the Administration block.

Building Websites with PHP-Nuke

The top link in this block, Administration, returns you to the administration homepage. This block is ever present if you are logged in as the administrator. Administrator movements are not necessarily restricted to the ‘back end’ (the administration interface) of the site. You can also visit the ‘front end’ of the site and view the site as your visitors see it. However, for the administrator, extra, context-sensitive links appear on various items that provide you with a fast track to the administration area, and let you control that item. We’ll see more of these links as we look in detail at the default modules over the next few articles of the series.

Also, there are special blocks that are only visible to the administrator, the Administration block being one of them.

You can replace the graphical administration menus by a more manageable text menu, but for now we will be working in the more familiar graphical environment, at least until we know our way round.

Site Preferences

Our first job will be to change some global settings of our site; we do so by clicking on the Preferences option:

Building Websites with PHP-Nuke

When you do this, the page will reload and the Administration Menu will reappear, and then you should scroll down to the Web Site Configuration menu. This is a long list of options; the top part is shown in the following figure:

Building Websites with PHP-Nuke

At the foot of the list is a Save Changes button (not seen in the screenshot as it is too far below). This button has to be clicked for any changes to persist.

The list of Web Site Configuration options is divided into a number of panels, grouping together options for particular tasks:

  • General Site Info
  • Multilingual Options
  • Banners Options
  • Footer Messages
  • Backend Configuration
  • Mail New Stories to Admin
  • Comments Moderation
  • Comments Option
  • Graphics Options
  • Miscellaneous Options
  • Users Options
  • Censure Options

We won’t look at all of these panels now; instead we will look at them as we need them. For example, when covering story management in the article—Story Management with PHP-Nuke, we’ll explore the Comments Moderation, Comments Option, Censure Options, Backend Configuration, and the Mail New Stories to Admin panels.

We shall now look at some of the options in General Site Info; these control some basic options for our site.

First up is the Site Name option. This is the name of your site, and is usually displayed in the title-bar at the top of the browser. It also used in any text referring to your site, such as email messages automatically sent out by the site (for example, the confirmation message sent to a user who has created an account on your site).

Let’s stamp the identity of this site, by changing the Site Name value to the Dinosaur Portal:

Building Websites with PHP-Nuke

Now scroll to the bottom of the list of preferences where you see the Save Changes button. Click this to update your site. After the page reloads, you should see that the title bar in your browser has changed from PHP-Nuke Powered Site to our new site name—the Dinosaur Portal.

When the page reloads, you are still on the Web Site Configuration menu page. This is good in case you need to make any further changes, or if you got something wrong with the last change you made. There are some parts of the PHP-Nuke administration interface where clicking a Save or Ok button does not keep you in the same part of the administration interface but returns you to the administration homepage. This kind of thing can make you lose your bearings early on.

Although we only made one change before clicking the Save Changes button, you can, of course, make as many changes to the preferences as you like before clicking the button.

The Site URL is important too. This field holds the URL of your site homepage (without the index.php bit). If you specify the wrong Site URL or, more likely, forget to change it from http://phpnuke.org, then the consequences are not drastic; visitors will not suddenly find themselves transported to another site when they click a link on your site. However, the Site URL is used in emails sent to newly registered users with a link to confirm their registration. With the wrong Site URL here, people will go to the wrong site to register (and fail!). We will remind you of this when we discuss emails sent out by the system.

Let’s change the Site URL before we forget. Since our site is at http://localhost/nuke, enter that into the Site URL field, and then scroll down and click the Save Changes button.

The Site Slogan, Site Start Date, and Administrator Email are straightforward to change. The Administrator Email account is the email account that will be used to send out user registration confirmations. The Site Slogan value is used in the META DESCRIPTION tag in the page header of your page:

<META NAME="DESCRIPTION" CONTENT="Your slogan here">

This tag is used by some search engines to create the description of your page in its listing. (That is when you are visited by search engines, which is still a long way off!)

By default, the value of the META DESCRIPTION tag is fixed for all pages in PHP-Nuke, and takes the value of your Site Slogan field.

The Site Logo specifies an image used by some modules to ‘stamp’ their pages. This value does not control any site logo image that may appear in the site banner at the top of your page.

Another interesting option is the Default Theme for your site. This gives you a drop-down box with a list of the currently installed themes. Select NukeNews from the list, scroll down, and click Save Changes. When the page reloads, it looks rather different:

Building Websites with PHP-Nuke

Not bad for two clicks of a mouse. We just changed the site’s default theme and immediately the new theme has been applied, and we now have a very different looking site. It still ‘works’ the same, but it looks very different. One of the most obvious changes is the icons in the Administration Menu. There are some standard images in PHP-Nuke that can be overridden by images from the theme. The icons in the Administration Menu are one set of images that can be overridden like this.

Every visitor sees the theme that is specified as the default theme. Registered users have the option to choose their own theme, to personalize the site to their liking.

Now let’s select the DeepBlue theme from the list of themes and click the Save Changes button. In the next few articles we’re going to see a lot of screenshots from the PHP-Nuke administration interface and the front end, and they’re all going to be taken with the DeepBlue theme. If you’re not using this theme as you follow along, things could look different. The DeepBlue theme is the default theme.

Turning off the Graphical Icons

For future reference, if you get sick of the Administration Menu icons (perhaps the terrifying IP Ban icon is finally getting to you), the Graphics Options panel is where you can turn off the graphical administration menu:

Building Websites with PHP-Nuke

We will leave it set to Yes for now as we explore the administration interface. When you feel more confident, you can return here and set it to No to replace the graphical menu by a text menu.

The Cookie Crumbles

That’s enough of the Web Site Configuration menu for now. Don’t worry; we will come back to it over the next few articles. Your next task is to close your browser.

Now open a new browser window, and navigate to your site’s homepage (http://localhost/nuke/). You will notice that you are still logged in as the administrator—you can see the Administration block in the left-hand side column.

You may find this rather strange—you didn’t enter a username or a password or go through the admin.php page, so how did it know? The answer is a cookie. PHP-Nuke issues cookies to visitors, which contain a number of user preferences, including their login details. This means that when the visitor returns to the site they are identified, and dealt with accordingly. This explains why you are logged back in as an administrator without having taken any action.

An annoying side-effect is that if you wanted to view the site as a visitor and administrator at the same time, you would have to log out and log in again before viewing. Should you find yourself doing this often, an obvious solution is to use two different types of browsers—say Mozilla Firefox and Internet Explorer (cookies are distinct on the two applications)—so one can be your administration browser and the other can be your visitor browser.

LEAVE A REPLY

Please enter your comment!
Please enter your name here