Центр истории и культурной антропологии
Институт Африки РАН
рус | eng

Новости

$content_type = array (
'story' => true,
'news' => true
);
$ct_for_sql = '(';
$delim = false;
foreach ($content_type as $type => $show) {
if ($show) {
if ($delim) {
$ct_for_sql .= ', ';
} else {
$delim = true;
}
$ct_for_sql .= '\''.$type.'\'';
}
}
$ct_for_sql .= ')';
$result = pager_query(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.type IN '.$ct_for_sql.' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'));
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);
}
$output .= theme('pager', NULL, $listlength);
print $output;
?>