function getSiteMap($id) { $sql = "SELECT `id` , `title` , `url`, `published`, `description`, `keywords` " . "FROM `pages` WHERE `parentid` = {$id} ORDER BY `place`"; $rs = mysql_query($sql) or die("Unable to Execute Select query"); $recordcount = mysql_num_rows($rs); if ($recordcount) { echo '<ul>'; while ($row = mysql_fetch_assoc($rs)) { // check if page is published and is not 404 page if ($row['published'] == 1 && $row['id'] != 2) { echo '<li>' . getEntryHTML($row); if ($row['id'] != 1) { getSiteMap($row['id']); } echo '</li>'; } } echo '</ul>'; } }
function readTemplate($template, $pagecontent) { global $HTML; global $HIGHLIGHT_REQUEST; global $language; global $syntax; global $CMS_CONF; global $smileys; # ist nur true wenn Inhaltseite eingelesen wird $is_Page = false; if (ACTION_CONTENT == "sitemap") { $pagecontent = getSiteMap(); } elseif (ACTION_CONTENT == "search") { require_once BASE_DIR_CMS . "SearchClass.php"; $search = new SearchClass(); $pagecontent = $search->searchInPages(); } elseif ($pagecontent === false) { # Inhaltseite wird eingelesen und USE_CMS_SYNTAX wird benutzt if (USE_CMS_SYNTAX) { $is_Page = true; } $pagecontent = getContent(); } # wenn im Template keine Inhaltseite benutzt wird if (!strstr($template, "{CONTENT}")) { $is_Page = false; } $HTML = str_replace('{CONTENT}', '---content~~~' . $pagecontent . '~~~content---', $template); $HTML = $syntax->convertContent($HTML, $is_Page); unset($pagecontent); // Smileys ersetzen if ($CMS_CONF->get("replaceemoticons") == "true") { $HTML = $smileys->replaceEmoticons($HTML); } // Gesuchte Phrasen hervorheben if ($HIGHLIGHT_REQUEST != "") { require_once BASE_DIR_CMS . "SearchClass.php"; $search = new SearchClass(); # wir suchen nur im content teil list($content_first, $content, $content_last) = $syntax->splitContent($HTML); $content = $search->highlightSearch($content); $HTML = $content_first . $content . $content_last; unset($content_first, $content, $content_last); } # $HTML = str_replace(array('{','}','[',']'),array('{','}','[',']'),$HTML); $HTML = str_replace(array('---content~~~', '~~~content---'), "", $HTML); }