Content Management Modules In PHP-Nuke

Exclusive offer: get 50% off this eBook here
Building Websites with PHP-Nuke

Building Websites with PHP-Nuke — Save 50%

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

$20.99    $10.50
by Douglas Paterson | March 2010 | MySQL Content Management Open Source PHP

The previous article of the series by Douglas Paterson, author of Building Websites with PHP-Nuke, shows us an overview of stories and the story publication process, also the way stories on our site are organized; stories are classified into topics and categories, and also how to edit and manage them. In this article which is the seventh article of the article series, we'll look at the PHP-Nuke modules for handling content. We will see how each of them works, how you add content with them, and what features they possess. We will cover these modules:

  • Content
  • FAQ
  • Encyclopedia
  • Web Links and Downloads
  • Reviews

For each module, we will explore both the visitor and administrator experience, and see how to work with the types of content these modules handle

Each of these modules handles a different type of content, as is hinted at by their name, and each offers a different amount of functionality for visitors to interact with the content. We will see all of this, and also see how each module organizes the content it manages.

Content

The Content module, as the name suggests, simply handles content. The Content module is handy for adding general pieces of information to your site, which are not particularly time-sensitive or intended to generate discussion.

The 'content' of the Content module is called a content page, and content pages may be organized into categories. Note that these categories have nothing to do with the categories created for news stories. In fact, several of the modules in this article will organize their content into 'categories', and there will be no relation between the categories of one module and the categories of another module.

A content page consists of some main page text, a title, a subtitle, a header and footer, and another field, called the signature. The display of a single content page may be split easily across several web pages, with PHP-Nuke providing Next and Previous page links automatically. Content pages are ideal for holding general pieces of HTML text that need to be organized into groups or categories. Using the Content module to handle such information means that you do not have to create a new module just to display things like site policy or privacy policy documents on your site.

Content pages are not searched by the Search module.

There are no comment features or ratings available for Content content, and only the administrator may add pages; there is no place for user-submitted content here.

In versions of PHP-Nuke prior to 7.5, there was a module called Sections, which was almost identical in functionality to Content, with the addition of an image for the categories. From PHP-Nuke 7.5, the Sections module is no longer shipped with the standard installation of PHP-Nuke, and we will not consider it any further.

Like the other modules, the Content module is not activated by default, if you didn't activate the Content module before, do so now.

Time For Action—Creating a Content Category

We are going to use the Content module to add site 'policy' documents, in this case a site Privacy Policy.

  1. Log in as administrator.
  2. To access the Content administration area, click on the Content link in the Administration block, or click on the Content icon in the Modules menu:

    Content Management Modules In PHP-Nuke

  3. In the Add a New Category panel, enter the text Site Documents into the Title field.
  4. Enter the following text into the Description field: Here you will find a collection of documents about the site.
  5. Click the Add button.
  6. When the page reloads, there isn't much evidence that your category has been entered, but if you scroll down the screen to the Edit Category panel, you will find the category in the Category drop-down box:

    Content Management Modules In PHP-Nuke

What Just Happened?

We just added a content category. They are added from the Content Manager area of the administration area. The disconcerting thing is that it's difficult to tell if your category has been added successfully; there is no list of the content categories displayed in the Content Manager area. You will have to look in the drop-down box in the Edit Category panel to confirm that your category has indeed been added.

Now we have a category, let's add some pages.

Time For Action—Adding a Content Page

  1. In the Content Manager area of the administration area, scroll down to find the Add a New Page panel.
  2. Enter the title of the page into the Title textbox. In our case, this page will be titled Privacy Policy.
  3. Select Site Documents from the Category drop-down box.
  4. Enter the Dinosaur Portal Privacy Policy into the Sub-Title field.
  5. Next comes the Header Text. Enter the following into that field:
    This policy applies to all web sites and email services provided by the Dinosaur Portal. By using these web sites you consent to the general terms and conditions of usage and to the terms of this privacy policy.
  6. The Page Text field contains the body of the page. We'll enter the following:
    <h2>Collection of your Personal Information</h2>
    <p>We will ask you when we need information that personally
    identifies you (personal information) or allows us to contact
    you. Generally, we request this information when you are
    registering before ordering products from theDinosaurPortal.com,
    downloading or viewing limited-access content, entering a contest,
    ordering email newsletters. In each circumstance we try to limit
    the information we request to the minimum required to deliver the
    service to you. We also use various standard technologies such as
    cookies to track user activity on our sites.</p>
    <!--pagebreak-->
    <h2>Use of your Personal Information</h2>
    <p>We use your personal information for the following purposes...</p>
  7. There are two fields remaining, Footer Text and Signature. We'll enter this for the Footer Text:
    If you require any further assistance, please contact contact@thedinosaurportal.com

    and this for the Signature:
    the DINOSAUR PORTAL – Just because you've never seen one, doesn't mean they've all died out...

  8. Click the Send button.
  9. When the page reloads, the details of our first page are visible in the Content Manager panel, confirming its creation:

    Content Management Modules In PHP-Nuke

  10. Now click on the Content link in the Modules block, or go straight to http://localhost/nuke/modules.php?name=Content. You will see the list of content categories:

    Content Management Modules In PHP-Nuke

  11. Click on the Site Documents link, and you will see the list of content pages in this category:

    Content Management Modules In PHP-Nuke

  12. Clicking on the Privacy Policy link will take us to our document:

    Content Management Modules In PHP-Nuke

  13. Click the Next Page link to see the rest of the document:

    Content Management Modules In PHP-Nuke

What Just Happened?

We just added a content page, and then viewed the page. We assigned the content page to the Site Documents category when we created the page. It is possible to create content pages that do not belong to any category. The current list of content pages is shown in a table in the Content Manager area; we saw this screenshot at the end of step 11.

When you visit the front page of the Content module, the list of categories is displayed. Only the categories that have content pages associated with them are displayed. Also, if there are any content pages not associated with a category, their titles will be listed here.

Clicking on a category takes you to a list of the content pages associated with that category. This list is ordered by the date on which the pages were entered; the content page created first is displayed at the top of the list and so on. For each content page, the text entered into its Title field is displayed in this list, along with the Sub-Title in brackets. Clicking on the title of a content page will take you to display of the page itself. The following diagram shows this navigation hierarchy:

Content Management Modules In PHP-Nuke

Note that there is no direct link to go back from the content page to its 'parent' category. You will have to use the Back button of your browser to do this. You can get back to the list of all categories by clicking the Content link in the Modules block, but you will still need to click again on the category to display the list of content pages it contains.

Returning to our privacy content page, we see that our content page has been split into two pages. This is done by inserting the <!--pagebreak--> text into the Page Text field, which forces PHP-Nuke to break the page at that point. The contents of the Page Text field form the body of a content page, with the Title and Sub-Title always displayed at the top.

The Next Page pager is automatically provided by PHP-Nuke, and with that you can navigate through the pages of the content page. On the first page, the Header Text is displayed before the Page Text starts, and on the final page, the Footer Text is displayed at the end of the Page Text, followed by the Signature text. A copyright notice, including the site name, follows the Signature, and then there is the date the page was created, followed by the number of times the page has been read.

Since we were still logged in as an administrator, at each part of this journey there are panels allowing you to edit the details of either the category or the content pages. For example, there is a panel for altering the category on the page displaying that category's content pages, in addition to a 'content page editing' panel on each page of the content itself:

Content Management Modules In PHP-Nuke

Any of these links can be used to change the object in question. Of course, these links are visible only to an administrator. No visitor will be able to see these links or access their functionality.

Deactivating a page makes it invisible to a visitor from the list of available content pages, and the page will not be displayed even if the visitor manages to enter the URL of the content page. The administrator will be able to see a list of deactivated pages on the front page of the Content module (http://localhost/nuke/modules.php?name=Content) or in the Content Manager area of the administration area.

Currently, our Privacy Policy document is at the URL http://localhost/nuke/modules.php? name=Content&pa=showpage&pid=1. To view this page, the visitor need not go through the entire Content 'hierarchy' if they are provided with a direct link. We could, for example, add a link to the Privacy Policy in the footer of our page, from the Web Site Configuration menu. The link would point to the above URL, and the reader would be taken directly to our document.

The pid value of the query string is the unique identifier for this piece of content in the same way as we saw the story ID when looking at stories. This value will not change with subsequent modifications of the content page, or even moving it to another category.

The Content Block

The Content block is part of the standard PHP-Nuke installation, but isn't loaded. You can load this block from Blocks area of the administration area by selecting Content from the Filename dropdown, and choosing a title for the block as usually done for file blocks.

Once the block is activated, it will display a list of the titles of all active content pages, with links to view each content page in full.

Note that the Content block will still display the list of titles present in the content pages even if the user does not have read access to the Content module.

Managing Categories

Categories can be edited or deleted through the Edit Category panel in the Content Manager area. Simply select a category from the drop-down box and click the Edit button to go to the Edit Category page. Here you can edit the title and description of the category, or delete the category.

Note that deleting the category does not delete the content pages associated with that category. All pages in a deleted category are preserved, but no longer belong to any category (they belong to the None category!).

Special Administrator

You can create a special administrator with rights to only the Content module in the Edit Admins menu of the Administration Menu.

Restricting Access

Access to the Content module is done on a 'whole module' basis. The visitor either sees nothing or everything. You cannot configure individual categories or content pages to be viewed by certain user groups.

Points and Prizes

There are no activities in the Content module that contribute any points towards a user's point score.

Building Websites with PHP-Nuke A practical guide to creating and maintaining your own community website with PHP-Nuke
Published: November 2005
eBook Price: $20.99
Book Price: $29.99
See more
Select your format and quantity:

FAQ

The FAQ (Frequently Asked Questions) module allows you to create categories of questions, with answers. This module contains a list of questions (and their answers) frequently asked by visitors.

Only an administrator may enter questions and answers, and by default, the text in neither the question nor the answer is searchable. However, if you provide suitably named categories it should not be difficult for a visitor to find the question they are after.

By default, the FAQ module is not activated.

Time For Action—Adding a FAQ Category

  1. Log in as the administrator.
  2. Click the FAQ icon in the Modules menu of the administration area:

    Content Management Modules In PHP-Nuke

  3. We first need to create a new category. We will create a category called Dinosaur Survival Tips. This category will provide visitors with answers to common questions about what to do when confronted with some marauding dinosaur. Enter the text Dinosaur Survival Tips into the Categories field to create a new category with this name.
  4. Click the Save button.
  5. The title of our newly created FAQ category is displayed, along with links to add a question to that category, edit the title of the category, or delete the category:

    Content Management Modules In PHP-Nuke

What Just Happened?

We visited the FAQ Administration area and created the new category. All that was required was for us to specify the category title. The current list of categories is displayed in a table, along with three icons for each category. The first icon is the Content icon, which allows you to add a FAQ to that category. The next icon is the Edit icon, which allows you to modify the category title. The final icon is the Delete icon, which removes the category.

Time For Action—Adding a FAQ

Now that we have a category, we can add a question (and answer) to it:

  1. In the table of Active FAQs in the FAQ Administration area, find our Dinosaur Survival Tips category. (We only have one category—it shouldn't be too hard to find.)
  2. Click the Content icon of the Dinosaur Survival Tips category to add a new question to that category. You will be taken to the Add a New Question panel. Enter the following text into the Question field:
    What do I do if a fearsome Allosaurus tries to bite me? and into the Answer field, type:
    Bite it. <br><br>
    The <b>Allosaurus</b> is actually rather
    timid, and a quick chomp
    will put him back in his place.
  3. Click the Save button.
  4. Our new question is now displayed, along with links to edit it further, or delete it. We are done here.

    Content Management Modules In PHP-Nuke

  5. Let's see what the visitor will see. Click the FAQ link in the Modules block on the left-hand side of the screen to start the FAQ module:

    Content Management Modules In PHP-Nuke

  6. We have only one category, so click the Dinosaur Survival Tips category and the questions in that category will be displayed. Underneath the questions, the answers are displayed. Clicking on any of the questions will take you down to the part of the page containing the answer:

    Content Management Modules In PHP-Nuke

  7. Clicking the Back to Top link will take you back to the list of questions, and the Back to FAQ Index link takes you back to the list of FAQ categories.

What Just Happened?

We just added a FAQ. We selected the category to add the FAQ to (from the list of Active FAQs), and then provided the question and answer, and we were done.

Managing FAQs

From the list of FAQ categories shown in the Active FAQs panel of the FAQ Administration area, we can edit the category title, delete the category, or modify questions in that category.

Note that deleting a FAQ category will delete all the questions associated with that category. You should also be aware that there is no functionality to move questions from one category to another other than by manual copy and paste of the question and answer texts.

Editing a FAQ

Clicking the Content icon of a category in the FAQ Administration area brings up a list of entered questions for that category, and allows you to enter a new question, or edit an existing question. In the list of questions here and when presented to the visitor, the most recently entered FAQ is displayed first, and then the next most recent FAQ and so on. In other words, the list of FAQs is ordered by the date the FAQ was entered, in descending order.

The FAQ Block

There is no block shipped with PHP-Nuke for displaying the list of most recent FAQs or FAQ categories.

Special Administrator

You can create a special administrator with rights to only the FAQ module in the Edit Admins menu of the Administration area.

Restricting Access

Access to the FAQ module is done on a 'whole module' basis. The visitor either sees nothing or everything. You cannot configure individual categories or questions to be viewed by certain user groups.

Points and Prizes

There are no activities in the FAQ module that contribute any points towards a user's point score.

Encyclopedia

The Encyclopedia module provides sets of 'alphabetized' entries. As the name suggests, this module is used as a reference for terms or definitions. The collection of terms is known as an encyclopedia, and the Encyclopedia module allows you to create these, and then add terms or entries to each encyclopedia.

Only an administrator may enter encyclopedia entries or create a new encyclopedia. Entries are searchable from the Search module, but it is easy to retrieve an entry in an encyclopedia since the module offers a simple, alphabetical navigation menu.

By default, the Encyclopedia module is not activated

We will make use of the Encyclopedia module to provide information about a range of dinosaurs. We can create different encyclopedias for the different periods during which dinosaurs existed (Triassic, Cretaceous, Jurassic, and so on).

Time For Action—Adding a new Encyclopedia

  1. Log in as the administrator.
  2. Click on the Encyclopedia icon in the Modules Administration area:

    Content Management Modules In PHP-Nuke

  3. You are in the Encyclopedia Manager area; scroll down to find the Add a New Encyclopedia Panel, and enter The Jurassic Period into the Title field.
  4. Enter the following for the Description:
    A collection of dinosaurs from the Jurassic period, which began some 210 million years ago, and lasted for about 70 million years.
  5. Make sure that Activate this Page? is set to Yes.
  6. Click the Save button.
  7. When the page reloads, the title of your newly created encyclopedia is displayed in the list of existing encyclopedia:

    Content Management Modules In PHP-Nuke

What Just Happened?

You just added a new encyclopedia; all that was required was a title and a description, and this was entered from the Encyclopedia Manager area of the administration area. A table of created encyclopedias is displayed in the Encyclopedia Manager area, along with icons for editing the titles and descriptions, activating or deactivating each encyclopedia, or deleting each encyclopedia entirely. Also displayed is a count of the number of terms currently entered for each encyclopedia, and whether that encyclopedia has currently been activated. Each of the icons is one of the familiar ones that we have seen much of before, and their meaning should be clear. Simply hover the mouse cursor over one of the icons to be reminded of its action.

Note that an encyclopedia has to be activated before it can be displayed to the visitor.

Time For Action—Adding a new Entry

Now that we have an encyclopedia, we can add our first definition to our encyclopedia.

  1. In the Encyclopedia Manager area, scroll down to find the Add a New Encyclopedia Term panel.
  2. The definition will require a title and some body text, and then needs to be assigned to an encyclopedia. Let's add the Title of Allosaurus.
  3. In the Term Text field, we will enter the following:
    The Allosaurus lived about 150 to 145 million years ago in the Late Jurassic period. Allosaurus was a carnivore with big, curved teeth that were grooved for extra sharpness, and was about 12m long and weighed up to 3 tonnes.
  4. Select The Jurassic Period from the Encyclopedia drop-down box.
  5. Click the Add button.
  6. When the page reloads, you can see from the count of terms that our encyclopedia now has an entry:

    Content Management Modules In PHP-Nuke

What Just Happened?

We just added an encyclopedia entry. Entries are added from the Add a New Encyclopedia Term panel below the Add a New Encyclopedia panel. You provide the title and text for the entry, and then you select the encyclopedia to add the entry to from a drop-down box. In the same way as you could with Content pages, you can create multi-page entries by inserting <!--pagebreak--> into your text, and the text will be broken at that point, with PHP-Nuke providing the Next and Previous page navigation for you.

Managing the Encyclopedia

Once an encyclopedia is created, you can edit its title to rename it, deactivate it, or delete it completely. This can be done from either the Encyclopedia Manager area, or from the visitor end of the site when logged is as the administrator:

Content Management Modules In PHP-Nuke

If you choose to delete an encyclopedia, you will be prompted to confirm your choice before the encyclopedia is deleted.

Note that deleting an encyclopedia will delete all the entries associated with it. You should also be aware that there is no way to move entries from one encyclopedia to another other than by manual copy and paste of the entries.

Viewing the Encyclopedia

To get a proper visitor's view of the Encyclopedia, we'll log out by clicking the Logout link in the Administration block, or the Logout icons in the Administration Menu.

The list of active encyclopedias is found by clicking on the Encyclopedia link in the Modules block. The title of each encyclopedia along with its description is then shown:

Content Management Modules In PHP-Nuke

There are Edit, Deactivate, and Delete links that are only shown when you are logged in as the administrator; the administrator is also able to see any deactivated encyclopedia listed here. As mentioned above, these extra links take you to the Encyclopedia Manager area from where you can edit, deactivate, or delete that encyclopedia.

Clicking on the title of the encyclopedia will bring up the alphabetical navigation menu:

Content Management Modules In PHP-Nuke

Entries are alphabetized by the first letter of their title, and any letters that actually have entries are shown underlined; this is because they are actually links to those entries. In our case, we only have one entry, Allosaurus, so only the A entry is underlined. By clicking on one of these underlined entries you can view all the entries corresponding to that letter (we click on A):

Content Management Modules In PHP-Nuke

The entries will be arranged alphabetically by their titles. Clicking on any of the entries will display that entry's text. Here we click on our only entry, Allosaurus:

Content Management Modules In PHP-Nuke

In each of these screens, there is a Go Back link, which has the same effect as clicking Back in your browser; it does not necessarily take to you to the previous screen in the Encyclopedia navigation process unless that is where you have come from.

When logged in as the administrator, you will catch sight of an Edit link at the right-hand foot of the entry. Clicking this link takes you into the Encyclopedia Terms Edit panel in the Encyclopedia administration area. From this panel, you can edit the text of the entry, assign it to another encyclopedia if you like, or delete the entry entirely.

The Encyclopedia Block

There is an Encyclopedia block that ships with PHP-Nuke. (It is not displayed by default.) The Encyclopedia block simply displays a menu of the currently active encyclopedias, with links to view the entries in those encyclopedias.

Like the Content block, the Encyclopedia block will display the list of active encyclopedias even if the visitor does not have access to the Encyclopedia module to view the entries.

Special Administrator

An administrator for only the Encyclopedia module can be created from the Edit Admins area of the Administration Menu.

Restricting Access

Access to the Encyclopedia module is done on a 'whole module' basis. The visitor either sees nothing or everything. You cannot configure individual encyclopedias to be viewed only by certain user groups.

Points and Prizes

Since the visitor doesn't really do much with this module, there are no activities in the Encyclopedia module that contribute any points towards a user's score.

Web Links and Downloads

The Web Links module is an excellent piece of work; it provides directories of links to other websites. Visitors themselves are able to suggest sites and links to add to the collection, after administrator moderation.

The Web Links module has a 'sister' module, the Downloads module, with virtually identical functionality and use. One of the main differences between the modules is that while Web Links is used to manage links that will point at other web pages on other sites, Downloads is intended to manage links to files on other sites. When the visitor clicks on a download, they will download the file from the other site rather than viewing the page on that site. We won't spend much time covering the Downloads module here—you will be able to apply the Web Links expertise you gain here to that module.

Web Links works with links. For each link, you provide this information to PHP-Nuke:

  • The title of the page the link points to
  • A URL for the link
  • A description of the content of the page or site the link is pointing to

The text contained in these details can be searched from the Search module.

When you visit the index of the Web Links module, either by clicking the Web Links link in the Modules block or going straight to the URL, http://localhost/nuke/modules.php?name=Web_Links, the top panel gives you an idea of the features you can expect from the Web Links module:

Content Management Modules In PHP-Nuke

From here people can add their own links to the collection, view the newest links added, view the most popular (most clicked-on) links, or view the highest-rated web links. There is also an option to view a randomly-chosen link from the collection. All of this suggests that there is much that can be done with the Web Links module, for both administrator and visitor, so let's press on.

Links are organized into categories. Categories can be nested, so within one category you can have other categories. The top-level categories are called main categories.

For the Dinosaur Portal, we are going to add a Museums category. This will hold links to the websites of various Natural History and Dinosaur Museums around the world.

Time For Action—Creating a Web Link Category Structure

  1. Ensure you are logged in as the administration, and go to the administration menu.
  2. Click on the Web Links icon in the Modules Administration menu:

    Content Management Modules In PHP-Nuke

  3. You will come to the Web Links administration area. We are going to add a main category, our Museums category.
  4. Enter Museums in the Name field.
  5. Enter the following text into the Description field:
    Visit Natural History and Dinosaur Museums from all round the world.
  6. Click the Add button.
  7. When the page reloads, you will see the Add a Main Category panel again. Scroll down to find the Add a SUB-Category panel that has just appeared.
  8. In the Add a SUB-Category panel, enter North America into the Name field, and leave Museums selected in the drop-down box.
  9. Enter the following text into the Description field:
    Museums in North America.

    Content Management Modules In PHP-Nuke

  10. Click the Add button.

What Just Happened?

We just added two new categories, Museums and North America. Museums is a main (top-level) category and North America a subcategory. The parent category has to be created first, and then the subcategory is created from the Add a SUB-Category panel and added to the parent category.

Time For Action—Adding a Web Link

Our first link will point to the website of the Fossil Halls at the American Museum of Natural History in New York. We will add it to the North America subcategory of Museums.

  1. In the Web Links Administration page, under the Add a Main Category and Add a SUB-Category panel, you will find the Add a New Link panel.
  2. In the Add a New Link panel, enter Fossil Halls: American Museum of Natural History into the Page Title field.
  3. Enter the following URL into the Page URL field:
    http://www.amnh.org/exhibitions/permanent/fossilhalls/?src='//dgdsbygo8mp3h.cloudfront.net/sites/default/files/blank.gif' data-original=h_h
  4. Ensure that Museums/North America is selected from the Category drop-down box:

    Content Management Modules In PHP-Nuke

  5. In the Description field, enter the following text:
    This museum is home to the world's largest collection of vertebrate fossils, totaling nearly one million specimens.
  6. Enter your name into the Name field, and your email address into the Email field.
  7. Click the Add this URL button. When the page reloads, you will see a message confirming the successful addition of your file to the collection.
  8. Click the link to return to the Web Links administration page.

What Just Happened?

We just added our first web link. We provided a title for the link, the URL for the link, as well as a short description about the link. Note that the URL of the link can only appear once in the database; you cannot submit two different links pointing to the same URL. This will be refused by PHP-Nuke.

The link was assigned to the North America category by selecting it from the Category drop-down box. The 'full path' of the category shown in this drop-down box—Museums/North America—indicates that North America is a subcategory of Museums. If we were to go on to create a subcategory of North America, say MidWest, then it would appear as Museums/North America/MidWest in the drop-down box.

If you now click the Web Links link in the Modules block, or go straight to the URL http://localhost/nuke/modules.php?name=Web_Links, then you can see the list of web links. First, each of the main categories is displayed, followed by a list of its subcategories. At this point our web links database is rather bare:

Content Management Modules In PHP-Nuke

If you click the North America link, you will be taken to the list of web links within that category:

Content Management Modules In PHP-Nuke

The new text next to the title of the link indicates that it has been added to the database recently.

The visitor is able to sort the list of links with the Sort Links by options. The links can be sorted in ascending or descending order, and by title, date of submission, rating, or popularity, which we will come to in a minute.

To follow the link itself, and visit its target site, you simply click its title. Note that this link does not actually point to the target of the web link; it actually points back to another part of the Web Links module on our PHP-Nuke site, and from there, you will be redirected to the target of the link.

To follow the link itself, and visit its target site, you simply click its title. Note that this link does not actually point to the target of the web link; it actually points back to another part of the Web Links module on our PHP-Nuke site, and from there, you will be redirected to the target of the link.

If you click the link now, you will be taken to the Fossil Halls of the American Museum of Natural History. While that site is interesting in its own right, we still have to continue our work with the Web Links module.

Since clicking the link takes you to its target, we're going to refer to this page as the 'exit page' of the link. This will help us in a moment.

A consequence of the way PHP-Nuke handles web links is that there isn't actually any record of the URL of the web link on any of your pages. The link of a web link points back to your site, from where you are redirected to the target. There is no <a> tag anywhere in the page that points to the target site. This means that the Web Links module isn't suitable for link exchanges, where you put a link to someone's site on your site, in return for them putting a link to your site on theirs.

Although the Web Links module allows visitors to move easily from your site to other sites that may be of interest to them, the point of a link exchange is to actually increase incoming links to each site. The physical presence of the link in the page is beneficial to the search ranking of the target site, and this is often a primary purpose of link exchanges.

Interacting with Web Links

Visitors are able to rate a web link and add comments by clicking Rate this Site. This brings them to a page where they can score the target site from 1 to 10, and, if they don't have a bad or devil karma, they can add comments:

Content Management Modules In PHP-Nuke

After selecting your rating from the Rate this Resource dropdown, entering your comment, and then clicking the Rate this Resource button, you are presented with a thank-you screen and some options:

Content Management Modules In PHP-Nuke

Note that Report Broken Link is only shown to registered users. When you are logged in, you can only vote once for any particular link. Unregistered users are checked by their IP address—there can be only one rating submitted from a given IP address in a particular day, or PHP-Nuke will reject the rating.

The results of visitor ratings can be seen by clicking the Additional Details link. This brings up the Link Profile page, which shows how people have rated the web link, breaking down the votes between registered users, unregistered users, and outside voters, and showing a distribution of the scores within each of these groups:

Content Management Modules In PHP-Nuke

An outside vote is one where the rating has been done through an external website—the Is this your resource? Allow other users to rate it from your web site! link at the bottom of the Link Profile provides three options for website/resource owners to let visitors to their site vote in this poll.

Clicking on Link Comments at the top of the Links Profile area shows the comments left by visitors expressing what they thought of that link:

Content Management Modules In PHP-Nuke

Note that the Link Profile page can lead to some confusion since there is more than one route to the same feature. Once a rating has been logged for a web link, a Details link appears under the web link description:

Content Management Modules In PHP-Nuke

The Details link takes you to the Link Profile page we saw above. Once on the Link Profile page, there is an Additional Details link, which again points to the Link Profile page.

Similarly, when comments have been entered for a web link, a Comments link appears under the description, showing how many comments have been added for that web link . Clicking that Comments link will display the comments, and takes you to the same place as the Link Comments link from the Link Profile page.

Building Websites with PHP-Nuke A practical guide to creating and maintaining your own community website with PHP-Nuke
Published: November 2005
eBook Price: $20.99
Book Price: $29.99
See more
Select your format and quantity:

Checking the Web Link

Visitors are also able to assist the administrator of the site by reporting if the details of the web link are incorrect, or if the link is broken. Broken means the file is no longer there; possibly the website isn't available at this time, or maybe the website has stopped its service or the page has been moved. In any case, having your visitors submit corrections to existing information makes the job of managing a large number of web links easier.

Modifying Web Link Details

First of all, the visitor can click the Modify link to bring up the details of the current web link:

Content Management Modules In PHP-Nuke

The visitor is able to edit any of these fields, and click the Send Request button to notify the administrator that some of the details may need amending. We will see how to manage these modification requests in a moment.

Reporting Broken Links

When the visitor is a registered user and logged in, the other important way they can contribute to the Web Links module is to report broken links. This is done by clicking Report Broken Link under the web link description. This link is only visible to registered users.

Clicking this brings up a screen with a button to click to submit the broken link report:

Content Management Modules In PHP-Nuke

When the user clicks the Report Broken Link button, this link is submitted, and the user's job is done!

Submitting Web Links

Visitors are able to submit their own web links to be included in the list. Clicking Add Link from the top menu of the Web Links module brings up the familiar web link details screen:

Content Management Modules In PHP-Nuke

The user enters the details of their web link and then clicks Add this URL. A confirmation that their submission has been received is displayed, and the user's part is done.

Note that the submitted link is not immediately added to the system; administrator action is required before that happens. That's what we will look at now.

Managing Web Links

Now that we've seen what the visitor can do with a web link, let's have a look at what the administrator is able to do. We'll see how to:

  • Modify web link details
  • Manage user web link submissions, modifications, and broken link reports
  • Change the existing category structure and move web links from one category to another

Modifying Web Links

The details of a particular web link can be edited in one of two ways:

  • From an Edit link that appears under the web link description when logged in as the administrator
  • From the Modify a Link panel in the Web Link Administration area

Both of these methods take you to the same page for editing details. The first method is simple; when logged in as administrator, an Edit link appears for you on any given web link:

Content Management Modules In PHP-Nuke

Clicking this will take you to the Modify a Link page in the administration area, which we will look at in a moment.

The other way to access the details of a web link is from the Web Links administration area. Scroll down to find the Modify a Link panel:

Content Management Modules In PHP-Nuke

You enter the link ID and click the Modify button. This ID is found from the front-end display of the web link itself. Hover your mouse cursor over the title of the link, and the URL it points to will appear in your browser status bar. This URL will be of the form:
http://localhost/nuke/modules.php?name=Web_Links&l_op=visit&lid=1

The link ID is got from looking at the lid value in the URL. Here, the value is 1, and this is the link ID that we enter into the Modify a Link panel to begin editing its details:

Clicking the Modify button brings us to the Modify a Link page. This is the same page that we arrive at when we click Edit from the web link description:

Content Management Modules In PHP-Nuke

Here you can change any of the details of the web link, or reassign it a different category from the Category drop-down box. You click the Modify button to save your changes, or the Delete button to remove the web link from the database. Despite the fact these buttons are right next to the Category drop-down box, they do apply to the web link and are not ways to modify or delete categories. We'll come onto that in a moment.

Underneath the Modify a Link panel there is the Add Editorial panel.

This panel allows you to add some 'editorial' comments about the web link, and the presence of an editorial is indicated by an Editorial link that appears under the link description:

Content Management Modules In PHP-Nuke

The editorial text can be viewed by clicking that link or by clicking the Editor Review link of the Link Profile page.

There is more underneath the Add Editorial panel when you edit web link details. You can find a list of all the comments and ratings that have been submitted for that web link:

Content Management Modules In PHP-Nuke

If you have a large number of ratings for your web link, this could be a very long list!

Each table has a Delete column, and clicking the X link in that column will remove the comment or the rating of the web link.

Managing User-Submitted Web Links

Earlier we saw ways for the visitor to submit information about web links—requesting modifications to details, reporting a broken link, and also submitting a new web link. We left that at the point of the visitor making their submission, and now we'll continue from there.

Firstly we'll look at handling web links submitted by users. After the submission, the administrator will know there is a link submission in the queue by looking at the Waiting Content administration block.

Content Management Modules In PHP-Nuke

The number next to Links indicates the length of the queue for submitted web links. Clicking Waiting Links here brings you to the Links Waiting for Validation page:

Content Management Modules In PHP-Nuke

The Submitter field shows the name of the user who added the web link. After that, the details are the same as those that you worked with earlier while adding a web link through the administration area. Since these details were entered by another user, you will have to check through them carefully before deciding what to do with the web link.

You are able to edit and correct any of these details before clicking the Add button to accept the web link, or Delete to discard it. Clicking either of these will remove the web link from the queue.

Managing User-Submitted Modification Requests

Earlier we saw that a visitor is able to request changes to the web link details—possibly to point out an inaccuracy in it that needs to be corrected.

Once the visitor submits their change request, the Waiting Content administrator block notifies the administrator of it:

Content Management Modules In PHP-Nuke

Again, the number next to Mod. Links indicates the length of the queue for web link modification requests. Clicking that link brings you to the User Link Modification Requests page. Each of the submitted requests is shown along with the original web link and options to Accept or Ignore the request. Choosing to Accept or Ignore the request removes it from the queue. Clicking Accept will replace the existing web link details with the requested details. Be certain to check these details carefully! Clicking Ignore simply discards the request.

Managing User-Submitted Broken Link Notifications

We also saw earlier that visitors are able to report 'broken' links. In the same way as modification requests, the Waiting Content administration block also notifies you of any broken links submitted:

Content Management Modules In PHP-Nuke

Clicking Broken Links brings you to the User Reported Broken Links page, your control center for investigating these claims. All reports of broken links are listed here, along with options to Ignore (discard) the report, Delete the report and the web link that goes with it, or Edit the web link details to correct the link. The link itself is in the Link column—a click of that should confirm if your link is indeed broken.

Content Management Modules In PHP-Nuke

If you click the Edit link, and then correct the link, you will still have to return to the User Reported Broken Links page to discard the report.

An alternative way to access these last two features is from a menu at the top of the Web Links administration page:

Content Management Modules In PHP-Nuke

This menu has links to web link modification request and broken link reports that we have just seen, along with the Clean Links Votes link, which tidies up the rating totals and averages, resetting all the votes to zero for each link.

Validating Links

Although visitors can report broken links, it would be good for you to periodically check on the status of all your links, without having to go through them individually and click on all the links. This is done by clicking the Validate Links link.

This brings you to a list of your categories:

Content Management Modules In PHP-Nuke

By clicking one of the category titles, each web link in that category will be checked (or every web link in the database if you click Check ALL Links). Once this is complete, you see the status report:

Content Management Modules In PHP-Nuke

'Checking the links' means that PHP-Nuke will be sending a request to the server hosting each of your web links, and then waiting for a response. As such, this process could take quite a while, depending on various network connection factors. The Status column reports whether the link is Ok! or if there was some problem with the link.

In fact, link validation doesn't actually check if there is a problem with the target page at all, it only checks if there is a response from the host site of the link. If the target page of the web link has been moved to a different location on the host server (or even if it is no longer on that server), then the Status will still be Ok!, although the link itself is no longer useful. If the host doesn't exist or is unavailable at the time, only then will PHP-Nuke report a problem.

If the Status does show as Failed!, then you will find links in the Functions column to edit the web link details, or delete the web link entirely.

Changing Category Structure

It is also possible to modify the web link category structure. We have already seen how to create new categories, and now we will see how to 'move' categories around to different points in the hierarchy, and how to transport their web links along with the category.

The process that we describe here moves all the web links from one category to another. If you only want to move certain web links within a category, then you will have to do that on an individual basis by assigning them to a new category from the Modify a Link panel in the Web Links administration menu.

Time For Action—Moving Categories

We will add a subcategory of Museums called Fossils, and we will move our North America category along with its web links into that category.

  1. From the Web Links administration area, we begin by creating a new subcategory, Fossils, to go in the Museums category. Enter the details as shown, and click the Add button:

    Content Management Modules In PHP-Nuke

  2. Next we create another subcategory called North America. This has the same description as the North America category we created earlier, but this time, the category is a subcategory of Museums/Fossils. We enter the details, and click Add to create the subcategory:

    Content Management Modules In PHP-Nuke

  3. When the page reloads, scroll down the screen to find the Transfer all links from category panel. Select Museums/North America from the upper Category drop-down box:

    Content Management Modules In PHP-Nuke

  4. And now select Museums/Fossils/North America from the lower in Category drop-down box, and then click Transfer:

    Content Management Modules In PHP-Nuke

  5. When the page reloads, scroll down to the find the Modify a Category panel. Select the Museums/North America category from the Category dropdown, and click Modify.
  6. When the page reloads, you see the name and description of the category displayed; click the Delete button to delete this category:

    Content Management Modules In PHP-Nuke

  7. You will then be asked to confirm the deletion of this category, so click Yes.
  8. Now when you revisit the index of your Web Links, you will see the Fossils subcategory:

    Content Management Modules In PHP-Nuke

  9. Clicking the Fossils link shows the new Fossils/North America category that we just created, in which can be found the web links copied from the original Museums/North America category.

What Just Happened?

We moved a set of web links from one category to another. In PHP-Nuke, you can change the name or description of a category, but you cannot actually move it to another parent category. What we performed above achieved the equivalent of this.

To obtain the effect of moving a category to a new parent category, you first have to create the new subcategory in the 'target' category. This was done in the first two steps by creating the Fossils subcategory of Museums, and then a North America subcategory of Fossils. The Museums/Fossils/North America category is our target category, and it will become the new home for the web links of the Museums/North America category.

With the target category in place, the next step is to move the web links from one category to the other. This is done through the Transfer all links from category panel. From the top drop-down box in that panel you select the category that you are moving the web links from, and in the bottom drop-down box you select the category you are moving the web links to. After selecting these categories, clicking the Transfer button moves the web links from one category to the other.

At the end of step 4, we had created a new Museums/Fossils/North America category and moved all the web links from the existing Museums/North America category to that category. The final piece of tidying up was to delete the original Museums/North America category; this is done from the Modify a Category panel.

In this panel, you first select the category and then click the Modify button. This brings you to a screen where you can edit the details of the category, or click the Delete button to remove the category. Note that deleting a category removes all its web links from the database, in addition to removing any subcategories.

Web Links Block

 

The Top10_Links block that ships with PHP-Nuke displays the ten most viewed links, along with a link to their details. Similarly, there is a Top10_Downloads block that displays the ten most popular downloads.

Like the other blocks mentioned in this article, these blocks still display the list of links or downloads even if the visitor has no access to the modules themselves.

Special Administrator

An administrator with privileges only for the Web Links module can be created from the Edit Admins menu of the administration area.

Restricting Access

You can restrict access to the Web Links module from the Modules administration area as you can for any other module.

The same holds for the Downloads module. However, restricting access in this way means that before the visitor has even had a chance to see what downloads you have on offer, they are presented with the 'NO ACCESS' screen, and told they need to register or login to proceed.

You might consider this as rather unfriendly to your visitors; people may be prepared to register in order to get at a particular download, but they're not prepared to register blindly without knowing what's on offer.

One way of giving people a taste of what is in your Downloads module is through the Top 10 module. This module displays a list of 10 pieces of content from a variety of modules. Like many of the module blocks we have seen in this article, the list will be displayed to the visitor even if they do not have permission to access the full content itself. However, the Top10 module does not display a list of the top 10 web links, so this strategy will fail for Web Links.

Points and Prizes

There are a number of activities in the Web Links module that can earn points for registered visitors. The administrator can allot points for clicking a web link, rating a web link, or commenting on a web link. Same goes for the sister module, Downloads.

Reviews

The Reviews module enables the creation of a collection of articles, ratings, and comments about particular products, or indeed, about anything.

Like Encyclopedia, the reviews are alphabetized, and this makes it easy for the visitor to find a review on something—they simply have to know the first letter of the subject of the review to find it.

The image below shows the welcome screen of the Reviews module; the alphabetical navigation menu is clear:

Content Management Modules In PHP-Nuke

Clicking on any of the letters or digits brings up a list of the entered reviews whose titles begin with that letter:

Content Management Modules In PHP-Nuke

From the list of reviews, clicking the title of the review shows the review, and the list also shows the author of the review, the rating awarded in the review, and the number of views of that review. There are little arrows in the title bar of the list to sort the display by any of the columns.

Submitting Reviews

Reviews can be submitted by registered or unregistered visitors, and the submitted reviews need to be approved by the administrator before they are posted to the site. Administrator-submitted reviews go directly onto the site.

The review-submitting process begins by clicking the Write a Review link on the Reviews welcome page. This brings up a form for the details of the review; here is the top part:

Content Management Modules In PHP-Nuke

You enter the Product Title followed by the text of the review into the Review textbox. The Product Title must be entered, and so must some text for the review, or the review will not be accepted. Underneath it you will find more fields:

Content Management Modules In PHP-Nuke

You enter the Product Title followed by the text of the review into the Review textbox. The Product Title must be entered, and so must some text for the review, or the review will not be accepted. Underneath it you will find more fields:

First of all are fields for your name and email address. If you are already logged in, these will be filled with the details from your user account. The name and email address must be provided or the review is not accepted. Under those fields is a drop-down box to select a Score from 1 to 10. After that are fields for adding a link to the product website, and a title to accompany that link—if you enter some text for one of these fields you must enter text for them both.

To proceed, you must click the Preview button, or click Cancel to discard your review:

Content Management Modules In PHP-Nuke

Clicking the Yes button submits the review, or No goes back to the previous page to amend the details.

When logged in as the administrator, the review is immediately posted to the site, and can be seen in the list of recent reviews on the Reviews welcome page:

Content Management Modules In PHP-Nuke

Clicking the review title in this list will display the review immediately. If the review is submitted by an ordinary visitor, it goes into the reviews queue, and the length of the queue can be seen by the administrator in the Waiting Content administrator block:

Content Management Modules In PHP-Nuke

Clicking the Waiting Reviews link brings you to a page showing the Reviews Waiting for Validation panel, which—in the same way as you saw with the Web Link checking—displays the details of the review, and allows you to add or discard the review.

Interacting with Reviews

Visitors are able to post comments to submitted reviews. There is a Post Comment link on the review itself from where visitors can add their own opinion about the product, and their own rating. On each comment there is a Delete link for the administrator to remove the comment if required.

Managing Reviews

The administrator interface of the Reviews module is limited, since the power to edit and delete reviews is accessed from the review display itself. When logged in as administrator, there are Edit and Delete links embedded in the text of the review:

Content Management Modules In PHP-Nuke

These links give you power to manage the reviews in the database. Clicking the Edit link brings up a form that allows you edit the details of the review. After making your changes, you can preview your changes as you did earlier, and click Yes to accept them. Note that only the administrator can edit reviews in this way; the original submitter of the review cannot do so.

Customizing the Reviews Welcome Page

Clicking the Reviews icon in the Modules Administration menu brings you to the Reviews Administration page:

Content Management Modules In PHP-Nuke

The Reviews Administration page really has only one feature—the ability to change the text that is displayed on the reviews welcome page:

Content Management Modules In PHP-Nuke

Changing the text in these fields and clicking the Save Changes button gives your Reviews module a new-look front page:

Content Management Modules In PHP-Nuke

The Reviews Block

There is a Reviews block that ships with PHP-Nuke, but is not displayed by default. This block simply displays the titles of the ten most-recently entered reviews, with a link to read each review.

Special Administrator

You can create a special administrator with rights to only the Reviews module in the Edit Admins menu of the administration area. This administrator has the ability to approve or remove submitted reviews, in addition to posting their own.

Restricting Access

Access to the Reviews module is done on a 'whole module' basis. The visitor either sees nothing or everything. You cannot configure individual reviews to be viewed by certain user groups.

Points and Prizes

Posting a review is strangely not worth any points, but posting a comment to a review is eligible for earning user points.

Module Feature Comparison

We've now seen the major content types of PHP-Nuke. In an attempt to help you remember what you have seen, here is a table listing the content types for you to quickly compare the features they have:

Feature

Stories

Content

Web Links / Downloads

FAQ

Encyclopedia

Searchable

Yes

No

Yes

No

Yes

Categorized

Yes

Yes

Yes

Yes

Yes

Hierarchical

(nested)

No

 

No

 

Yes

 

No

 

No

 

Ordered By

Category

Topics

Date of Publication

Category

Category

Subcategory

Category

Encyclopedia

User Submitted Content

Yes

No

Yes

No

No

Ratings

Yes

No

Yes

No

No

Comments

Yes

No

No

No

No

Polls

Yes

No

No

No

No

Points Awarded

Yes

No

Yes

No

No

Special Administrator

Yes

Yes

Yes

Yes

Yes

Block Available

No

Yes

Yes

No

Yes

 

Summary

In this article we have had a tour of the other default modules that ship with PHP-Nuke, and seen the types of content they manage.

We looked at the Content, FAQ, Encyclopedia, Web Links and Downloads, and Reviews modules.

Each of these modules handles different types of content, but there are similarities. Each module organizes the content into hierarchical structures, and most allow their content to be searched from the Search module.

We saw that the Web Links and Downloads modules (which are very similar) have the most features among the modules in this article. These two modules allow users to submit their own links, rate or comment on existing links, and also help out the administrator by notifying the administrator of any broken link or download.

For each module, we looked at both the visitor and the administrator experience, seeing how to add, edit, and manage the content these modules work with. We also looked at the existence of blocks that come with PHP-Nuke that can be used to display lists of content from the module, as well as which module activities let the user earn points.

[ 1 | 2 |3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 ]

If you have read this article you may be interested to view :

About the Author :


Douglas Paterson

Douglas Paterson is a full-time acquisition editor and part-time author for Packt Publishing. He is a doctor of Mathematics and has over five years experience of working on programming books across a number of different subjects. He lives in Birmingham, England, with his wife, and his unusually hairy dog, Zak.

Contact Douglas Paterson

Books From Packt

Drupal 6 Performance Tips
Drupal 6 Performance Tips

Grok 1.0 Web Development
Grok 1.0 Web Development

CMS Made Simple 1.6: Beginner's Guide
CMS Made Simple 1.6: Beginner's Guide

Learning jQuery 1.3
Learning jQuery 1.3

Building Websites with Joomla! 1.5
Building Websites with Joomla! 1.5

Drupal: Creating Blogs, Forums, Portals, and Community Websites
Drupal: Creating Blogs, Forums, Portals, and Community Websites

Magento 1.3: PHP Developer's Guide
Magento 1.3: PHP Developer's Guide

PHP 5 E-commerce Development
PHP 5 E-commerce Development

No votes yet
Hey people by
I like this forum. I’m lucky to have found so much useful advice here. Many thanks to you all mates! I love http://facebook.com

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
G
E
z
M
s
A
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software