Before writing any code, I sat down and came up with several things that I decided were essential to such a site. These included:
A sign-up process
A login form
A logout facility
User profiles with uploaded thumbnails
A member directory
Adding members as friends
Public and private messaging between members
That’s 8 main elements, but in the end it turned out that because the project would require a main index.html page and a separate include file for the main functions, 10 PHP program files were required.
I decided to name the project Robin’s Nest, but you have to modify only one line of code to change this to a name of your choice. Also, all the filenames (except index.html) start with the letters rn to separate them from any other files you have saved from this book. If you change these names, make sure you also change all references across all the files.
For reasons of simplicity and size, and so that you don’t have to install add-ons to your server if you don’t wish to, I have deliberately not used either PEAR (see Appendix E) or Smarty (see Chapter 12) in these examples. But if you plan on extending the code, I strongly recommend you consider them, as PEAR can make the programming process simpler. Furthermore, if you will be working with separate designers, Smarty can remove the programming layer from the presentation layer, leaving them free to create at their heart’s content.
However, where I have implemented ...