function generateSitemapFile($sitemapInfo) { $sitemapInfo['website_id'] = intval($sitemapInfo['website_id']); if (!empty($sitemapInfo['website_id'])) { # check whether the sitemap directory is writable if (!is_writable(SP_TMPPATH . "/" . $this->sitemapDir)) { hideDiv('message'); showErrorMsg("Directory '<b>" . SP_TMPPATH . "/" . $this->sitemapDir . "</b>' is not <b>writable</b>. Please change its <b>permission</b> !"); } $websiteController = new WebsiteController(); $websiteInfo = $websiteController->__getWebsiteInfo($sitemapInfo['website_id']); $baseUrl = $websiteInfo['url']; $this->section = formatFileName($websiteInfo['name']); if (!preg_match('/\\/$/', $baseUrl)) { $baseUrl = $baseUrl . "/"; } $this->baseUrl = $baseUrl; $urlInfo = parse_url($this->baseUrl); $this->hostName = str_replace('www.', '', $urlInfo['host']); $this->smType = $sitemapInfo['sm_type']; $this->excludeUrl = $sitemapInfo['exclude_url']; if (!empty($sitemapInfo['freq'])) { $this->changefreq = $sitemapInfo['freq']; } if (!empty($sitemapInfo['priority'])) { $this->priority = $sitemapInfo['priority']; } $this->createSitemap(); } else { hideDiv('message'); showErrorMsg("No Website Found!"); } }
?> <div class="container"> <h1>Tutorials</h1> <h3>Contents</h3> <ul> <?php foreach ($fileNames as $tutorialNumber => $fileName) { ?> <li> <a href="#tutorial-<?php echo $tutorialNumber; ?> "> <?php echo formatFileName($fileName); ?> </a> </li> <?php } ?> </ul> <?php foreach ($fileNames as $tutorialNumber => $fileName) { ?> <section data-markdown id="tutorial-<?php echo $tutorialNumber; ?> ">
function generateSitemapFile($sitemapInfo) { $sitemapInfo['project_id'] = intval($sitemapInfo['project_id']); if (!empty($sitemapInfo['project_id'])) { # check whether the sitemap directory is writable if (!is_writable(SP_TMPPATH . "/" . $this->sitemapDir)) { hideDiv('message'); showErrorMsg("Directory '<b>" . SP_TMPPATH . "/" . $this->sitemapDir . "</b>' is not <b>writable</b>. Please change its <b>permission</b> !"); } $saCtrler = $this->createController('SiteAuditor'); $projectInfo = $saCtrler->__getProjectInfo($sitemapInfo['project_id']); $this->section = formatFileName($projectInfo['name']); $this->smType = $sitemapInfo['sm_type']; $this->excludeUrl = $sitemapInfo['exclude_url']; if (!empty($sitemapInfo['freq'])) { $this->changefreq = $sitemapInfo['freq']; } if (!empty($sitemapInfo['priority'])) { $this->priority = $sitemapInfo['priority']; } $auditorComp = $this->createComponent('AuditorComponent'); $pageList = $auditorComp->getAllreportPages(" and project_id=" . $sitemapInfo['project_id']); $urlList = array(); foreach ($pageList as $pageInfo) { $pageInfo['page_url'] = Spider::addTrailingSlash($pageInfo['page_url']); if ($auditorComp->isExcludeLink($pageInfo['page_url'], trim($sitemapInfo['exclude_url']))) { continue; } $urlList[] = $pageInfo['page_url']; } $this->createSitemap($this->smType, $urlList); } else { hideDiv('message'); showErrorMsg("No Website Found!"); } }