Changeset 706
- Timestamp:
- Jan 17, 2005, 11:01:40 PM (19 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/config.inc.php
r695 r706 81 81 // anti-flood_time : number of seconds between 2 comments : 0 to disable 82 82 $conf['anti-flood_time'] = 60; 83 84 // max_LOV_categories : maximum number of categories to display in a list of85 // value. Over this limit, a textfield is displayed, asking for a category86 // identifier87 $conf['max_LOV_categories'] = 50;88 83 89 84 // show_iptc_mapping : is used for showing IPTC metadata on picture.php -
trunk/include/functions.inc.php
r698 r706 35 35 //----------------------------------------------------------- generic functions 36 36 37 /**38 * possible values of an "enum" field39 *40 * get_enums returns an array containing the possible values of a enum field41 * in a table of the database.42 *43 * @param string table in the database44 * @param string field name in this table45 * @uses str_replace46 * @uses explode47 * @uses sizeof48 * @uses substr49 */50 function get_enums( $table, $field )51 {52 // retrieving the properties of the table. Each line represents a field :53 // columns are 'Field', 'Type'54 $result=pwg_query("desc $table");55 while ( $row = mysql_fetch_array( $result ) )56 {57 // we are only interested in the the field given in parameter for the58 // function59 if ( $row['Field']==$field )60 {61 // retrieving possible values of the enum field62 // enum('blue','green','black')63 $option = explode( ',', substr($row['Type'], 5, -1 ) );64 for ( $i = 0; $i < sizeof( $option ); $i++ )65 {66 // deletion of quotation marks67 $option[$i] = str_replace( "'", '',$option[$i] );68 }69 }70 }71 mysql_free_result( $result );72 return $option;73 }74 75 37 // get_boolean transforms a string to a boolean value. If the string is 76 38 // "false" (case insensitive), then the boolean value false is returned. In
Note: See TracChangeset
for help on using the changeset viewer.