This is the structure of the user_photomarathon table used on the testsite:
CREATE TABLE user_photomarathon (
uid int(11) unsigned DEFAULT '0' NOT NULL auto_increment,
pid int(11) unsigned DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(3) unsigned DEFAULT '0' NOT NULL,
title tinytext NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
photodate int(11) DEFAULT '0' NOT NULL,
description text NOT NULL,
images tinyblob NOT NULL,
fe_cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
);
Notice the red lines - those are fields which are not editable but rather used for system information and the database index.
The remaining black lines are the fields configured for editing in the backend.
The configuration of a custom table is officially done in typo3conf/tables.php. However the best solution is to always use the default tables.php file (found in t3lib/tables.php) and configure a custom script to be included immediately after tables.php. In this script you cannot only modify the $TCA array set in tables.php but also add more tables as you like.
This is how the testsite typo3conf/localconf.php file is configured:
$typo_db_extTableDef_script = "extTables.php";
... and in the file typo3conf/extTables.php this is what we find (extract):
<?php/** * Setting up Typo3 to work with Photo Marathon table in the database */$TCA["user_photomarathon"] = Array ( "ctrl" => Array ( "label" => "title", "tstamp" => "tstamp", "crdate" => "crdate", "fe_cruser_id" => "fe_cruser_id", "delete" => "deleted", "title" => "Photo Marathon image|Photo Maraton Billede|Photo Marathon Bild", "iconfile" => "../fileadmin/photomarathon/user_pm_icon.gif", "enablecolumns" => Array ( "disabled" => "hidden", ) ), "interface" => Array ( "showRecordFieldList" => "title,description,images,hidden" ), "feInterface" => Array ( "fe_admin_fieldList" => "title,description,images,hidden,photodate", ), "columns" => Array ( // Title is set up as an ordinary input-field, one line. "title" => Array ( "label" => "Image title:|Billedtitel:|Bildtitel:", "config" => Array ( "type" => "input", "size" => "40", "max" => "80", "eval" => "trim" ) ), // Image description is set up as a textarea form element in the backend "description" => Array ( "label" => "Image description:|Billedbeskrivelse:|Bildbeschreibung:", "config" => Array ( "type" => "text", "cols" => "48", "rows" => "5" ) ), // Images are stored in a tinyblob where the filenames from // uploads/photomarathon are stored comma-separated "images" => Array ( "label" => $LANG_GENERAL_LABELS["image"], "config" => Array ( "type" => "group", "internal_type" => "file", "allowed" => "gif,jpg,jpeg,png", // Allowed extensions "max_size" => "1000", // Max 1000 kb pr. image "uploadfolder" => "uploads/photomarathon", "show_thumbs" => "1", // Yes, show thumbnails in backend "size" => "3", // The image list box is 3 items high "maxitems" => "6", // Max 6 images pr. record! "minitems" => "0" // Min 0 images. ) ), // Hidden field "hidden" => Array ( "label" => $LANG_GENERAL_LABELS["disable"], "config" => Array ( "type" => "check" ) ), // Photo date "photodate" => Array ( "label" => "Date:|Dato:|Datum:", "config" => Array ( "type" => "input", "size" => "7", "max" => "20", "eval" => "date", "checkbox" => "0", "default" => "0" ) ), // This field is loaded with the uid of the fe_user // who created the photomarathon image. "fe_cruser_id" => Array ( "label" => "Front End Owner:|Website-bruger ejer:|Frontend Besitzer:", "config" => Array ( "type" => "group", "internal_type" => "db", "allowed" => "fe_users", "size" => "1", "maxitems" => "1", "minitems" => "0", "show_thumbs" => "1" ) ) ), "types" => Array ( "0" => Array("showitem" => "title;;1,photodate,description,images,fe_cruser_id") ), "palettes" => Array ( "1" => Array("showitem" => "hidden") ));?>(From testsite: typo3conf/extTables.php. The original file contains comments which are stripped in this listing.)