Ich habe mich einfach mal an getArticles orientiert, was das Globalisieren angeht:
Code: Alles auswählen
function rubricinclude ($rubric_id, $template_id, $artikelanzahl, $sortierung) {
global $content, $db_autor, $db_changer, $db_content, $db_email,
$db_idx, $db_initial, $db_last_modify, $db_nr, $db_pub_datum,
$db_rubric_id, $db_template, $db_titel, $db_verfallsdatum,
$fetchedcontent, $hdlr_parser_content, $hdlr_parser_replacement,
$key, $_name, $parameters, $placeholder, $placeholders_cache,
$replacement, $_type, $typeNames, $cpoSystem, $tl, $activeModules;
switch ($sortierung){
case 'manual': $sortierung = 'sort_id desc'; break;
case 'index aufwärts': $sortierung = 'index asc'; break;
case 'index abwärts': $sortierung = 'index desc'; break;
default: $sortierung = 'sort_id desc';
}
$pagetype = 'index';
ob_start();
// datenbank-abfrage
$query = "SELECT rubric_id, commentary, verfallsdatum, templates_id, nr, idx, email, autor, pub_datum, titel, initial, freigabe, changer FROM " . CPO_NEWS . " WHERE " . ( $cpoSystem['release'] ? "artikel_archiv<2 AND freigabe=" . STATE_RELEASED : "artikel_archiv<1 AND freigabe!=" . STATE_BLOCKED ) . " AND pub_datum<='" . date('Y-m-d H:i:s', time()) . "' AND verfallsdatum>='".date('Y-m-d H:i:s', time())."' AND rubric_id='".$rubric_id."' ORDER BY ".$sortierung." LIMIT 0," . $artikelanzahl . " ";
$db = new DB;
$db->query($query);
while($db->next_record()) {
$db_template = $template_id;
$db_nr = $db->v('nr');
$db_idx = $db->v('idx');
$db_email = $db->v('email');
$db_autor = $db->v('autor');
$db_changer = $db->v('changer');
$db_pub_datum = $db->v('pub_datum');
$db_verfallsdatum = $db->v('verfallsdatum');
$db_commentary = $db->v('commentary');
$db_titel = $db->v('titel');
$db_initial = $db->v('initial');
$db_freigabe = $db->v('freigabe');
$db_rubric_id = $db->v('rubric_id');
require(CPO_BASEDIR.'_include/select_template.php');
}
$rubriccontent = ob_get_contents();
ob_end_clean();
return $rubriccontent;
}
Bei mir funzt das in Seitentemplates und in Artikeln problemlos...