2003.05.13 user_add and user_modify added

git-svn-id: http://piwigo.org/svn/trunk@9 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
z0rglub
2003-05-13 10:02:06 +00:00
parent 0cc55ec468
commit b7b705f268
19 changed files with 472 additions and 792 deletions
+32 -5
View File
@@ -20,6 +20,33 @@ include( 'functions_category.inc.php' );
//----------------------------------------------------------- generic functions
// get_enums returns an array containing the possible values of a enum field
// in a table of the database.
function get_enums( $table, $field )
{
// retrieving the properties of the table. Each line represents a field :
// columns are 'Field', 'Type'
$result=mysql_query("desc $table");
while ( $row = mysql_fetch_array( $result ) )
{
// we are only interested in the the field given in parameter for the
// function
if ( $row['Field']==$field )
{
// retrieving possible values of the enum field
// enum('blue','green','black')
$option = explode( ',', substr($row['Type'], 5, -1 ) );
for ( $i = 0; $i < sizeof( $option ); $i++ )
{
// deletion of quotation marks
$option[$i] = str_replace( "'", '',$option[$i] );
}
}
}
mysql_free_result( $result );
return $option;
}
// get_boolean transforms a string to a boolean value. If the string is
// "false" (case insensitive), then the boolean value false is returned. In
// any other case, true is returned.
@@ -54,9 +81,9 @@ function array_remove( $array, $value )
// are precised : e.g. 1052343429.89276600
function get_moment()
{
$t1 = explode( " ", microtime() );
$t2 = explode( ".", $t1[0] );
$t2 = $t1[1].".".$t2[1];
$t1 = explode( ' ', microtime() );
$t2 = explode( '.', $t1[0] );
$t2 = $t1[1].'.'.$t2[1];
return $t2;
}
@@ -273,9 +300,9 @@ function pwg_log( $file, $category, $picture = '' )
}
}
function templatize_array( $array, $global_array_name )
function templatize_array( $array, $global_array_name, $handle )
{
global $vtp, $handle, $lang, $page, $user, $conf;
global $vtp, $lang, $page, $user, $conf;
for( $i = 0; $i < sizeof( $array ); $i++ )
{