Therion Web Database Web Query
Install
The web pages are designed to run within an existing web site or a stand alone site.
websearch.tar.gz Andrew Atkinson version
websearch.zip downloadable here Dave Clucas version
The units are the default of the database. AFAIK by default therion uses metres and degrees, unless this has been changed in survey/layout/ini.
The web search will output results in the units of the database, and makes no reference to the units directly in the output. The config.php file has a full turn set as 360 for degrees, this needs to be changed to the correct quantity if not degrees, and is used in internal calculations, the outputs will remain in the same units as the database.
Requirements
A web server with php and sql.
The pages have been tested on mysql 5.1 with php 5.3 and apache2 running on Linux (Debian and Ubuntu.) It probably works on other systems.
A database user with the privilege of SELECT on the Database (see Setting up the database)
Structure
The root directory contains the following files that may need editing
- config.php: needs to be edited so the variables reflect that of the site or local computer to which it is being installed. Further instructions are in the file, only edit the parts in the quotations. For this file the following will be needed
- Title of the project used in the header and on the pages
- Database name
- Server host name, Usually localhost when on the same machine.
- Database User
- Database Password for the User
- Option: Name of the sql dump file
- Amount of unit in a full turn. Eg degrees will be 360
- Where the css styles sheet is
- Searches/Searches.php: A list of Searches available. Comment out all lines in a section to make search not accessible through the web interface.
- Option: The Downloads file can have the sql file in it, which should be the same one as uploaded to the database. The home page looks at the modified date of this file and displays it to the user as an uploaded time. If the correct file cannot be found the whole paragraph is omitted.
Setting up the Database
Create a database and add the database name to the config.php. Use the .sql file created by therion to import the data. The database user given in config.php should only have the privilege of SELECT
Adding to the Searches
The Directory Searches contains a list of Searches and a directory called scripts, along with a Searches.php.
Further Searches can be added by adding another directory which contains at least a the files form.php and result.php. Other files may be present, however if they are likely to be useful to other searches they should be placed in the scripts directory. (Some installations may choose to delete some of the Searches Directories.) Searches.php contains an array split into sections by comments. The 'directory' give the location and the title give the text that is given in the drop down menu on the home page.
Explaining the Queries
Some of these queries are modifications of the ones in the Therion book, authors of which I owe a debt of gratitude to for helping me understand the Therion Database, by providing examples.
Note. The version by Dave Clucas has a different user interface class and the structure of the input forms and output algorithms are all contained in a single file which is well commented.