Location: PHPKode > projects > Esvon Personals > esvon-personals/docs/fieldsets.txt
// --------------------------------------------------------------------------
// Esvon Classifieds v.4.0
// Copyright(C), Esvon LTD, 2001-2010, All Rights Reserved.
// E-mail: hide@address.com
// All forms of reproduction, including, but not limited to, internet posting, 
// printing, e-mailing, faxing and recording are strictly prohibited.
// One license required per site running Esvon Classifieds. 
// To obtain a license for using Esvon Classifieds, please register at
// http://www.esvon.com/pg/products/p_classifieds/
// --------------------------------------------------------------------------

Esvon Classifieds Fieldsets Definition Guide

 All fieldset files are located at /tpl/db_fields/FIELDSET_NAME/ directory

 Template files (see explanation in templates.txt file)


 Note: if file is not found in fieldset directory it is taken from general
templates directory, it means all files are optional and only fieldset
specific files have to be created and stored in fieldset directory.

New Fieldset

To create new fieldset :
- in Admin Area -> "Manage Fieldsets" add new fieldset
- in "Field Manager" add new fields or make necessary changes to the fields
of the created fieldset
- view each template file of the new fieldset and update it if necessary
(row.htm and details.htm are important)

Go to "Fieldsets Options" in admin area. See "Settings explained" section, "Fieldsets Options"
in readme.txt for more information.

Fieldset can be assigned to a top level category in Admin Area -> Manage Ads
(click "Modify Category").

Fieldset definition file format (fields.txt)
[although User and Listing fields are managed in Admin Area -> "Manage Fieldsets" now,
such plain text fieldset files are still used in several places to simplify fields management]

Each line corresponds to data field.
Empty lines or lines starting from "#" are skipped.
Here is line format with further explanation of each item :

# id|db_field|title|error|input_type|valid_type|addit_valid_chars|size|min_sz|max_sz|value|require|

 id - Field ID. Must be unique, recommended to be started from "f_" for ad fieldset
and from "uf_" for user reg.data fieldset.

 db_field - corresponding database field

 title - Field Title

 error - Custom error message (used for required fields). If left blank,
"%s is required" is used where %s is field title

 input_type - Input type. Can be "text","textarea","htmlarea","checkbox","date","datetime","menu",
"multimenu","checkboxes","radio","file". By default "text" is assumed.  

 valid_type - Validation type. Can be "alpha" (to allow only alphanumeric chars),
"digit" (to allow only digits), "decimal", "email", "url" or custom regular expression.

 addit_valid_chars - Additional allowed chars (useful in combination with
"alpha" or "digit" value of valid_type)

 size - Form control (data input field) size. Can be set for input types "menu", "multimenu",
"text", "checkboxes" (amount of columns), "textarea" and "htmlarea" ("40x8" format - columns x rows)

 min_sz - Min. allowed size for data entered (for "checkboxes","multimenu" - min. amount 
of options required)

 max_sz - Max. allowed size for data entered (for "checkboxes","multimenu" - max. amount 
of options required, for "file" - max. allowed file size in kb)

 value - Default value

 require - Is field required ? (Yes/No)

 search_adv - Is field searchable (advanced search) ? (Yes/No/Range/Range-min-max-step/Multi) 
Multi is valid for "menu" input type only.
 Note: for Range-based search to work correctly database field type for this field must be
numeric (int, mediumint, smallint or decimal usually)

 search_keywords - Is field searchable (keywords search) ? (Yes/No) 

 active - Is field active ? If not will be displayed in admin. area only (Yes/No)

 extra - Extra parameter. It has different meaning for different input types.

 1/ for "checkbox" - defines checked (and stored in db) value ("1" is default)
 2/ for "date","datetime" - comma-separated year range (2003,2008)
 3/ for "file" - comma-separated file extensions allowed. Example: avi,mov,mp3.
You should always specify allowed extensions to prevent malicious files uploading.
 4/ for "checkboxes","menu","multimenu" - defines drop-down menu options. There are 2 ways
to define them: 
  - comma-separated values (preferred)
  - Options set ID from config_sel.txt file - surrounded with "%%". Example: %%setid%%

 notes - comments that will appear at place ad / modify ad forms next to input fields
(to allow hints displaying for certain fields for example)



1/ please alter default fields after "# additional admin fields" line 
in fields_shared.txt only if you know what you're doing. They should be left 
intact usually (new can be added of course).

2/ 'v_title' (database field) must be present in each fieldset as Ad Title
Return current item: Esvon Personals