- ModMaker
- Define Fields
- Administration
- Data output
- Templates
- config.php

# ModMaker - Visitors view and output of the fields in the templates

## Visitors view

Under the visitors view tab is set as the output should look like for the visitor. The display of the data set list is the basis for each module. The data set is the full view and is accessed via a link in the list.

Latest records:
The latest records can be displayed on a separate page (eg home or a block). To output the template is used newest.tpl. In the administration of the module, the number of displayed contributions are determined.

Input mask in the visitor view:
Visitors can create new topics or only records. The input mask is under the list or on a separate page.

## set SQL query filter

Form:
When you select this item, a form (template: filter.tpl) is set for the user defined DB query. You have to set the input fields of the form by yourself. The input must be passed in the view.php to the array class->datafilter.
The form is displayed to the topic or the record list.

Array datafilter:
In array the following key-value pairs can be set, not setted pairs are ignored:

where: "fieldname1 < xyz AND fieldname2 > xyz OR fieldname3 = xyz"
With the where string the database query is expanded.
'fieldname' must be self-defined database field name. You can find all the names in config.php: conf['data']. 'Xyz' can be the values ​​from the specified inputs of the form.
It must be kept to the SQL syntax!

order: fieldname
'fieldname' must be an defined database field name.

direction: ASC or DESC
The sort direction.

datafilter example:
In the form, there are two date input fields with the names start and end. With it only records that are within the selected date should be displayed. A database field with the name date is queried.
$startdate = strtotime(preg_replace("/[^0-9\-]/", "", $_POST['start']));
$enddate = strtotime(preg_replace("/[^0-9\-]/", "", $_POST['end']));
$mod_class->datafilter = array(
'where' => "date > ".$startdate." AND date < ".$enddate,
'order' => 'date',
'direction' => 'DESC'
);

## Templates

Under the rider template is set the data fields to be of which template output.

List view:
Fields to be displayed as a list item.

Page view:
When enabled, the fields to be displayed as a full record.

Visitors input:
When enabled, the fields to be displayed as a visitor input mask.

Recent items:
When enabled, the fields to be displayed in the list of recent entries.

## Download

Under the tab Download the created module is downloaded as a ZIP file.