Changeset 3145 for trunk/admin
- Timestamp:
- Feb 14, 2009, 3:24:10 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r3072 r3145 144 144 { 145 145 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 146 146 147 147 // we can currently delete physically only photo with no 148 148 // storage_category_id (added via pLoader) … … 1865 1865 $extents = array_merge($extents, get_extents($path)); 1866 1866 } 1867 elseif ( !is_link($path) and file_exists($path) 1867 elseif ( !is_link($path) and file_exists($path) 1868 1868 and get_extension($path) == 'tpl' ) 1869 1869 { … … 2010 2010 $path = isset($src['path']) ? $src['path'] : '/'; 2011 2011 $path .= isset($src['query']) ? '?'.$src['query'] : ''; 2012 2012 2013 2013 if (($s = @fsockopen($host,80,$errno,$errstr,5)) === false) 2014 2014 { … … 2067 2067 } 2068 2068 2069 2070 /** 2071 * returns the groupname corresponding to the given group identifier if 2072 * exists 2073 * 2074 * @param int group_id 2075 * @return mixed 2076 */ 2077 function get_groupname($group_id) 2078 { 2079 $query = ' 2080 SELECT name 2081 FROM '.GROUPS_TABLE.' 2082 WHERE id = '.intval($group_id).' 2083 ;'; 2084 $result = pwg_query($query); 2085 if (mysql_num_rows($result) > 0) 2086 { 2087 list($groupname) = mysql_fetch_row($result); 2088 } 2089 else 2090 { 2091 return false; 2092 } 2093 2094 return $groupname; 2095 } 2096 2097 /** 2098 * returns the username corresponding to the given user identifier if exists 2099 * 2100 * @param int user_id 2101 * @return mixed 2102 */ 2103 function get_username($user_id) 2104 { 2105 global $conf; 2106 2107 $query = ' 2108 SELECT '.$conf['user_fields']['username'].' 2109 FROM '.USERS_TABLE.' 2110 WHERE '.$conf['user_fields']['id'].' = '.intval($user_id).' 2111 ;'; 2112 $result = pwg_query($query); 2113 if (mysql_num_rows($result) > 0) 2114 { 2115 list($username) = mysql_fetch_row($result); 2116 } 2117 else 2118 { 2119 return false; 2120 } 2121 2122 return $username; 2123 } 2069 2124 ?>
Note: See TracChangeset
for help on using the changeset viewer.