| version 1.39, 2007/04/09 23:14:43 |
version 1.40, 2007/04/22 15:37:53 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/db.inc.php,v 1.38 2007-03-06 21:26:50 nepto Exp $ */ |
/* $Platon: Metafox/db.inc.php,v 1.39 2007-04-09 23:14:43 nepto Exp $ */ |
| |
|
| /* |
/* |
| * updates: 23/5/2001, 29/7/2001, 11/10/2001, 2/11/2001, 11/1/2002, 23/7/2002 |
* updates: 23/5/2001, 29/7/2001, 11/10/2001, 2/11/2001, 11/1/2002, 23/7/2002 |
| Line 617 function ezin_get_author($author_id) /* |
|
| Line 617 function ezin_get_author($author_id) /* |
|
| $row = array(); |
$row = array(); |
| @mysql_free_result($result); |
@mysql_free_result($result); |
| foreach (array_keys($row) as $key) { |
foreach (array_keys($row) as $key) { |
| $ret_row['author_'.$key] = $row[$key]; |
if ($key == 'id') { |
| |
$ret_row['author_user_id'] = $row[$key]; |
| |
} else { |
| |
$ret_row['author_'.$key] = $row[$key]; |
| |
} |
| } |
} |
| |
|
| $query = sprintf('SELECT COUNT(*) FROM %s WHERE author_id = %d AND status != "disabled"', |
$query = sprintf('SELECT COUNT(*) FROM %s WHERE author_id = %d AND status != "disabled"', |
| Line 660 function ezin_update_author($data) /* {{ |
|
| Line 664 function ezin_update_author($data) /* {{ |
|
| global $ezin_sys, $ezin_cfg; |
global $ezin_sys, $ezin_cfg; |
| global $ezin_db_handle; |
global $ezin_db_handle; |
| |
|
| |
$password = $data['password']; |
| $data = ezin_db_escape($data); |
$data = ezin_db_escape($data); |
| |
|
| // users update |
// users update (password only) |
| $query = sprintf('UPDATE %s SET password="%s" WHERE username="%s"', |
if (strlen($password) > 0) { |
| $ezin_sys['db']['tables']['users'], $data['password'], $data['username']); |
$query = sprintf('UPDATE %s SET password="%s" WHERE username="%s"', |
| $result = @mysql_query($query, $ezin_db_handle) |
$ezin_sys['db']['tables']['users'], md5($data['password']), $data['username']); |
| or ezin_db_error('ezin_update_author() [1]'); |
$result = @mysql_query($query, $ezin_db_handle) |
| |
or ezin_db_error('ezin_update_author() [1]'); |
| |
} |
| // author_id |
// author_id |
| $query = sprintf('SELECT COUNT(*) FROM %s WHERE username = "%s"', |
$query = sprintf('SELECT author_id FROM %s WHERE username = "%s"', |
| $ezin_sys['db']['tables']['users'], $data['username']); |
$ezin_sys['db']['tables']['users'], $data['username']); |
| $result = @mysql_query($query, $ezin_db_handle) |
$result = @mysql_query($query, $ezin_db_handle) |
| or ezin_db_error('ezin_update_author() [2]'); |
or ezin_db_error('ezin_update_author() [2]'); |