Changeset 3147 for branches/2.0/include/functions_user.inc.php
- Timestamp:
- 02/14/09 03:28:21 (4 years ago)
- Files:
-
- 1 modified
-
branches/2.0/include/functions_user.inc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/include/functions_user.inc.php
r3127 r3147 674 674 675 675 /** 676 * returns the username corresponding to the given user identifier if exists677 *678 * @param int user_id679 * @return mixed680 */681 function get_username($user_id)682 {683 global $conf;684 685 $query = '686 SELECT '.$conf['user_fields']['username'].'687 FROM '.USERS_TABLE.'688 WHERE '.$conf['user_fields']['id'].' = '.intval($user_id).'689 ;';690 $result = pwg_query($query);691 if (mysql_num_rows($result) > 0)692 {693 list($username) = mysql_fetch_row($result);694 }695 else696 {697 return false;698 }699 700 return $username;701 }702 703 /**704 676 * returns user identifier thanks to his name, false if not found 705 677 * … … 933 905 } 934 906 } 935 936 /**937 * returns the groupname corresponding to the given group identifier if938 * exists939 *940 * @param int group_id941 * @return mixed942 */943 function get_groupname($group_id)944 {945 $query = '946 SELECT name947 FROM '.GROUPS_TABLE.'948 WHERE id = '.intval($group_id).'949 ;';950 $result = pwg_query($query);951 if (mysql_num_rows($result) > 0)952 {953 list($groupname) = mysql_fetch_row($result);954 }955 else956 {957 return false;958 }959 960 return $groupname;961 }962 963 907 964 908 /**
![(please configure the [header_logo] section in trac.ini)](http://piwigo.org/screenshots/piwigo_logo_on_white.png)