示例#1
0
文件: sitemap.php 项目: philum/cms
function plug_sitemap($hub, $o)
{
    require 'sys.php';
    if ($_SESSION['mn'][$hub]) {
        $ret = build_sitemap($hub);
        return b_sitm('urlset', $ret);
    } else {
        foreach ($_SESSION['mn'] as $k => $v) {
            $ret .= node_build('sitemap', prep_host_b($k), '', '', '');
        }
    }
    return b_sitm('sitemapindex', $ret);
}
示例#2
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);
示例#3
0
*/
//only add tags,
//do not remove tags from CMS when there is no tag-post association
//
//trim spaces
if (!empty($tagstring)) {
    $tagstring = str_replace(' ', '', $tagstring);
    //echo $tagstring ;
    $tags = explode(',', $tagstring);
    sort($tags);
    echo '<h2>identified tags from the form field</h2>';
    pretty($tags);
}
add_cms_tags($tags);
//now that we know which tags are sent from the form
//attach them to the post
//delete current tag_post association
//
remove_tag_post_association($id);
add_tag_post_association($tags, $id);
echo '<h2>======= END  TAG SECTION ============</h2>';
//END OF METADATA PROCESSING
//update the RSS Feed
build_rss();
//update the sitemap
build_sitemap();
echo "<meta http-equiv='refresh' content='" . $redir_delay . "; url={$tld2}/manage/write.php?id={$id}'>";
$db->close();
?>

示例#4
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;
}