Changeset 3145 for trunk/include/functions_user.inc.php
- Timestamp:
- Feb 14, 2009, 3:24:10 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r3126 r3145 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 /**
Note: See TracChangeset
for help on using the changeset viewer.