Managing the Discussion Forums Using 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

£13.99    £7.00
by Douglas Paterson | March 2010 | MySQL Content Management Open Source PHP

In the previous article of the series by Douglas Paterson, author of Building Websites with PHP-Nuke, we have had a tour of the other default modules that ship with PHP-Nuke, and seen the types of content they manage.

In this article which is the eighth article of the article series, we will begin to explore the PHP-Nuke Forums module. You will:

  • Learn about the structure of a discussion board
  • Learn how to create categories and forums, and make postings
  • Create groups, and set simple permissions for forums
  • See how to moderate forum content

PHP-Nuke has an awesome discussion board module, the Forums module, which is a complete application. phpBB—the leading free, open-source discussion board application—has been 'refitted' as a PHP-Nuke module, providing integration with the PHP-Nuke user accounts.

Forum Structure

Rather than having a single discussion area, with topics intermingling with other topics, themes of conversation are organized into a number of different containers, rather like the folder and file structure of your hard disk.

The top-level of organization is the category. Note that the categories here are different from the categories we have met in the other modules!

Within categories, the next level of organization is into forums. Forums consist of topics, and finally, users are able to creating postings on these topics. Thus categories, forums, and topics act like folders, with postings being analogous to the files, to continue the file system analogy.

Only forum administrators can create categories and forums. Topics (and obviously postings, since they are the real body of a discussion area) can be added by users of the forum. A topic is essentially a 'first' posting, with subsequent postings on that topic being replies to the topic subject.

Here is a diagram of the forums hierarchy:

Building Websites with PHP-Nuke

Although a forum is contained in a category, the term 'forum' is generally used informally to refer to the whole discussion environment, covering categories, forums, topics, and postings. When you 'post to a forum', you are actually posting to a topic in a particular forum of a certain category! The general term 'board' or 'discussion board' is usually used to refer to the whole forum experience.

Access to categories and forums can be restricted to groups of users. These restricted categories and forums can also be made invisible to those unable to access them. This is in contrast with other modules in PHP-Nuke where you restrict access to the entire module. In general, visitors either see all the contents of the module or none of it. The Forums module enables a set of 'mini-administrators', forum moderators, who are able to control who is able to post what, and where. We'll see more about that later.

The Forums Administration Area

The Forums administration area is accessed through the PHP-Nuke Administration area, in the same way as for any other module.

Building Websites with PHP-Nuke

This brings you to an area very different from the other PHP-Nuke module administration areas. This is the phpBB administration area, and is the nerve center of your phpBB forums.

The page has a frame-based layout, with the left-hand frame being the navigation panel, giving you links to the various phpBB administration tasks. The right-hand frame holds the main page content.

Building Websites with PHP-Nuke

This screen shows you some statistics about your board, and the details of current, online visitors. Clicking on the Admin Index link will return you to this page, with the Forum Index link taking you into your forums. The Preview Forum link also takes you to your forums, but opens them up in the right-hand frame of the browser, retaining the phpBB administration navigation in the left-hand frame, so you can continue to work in the phpBB administration area if you need to.

phpBB is truly awesome. It is arguably one of the most impressive free, open-source PHP web applications available, and we can only scratch the surface of its true power here..

Here we will step through the tasks of creating the structure to allow users to make postings, follow the posting process, and also see how to make some basic configuration changes.

Forum Configuration

Just as with PHP-Nuke where we began by making changes to PHP-Nuke's site configuration, here too, we begin with some global configuration settings for phpBB. Clicking on the Configuration link in the General Admin part of the left-hand panel takes you to the phpBB configuration area. There are many options; only some of the top ones are shown here:

Building Websites with PHP-Nuke

The Domain Name, Site name, and Site description fields are similar to the Site URL, Site Name, and Slogan fields of the PHP-Nuke preferences. The Domain Name field holds the domain name of your site, and we'll set the Site name and Site description fields to match those in our PHP-Nuke site configuration.

We will also set the Cookie Domain to our site domain name, and the Cookie name to dinoportalforum. Note that if you change these settings after your site has gone live with people having visited the forums and logged in, then they won't be able to log in automatically since the Forums module will be looking for a different cookie from the one they have stored in their browser.

PHP-Nuke generally uses the PHP mail() function to send its emails, but the Forums module offers the option to use an SMTP server to send mail. If you know the details of an SMTP server that you can use (possibly your Internet Service Provider has given you access to an SMTP server), then you can enter the settings for this in the Email Settings panel. If you don't have access to an SMTP server, then the default action of the Forums module is to use the PHP mail() function, as PHP-Nuke would normally do.

Scrolling down the screen you will find a Submit button that will save your changes.

Creating a Category

Click on the Management link in the Forum Admin panel to begin creating the forum structure. First, you will need to create a category:

Building Websites with PHP-Nuke

Once you enter the name for the category into the box and click on the Create new category button, you have a category.

Creating a Forum

When the page reloads after creating the category, you are presented with a screen confirming the creation of your forum, and a Click Here to return to Forum Administration link. Clicking this link brings you to a page with the list of current categories displayed, along with links to edit, delete, or change their ordering in the list. You are also able to continue creating new categories.

Immediately underneath our new category is a box for entering the name of a new forum for that category, and clicking on the Create new forum button will create a forum of that name:

Building Websites with PHP-Nuke

When the page reloads, you will be given a screen into which you can enter a description of the forum, and set some properties for it. You can assign the forum to another category from the Category dropdown, or you can set the Forum Status. The Forum Status is Locked or Unlocked. An Unlocked forum is free for all to view and contribute to; a Locked forum requires the user to have specific access to write or post to it.

Building Websites with PHP-Nuke

There are also 'pruning' options available for removing topics that haven't seen enough activity in the forum. These options will be useful for keeping your 'board' clean over time.

Clicking on the Create new forum button creates the forum:

Building Websites with PHP-Nuke

Now we have forums, we are ready for topics. It is only a matter of time before we are posting!

The Visitor Experience

Open a new browser window, visit your PHP-Nuke site, and click on the Forums link. The visitor is welcomed to the Forums module with a list of the categories:

Building Websites with PHP-Nuke

Clicking on the Who is Online link presents you with a list of people who are currently viewing the forum, and where they are in the forum.

Clicking on one of the forums takes you to the list of topics in that forum. At the moment, our forum is empty.

Building Websites with PHP-Nuke

As the screen is encouraging us to do, we can click on the new topic button to post a new topic to the forum. We do not have to be an administrator to do this, but we do have to be a registered user of the PHP-Nuke site.

Posting a Topic

The form for posting a new topic is rather exciting:

Building Websites with PHP-Nuke

You can enter the Subject of your topic, and enter the body of the topic in the Message body box. You are able to use a range of formatting effects within the body of your posting, including inserting those the little emoticons by clicking on them to add them to your text.

Before posting your topic, it is worth taking a moment to preview it by clicking on the Preview Post button:

Building Websites with PHP-Nuke

If you are happy with the posting as it is, click on the Submit button and the posting is submitted. Your new topic is displayed in the forum's topic list:

Building Websites with PHP-Nuke

Clicking on the topic title brings up the submitted postings for that topic. At this point, we have only one—the topic posting:

Building Websites with PHP-Nuke

Users can now continue the discussion by posting a reply to this post. The author of the post is able to reply to, edit, or delete his or her own post with the aid of the three icons in the top right-hand corner of the post before any replies have been posted to the posting.

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

Forum Permissions

Access to particular forums can be restricted to groups of users. Going one step further, forums can be made invisible to anyone outside the group.

Before we set up permissions, we will create a group of users who will have access to our Project Chimera forum. The moderator of this group will be our testuser account, and that user will have the responsibility of approving membership to the group.

Creating Groups

We return to the Forum Administration area, and click on the Management link in the Group Admin section of the left-hand navigation pane:

Building Websites with PHP-Nuke

We are presented with the Group Administration page, where we begin the process of configuring group permissions by selecting the group from the dropdown. At this point, we need to create a group, so we click the Create New Group button instead:

Building Websites with PHP-Nuke

This brings us to a form for entering our group's details:

Building Websites with PHP-Nuke

We provide the group name, a description, and also enter the username of a group moderator. (The Find a username button opens a dialog that allows you to search the list of users to find your moderator if you have forgotten their full username.) You must specify a moderator for the group; you won't be allowed to create the group without one.

The Group status works like this:

  • Anyone can apply to join an open group, and the moderator approves or denies their membership. Alternatively, the moderator can add them directly to the group.
  • For a closed group, there is no application process, and the moderator has to add the user directly to the group.
  • Hidden groups work in the same way as closed groups, except they are invisible to non-members.

We select testuser as our moderator and Open group for the group status.

Once our details are complete, we click on the Submit button and our group is created.

Setting Forum Permissions

To begin the process of restricting permissions, we return to the Forum Administration area, and click on the Permissions link in the left-hand navigation frame:

Building Websites with PHP-Nuke

This takes you to the Forum Permissions Control interface. From here you select a forum; click on the Look up Forum button and then you can set the permissions for that forum:

Building Websites with PHP-Nuke

The next screen presents you a dropdown for selecting the access mode of the forum. There is a Simple Mode of assigning phpBB privileges and, for finer control over your forum privileges, there's also a link to the Advanced Mode. Discussion of that is beyond our scope here; suffice it to say that this allows control over what users can do within a particular forum. This level of permissions is reflected by the text at the right-hand foot of the forum area:

Building Websites with PHP-Nuke

We will select Private from the dropdown, so that only authorized users will be able to see the forum. The authorized users will be members of the Project Chimera team.

Building Websites with PHP-Nuke

After selecting Private, we click on the Submit button, and our forum's permissions are updated.

Now, if you return to the Forums homepage and attempt to view the Project Chimera forum, you will receive a 'no entry' message:

Building Websites with PHP-Nuke

Although you are still logged in as testuser, and that user is the moderator of the Project Chimera Team group, that group itself has no access to the forum. Thus we will need to add that in order to continue.

Setting Group Permissions

Click on the Permissions link in the Group Admin section of the left-hand navigation frame:

Building Websites with PHP-Nuke

You find yourself in the Group Permissions Control page. From here we can select a group and move on to manage its permissions. We select Project Chimera Team from the dropdown and click on Look up Group:

Building Websites with PHP-Nuke

Now we are able to allow the members of the Project Chimera Team to view their forum by selecting Allowed Access from the Simple Permissions dropdown. Again, there is an Advanced Mode, but that is beyond the scope of our discussion here. Clicking on the Submit button saves our permissions:

Building Websites with PHP-Nuke

Now, when you return to the Forums homepage you will be able to view the Project Chimera forum, when logged in as testuser.

Joining Groups

We've created another user for the PHP-Nuke site, called Zak. As a member of the ill-fated Project Chimera team, he wants to add himself to the Project Chimera Team group so that he is able to view the forum, and find out what's going on.

Zak does this by going to the Forums module, and clicking on the Usergroups link:

Building Websites with PHP-Nuke

This brings you to a page with group membership details. In the list of Non-member groups, we can see the groups that can be joined. Zak can select one from the dropdown, and then click on its View Information button:

Building Websites with PHP-Nuke

On clicking the button, Zak is presented with details of the group, including the group description that we entered when we created the group, a button to join the group, and a list of the group members:

Building Websites with PHP-Nuke

Clicking on the Join Group button begins the process of Zak joining the Project Chimera Team group. To be fully accepted into the group, the application has to be approved by a moderator of the group, as can be seen below when Zak views the group's information:

Building Websites with PHP-Nuke

Approving the Membership Application

Now it is up to the moderator, testuser, to approve Zak's membership. This process begins by testuser clicking on the Usergroups link, selecting the Project Chimera Team group from the Group Membership Details, and clicking on the View Information button.

The moderator's view of the group information is different from that of the standard user. In addition to seeing the list of group members, there are buttons to remove members from the group, and also an opportunity to add a new member without the need for the approval stage.

At the foot of the display is a list of pending memberships:

Building Websites with PHP-Nuke

By checking the box next to zak's name, and clicking on the Approve Selected button, Zak is admitted to the group.

Now Zak is free to read the Project Chimera forum, and post to his heart's content.

Underneath the list of pending members is a textbox to add members directly to the group:

Building Websites with PHP-Nuke

By entering the username into the textbox and clicking on the Add Member button, that user is added to the group. For closed or hidden groups, there will be no list of pending members since applications are not accepted, and you add members through this textbox.

Moderating the Forum

Although testuser is the Project Chimera Team group moderator, that user is not the moderator of the forum itself. In order to make testuser the forum moderator, so that they can edit or delete posts to that forum, we need to set this permission explicitly.

Setting a Forum Moderator

We start by clicking on the Permissions link in the User Admin portion of the left-hand navigation frame:

Building Websites with PHP-Nuke

This brings us to the User Permission Control page, where we first have to enter the username of the user whose permissions we wish to modify:

Building Websites with PHP-Nuke

Clicking on the Look up User button brings us to the details of this user's permissions. At the top of the page is information about the level of that user (Administrator or User), and the groups that they are members of:

Building Websites with PHP-Nuke

Underneath that is the information about the user-to-forum permissions:

Building Websites with PHP-Nuke

Although the Simple Permissions column of the Project Chimera forum shows Disallowed Access, this is overridden by testuser's membership of the Project Chimera Team group, and they are able to access that forum. However, to allow Zak and the other members of the Project Chimera Team to view the forum, it needs to be set to Allowed Access.

To make testuser a moderator of the forum, select Is Moderator from the Moderator status dropdown, and click on the Submit button.

Now that testuser is a moderator of the Project Chimera forum, on their next visit they will notice an extra 'toolbar' that is added to the top right-hand of each of the posts:

Building Websites with PHP-Nuke

The buttons on this toolbar allow testuser to edit the post, delete the post, or view the IP address of the poster.

Clicking on the edit button allows you to modify the post, maybe removing or disclaiming some statement in the text. Click on the delete button (the cross icon) and confirm that you want that post deleted to remove it from the topic.

Summary

As we mentioned earlier, we can only hope to scratch the surface of phpBB's awesome power in this single article. However, we have covered the basics of working with PHP-Nuke's Forums module.

We covered the basic structure of a discussion board, and saw how categories, forums, and postings relate to each other.

We then moved on to create some categories and forums, and make postings to the forum. Restricting forums to particular groups of users was our next stop, creating groups, setting the permissions for those groups, and then seeing how users can be assigned to those groups. We finished off with a quick look at moderation, how to set up a user as a forum moderator, and saw the extra information visible to the moderator that appeared in each post. Also, we finally saw exactly what Project Chimera is.

In the next article,Customising Layout with Themes, we will learn to transform the look of the Dinosaur Portal with the help of a new PHP-Nuke theme.

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

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

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

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

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

Drupal E-commerce with Ubercart 2.x
Drupal E-commerce with Ubercart 2.x

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

Getting started with Audacity 1.3
Getting started with Audacity 1.3

iReport 3.7
iReport 3.7

Apache MyFaces 1.2 Web Application Development
Apache MyFaces 1.2 Web Application Development

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

MediaWiki 1.1 Beginner's Guide
MediaWiki 1.1 Beginner's Guide

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