?>= "0.6" && !getPluginByName("SiteMap")) { $SiteMapCode = "\$sitemap = new plugin();" . $nl; $SiteMapCode .= "\$sitemap->name = \"SiteMap\";" . $nl; $SiteMapCode .= "\$sitemap->version = \"" . $SiteMapVersion."\";" . $nl; $SiteMapCode .= "\$sitemap->createMenuItem(\"" . $MenuSection . "\", \"" . $MenuItemText . "\", \"content.php?title=" . urlencode($item->title) . "\", \"" . $MenuItemTooltip . ".\", 0);" . $nl; if (!installPlugin ("SiteMap", $SiteMapVersion, "", $SiteMapCode, 1)) { print "

" . $MenuErrorText . ".

" . $nl; } } print "" . $nl; print "" . $nl; if (!$AutoGenerateSiteMap && $userinfo->userlevel >= USERLEVEL_ADMIN) { print "

id . "\" />    

" . $nl; } print "
" . $nl; /** * Function: parseLinkTree * * Parses linked HTML content items and returns a link tree * in an unordered list. * * Parameters: * * link - The link to follow. * parentlink - An array of links not to follow. * * Returns: * * String containing the link tree list. */ function parseLinkTree($link, &$parentlink) { global $userinfo; $nl = chr(13) . chr(10); $linkmatch = array(); if (array_search($link, $parentlink) === false) $parentlink[] = $link; else return ""; if (preg_match("/([^:]+?|)content\.php\?.*?(title|id)=([^\s&#]*)/i", $link, $linkmatch)) { if ($linkmatch[2] = "title") { $contentItem = getContentByTitle(urldecode($linkmatch[3])); if (count($contentItem) > 1) return ""; } else $contentItem = getContentById($linkmatch[3]); if ($contentItem === false || ($contentItem->userlevel && $userinfo->userlevel < $contentItem->userlevel)) return ""; } else return ""; $list = "
  • " . $contentItem->title . "
  • " . $nl; if ($contentItem->type == 'html') { if (preg_match_all("/]*?href\s*?=\s*?\"(.*?)\"/i", $contentItem->content, $linkmatch, PREG_PATTERN_ORDER)) { $subliststr = ""; foreach ($linkmatch[1] as $linkURL) $subliststr .= parseLinkTree($linkURL, $parentlink); if ($subliststr != "") $list .= "" . $nl; } } return $list; } /** * Function: getPluginByName * * Retrieves the specified plugin object from the database. * * Parameters: * * name - Plugin name. * * Returns: * * Plugin object on success, *false* on error. * * See Also: * */ function getPluginByName($name) { global $db; $result = $db->query("SELECT * FROM ".DBTABLEPREFIX."plugins WHERE name = '$name'"); if (count($result) == 1) return $result[0]; else return false; }