| @@ 122-137 (lines=16) @@ | ||
| 119 | ||
| 120 | ||
| 121 | // GCChange[1] - better username generation function found from a user note on the ucfirst() php.net manual page |
|
| 122 | function usernameize($str,$a_char = array("'","-",".")) |
|
| 123 | { |
|
| 124 | $string = replaceAccents(mb_strtolower(strtok( $str, '@' ))); |
|
| 125 | foreach ($a_char as $temp){ |
|
| 126 | $pos = strpos($string,$temp); |
|
| 127 | if ($pos){ |
|
| 128 | $mend = ''; |
|
| 129 | $a_split = explode($temp,$string); |
|
| 130 | foreach ($a_split as $temp2){ |
|
| 131 | $mend .= ucfirst($temp2).$temp; |
|
| 132 | } |
|
| 133 | $string = substr($mend,0,-1); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | return ucfirst($string); |
|
| 137 | } |
|
| 138 | ||
| 139 | /** |
|
| 140 | * |
|
| @@ 28-42 (lines=15) @@ | ||
| 25 | return str_replace($a, $b, $str); |
|
| 26 | } |
|
| 27 | ||
| 28 | function usernameize2( $str, $a_char = array("'", "-", ".") ){ |
|
| 29 | $string = replaceAccents2(mb_strtolower(strtok( $str, '@' ))); |
|
| 30 | foreach ($a_char as $temp){ |
|
| 31 | $pos = strpos($string,$temp); |
|
| 32 | if ($pos){ |
|
| 33 | $mend = ''; |
|
| 34 | $a_split = explode($temp,$string); |
|
| 35 | foreach ($a_split as $temp2){ |
|
| 36 | $mend .= ucfirst($temp2).$temp; |
|
| 37 | } |
|
| 38 | $string = substr($mend,0,-1); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | return ucfirst($string); |
|
| 42 | } |
|
| 43 | ||
| 44 | elgg_make_sticky_form('register'); |
|
| 45 | global $CONFIG; |
|
| @@ 174-189 (lines=16) @@ | ||
| 171 | ||
| 172 | ||
| 173 | // GCChange[1] - better username generation function found from a user note on the ucfirst() php.net manual page |
|
| 174 | function usernameize($str,$a_char = array("'","-",".")) |
|
| 175 | { |
|
| 176 | $string = replaceAccents(mb_strtolower(strtok( $str, '@' ))); |
|
| 177 | foreach ($a_char as $temp){ |
|
| 178 | $pos = strpos($string,$temp); |
|
| 179 | if ($pos){ |
|
| 180 | $mend = ''; |
|
| 181 | $a_split = explode($temp,$string); |
|
| 182 | foreach ($a_split as $temp2){ |
|
| 183 | $mend .= ucfirst($temp2).$temp; |
|
| 184 | } |
|
| 185 | $string = substr($mend,0,-1); |
|
| 186 | } |
|
| 187 | } |
|
| 188 | return ucfirst($string); |
|
| 189 | } |
|
| 190 | ||
| 191 | /** |
|
| 192 | * |
|
| @@ 151-165 (lines=15) @@ | ||
| 148 | return str_replace($a, $b, $str); |
|
| 149 | } |
|
| 150 | ||
| 151 | function create_username($str, $a_char = array("'", "-", ".")) |
|
| 152 | { |
|
| 153 | $string = replace_accents(mb_strtolower(strtok($str, '@'))); |
|
| 154 | foreach ($a_char as $temp) { |
|
| 155 | $pos = strpos($string, $temp); |
|
| 156 | if ($pos) { |
|
| 157 | $mend = ''; |
|
| 158 | $a_split = explode($temp, $string); |
|
| 159 | foreach ($a_split as $temp2) { |
|
| 160 | $mend .= ucfirst($temp2).$temp; |
|
| 161 | } |
|
| 162 | $string = substr($mend, 0, -1); |
|
| 163 | } |
|
| 164 | } |
|
| 165 | return ucfirst($string); |
|
| 166 | } |
|
| 167 | ||
| 168 | elgg_ws_expose_function( |
|