ich würde gern eine Rubrik im _local_header includen in Abhängigkeit vom im Artikel angegebenen "Author".
Kann ich dieses Feld irgendwie abfragen, so wie z.B. den Rubriktitel??
Gruß,
dutch
Code: Alles auswählen
$getAutor = new DB;
$getAutor->query("SELECT autor FROM cpo4_news WHERE nr = ".(int)$_REQUEST['nr']);
$getAutor->next_record();
$articleAutor = $getAutor->v('autor');
Code: Alles auswählen
$getAutor = new DB;
$getAutor->query("SELECT autor FROM cpo4_news WHERE nr = ".(int)$_REQUEST['nr']);
$getAutor->next_record();
$articleAutor = $getAutor->v('autor');
if ($articleAutor == 'Administrator'){
### Ausgabe ###
}
Code: Alles auswählen
$getAutor = new DB;
$getAutor->query("SELECT autor FROM cpo4_news WHERE nr = ".(int)$_REQUEST['nr']);
$getAutor->next_record();
$articleAutor = $getAutor->v('autor');
if ($articleAutor == 'Administrator'){
$rubrikid = 2; // Rubrik-id
$artikelanzahl = 1; // maximale Anzahl der auszugebenden Artikel
$sortierung = 'sort_id DESC'; // Art der Artikelsortierung
// ab hier nix mehr ändern
if (!defined('CPO')) exit;
$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='".$rubrikid."' ORDER BY ".$sortierung." LIMIT 0," . $artikelanzahl . " ";
$db = new DB;
$db->query($query);
while($db->next_record()) {
$db_template = $db->v('templates_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');
}
}
Code: Alles auswählen
// function getArticles($rubricId, $pagetype = 'index', $pos = 0, $cpoRubricOverride = array())
$individualContent = getArticles(2, 'index', 0, array('sorting'=>'sort_id DESC', 'noOfArticles'=>1));
echo $individualContent;
Code: Alles auswählen
// function getArticles($rubricId, $pagetype = 'index', $pos = 0, $cpoRubricOverride = array())
$individualContent = getArticles(2, 'index', 0, array('sorting'=>'sort_id DESC', 'noOfArticles'=>1));
echo $individualContent;
Code: Alles auswählen
$cpoRubricOverride = array();
$cpoRubricOverride['settings']['noOfArticles'] = 1;
$cpoRubricOverride['settings']['sorting'] = 'sort_id DESC';
$individualContent = getArticles(2, 'index', 0, $cpoRubricOverride);
echo $individualContent;