Changeset 706


Ignore:
Timestamp:
Jan 17, 2005, 11:01:40 PM (19 years ago)
Author:
plg
Message:
  • deletion of obsolete function get_enums
Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/config.inc.php

    r695 r706  
    8181// anti-flood_time : number of seconds between 2 comments : 0 to disable
    8282$conf['anti-flood_time'] = 60;
    83 
    84 // max_LOV_categories : maximum number of categories to display in a list of
    85 // value. Over this limit, a textfield is displayed, asking for a category
    86 // identifier
    87 $conf['max_LOV_categories'] = 50;
    8883
    8984// show_iptc_mapping : is used for showing IPTC metadata on picture.php
  • trunk/include/functions.inc.php

    r698 r706  
    3535//----------------------------------------------------------- generic functions
    3636
    37 /**
    38  * possible values of an "enum" field
    39  *
    40  * get_enums returns an array containing the possible values of a enum field
    41  * in a table of the database.
    42  *
    43  * @param string table in the database
    44  * @param string field name in this table
    45  * @uses str_replace
    46  * @uses explode
    47  * @uses sizeof
    48  * @uses substr
    49  */
    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 the
    58     // function
    59     if ( $row['Field']==$field )
    60     {
    61       // retrieving possible values of the enum field
    62       // 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 marks
    67         $option[$i] = str_replace( "'", '',$option[$i] );
    68       }                 
    69     }
    70   }
    71   mysql_free_result( $result );
    72   return $option;
    73 }
    74 
    7537// get_boolean transforms a string to a boolean value. If the string is
    7638// "false" (case insensitive), then the boolean value false is returned. In
Note: See TracChangeset for help on using the changeset viewer.