Messageboard v2

Although we've just spent a large number of pages looking solely at messageboards, we've literally just scratched the surface as far as functionality goes - if you have the time to go ahead and try writing version two of this messageboard system, there is a lot more for you to try out.

Here is a short list of ideas you could try:

  • Have symbols such as :) and ;) replaced with their equivalent smiley emoticon pictures. There are quite a few emoticons out there for you to use in your system!

  • Allow people to insert special codes such as :bold: and :endbold: to their messages, which you convert to HTML codes as necessary. This circumvents the strip_tags() issue - you strip out all HTML first, then convert the special codes to the equivalent HTML.

  • Allow people to add polls to their messages that others can take part in

  • Let people give their messages an image, which can be shown on mbindex.php - e.g. a light bulb if the message is about an idea. Similarly, allow people to give their message a priority - use a down arrow for low priority, and a red, upwards arrow for high priority.

  • Allow people to lock their thread so that no other replies can be posted to it.

  • Let people check a box "Email me when a reply is posted", that notifies them when people reply to one of their checked posts.

  • Store a "LastEdited" date in mbmsgs so that people who edit their posts get "Last edited on July 14th 2004" or the like on the bottom of their message.

  • Change read.php to show a list of replies, threaded as in mbindex.php, so that people can navigate around a thread easily. For extra points, have the message currently being viewed displayed as bold in the list.

  • Tell people what messages have been posted since their last visit. This is most easily accomplished by storing a cookie of the highest ID number in mbmsgs, then checking against that with each visit.

That should be enough to get you started. If you implement all that and also find the time to give the system an attractive design, you will have a truly excellent messageboard system on your hands that is powerful, flexible, and should keep visitors to your site returning time and time again.

Remember, the advantage to messageboards is that they generate content for you free of charge, courtesy of your visitors - play this card to the full, and your community will look after itself!

 

Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Making an object-oriented messageboard >>

Previous chapter: Making Messageboard v1.1

Jump to:

 

Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.