If you directly want to start, jump to 'The sourcecode'.
Firstly: This is an open work, if you find any problem with a term or concept you can contribute to it. You are also welcome to state any preference or vision for the actual book structure, objectives or other conceptual matters, see this wikibook discussion area. Secondly: I'm not a native. If you attach importance to the grammar, feel free to correct my sentences. If this book was written in my language and you would make a lot of mistakes, I would correct. I hope to improve my english while writing this book with lots of people.
(Please replace the following questions with their answers)
What is "Noah's Classifieds"? Is it a computer, an algorithm, a particular software application, a programming language, a library of support code, a small fish, or what?
What do people do with "Noah's Classifieds"? Is it purely a learning tool as a toy example to help programmers learn OOP? If I'm not a programmer, is there anything useful I could do with it?
What prerequisites do I need to have before using "Noah's Classifieds"? Do I need to have PHP installed on my computer before using it? Can I use it on my MacOS, Windows, or Linux box? Will it run on my server that has no display plugged into it? Will it run on my laptop that has no internet connection?
Who currently maintains "Noah's Classifieds"?
Listed in perceived order of importance;
User Accounts are stored here.
Classified Listings are in this database.
The sections shown on the front page are enumerated here.
n_settings, n_ecommsettings, n_globalstatEdit
Various administrative settings for the page are held in these databases.
Other tables hold other sorts of information to control cross referencing, cron jobs, email notifications, search and rss functionality, etc. Most of this information can be easily controlled through the Admin section of the site. To manually create a new Admin account, set isAdm to 1 for any existing user in the n_user table.
Pages that make database connectionsEdit
The pages which connect to the database all reside in the gorum directory, and are; /gorum/dbinstall.php, /gorum/dbproperty.php, and /gorum/installlib.php. Additionally, /feedcreator/feedcreator.class.php makes a query to the database, and many files in the /app/ and /gorum/ folders contain calls to the executeQuery functions defined by /gorum/dbproperty.php.
The sourcecode Edit
The Tasks of the VariablesEdit
If this Variable is set (uncomment the related line in constants.php to do so) Noah's uses an unusual template. A template takes only effect on the look and style of Noah's Classifieds software. The file must be stored in the root directory of Noah's and needs a number in front of the suffix (e.g. template4.php). This index is declared to the system as our variable $otherTemplate.
(Noah includes the template-file while loading include.php wether it's the default one or not - line 24.)
File and Function DescriptionsEdit
The config.php contains just the parameters for the database. The second - really little - task of this file is to construct the $dbHost string, addicted to whether the port is given or not.
The item.php comes in include.php into play. At first, if the variable $immediateAppear isn't set yet, the script sets it to "true". If needed or not at the moment, (I guess it's always needed) the variable item_typ is build at the beginning of that script.
Anything that communicates with the database is derived from the object class. Items (adverts), categories, users and even the global settings. Start at this class because most of its functions aren't ever overloaded.
This File is included in index.php and itself includes another bunch of files.
include("./gorum/constants.php"); if( $registrationType!=User_noUserFromGorum ) include("./gorum/loginlib.php"); include("./gorum/gorumlib.php"); include("./gorum/object.php"); include("./gorum/form.php"); include("./gorum/generformlib.php"); include("./gorum/roll.php"); include("./gorum/dbproperty.php"); include("./gorum/privilegeproperty.php"); include("./gorum/htmllist.php"); include("./gorum/tools.php"); include("./gorum/showdetails.php");
Furthermore it seems like it differs the type of user and loads user_simple.php or in the other case user_email.php.
This contains the roll class. Roll is simply the class that handles link generation. It is nice because it adds a memory capability.
The classes Edit
Unusually, this webapplication is full objective. As mentioned before, Noah's works with classes - in fact a lot. For example the ad itself is permanently handled as an object. This is useful but it needs to get used to.
The most important one is the class called "Object". This is the parent one I will introduce next.