In construction
This manual describes how to create a front end for the web site http://www.hitchhikers.org. Here are a few characteristics of our front end service:
All data for a front end is stored in one directory. The name of that directory should be equal to the domain name which you will use for the site, like "hitchhiking.yahoo.com". The scripts will choose the front end from the domain name in the URL of the request. Note that "www." should be omitted; the scripts will select your front end independent of whether the URL started with "www." or not. In your front end directory, there must be one file called settings.txt. This file contains all the front end dependent settings. A directory structure for a single language front end might look like this:
rideshare.yahoo.com/
settings.txt
dictinaries/
en/
internal.txt
email_templates/
addquery_en.tmpl
addride_en.tmpl
notification_en.tmpl
passwordrequest_en.tmpl
reaction_en.tmpl
tellafriend_en.tmpl
templates/
index_en.tmpl
form_en.tmpl
entry_en.tmpl
A setup for a multi-language front end, might look like this (see also multi language support):
rideshare.yahoo.com/
settings.txt
dictinaries/
en/
internal.txt
general.txt
fr/
internal.txt
general.txt
email_templates/
:
templates/
index.tmpl
form.tmpl
entry.tmpl
or like this:
rideshare.yahoo.com/
settings.txt
dictinaries/
en/
internal.txt
fr/
internal.txt
email_templates/
:
templates/
index_en.tmpl
index_fr.tmpl
form_en.tmpl
form_fr.tmpl
entry_en.tmpl
entry_fr.tmpl
You can manage your front end directory through http://www.hitchhikers.org/protected/fileman.cgi. You will be prompted for a username and password. The username is equal to the name of your front end directory and the password will be given to you by your hitchhikers.org contact person. After logging in, you will see a list with all the files and directories in your front end directory. From here, you can upload or delete your files. Note that you will not be able to download your files, so you have to keep a copy of your files locally.
There is also a possibility to provide you with an ftp account. As this costs more time and effort to setup, these accounts will be provided on an individual basis.
variable_name => 'variable value'.
Dictionaries are used for creating multi language front ends and for providing the backend with wordts that are requiredc for operation (like like the days of the week). Each dictionary file contains a list with codes and their meaning for one language (a possible code might be 'intro' and its meaning might be 'Welcome to our ridesharing service').
In your front end directory, there should be a directory with the name dictionaries. This directory should contain a directory for each language that your front end supports (the name of these directories should be its two letter lowercase language code, a list with language codes can be found here) plus optionally a directory called all. Each of these directories may contain the following files:
There are two kind of dictionaries. internal.txt, general.txt and rides.txt are simple lists with codes and their meanings. The other dictionaries are a little more complex. They contain a kind of sub-dictionary for each element in the list. For example, in the file currencies.txt, there will be a subdictionary for currency 'XEU' and one for 'USD'.
Values in the dictionaries in the directory all are meant for strings that are not language specific (like the name of a language in its local language in languages.txt or is_after_juli in months.txt) and will be accessible in all languages.
For an example of the exact format of the different dictionaries, you can have a look at a few examples from our front end.
You can find out how your front end is doing, by going to http://www.hitchhikers.org/protected/stats.cgi. You will be prompted for a username and password. The username is equal to the name of your front end directory and the password will be given to you by your hitchhikers.org contact person. After logging in, you will get tables with the number of added rides and the number of reactions for your front end. If you feel some statistics are missing, just let us know. It does not include web server statistics.
rideshare.yourdomain.com. IN CNAME hitchhikers.org.
Our server will show your frontend to the hitchhikers-database if people visit the new url 'rideshare.yourdomain.com'. This means that visitors only have to type
http://rideshare.yahoo.com/index.cgi (or http://rideshare.yahoo.com) to go to your front end
and nothing has to be changed in your web site.Templates are the method of creating customized front ends for the hitchhikers website. There are two types of templates: templates for creating web pages and templates for creating email messages. Both types are regular text files with some added markup. The scripts will process the templates and replace the added markup by generated values. The actual codes that can be used, are described per script.
The easiest way to learn how to write a front end for hitchhikers.org is to have a look at some example front ends. If you don't have any examples yet, please ask your hitchhikers.org contact person. The long list with input and output variables in chapter The Scripts is intended as a reference.
All web templates should be stored in the directory templates within the front end directory. The email templates should be stored in the directory email_templates
The scripts can automatically select a language specific template, they can automatically select a language independent template or you can specify a template yourself, in the URL. The different options are explaied below in the order in which they are executed:
Each email template should begin with some headers, followed by a white line and then the body text. The headers start with a field name (like 'To' or 'From'), followed by a colon and a space and then the value. Each fieldname can only appear once in the headers and 'From', 'To' and 'Subject' are required. The 'From' and 'To' fields should contain a valid email addres between '<' and '>'.
The following is an example of a valid email template:
From: "The hitchhackers" <deletecodes@hitchhikers.org> To: "<TMPL_VAR NAME="_name">" <<TMPL_VAR NAME="_email">> Subject: Thank you for your new ride in hitchhikers.org Thank you for adding a ride from <TMPL_VAR NAME="_from_city"> to <TMPL_VAR NAME="_to_city"> on <TMPL_VAR NAME="_startdayname"> <TMPL_VAR NAME="_startmonth_name"> <TMPL_VAR NAME="_startdaynr">, <TMPL_VAR NAME="_startyear4">. Remember the remove-code to be able to remove your submission. Your code is: <TMPL_VAR NAME="_deletecode">. You can view or remove your entry at <TMPL_VAR NAME="_entryurl">. Have fun, the hitchhackers
Note that whitespace and newlines will appear in the email message exactly as you put it in the templates.
All parameters in the URL will be provided in the template (including the ones that you added to the URL), prepended with an underscore ('_'). If there is more then one value for a parameter, it will be provided as a HTML::Template list. The variable will have the name "_value". So if you have a list with colors as part of the URL, you can access them in the following way:
<HTML_LOOP NAME="colors"> <HTML_VAR NAME="_value"> </HTML_LOOP>
If URLs are provided in the template, they will not contain the parameters you added.
If there is an error in the input parameters, the script might use the default value (this happens in index.cgi) or set some error variables for the template (this happers in form.cgi and most process scripts).
If an error has occured that did not happen because incorrect user input (like a database error or a bug), the script will show the template with the name 'error.tmpl' (for a front end that uses a template dictionary) or 'error_languagecode.tmpl' (for a front end that use a different template for each language). The error template will get an error code and a short (English) description of the error. As with all variables, the front end designer can choose whether or not to use this message. The codes that can be used in the error template, are described in error.tmpl.
If the error is so severe that it cannot reach your template, a boring white screen, plain English error will be shown. This should never occur.
hitchhikers.org currently supports the following currencies: USD (US Dollar), XEU (Euro). If you need an other currency for your front end, please let us know.
You can choose to limit the currency options during submission of a new ride, by making your own list of currencies or by making the currency a hidden field in your ride submission form (if you just ont to support a single uccrency). But remember that the rides that you are showing (in index.cgi and entry.cgi) might have different currencies then the ones that you allow in your submission form, as some rides might be submitted by other front ends. If you really only want your own currencies, you can make sure that index.cgi and entry.cgi will only show rides that are posted by your front end, by setting the variable frontendids to the id of your front end(s).
The only requirement for the design of your front end is, that you include a clickable image with 'powered by hitchhikers.org' on all your pages. The image must be included in your pages by inserting the following template code in your templates (a header or footer might be a good location):
<TMPL_VAR NAME="_poweredby">This will insert html code for a clickable button on your page. If the code is not included, the script will produce an error to remind you.
There are four scripts that produce all the output. These can be considered the main scripts of the web site.
Then there are a few scripts that do some work, but don't produce any output. When they are finished with their work, they redirect the user to one of the four main scripts (including all the input parameters that they got). They are normally called by forms on your pages or by URLs that are send to the user by email.
And finaly, there is the possibility that an error occures. If the error is so severe that it can not be solved, it will use the error template (see section handling errors):
The tables in the following sections describe how to use the different parameters. The tables can contain the following columns:
<TMPL_LOOP NAME="_currencies"> </TMPL_LOOP>
Some output variables return a URL. These URLs will always end with a '?' or ';', so you can append your own variables like this:
<a href="<TMPL_VAR NAME="_general_url">tmpl=about.tmpl">About us</a>
Scripts of which the name start with 'process_', will not produce a page. After doing their actions, they will redirect the user to another script (specified in the section for that script). This means that these scripts do not have any output variables.
Except for the variables mentioned in the table, the following variables are also included:
| Name | In or Out |
Format | Default | Description |
| lang | in | See Input formats | user agent default language or otherwise front end default language | The language that the script should use to show the page in. The given language code will be included in URL's that are generated by the scripts. |
| fe | in | see Input formats | domain name in URL or otherwise the script default front end | The front END that the script should use to show the page in. The given front end will be included in URL's that are generated by the scripts. |
| tmpl | in | See Input formats | the name of the script (see section template file names) | The language that the script should use to show the page in. The given template will not be included in URL's that are generated by the scripts. |
| _scripturlroot | out | URL | - | The script root location (in URL form). Current value is '/'. |
| _frontendroot | out | directory path | - | The location of the directory containing all front end directories. Current value is '/home/hitch/www/frontends/'. Not supported |
| _delete_code_length | out | positive integer | - | The length of the code used to delete entries. Current value is '8'. |
| _max_list_length | out | positive integer | - | The maximum length of a list with rides. Current value is '500'. |
| _default_fe | out | name of a directory in _frontendroot | - | The front end that will be used if no other front end can be found. Current value is 'europe.hitchhikers.org'. Not supported. |
| _db_name | out | alphanumeric characters | - | The name of the database. Current value is 'hitch_main'. Not Supported. |
| _db_username | out | alphanumeric characters | - | The username for logging into the database. Current value is 'hitch_hitchhiker'. Not supported |
| _default_lang | out | two character language code | - | The default language for your front end. This variable is set in the front ends settings file. Current value is 'en'. |
| _default_query | out | any query string (in URL format) | - | The initial query string for your front end. This variable is set in the front ends settings file. Current value is 'isquery=1&sk1=start_date&sk2=from_country&fromregions=europe&toregions=europe'. |
| _tmpl_dir | out | an absolute directory path | - | The template directory of your front end, relative to your front end root directory. This variable is set in the front ends settings file. Current value is 'templates/'. |
| _poweredby | out | HTML sniplet | - | This variable produces some html code to show the 'powered by hitchhikers.org'
button. It is required that you show this button on all of your pages. Current value is ' |
| _lang | out | a language code | - | Will be set to the current two character language code. Current value is 'en'. |
| _language_is_XX | out | '1' | - | Will be set to true for the current language. XX will be replaced by a two character language code. |
| _tmplname | out | '1' | - | The name of the template in use (will be set to the name of the name of the template that should have been used in case of an error). Current value is ''. |
| _tmplname_is_XX | out | '1' | - | Will be set to true for the current template name. XX will be replaced by a template name. |
| _scriptname_is_XX | out | '1' | - | Will be set to true for the current script name. XX will be replaced by a script name (without path). |
| _developer | out | string | - | The name of the developer which version of the scripts are being executed.Current value is 'production'. |
| _developer_is_XX | out | '1' | - | Will be set to true for the current developer name. XX will be replaced by a developer name. |
| _frontend | out | domain name without 'www.' | - | The name of the current frontend. Current value is 'europe.hitchhikers.org'. |
| _domainname | out | domain name | - | The name of the domain of the current URL. Current value is 'europe.hitchhikers.org'. |
| _frontend_is_XX | out | '1' | - | Will be set to true for the current front end name. XX will be replaced by a front end name (without 'www.'). |
| _useragent_is_XX | out | '1' | - | Will be set to true for many characteristics about the user agent (browser type,
browser version, operating system type and operating system version. Currently
the following values are supported for XX:
browsers: netscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up gecko ie ie3 ie4 ie4up ie5 ie55 neoplanet neoplanet2 mosaic aol aol3 aol4 aol5 aol6 webtv opera lynx emacs staroffice lotusnotes icab konqueror java operating systems: windows win16 win3x win31 win95 win98 winnt win32 win2k winme mac mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms amiga other devices: wap audrey iopener palm avantgo robots: wget getright yahoo altavista lycos infoseek lwp webcrawler linkexchange slurp google Note that multiple values can be true. More info can be found at http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html |
| _useragent_majorversion_is_XX | out | '1' | - | Will be set to true for the major version number of the users browser. for example, if the user is using Internet Explorer 5.1b2, _useragent_majorversion_is_5 will be set to true. |
| _useragent_minorversion_is_XX | out | '1' | - | Will be set to true for the minor version number of the users browser. for example, if the user is using Internet Explorer 5.1b2, _useragent_minorversion_is_1 will be set to true. |
| _useragent_betaversion_is_XX | out | '1' | - | Will be set to the beta version number of the users browser (this is any non-numeric characters after the version number. for example, if the user is using Internet Explorer 5.1b2, _useragent_betaversion_is_b2 will be set to true. |
| _general_url | out | URL | - | The URL to the general page. Does include the current language and front end settings, but not the template name and variables that are set by the user. Current value is 'general.cgi?'. |
| _index_url | out | URL | - | The URL to the index page. Does include the current language and front end settings, but not the template name and variables that are set by the user. Might include index specific variables. Current value is 'index.cgi?'. |
| _form_url | out | URL | - | The URL to the form page. Does include the current language and front end settings, but not the template name and variables that are set by the user. Does not include form specific variables. Current value is 'form.cgi?'. |
| _this_url | out | URL | - | The URL to the current page. Does include the current language and front end settings, but not the template name and variables that are set by the user. Does include page specific variables. Current value is ''. Not yet implemented. |
| _general_params | out | partial URL | - | A string to include to URLs if you want to keep the current front end and language settings. Current value is ''. |
| _general_form | out | HTML | - | The HTML form elements to include hidden fields for the language and front end setting. Current value is ''. |
| _debug_info | out | HTML | - | This should be a list with all parameters available to the template. Can be used for documentation and debugging purposes. Actually, if we would include a description with each parameter and value, we would not need this list!!!. Not yet implemented. |
| _afterXXdaysDATE | out | dateinfo | - | Information for the date, XX days after today. Currently provided for the following values of XX: 0, 1, 2, 3, 4, 5, 6, 7, 14, 15, 21, 30, 60, 90, 365. Let us know if you need other values for your front end |
| _currencies | out | LOOP | - | Loop over all supported currencies. The list is sorted alphabetical on the code. |
| _currencies / _currency_code | out | three letter code | - | The currency code of the currency in the loop |
| _currencies / user defined | out | user defined | - | All entries in dictionaries/languagecode/currencies.txt will be added to this list. See hitchhikers.org/dictionaries/en/currencies.txt for an example of the use and the format. Can be used for specifying the currency name and formatting rules. |
| _languages | out | LOOP | - | Loop over all supported languages. The list is sorted alphabetical on the code. |
| _languages / _language_code | out | two letter code | - | The language code of the language in the loop |
| _languages / _language_url | out | URL | - | The URL to switch to the language in the loop |
| _languages / _is_current_language | out | undefined or '1' | - | Whether the language in the loop is the current language. Will only be true for one of the languages. |
| _languages / user defined | out | user defined | - | All entries in dictionaries/languagecode/languages.txt will be added to this list. See hitchhikers.org/dictionaries/en/languages.txt for an example of the use and the format. |
| _countries_XX | out | LOOP | - | A list with all countries in region XX. See appendix 1 for a overview of all regions and their countries. If the user dictionary contains an element with name as name, it will sort on the value for that entry and on the code otherwise. Note that you can invluence the sorting by prepending hidden characters to the name (like '<!--001-->'). |
| _countries_XX / _code | out | a country code | - | The country code of the current country in the list. |
| _countries_XX / user defined | out | user defined | - | All entries in dictionaries/languagecode/countries.txt will be added to this list. See hitchhikers.org/dictionaries/en/countries.txt for an example of the use and the format. Will mainly be used for specifying the country name |
| _months | out | LOOP | - | A list with all months. |
| _months / _month_number | out | between 1 and 12 | - | The number of the month in the list (starts with 1). |
| _months / _month_number_is_XX | out | '1' | - | True for the number of the month in the list (starts with 1). |
| _months / _is_current_month | out | boolean. Value of true is ' selected' | - | Whether the month in the list is the current month. Exactly one entry will have a true value. |
| _months / _in_this_year | out | boolean | - | Whether the month in the list is will still occur in this year (is also true for the current month). |
| _months / user defined | out | user defined | - | All entries in dictionaries/languagecode/months.txt will be added to this list. See hitchhikers.org/dictionaries/en/months.txt for an example of the use and the format. Will mainly be used for specifying the month name. |
| _days | out | LOOP | - | A list with all days of the month. |
| _days / _day_number | out | between 1 and 31 | - | The number of the day in the list (starts with 1). |
| _days / _day_number_is_XX | out | '1' | - | True for the number of the day in the list (starts with 1). |
| _days / _is_current_day | out | boolean. True value is ' selected' | - | Whether the day in the list is the current day. Exactly one entry will have a true value. |
| _days / user defined | out | user defined | - | All entries in dictionaries/languagecode/days.txt will be added to this list. No examples yet. But hitchhikers.org/dictionaries/en/months.txt should give you an idea. I cannot think of any use of it, but I included it for consistency. |
All input and output variables from general.cgi and the variables listed below are supported by index.cgi
| Name | In or Out |
Format | Default | Description |
| isquery | in | boolean | false | If this variable is not true, index.cgi will ignore all other index.cgi specific parameters and use the parameters that are described in the front ends settings file (see section settings file) |
| begindepyear | in | year | see below | Only rides that departure on or after begin date are shown. |
| begindepmonth | in | month | see below | Only rides that departure on or after begin date are shown. |
| begindepday | in | day | see below | Only rides that departure on or after begin date are shown. |
| begindepdate_from_now | in | non-negative integer, representing days | 0 | Only rides departing begindepdate_from_now days after today or later are shown. |
| enddepyear | in | year | see below | Only rides on or before end date are shown. |
| enddepmonth | in | month | see below | Only rides on or before end date are shown. |
| enddepday | in | day | see below | Only rides on or before end date are shown. |
| enddepdate_from_now | in | non-negative integer, representing days | infinite | Only rides departing enddepdate_from_now days after today or earlier are shown. |
| max_depdate_interval | in | non-negative integer, representing days | infinite | Only rides departing max_depdate_interval days after the begindate (this is the maximum of begindepyear-begindepmonth-begindepday and begindepdate_from_now) or earlier are shown. |
| beginentryyear | in | year | see below | Only rides that are entered on or after begin entry date are shown. |
| beginentrymonth | in | month | see below | Only rides that are entered on or after begin entry date are shown. |
| beginentryday | in | day | see below | Only rides that are entered on or after begin entry date are shown. |
| beginentrydate_from_now | in | integer, representing days | minus infinity | Only rides entered beginentrydate_from_now days after today or later are shown. Will normally be a negative integer, because there are no rides added in the future. |
| endentryyear | in | year | see below | Only rides that are entered on or before end entry date are shown. |
| endentrymonth | in | month | see below | Only rides that are entered on or before end entry date are shown. |
| endentryday | in | day | see below | Only rides that are entered on or before end entry date are shown. |
| endentrydate_from_now | in | integer, representing days | 0 | Only rides entered endentrydate_from_now days after today or earlier are shown. Will normally be a negative integer, because there are no rides added in the future. |
| max_entrydate_interval | in | integer, representing days | infinite | Only rides entered max_entrydate_interval days after the start entrydate (this is the maximum of beginentryyear-beginentrymonth-beginentryday and beginentrydate_from_now) or earlier are shown. |
| maxrideid | in | id | infinite | Only rides with id lower or equal to maxrideid are shown. |
| minrideid | in | id | 1 | Only rides with id higher or equal to minrideid are shown. |
| minseats | in | integer | 1 | Only rides with minseats or more free seats are shown (rides where the number of seats is not known, are always shown). |
| findsmoking | in | 'no' or 'allowed' | undefined | If the value is 'no', only rides where the driver is not smoking are shown (both rides where the driver specified 'no smoking ride' or 'driver doesnt smoke, but passengers are allowed to smoke'). If the value is 'allowed', only rides where the passengers are allowed to smoke are shown (both rides where the driver specified 'driver smokes' or 'driver doesnt smoke, but passengers are allowed to smoke'). If the value is undefined or any other value, all rides will be shown. |
| freeridesonly | in | boolean | false | If set to true, only free rides are shown. |
| datedridesonly | in | boolean | false | If set to true, only rides with one date are shown (for hitchhiking). if set to true, undatedridesonly will be assumed false. |
| undatedridesonly | in | boolean | false | If set to true, only rides without a specific date are shown (for carpooling). |
| frontendids | in | list with ids | empty list | Only rides that are added using a front end in the list are shown. This enables you to show only rides that are posted on your front end. This enables you to make your own sub database, but remember that other front ends can always see your rides. If no front end is specified, rides from all front ends are shown. |
| fromregions | in | list with regions | empty list | Only rides of which the departure country is within at least one of the specified regions are shown. If no region is specified, rides departing from any country are shown. |
| fc | in | list with country codes | empty list | Only rides of which the departure country is within the country list are shown. If no country is specified, rides departing from any country are shown. The name is abbreviated for performence reasons. |
| fromcities | in | list with cities | empty list | Only rides of which the departure city contains at least one of the stings in the city list are shown (so if 'Roskilde' is in the list, 'roskilde festival' will be shown. If no city is specified, rides departing from any city are shown. |
| toregions | in | list with regions | empty list | Only rides of which the destination country is within at least one of the specified regions are shown. If no region is specified, rides going any country are shown. |
| toregions_as_fromregions | in | boolean | false | Only rides to regions in fromregions and in toregions will be shown. So if toregions is the empty list, only rides to fromregions will be shown. |
| tc | in | list with country codes | empty list | Only rides of which the destination country is within the country list are shown. If no country is specified, rides going to any country are shown. The name is abbreviated for performence reasons. |
| tc_as_fc | in | boolean | false | Only rides to countries in fc and in tc will be shown. So if tc is the empty list, only rides to fc will be shown. |
| tocities | in | list with cities | empty list | Only rides of which the destination city contains at least one of the stings in the city list are shown (so if 'Roskilde' is in the list, 'roskilde festival' will be shown. If no city is specified, rides going to any city are shown. |
| tocities_as_fromcities | in | boolean | false | Only rides to cities in fromcities and in tocities will be shown. So if tocities is the empty list, only rides to fromcities will be shown. |
| newquery_add | in | boolean | false | If set to true, a notification is send to newquery_email, whenever a new ride is submitted, that matches all search requirements. |
| newquery_name | in | name | required if newquery_add is true | The name of the person where the notifications should be send to. |
| newquery_email | in | required if newquery_add is true | The email address where the notifications should be send to. | |
| sk1 | in | 'from_country', 'from_city', 'to_city', 'to_country', 'entry_date', 'cost', 'seats' or 'start_date' | sk2 | Primary search key |
| sk2 | in | 'from_country', 'from_city', 'to_city', 'to_country', 'entry_date', 'cost', 'seats' or 'start_date' | database default | Secondary search key |
| limit | in | positive integer, less or equal to _max_list_length | _max_list_length | The maximum number of rides to be shown in the screen. |
| begin_index | in | index | 0 | The first item to be shown in the screen. So if the list contains 80 items, the limit is 20 and the begin index is 16, items 16 (starting from 0) to 35 are shown. If begin_index is 75, then items 75 to 79 are shown. |
| _sort_by_XX_url | out | URL | - | An url to the same page, but than sorted by XX. XX can be from_country, to_country, start_date, entry_date, smoking, seats or cost. The previous primary sort key well be the secondary sort key. |
| _is_sorted_by_XX | out | '1' | - | XX can be from_country, to_country, start_date, entry_date, smoking, seats or cost. Is true for the name of the primary seach key. |
| _sorting_params | out | URL | - | A parameter string to retrieve the current sort settings. Should be used as part of a URL. |
| _sorting_form | out | html | - | A html form to retrieve the current sort settings. Should be used as part of a form. |
| _begindepDATE | out | dateinfo | - | All date info about the beginning of the departure date interval. |
| _begindepdate_from_now | out | integer, representing days | - | Set to the number of days after today where the first departure date is set to. So if the list shows rides from tomorrow to next week, _begindepdate_from_now is set to 1. |
| _begindepdate_from_now_is_XX | out | '1' | - | True when XX is the number of days after today where the first departure date is set to. So if the list shows rides from tomorrow to next week, _begindepdate_from_now_is_1 will be true. |
| _enddepDATE | out | dateinfo | - | All date info about the last day of the departure date interval. |
| _enddepdate_from_now | out | integer, representing days | - | Set to the number of days after today where the last departure date is set to. So if the list shows rides from tomorrow to next week, _enddepdate_from_now is set to 7. |
| _enddepdate_from_now_is_XX | out | '1' | - | True when XX is the number of days after today where the last departure date is set to. So if the list shows rides from tomorrow to next week, _enddepdate_from_now_is_7 will be true. |
| _depdate_interval | out | non-negative integer | - | The number of days in the departure date interval. |
| _depdate_interval_is_XX | out | '1' | - | Is true if XX is the number of days in the departure date interval. |
| _beginentryDATE | out | dateinfo | - | All date info about the beginning of the entry date interval. |
| _beginentrydate_from_now | out | integer, representing days | - | Set to the number of days after today where the first entry date is set to. So if the list shows rides from tomorrow to next week, _beginentrydate_from_now is set to 1. |
| _beginentrydate_from_now_is_XX | out | '1' | - | True when XX is the number of days after today where the first entry date is set to. So if the list shows rides from tomorrow to next week, _beginentrydate_from_now_is_1 will be true. |
| _endentryDATE | out | dateinfo | - | All date info about the last day of the entry date interval. |
| _endentrydate_from_now | out | integer, representing days | - | Set to the number of days after today where the last entry date is set to. So if the list shows rides from tomorrow to next week, _endentrydate_from_now is set to 7. |
| _endentrydate_from_now_is_XX | out | '1' | - | True when XX is the number of days after today where the last entry date is set to. So if the list shows rides from tomorrow to next week, _endentrydate_from_now_is_7 will be true. |
| _entrydate_interval | out | non-negative integer | - | The number of days in the entry date interval. |
| _entrydate_interval_is_XX | out | '1' | - | Is true if XX is the number of days in the entry date interval. |
| _minseats_is_XX | out | '1' | - | Is set to true where XX is the minimum number of free seats in the previous query. |
| _findsmoking_is_XX | out | '1' | - | Is set to true where XX is the specified smoking selection. Can be 'undefined', 'no' or 'allowed'. |
| _total_number_of_entries | out | non-negative integer | - | The number of entries in the selection (can be more then the number of entries in the current screen). |
| _number_of_rides_in_screen | out | non-negative integer | - | The number of entries in the current screen. This is the number of entries that will be shown on the current page. Might be less then the total number of rides that are found. |
| _number_of_screens_is_XX | out | '1' | - | Set to true for XX being the total number of screens for the whole selection. So if the query found 125 rides and the screensize is 20, _number_of_screens_is_7 will be set to true. |
| _previous_screen_url | out | URL | - | The url to the previous screen. |
| _next_screen_url | out | URL | - | The url to the next screen. |
| _countries_XX / _query_is_fromcountry | out | boolean. True value is ' selected' | - | Set to true if the current country in the list is an accepted departure country in the query. Multiple values can have true value. |
| _countries_XX / _query_is_tocountry | out | boolean. True value is ' selected' | - | Set to true if the current country in the list is an accepted departure country in the query. Multiple values can have true value. |
| _months / _query_is_begindepmonth | out | boolean | - | Set to true if the current month in the list is the begin departure month in the query. |
| _months / _query_is_enddepmonth | out | boolean | - | Set to true if the current month in the list is the end departure month in the query. |
| _months / _query_is_beginentrymonth | out | boolean | - | Set to true if the current month in the list is the begin entry month in the query. |
| _months / _query_is_endentrymonth | out | boolean | - | Set to true if the current month in the list is the end entry month in the query. |
| _days / _query_is_begindepday | out | boolean | - | Set to true if the current day in the list is the begin departure day in the query. |
| _days / _query_is_enddepday | out | boolean | - | Set to true if the current day in the list is the end departure day in the query. |
| _days / _query_is_beginentryday | out | boolean | - | Set to true if the current day in the list is the begin entry day in the query. |
| _days / _query_is_endentryday | out | boolean | - | Set to true if the current day in the list is the end entry day in the query. |
| _screens | out | LOOP | - | A list with all screens that are required to show all rides in the selection. |
| _screens / _screen_number | out | positive integer | - | The number of the screen in the loop (starts with 1). |
| _screens / _is_current | out | boolean | - | Whether the screen in the loop is the current screen. |
| _screens / _url | out | URL | - | URL to the screen in the loop. |
| _screens / _begin_index | out | non-negative integer | - | The index of the ride that is the first ride in the screen in the loop. So if the screensize is 15 and for screen number 4, _begin_index will be 45. |
| _rides | out | LOOP | - | A list with all rides within the current screen, that match the specified limitations. |
| _rides / _url | out | URL | - | The URL to the ride in the loop. |
| _rides / _drivername | out | string | - | The name of the driver for the ride in the loop. |
| _rides / _from_country_XX | out | user defined | - | Adds all data from countries.txt for the country of the ride in the loop. So if your dictionary contains the key-value pair name=>Spain for the country with code ES, the value of _from_country_name will be 'Spain' for all rides which have departure country code ES. |
| _rides / _to_country_XX | out | user defined | - | Adds all data from countries.txt for the country of the ride in the loop. So if your dictionary contains the key-value pair name=>Spain for the country with code ES, the value of _to_country_name will be 'Spain' for all rides which have destination country code ES. |
| _rides / _countries_are_equal | out | user defined | boolean | True if the destination country is equal to the departure country. |
| _rides / _from_city | out | string | - | The name of the departure city for the ride in the loop. |
| _rides / _to_city | out | string | - | The name of the destination city for the ride in the loop. |
| _rides / _from_city_url | out | string | - | The name of the departure city for the ride in the loop. URL escaped, so it can be used in an URL (like in a link to a route planner) |
| _rides / _to_city_url | out | string | - | The name of the destination city for the ride in the loop. URL escaped, so it can be used in an URL (like in a link to a route planner) |
| _rides / _dated | out | boolean | - | Whether the ride is dated or not. |
| _rides / _startDATE | out | dateinfo | - | The departure date of the ride in the loop |
| _rides / _entryDATE | out | dateinfo | - | The entry date of the ride in the loop. |
| _rides / _rideid | out | id | - | The ride id of the ride in the loop. |
| _rides / _remark | out | string | - | The remarks that the driver has specified. |
| _rides / _seats | out | '1', '2', '3', '>3' or '?' | - | The number of free seats of the ride in the loop. |
| _rides / _smoking | out | 'undefined', 'no', 'allowed', 'driversmokes' | - | The smoking selection of the driver. |
| _rides / _smoking_is_XX | out | boolean | - | True where XX is the smoking selection of the driver. |
| _rides / _cost | out | amount, '.' is used as separator. | - | The cost (this is the amount the driver wants to get) of the ride in the loop. |
| _rides / _cost_integer | out | positive integer | - | The integer part of the cost (this is the amount the driver wants to get) of the ride in the loop. To be used if the language does not have a dot as separator. |
| _rides / _cost_fraction | out | two digit positive integer | - | The fracrional part of the cost (this is the amount the driver wants to get) of the ride in the loop. To be used if the language does not have a dot as separator. |
| _rides / _cost_is_XX | out | boolean | - | True where XX is the cost. the notation is first the integer part, then a dot and then the fraction. |
| _rides / _currency_code | out | a three letter uppercase currency code | - | The currency code in which the cost is specified. |
| _rides / _currency_XX | out | user defined | - | Adds all data from currencies.txt for the currency of the ride in the loop. So if your dictionary contains the key-value pair name=>Euro for the currency with code XEU, the value of _currency_name will be 'Euro' for all rides where the currency code is XEU. |
| _rides / _costtype | out | code | - | The costtype of the ride in the loop. |
| _rides / _costtype_is_XX | out | boolean | - | True for the cost type of the ride in the loop. |
| _rides / user defined | out | user defined | - | All entries in dictionaries/languagecode/rides.txt will be added to this list. See hitchhikers.org/dictionaries/en/rides.txt for an example of the use and the format. Note that this list behaves different from the other user defined entries. In the other dictionaries, you had to specify a key. The data that belongs that key will only be included in the loop entry with that key. The name-value pairs in rides.txt will be included in all entries in the loop. This can be used to add language codes that you want to access within the loop. |
| _stopquery_success | out | boolean | - | Is set to true if this page is the result from process_deletequery.cgi and the script removed the query successfully. |
| _stopquery_wrong_password | out | boolean | - | Is set to true if this page is the result from process_deletequery.cgi and the script did not remove the query because the password was incorrect. |
| _newquery_success | out | boolean | - | Is set to true if the user specified in the query that (s)he wants to get a notification whenever a machting ride is added to the database and the request was processed successfully. |
| _newquery_wrong_name | out | boolean | - | Is set to true if the user specified in the query that (s)he wants to get a notification whenever a machting ride is added to the database but the name was invalid. |
| _newquery_wrong_email | out | boolean | - | Is set to true if the user specified in the query that (s)he wants to get a notification whenever a machting ride is added to the database but the email was invalid. |
| _passwordrequest_success | out | boolean | - | Is set to true if this page is the result from process_passwordrequest.cgi and the script has send an email with the password successfully to the user. |
| _passwordrequest_unknown_person | out | boolean | - | Is set to true if this page is the result from process_passwordrequest.cgi and the script could not find the specified person in the database. |
As part of the query, you can specify four dates (the begin and end date for the departure date and the begin and end date for the entry date) by a year, a month and a day. Some of these values can be ommited. The way that the missing values are interpreted is described below:
| specified values | Interpretation for | |||
| begin entry date | begin departure date | End entry date | departure date | |
| nothing | The beginning of time | Today | Today | The end of time |
| year | January 1st of the specified year | December 31st of the specified year | ||
| month | first occurence of the last day of the specified month | first occurence of the last day of the specified month | ||
| year-month | year-month-01 | last day of the specified year and month | ||
| month-day | first occurence of the specified month and day | first occurence of the specified month and day | ||
| year-month-day | year-month-day | |||
The variables to be used with this script include all variables from general.cgi, all input variables from index.cgi and all output variables from the list _rides in index.cgi.
The selection of the ride can be done by giving an ride id as input variable (see below), or by giving all the restrictions as in index.cgi to specify a query plus an index (see below) to specify which ride in the query to show.
| Name | In or Out |
Format | Default | Description | |
| Exactly one of the following two input variables is required. | |||||
| id | in | non-negative integer | required | Ride id to be shown. The ride might be deleted or expired. | |
| index | in | non-negative integer | required | The ride from the query with the given index will be shown. Normally this input variable is accompanied with other input variables to specify the query (see index.cgi). Starts from 0. Note as deleted and expired rides will never show up in a query, this will never show a deleted or exired ride. | |
| _deletionDATE | out | dateinfo or undefined | - | The deletion date of the ride or undefined if the ride is not deleted. | |
| _deletionremark | out | string | - | An (English) description why/by whom the ride is deleted or undefined if the ride is not deleted. | |
| _is_fresh | out | boolean | - | Whether the ride is still open (not expired or deleted). | |
| _back_to_list_url | out | URL | - | URL to go back to the list with rides (keeping the query). | |
| _next_url | out | URL | - | URL to go to the next ride in the list. | |
| _previous_url | out | URL | - | URL to go to the previous ride in the list. | |
| _entry_deletion_success | out | boolean | - | Is set to true if a user (or administrator) just successfully deleted a ride. | |
| _entry_deletion_wrong_password | out | boolean | - | Is set to true if a user (or administrator) just tried to delete a ride, but used an invalid password. | |
| _reaction_success | out | boolean | - | Is set to true if a user just successfully send a reaction to a driver. | |
| _reaction_wrong_email | out | boolean | - | Is set to true if a user just tried to send a reaction to a driver, but the email address (of the sender) was invalid. | |
| _reaction_wrong_name | out | boolean | - | Is set to true if a user just tried to send a reaction to a driver, but the name (of the sender) was invalid. | |
| _reaction_wrong_message | out | boolean | - | Is set to true if a user just tried to send a reaction to a driver, but the message (of the sender) was invalid. | |
All input and output variables from general.cgi and the variables listed below are supported by form.cgi
| Name | In or Out |
Format | Description |
| _returnseats_XX | out | boolean | Is set to true where XX is the number of free seats in return journey. |
| _costtype_XX | out | boolean | Is set to true where XX is the costtype in the submitted form. Will be 'total', 'pp' or 'pppk'. |
| _depyear_is_after_XX_years | out | boolean. True value is ' selected' | Is set to true where XX is depyear minus the current year. XX will be a non-negative integer |
| _returnyear_is_after_XX_years | out | boolean. True value is ' selected' | Is set to true where XX is returnyear minus the current year. XX will be a non-negative integer |
| _currencies / _newride_is_currency | out | boolean. True value is ' selected' | Is set to true if the currency in the submitted form is equal to the currencyy in the loop. Exactly one country in the loop will have a true value. |
| _countries_XX / _newride_is_fromcountry | out | boolean. True value is ' selected' | Is set to true if the departure country in the submitted form is equal to the county in the loop. Zero or one country in the loop will have a true value. |
| _countries_XX / _newride_is_tocountry | out | boolean. True value is ' selected' | Is set to true if the destination country in the submitted form is equal to the county in the loop. Zero or one country in the loop will have a true value. |
| _months / _newride_is_depmonth | out | boolean. True value is ' selected' | Is set to true if the departure month in the submitted form is equal to the month in the loop. Zero or one country in the loop will have a true value. |
| _days / _newride_is_depday | out | boolean. True value is ' selected' | Is set to true if the departure day in the submitted form is equal to the day in the loop. Zero or one country in the loop will have a true value. |
| _months / _newride_is_returnmonth | out | boolean. True value is ' selected' | Is set to true if the return month in the submitted form is equal to the month in the loop. Zero or one country in the loop will have a true value. |
| _days / _newride_is_returnday | out | boolean. True value is ' selected' | Is set to true if the return day in the submitted form is equal to the day in the loop. Zero or one country in the loop will have a true value. |
| _newride_wrong_email | out | boolean | Is set to true if there is an error in the email of the submitted ride. |
| _newride_wrong_name | out | boolean | Is set to true if there is an error in the name of the submitted ride. |
| _newride_wrong_phone | out | boolean | Is set to true if there is an error in the phone of the submitted ride. Note that the telephone number is not required, so an empty string will not generate an error. |
| _newride_wrong_depday | out | boolean | Is set to true if there is an error in the departure day of the submitted ride. |
| _newride_wrong_depmonth | out | boolean | Is set to true if there is an error in the departure month of the submitted ride. |
| _newride_wrong_depyear | out | boolean | Is set to true if there is an error in the departure year of the submitted ride. |
| _newride_wrong_returnday | out | boolean | Is set to true if there is an error in the departure day of the submitted ride. This field is not required if return_trip is set to false in the from. |
| _newride_wrong_returnmonth | out | boolean | Is set to true if there is an error in the departure month of the submitted ride. This field is not required if return_trip is set to false in the from. |
| _newride_wrong_returnyear | out | boolean | Is set to true if there is an error in the departure year of the submitted ride. This field is not required if return_trip is set to false in the from. |
| _newride_returndate_before_departure | out | boolean | Is set to true if the return date is set and it is before the departure date in the submitted ride. |
| _newride_departuredate_in_the_past | out | boolean | Is set to true if the departure date is before today in the submitted ride. |
| _newride_wrong_depseats | out | boolean | Is set to true if there is an error in the number of free seats of the submitted ride. Note that the telephone number is not required, so an empty string will not generate an error. |
| _newride_wrong_cost | out | boolean | Is set to true if there is an error in the cost of the submitted ride. Note that the cost is not required, so an empty string will not generate an error. |
| _newride_wrong_currency | out | boolean | Is set to true if there is an error in the currency code of the submitted ride. Note that the costtype is required. |
| _newride_wrong_costtype | out | boolean | Is set to true if there is an error in the cost type of the submitted ride. Note that the costtype is required. |
| _newride_wrong_fromcity | out | boolean | Is set to true if there is an error in the departure city of the submitted ride. |
| _newride_wrong_tocity | out | boolean | Is set to true if there is an error in the destination city of the submitted ride. |
| _newride_wrong_fromcountry | out | boolean | Is set to true if there is an error in the departure country of the submitted ride. |
| _newride_wrong_tocountry | out | boolean | Is set to true if there is an error in the destination country of the submitted ride. |
| _newride_XX_errors | out | boolean | Is set to true where XX is the number of errors in the form. If _newride_0_errors is true, there are no errors and the ride is accepted. |
| Name | In or Out |
Format | Description | ||
| _is_error | out | "1" | Set to true if there is an error. But as you are using it in the error template, this will always be true. I don't know why this variable exists.... | ||
| _message | out | English text | A short English description of the error. You recoomended not to use this variable unless you don't mind English technical nerd talk on your error page. | ||
| Only one of the next variables will be set to true: | |||||
| _db_misc | out | boolean | Is set to true if the error occured during a database related action. | ||
| _db_connecting | out | boolean | Is set to true if the error occured during connecting to the database. | ||
| _entry_not_found | out | boolean | Is set to true if the error occured while searching for a database entry and the id was invalid. | ||
| _invalid_language | out | boolean | Is set to true if the scripts could not determine a valid language for the chosen front end. | ||
| _invalid_frontend | out | boolean | Is set to true if the scripts could not determine a valid front end (from thew login name, the parameter list, the domain name and the default value). | ||
| _internal | out | boolen | This is what we call 'a bug' in the software. The software came to a state which it was not suppose to come in. Hope your users will never see this error..... | ||
| _unknown | out | boolean | The script was notr able to determine thew cause of the error. | ||
| Name | In or Out |
Default | Description |
| entry_id | in | required | The id of the ride to be deleted. |
| delete_code | in | required | The password of the user who posted the ride. |
| Name | In or Out |
Default | Description |
| stopquery_id | in | required | The id of the query to be deleted. |
| stopquery_password | in | required | The password of the user who posted the query. |
| Name | In or Out |
Default | Description | |
| Exactly one of the following variables should have a valid value: | ||||
| passwordrequest_entry_id | in | required | The password will be send to the submitter of the specified entry. | |
| passwordrequest_email | in | required | If a user with the given email address is known in the system, the password will be send to this email address. | |
| passwordrequest_person_id | in | required | The password will be send to this person. | |
| Name | In or Out |
Default | Description |
| name | in | required | The full name of the poster of the ride. |
| in | required | The email address of the poster of the ride. | |
| telephone | in | empty | The telephone number of the poster of the ride. |
| from_country | in | required | The country code of the country where the driver is departing from. |
| from_city | in | required | The city where the driver is departing from. |
| to_country | in | required | The country code of the country where the driver is going to. |
| to_city | in | required | The city where the driver is going to. |
| dateless | in | optional | If set to true, a dateless ride will be assumed and all datefields will be ignored. Note that one |
| depday | in | required | The day the driver is leaving. |
| depmonth | in | required | The month number the driver is leaving. |
| depyear | in | the next occasion of depday-depmonth | The year the driver is leaving. |
| return_trip | in | false | whether a return trip is specified or not. |
| returnday | in | required if return_trip is true | The day the driver is returning. |
| returnmonth | in | required if return_trip is true | The month number the driver is returning. |
| returnyear | in | the next occasion of returnday-returnmonth, after departure date | The year the driver is returning. |
| cost | in | 0 | The amount of money the driver wants to have for the trip. Will be rounded at two digits after the separator. '.' and ',' can be used as a separator. if you want a different separator for your language, you can ask us to add it, or you can provide the user with a combo box of possible values (instead of a text field), so you can show something that is different from what is send to this script. |
| currency | in | required | The currency in which the amount is specified. |
| costtype | in | required | Describes what the amount means. |
| smoking | in | undefined | the smoking selection of the driver. Can be 'undefined' (the driver did not specify the smoking selection), 'no' (the driver does not smoke and does not allow smoking), 'allowed' (the driver does not smoke, but allowes smoking) or 'driversmokes' (the driver smokes and allowes others to smoke as well). |
| depseats | in | 100 (unknown) | The number of free seats in the car on the outward journey. |
| returnseats | in | as depseats | The number of free seats in the car on the return trip. Note that as the default is as depseats, you can choose to ignore this field (in which case the number of free seats in the return journey would always be copied from the outward journey), make a combo box with the extra option "as onward jouney" (with a false value), of just make a combo with the five valid options. |
| message | in | empty | Remarks about the ride. can be that the driver can be reached on a second telephone number, the duration of the trip, the route of the trip or that a drivers licence is prefered. |
| Name | In or Out |
Default | Description |
| entry_id | in | required | The id of the ride to which the user wants to send a reaction. |
| reaction_name | in | required | The full name of the user who posts the message. |
| reaction_email | in | required | The email address of the user who posts the message. |
| reaction_message | in | required | The message that the user wants to send to the driver. |
| Name | Format | Description |
| _sendername | a non empty string | The name of the person that sends the reaction. |
| _senderemail | a valid email address | The email address of the person that sends the reaction. |
| _drivername | a non empty string | The name of the driver (that is the person that should receive this message). |
| _driveremail | a valid email address | The email address of the driver (that is the person that should receive this message). |
| _message | a non empty string | The message that the sender has written for the driver. |
| Name | Format | Description |
| _name | a non empty string | The name of the driver. |
| _email | a valid email address | The email address of the driver. |
| _deletecode | a fixed length integer | The code with which the ride can be deleted. |
| _from_city | a non empty string | The departure city of the ride. |
| _to_city | a non empty string | The destination city of the ride. |
| _entryurl | a full URL | The URL which will show the added ride. |
| _deletion_url | a full URL | The URL with which the submitted ride can be deleted (directly). |
| Name | Format | Description |
| _name | a non empty string | The name of the driver. |
| _email | a valid email address | The email address of the driver. |
| _removecode | a fixed length integer | The code with which the query can be deleted. |
| _remove_url | a full URL | The URL with which the query can be deleted (directly). |
| Name | Format | Description |
| _name | a non empty string | The name of the user. |
| _email | a valid email address | The email address of the user. |
| _removecode | a fixed length integer | The actual code. |
| Name | Format | Description |
| _name | a non empty string | The name of the user. |
| _email | a valid email address | The email address of the user. |
| _newridecount | positive integer | The number of new rides found. |
| _newridesurl | full URL | The URL with which the rides can be viewed. |
This chapter contains a list with all regions and the country codes that belong to that region. Note that countries can belong to more then one region. The country names are front end dependent (they are defined in the internal dictionary). So the names that you see here, are the names for the chosen front end and language. If you want to see the names in a different language, try to append lang=languagecode to the current URL.
If you need a new region for your front end, or if you think there is an error in the country code division, please contact your hitchhikers.org contact person.
This chapter contains a list with all the codes that are required in the internal dictionary and their current value for the front end that you are reading this manual in. The internal dictionaries (one for each language that your front end supports) should be stored in dictionaries/languagecode/internal.txt. If you want to see the meanings in a different language, try to append lang=languagecode to the current URL.
| day1 | Mon |
| day2 | Tue |
| day3 | Wed |
| day4 | Thu |
| day5 | Fri |
| day6 | Sat |
| day7 | Sun |
| forbidden_words | sex|porn|naked|fuck|hitler |