Flede 0.73 Manual

Overview

Flede (Flexible data editor) is a free open source content management system. Flede provides flexible and powerfull mechanism (not policy) to manage data with almost any structure in MySQL database. Flede supports user authorization with group-based access rights with separate access rights to view, edit, add and delete data.

Why you need Flede?

As Flede may be useful in many different situations we list only most common here:

  1. You want to create a website or information system with you own data structure.
  2. You have a website with mysql database, but you don't have appropriate administration interface.
  3. You wish to extend data structure of existing website without hand-writing administration interface.

What is good about Flede?

  1. Flede is flexible and lightweight solution. It requires PHP and MySQL, need only three tables for own data structure. It can be added to almost any website as alternative administration interface.
  2. Flede doesn't put any limitation on the information model. The only requirement is that all Flede-managed database tables should have unique id field.
  3. You decide by yourself which tables will be managed by Flede and which columns will be visible and editable.
  4. You can change your database structure at any time, provided you change table definitions in Flede accordingly.
  5. Flede natively supports file and image uploads into database (blob columns).
  6. Flede provides flexible error reporting mechanism. Database errors may be reported to user, log file or administrator e-mail.

What Flede does not provide?

  1. Flede doesn't provide page generation mechanism. As long as you have structured data and management interface, you may use any php or other language scripts to generate web pages.
  2. Flede doesn't provide complete database administration mechanism (like PhpMyAdmin does). It does't provide table creation, database backup and other tools. Flede is intended rather to manage existing data structure in multi-user environment.

System requirements

Flede is supposed to work with PHP 4 or later and Mysql 4.1 or later. AJAX save fuctionality requires iconv. Flede managed tables should have unique id field. Flede interface is currently available in English, Russian and Italian.

How to get Flede?

You may download the latest version from SourceForge.net:
http://sourceforge.net/projects/flede/

Installation

  1. Unzip flede and copy it to the folder, accessible from the web.
  2. Copy config-dist.php to config.php
  3. Edit config.php, update database settings, language and error repoting options following instructions in the file.
  4. Flede need to create three tables for internal data structures: To create these tables, point your browser to http://your_server/your_flede_folder/install.php
  5. Login to flede using username "admin" and password "flede".
  6. In tables list click on "Users". Then click "[Edit]" in line with "admin". In "Password" line, set select control to MD5() state and type new admin password in the window. You may also change administrator username in "Login name" line. Then click "Modify" button to save changes.

Configuration

Table configuration

If you want a table to be managed with flede you need to add a table description to MAIN TABLE. Table description determine a way table will be seen and accessible by flede users. Three flede internal tables are managed by flede and accessible to administrator by default as their definitions are added to main table during install. Go to "MAIN TABLE" from Tables list and click on "Add record".

Main table fields description: (don't panic, the example is in the next section). There is only several mandatory fields are marked bold and with asterisk, other fields may be safely left default.

Field nameDescription
Table name:*Name of table in database (e.g.: news)
Table title:*Name of table to display in flede (e.g: Company news)
Title field:*Name of table column to be displayed as record title (e.g.: title)
Additional title fields:Aditional title columns in pairs field:field_display_name serarated by semicolon (e.g: date:Issue date;author:Author of news or just date;author)
Id field:*Name of unique id column in the table (e.g. news_id)
Order priority:Table priority in the list of tables on main flede page (tables with smaller priority are on top)
Hidden:Hidden tables are not listed at flede main page, but can be accessed using explicit address (e.g.: index.php?t=7)
Fields:*Description of table columns to be edited by flede user (not neccesary all table columns). It contains one line for each table column. The format of line is the following:
field_name:field_type:field_display_name:default_value;
field_name - is name of table field (e.g. news_author)
field_type - is a field type in flede (not nessecary corresponding to mysql type). Field type determine the way how the field will be shown to flede user. The list of available types is:
  • i - integer (correspond to int in mysql)
  • l - logical (Yes/No) (correspond to bool or int in mysql)
  • h - hidden field (not available to edit, but can have default value)
  • t - short text field (correspond to varchar or text in mysql)
  • p - password field (md5 value is stored in the table and md5() is shown as an option when field is edited)
  • T - multiline text field (correspont to text in mysql) (textarea will be used to edit this kind of text)
  • TH - multiline HTML text field
  • d - date (correspond to DATE or DATETIME)
  • D - date and time (correspond to DATETIME)
  • b$tablename$id_column$value_column - values from external dictionary. The field is an integer taking values of id_column from table_name. During edit drop-list will be shown with possible values of value_column. (e.g. b$news_authors$author_id$author_name)
  • B$tablename$id_column$value_column - same as b, but id=0 is also possible and correspond to "not defined" value
  • f$filename_field - column contains binary file and filename_field in the same table keeps filename (correspond to blob or longblob)
field_display_name - is a field name to be displayed by flede (e.g. News Author).
default - is a default value (an optional parameter)
Comments:Semicolon separated comments to corresponding fields. Comments are considered as an addition to field_display_name and will be shown to user during table edit.
Parent field:If your table contains structured information (like website menu) you may select parent field name here (e.g.: parent_element_id). Then each record will be shown below and to the right of it's parent (record with id equal to parent field value).
Category field:Use if you want to show table records groupped by categories. Format is:
category_field_name:categories_table_name:id_column:title_column
Let's say you have news table with news_section column and you have also news_sections table with section_id and section_title columns. Use news_seaction:news_sections:section_id:section_title and your news will be separated by named sections in flede.
Where query:Use if you want to show in flede only record fulfiling some criteria (e.g. this.id>100). Use this.id insted of id here to avoid ambiguity in sql queries.
Order by query:Use if you want to order table records somehow (default: this.id desc)
Table description:Table description will be shown to user in top of table records list.
Max file size:Maximum file size for upload (if you have field of type "f"). Note that file size is also limited by php settings.
Read group:*Group id authorized to view records ("-1" - allow to all users)
Add group:*Group id authorized to add news records
Edit group:*Group id authorized to edit records
Group authorized to delete:*Group id authorized to delete records

User configuration

User table is much simpler.

Field nameDescription
id*User id
Login name*User login name
Password*User password, stored as md5() hash
Real nameUser real name
Access groupsList of access groups, separated by comma (e.g 0,1,2), all users are automatically assumed to belong to "-1" group
Last loginLast login time

If you change your own list of access groups you need to relogin for changes to become visible.

Flede configuration example

Suppose we need to run a website with news (each containing some image) and articles (divided into sections) and have the following tables in the database:

mysql> describe articles;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      |      | PRI | NULL    | auto_increment |
| title       | varchar(255) | YES  |     | NULL    |                |
| date        | datetime     | YES  |     | NULL    |                |
| message     | text         | YES  |     | NULL    |                |
| short       | text         | YES  |     | NULL    |                |
| active      | int(11)      | YES  |     | NULL    |                |
| source      | varchar(255) | YES  |     | NULL    |                |
| section     | int(11)      | YES  | MUL | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+

mysql> describe news;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      |      | PRI | NULL    | auto_increment |
| title       | varchar(255) | YES  |     | NULL    |                |
| date        | datetime     | YES  |     | NULL    |                |
| message     | text         | YES  |     | NULL    |                |
| short       | text         | YES  |     | NULL    |                |
| active      | int(11)      | YES  |     | NULL    |                |
| image       | longblob     | YES  |     | NULL    |                |
| imagename   | varchar(255) | YES  |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+

mysql> describe articles_sections;
+-----------+--------------+------+-----+---------+----------------+
| Field     | Type         | Null | Key | Default | Extra          |
+-----------+--------------+------+-----+---------+----------------+
| id        | int(11)      |      | PRI | NULL    | auto_increment |
| title     | varchar(255) | YES  |     | NULL    |                |
| keywords  | varchar(255) | YES  |     | NULL    |                |
+-----------+--------------+------+-----+---------+----------------+

Let's make them accesible with flede.

User configuration

Let's use group with id "0" for administration (access to system tables), "1" for articles_sections edit, "2" for news edit and "3" for articles edit, group "4" will be allowed to view all info. There is no special place for group definition, so we'll keep the numbers in mind.

Let's set up the following users (by adding info to usertable):

Administrator

Field nameValueDescription
id*1
Login name*admin
Password*md5("flede")
Real namePeter Ivanov
Access groups0,1,2,3,4need all access, so memebr of all groups

Main editor

Field nameValueDescription
id*2
Login name*editor
Password*md5("toredi")
Real namePavel Petrov
Access groups1,2,3,4main editor can manage articles,news and sections

News editor

Field nameValueDescription
id*3
Login name*olga
Password*md5("HudQwe")
Real nameOlga Pavlova
Access groups2,4Olga can view news and articles and edit news

Articles author

Field nameValueDescription
id*4
Login name*ivan
Password*md5("Vano")
Real nameIvan Sidorov
Access groups3,4Ivan can view news and articles and edit articles, but can't edit articles_sections

Company president

Field nameValueDescription
id*5
Login name*anna
Password*md5("qynywee")
Real nameAnna Smirnova
Access groups4President can't edit, but can view everything

Table configuration

Let's set up tables now (by adding them to MAIN TABLE)

Articles

Field nameValueDescription
Table name:articlesname of table in database
Table title:Corporate articlesdisplay name in flede
Title field:title
Additional title fields:datedate will also be displayed in record list
Id field:idid is unique id field here
Fields: title:t:Article title;
date:d:Publish date;
message:T:Full text;
short:T:Abstract;
active:l:Active:1;
source:t:Article source reference;
section:B$articles_sections$id$title:Section
active is logical with default '1', message and short should be edited with textarea, title and source are short text, section will take values from articles_sections table with 0 value possible
Theme field:section:articles_sections:id:titleArticles will be shown divided into sections
Read group:4
Add group:3
Edit group:3
Group authorized to delete:3

News

Field nameValueDescription
Table name:newsname of table in database
Table title:Company newsdisplay name in flede
Title field:title
Additional title fields:datedate will also be displayed in record list
Id field:idid is unique id field here
Fields: title:t:Article title;
date:d:Publish date;
message:T:Full text;
short:T:Abstract;
active:l:Active:1;
image:f$imagename:News image
active is logical with default '1', message and short should be edited with textarea, title and source are short text, image will contain file with news picture and imagename will contain it's name
Max file size:102400Maximum picture file size is 100Kb
Read group:4
Add group:2
Edit group:2
Group authorized to delete:2

Articles_sections

Field nameValueDescription
Table name:articles_sections
Table title:Articles sections
Title field:title
Id field:idid is unique id field here
Fields: id:t:Id;
title:t:Article title;
keywords:t:Section keywords
id is in fields list here, so it can be edited
Read group:4
Add group:1
Edit group:1
Group authorized to delete:1

Then each user can login and edit content, he is responsible for. Enjoy!

Contacts

If you have any questions, comments, suggestions, bug reports, bug fixes, contact author by e-mail: rgbeast at flede dot org


Sincerely yours,
Grigory Rubtsov [RGBeast]


Get Flede at SourceForge.net Fast, secure and Free Open Source software downloads Advertising:
Flede Manual, (C) 2003-2009 RGBeast.