Ignore:
Timestamp:
Jan 20, 2005, 12:34:42 AM (19 years ago)
Author:
plg
Message:
  • bug fixed : in admin, username displayed in titles if needed even if only user id was transmitted
File:
1 edited

Legend:

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

    r680 r708  
    354354  return $forbidden_categories;
    355355}
     356
     357/**
     358 * returns the username corresponding to the given user identifier if exists
     359 *
     360 * @param int user_id
     361 * @return mixed
     362 */
     363function get_username($user_id)
     364{
     365  $query = '
     366SELECT username
     367  FROM '.USERS_TABLE.'
     368  WHERE id = '.intval($user_id).'
     369;';
     370  $result = pwg_query($query);
     371  if (mysql_num_rows($result) > 0)
     372  {
     373    list($username) = mysql_fetch_row($result);
     374  }
     375  else
     376  {
     377    return false;
     378  }
     379 
     380  return $username;
     381}
    356382?>
Note: See TracChangeset for help on using the changeset viewer.