| version 1.50, 2008/07/29 17:00:18 |
version 1.51, 2008/07/31 16:00:16 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/db.inc.php,v 1.49 2008-07-29 15:56:17 nepto Exp $ */ |
/* $Platon: Metafox/db.inc.php,v 1.50 2008-07-29 17:00:18 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 659 function ezin_get_author($author_id) /* |
|
| Line 659 function ezin_get_author($author_id) /* |
|
| return $ret_row; |
return $ret_row; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| function ezin_save_author($data) /* {{{ */ |
function ezin_exists_author($username) /* {{{ */ |
| { |
{ |
| global $ezin_sys, $ezin_cfg; |
global $ezin_sys, $ezin_cfg; |
| global $ezin_db_handle; |
global $ezin_db_handle; |
| |
|
| $query = sprintf('SELECT COUNT(*) FROM %s WHERE username = "%s"', |
$query = sprintf('SELECT COUNT(*) FROM %s WHERE username = "%s"', |
| $ezin_sys['db']['tables']['users'], ezin_db_escape($data['username'])); |
$ezin_sys['db']['tables']['users'], ezin_db_escape($username)); |
| $result = @mysql_query($query, $ezin_db_handle) |
$result = @mysql_query($query, $ezin_db_handle) |
| or ezin_db_error('ezin_save_author() [1]'); |
or ezin_db_error('ezin_exists_author() [1]'); |
| if (($row = @mysql_fetch_array($result, MYSQL_NUM)) == false) |
if (($row = @mysql_fetch_array($result, MYSQL_NUM)) == false) |
| $row = array(); |
$row = array(); |
| @mysql_free_result($result); |
@mysql_free_result($result); |
| $exists = intval($row[0]); |
return intval($row[0]); |
| |
} /* }}} */ |
| |
|
| |
function ezin_save_author($data) /* {{{ */ |
| |
{ |
| |
$exists = ezin_exists_author($data['username']); |
| if ($exists) { |
if ($exists) { |
| return ezin_update_author($data); |
return ezin_update_author($data); |
| } else if ($ezin_cfg['user_create_role_id'] > 0) { |
} else if ($ezin_cfg['user_create_role_id'] > 0) { |