| version 1.55, 2010/10/15 14:09:15 |
version 1.56, 2010/11/02 17:32:26 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/db.inc.php,v 1.54 2010-09-24 15:52:19 igor Exp $ */ |
/* $Platon: Metafox/db.inc.php,v 1.55 2010-10-15 14:09:15 igor 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 568 function ezin_get_article_list($section_ |
|
| Line 568 function ezin_get_article_list($section_ |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |
| |
* ezin_get_featured_articles_list() |
| |
*/ |
| |
function ezin_get_featured_articles_list($limit = 10, $lang = '') /* {{{ */ |
| |
{ |
| |
global $ezin_sys; |
| |
global $ezin_cfg; |
| |
global $ezin_db_handle; |
| |
$limit = intval($limit); |
| |
$query = 'SELECT' |
| |
.' articles.id featured_article_id,' |
| |
.' articles.atitle featured_article_atitle,' |
| |
.' articles.title featured_article_title,' |
| |
.' articles.status featured_article_status,' |
| |
.' articles.access_key featured_article_access_key,' |
| |
.' articles.template_key featured_article_template_key,' |
| |
.' UNIX_TIMESTAMP(articles.datetime) featured_article_timestamp,' |
| |
.' articles.bodytext_wordcount featured_article_bodytext_wordcount,' |
| |
.' articles.bodytext_flags featured_article_bodytext_flags,' |
| |
.' articles.ghometext_wordcount featured_article_ghometext_wordcount,' |
| |
.' articles.ghometext_flags featured_article_ghometext_flags,' |
| |
.' articles.ghometext featured_article_ghometext,' |
| |
.' articles.hometext_wordcount featured_article_hometext_wordcount,' |
| |
.' articles.hometext_flags featured_article_hometext_flags,' |
| |
.' articles.hometext featured_article_hometext,' |
| |
.' articles.calendar_flag featured_article_calendar_flag,' |
| |
.' authors.id featured_article_author_id,' |
| |
.' authors.name featured_article_author_name,' |
| |
.' authors.email featured_article_author_email,' |
| |
.' authors.homepage featured_article_author_homepage,' |
| |
.' authors.position featured_article_author_position,' |
| |
.' authors.location featured_article_author_location,' |
| |
.' authors.access_key featured_article_author_access_key,' |
| |
.' authors.template_key featured_article_author_template_key,' |
| |
.' sections.id featured_article_section_id,' |
| |
.' sections.name featured_article_section_name,' |
| |
.' sections.type featured_article_section_type,' |
| |
.' sections.access_key featured_article_section_access_key,' |
| |
.' sections.template_key featured_article_section_template_key,' |
| |
.' sections.link featured_article_section_link' |
| |
.' FROM '.$ezin_sys['db']['tables']['articles'].' AS articles' |
| |
.' LEFT JOIN '.$ezin_sys['db']['tables']['authors'].' AS authors' |
| |
.' ON articles.author_id = authors.id,' |
| |
.' '.$ezin_sys['db']['tables']['sections'].' AS sections'; |
| |
$query .= |
| |
' WHERE articles.section_id = sections.id' |
| |
.' AND articles.featured_articles_flag IS NOT NULL'; |
| |
if ($lang != '') { |
| |
$query .= ' AND (lang IS NULL OR lang = ""' |
| |
.' OR lang LIKE "'.ezin_db_escape($lang).'")'; |
| |
} |
| |
|
| |
$query .= ' ORDER BY articles.featured_articles_flag DESC'; |
| |
|
| |
if ($limit > 0) { |
| |
$query .= ' LIMIT '.$limit; |
| |
} |
| |
$result = @mysql_query($query, $ezin_db_handle) |
| |
or ezin_db_error('ezin_get_featured_articles_list()'); |
| |
$array = array(); |
| |
for ($k = 0; ($array[$k] = @mysql_fetch_array($result, MYSQL_ASSOC)); $k++) |
| |
; |
| |
unset($array[$k]); |
| |
@mysql_free_result($result); |
| |
return $array; |
| |
} /* }}} */ |
| |
|
| |
|
| |
/* |
| * ezin_get_article_list_counts() |
* ezin_get_article_list_counts() |
| */ |
*/ |
| function ezin_get_article_list_counts($section_id = 0, $author_id = 0, $limit = 10, $lang = '') /* {{{ */ |
function ezin_get_article_list_counts($section_id = 0, $author_id = 0, $limit = 10, $lang = '') /* {{{ */ |