Ejemplo n.º 1
0
}
$CNT_TMP .= $sitemap['before'];
if ($content['struct'][$sitemap['startid']]['acat_nositemap']) {
    $sitemap['c'] = '';
    if ($sitemap['catclass']) {
        $sitemap['c'] .= ' class="' . $sitemap['catclass'];
        if ($sitemap['classcount']) {
            $sitemap['c'] .= '0';
        }
        $sitemap['c'] .= '"';
    }
    if (empty($sitemap["without_parent"])) {
        $CNT_TMP .= "<ul" . $sitemap['c'] . "><li" . $sitemap['cat_style'] . ">";
        $CNT_TMP .= '<a href="index.php?';
        if ($content['struct'][$sitemap['startid']]['acat_alias']) {
            $CNT_TMP .= $content['struct'][$sitemap['startid']]['acat_alias'];
        } else {
            $CNT_TMP .= 'id=' . $sitemap['startid'];
        }
        $CNT_TMP .= '">' . html_specialchars($content['struct'][$sitemap['startid']]['acat_name']) . '</a>';
    }
    if ($sitemap["display"]) {
        $CNT_TMP .= build_sitemap_articlelist($sitemap['startid'], 0, $sitemap);
    }
    $CNT_TMP .= build_sitemap($sitemap['startid'], 0, $sitemap);
    if (empty($sitemap["without_parent"])) {
        $CNT_TMP .= "</li>\n</ul>";
    }
}
$CNT_TMP .= $sitemap['after'];
unset($sitemap);
Ejemplo n.º 2
0
function build_sitemap($start = 0, $counter = 0, &$sitemap)
{
    // create sitemap
    $s = '';
    $c = '';
    $counter++;
    if (empty($sitemap['catclass'])) {
        $c = '';
    } else {
        $c = ' class="' . $sitemap['catclass'];
        if ($sitemap['classcount']) {
            $c .= $counter;
        }
        $c .= '"';
    }
    foreach ($GLOBALS['content']['struct'] as $key => $value) {
        if ($GLOBALS['content']['struct'][$key]['acat_nositemap'] && _getStructureLevelDisplayStatus($key, $start)) {
            $s .= '<li' . $sitemap['cat_style'] . '>';
            if (!$GLOBALS['content']['struct'][$key]["acat_redirect"]) {
                $s .= '<a href="' . rel_url(array(), array(), empty($GLOBALS['content']['struct'][$key]['acat_alias']) ? 'id=' . $key : $GLOBALS['content']['struct'][$key]['acat_alias']) . '"';
            } else {
                $redirect = get_redirect_link($GLOBALS['content']['struct'][$key]["acat_redirect"], ' ', '');
                $s .= '<a href="' . $redirect['link'] . '"' . $redirect['target'];
            }
            $s .= '>';
            $s .= html_specialchars($GLOBALS['content']['struct'][$key]['acat_name']);
            $s .= '</a>';
            if ($sitemap["display"]) {
                $s .= build_sitemap_articlelist($key, $counter, $sitemap);
            }
            $s .= build_sitemap($key, $counter, $sitemap);
            $s .= '</li>' . LF;
        }
    }
    if ($s) {
        $s = LF . '<ul' . $c . '>' . LF . $s . '</ul>';
    }
    return $s;
}