| version 1.33, 2007/02/24 19:27:03 |
version 1.34, 2007/02/24 21:11:02 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/db.inc.php,v 1.32 2007-02-18 21:30:28 nepto Exp $ */ |
/* $Platon: Metafox/db.inc.php,v 1.33 2007-02-24 19:27:03 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 629 function ezin_save_author($data) /* {{{ |
|
| Line 629 function ezin_save_author($data) /* {{{ |
|
| |
|
| $query = sprintf('SELECT COUNT(*) FROM %s WHERE username = "%s"', |
$query = sprintf('SELECT COUNT(*) FROM %s WHERE username = "%s"', |
| $ezin_sys['db']['tables']['users'], $data['username']); |
$ezin_sys['db']['tables']['users'], $data['username']); |
| echo $query,'<hr>'; |
|
| $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_save_author() [1]'); |
| if (($row = @mysql_fetch_array($result, MYSQL_NUM)) == false) |
if (($row = @mysql_fetch_array($result, MYSQL_NUM)) == false) |
| Line 659 function ezin_save_author($data) /* {{{ |
|
| Line 658 function ezin_save_author($data) /* {{{ |
|
| $result = @mysql_query($query, $ezin_db_handle) |
$result = @mysql_query($query, $ezin_db_handle) |
| or ezin_db_error('ezin_save_author() [23]'); |
or ezin_db_error('ezin_save_author() [23]'); |
| } /* }}} */ |
} /* }}} */ |
| else { /* {{{ */ |
else if ($ezin_cfg['user_create_role_id'] > 0) { /* {{{ */ |
| // authors INSERT |
// authors INSERT |
| $query = sprintf('INSERT INTO %s' |
$query = sprintf('INSERT INTO %s' |
| .' (name,email,homepage,description)' |
.' (name,email,homepage,description)' |
| Line 679 function ezin_save_author($data) /* {{{ |
|
| Line 678 function ezin_save_author($data) /* {{{ |
|
| // users INSERT |
// users INSERT |
| $query = sprintf('INSERT INTO %s' |
$query = sprintf('INSERT INTO %s' |
| .' (username,password,author_id,role_id)' |
.' (username,password,author_id,role_id)' |
| .' VALUES ("%s","%s",%d,8)', |
.' VALUES ("%s","%s",%d,%d)', |
| $ezin_sys['db']['tables']['users'], |
$ezin_sys['db']['tables']['users'], |
| $data['username'], md5($data['password']), $author_id); |
$data['username'], md5($data['password']), |
| |
$author_id, $ezin_cfg['user_create_role_id']); |
| $result = @mysql_query($query, $ezin_db_handle) |
$result = @mysql_query($query, $ezin_db_handle) |
| or ezin_db_error('ezin_save_author() [33]'); |
or ezin_db_error('ezin_save_author() [33]'); |
| } /* }}} */ |
} /* }}} */ |