| version 1.53, 2009/06/06 22:43:14 |
version 1.54, 2010/09/24 15:52:19 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/db.inc.php,v 1.52 2009-02-11 16:15:24 nepto Exp $ */ |
/* $Platon: Metafox/db.inc.php,v 1.53 2009-06-06 22:43:14 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 497 function ezin_get_article_list($section_ |
|
| Line 497 function ezin_get_article_list($section_ |
|
| $limit = 0; // unlimited articles on author pages |
$limit = 0; // unlimited articles on author pages |
| if (is_numeric($author_id)) { |
if (is_numeric($author_id)) { |
| if (intval($author_id) > 0) { |
if (intval($author_id) > 0) { |
| $query .= ' AND authors.id = '.intval($author_id); |
$query_nobind = ' AND authors.id = '.intval($author_id); |
| |
$query2 = 'SELECT id' |
| |
.' FROM '.$ezin_sys['db']['tables']['authors'] |
| |
.' WHERE bind = (' |
| |
.' SELECT bind' |
| |
.' FROM '.$ezin_sys['db']['tables']['authors'] |
| |
.' WHERE id = '.intval($author_id) |
| |
.' LIMIT 1' |
| |
.' )' |
| |
.' AND bind != 0'; |
| } |
} |
| } else { |
} else { |
| $query .= ' AND authors.name LIKE "%'.ezin_db_escape($author_id).'%"'; |
$query_nobind = ' AND authors.name LIKE "%'.ezin_db_escape($author_id).'%"'; |
| |
$query2 = 'SELECT id' |
| |
.' FROM '.$ezin_sys['db']['tables']['authors'] |
| |
.' WHERE bind = (' |
| |
.' SELECT bind' |
| |
.' FROM '.$ezin_sys['db']['tables']['authors'] |
| |
.' WHERE name LIKE "%'.ezin_db_escape($author_id).'%"' |
| |
.' LIMIT 1' |
| |
.' )' |
| |
.' AND bind != 0'; |
| |
} |
| |
|
| |
$result2 = @mysql_query($query2, $ezin_db_handle) |
| |
or ezin_db_error('ezin_get_article_list()'); |
| |
$array2 = array(); |
| |
for ($k = 0; ($array2[$k] = @mysql_fetch_array($result2, MYSQL_ASSOC)); $k++) |
| |
; |
| |
unset($array2[$k]); |
| |
@mysql_free_result($result2); |
| |
|
| |
if (count($array2) > 0) { |
| |
$query .= ' AND ('; |
| |
for ($a = 0; $a < count($array2); $a++) { |
| |
$query .= ($a > 0) ? ' OR ' : ''; |
| |
$query .= ' authors.id = '.intval($array2[$a]['id']); |
| |
} |
| |
$query .= ')'; |
| |
} else { |
| |
$query .= $query_nobind; |
| } |
} |
| |
|
| |
|
| } else { |
} else { |
| $query .= ' AND articles.status NOT IN ("hidden")'; |
$query .= ' AND articles.status NOT IN ("hidden")'; |
| if ($section_id > 0) { |
if ($section_id > 0) { |