# Understanding Noah's Classifieds

If you directly want to start, jump to 'The sourcecode'. (Jan 11, 2005) 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"?

## The database

Listed in perceived order of importance;

### n_user

User Accounts are stored here.

### n_item

Classified Listings are in this database.

### n_category

The sections shown on the front page are enumerated here.

### n_settings, n_ecommsettings, n_globalstat

Various administrative settings for the page are held in these databases.

### the others

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 connections

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 Tasks of the Variables
### $registrationType
### $otherTamplate

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 Descriptions
### config.php

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.

### item.php

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.

### object.php

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.

### gorum/gorum.php

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.

### gorum/roll.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

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.

### Object - the mothership

Let's Discover gorumMain
Multiple Image Submission
Multiple Image Extension