ich habe ein problem, und brauche dringend hilfe.
Ich bastle an ein navigationsmodul, das alle Artikel ausliest aber nur was online ist.
Es funct aber nicht, alle Artikel werden angezeigt egal ob online oder offline.
Weiss jemand was der fehler sein könnte?
Danke
___EDITED___
Ach, ich sehe shon nichts mehr....:
Code: Alles auswählen
foreach (OOCategory::getRootCategories(1) as $lev1){
Code: Alles auswählen
<?php
print "\n " . '<ul id="menu" class="collapsible">' . "\n";
function sitemapliste2(&$openul,$lev,$PathIndex,$lastcat) {
$time = time();
{
if($openul == 0) {
// print '<ul class="navLevel'.$PathIndex.'space">' . "\n";
$openul = 1;
}
if($lastcat == $lev){
$last = 'Last';
$last2 = '';
} else {
$last = '';
$last2 = 'navLevel'.$PathIndex;
}
if(sizeof($lev->getChildren()) != 0 OR count($lev->getArticles()) > 1){
$open = 'Open';
} else {
$open = '';
}
$articleDescription = $lev->getDescription();
print " " . '<li><a href="'.$lev->getUrl().'">'.$lev->getName(). '<span class="descmenu">' . $articleDescription .'</span></a>';
////////////ARTIKEL START///////////////////
$article = $lev->getArticles();
$i=0;
if (count($article) > 1) {
echo '<ul class="navLevel'.$PathIndex.'space">';
//foreach ($article as $var) {
//if ($var->isOnline()){
// if ($var->isOnline(false) and $articleId != $lev->getId()){
// echo 'online = ';
// print_r ($var->isOnline());
// $i = $i+1;
// }
//}
foreach ($article as $var) {
//if ($var->isOnline() and $articleId != $lev->getId()){
//echo 'iiiii';
//}
$articleId = $var->getId();
$articleName = $var->getName();
$articleDescription = $var->getDescription();
//if ($var->isOnline()){
if ($var->isOnline(false) and $articleId != $lev->getId()){
$j = $j + 1;
if($j == $i){
$last = 'Last';
$last2 = '';
} else {
$last = '';
$last2 = 'navLevel'.$PathIndex;
}
if ($var->isOnline()){
print '<li><a href="'.rex_getUrl($articleId).'">'.$articleName.'</a></li>';
}
}
}
echo '</ul>'; // is this necessary?
}
////////////ARTIKEL ENDE/////////////////////
$levSize = sizeof($lev->getChildren());
// startarticle
if($_SESSION['USR_TYP'] < $lev->getValue("art_type_id")){
$levSize = 0;
}
if($levSize != 0)
{
print '<ul class="acitem">';
$opensubul = 0;
$k = 0;
foreach($lev->getChildren() as $sublevel) {
$k = $k + 1;
if($k == $levSize){
$lastcat = $sublevel;
}
sitemapliste2($opensubul,$sublevel,$PathIndex + 1,$lastcat);
}
if($opensubul == 1)
echo "</ul>"; // END SUBITEMS
}
echo "</li>\n";
}
}
$openul = 0;
foreach (OOCategory::getRootCategories() as $lev1){
sitemapliste2($openul,$lev1,1,0);
}
if($openul == 1) {
echo "</ul>\n";
}
?>