public function generate() { require "libs/sitemap.php"; $sitemap = new sitemap(URL); //$sitemap->setPath(URL.'xmls/'); $sitemap->setPath('/home/u177922748/public_html/'); $sitemap->setFilename('sitemap'); $sitemap->addItem('', '0.9', 'weekly', 'Jun 25'); $sitemap->addItem('postjob', '0.4', 'monthly', 'Jun 25'); $sitemap->addItem('login', '0.4', 'monthly', 'Jun 25'); $sitemap->addItem('contactus', '0.4', 'monthly', 'Jun 25'); $sitemap->addItem('terms', '0.4', 'monthly', 'Jun 25'); $sitemap->addItem('privacy', '0.4', 'monthly', 'Jun 25'); $sitemap->addItem('signup', '0.4', 'monthly', 'Jun 25'); $posts = $this->model->sitemapList(); foreach ($posts as $post) { $sitemap->addItem('jobs/view/' . $post['postid'], '0.7', 'weekly', $post['date_create']); } $sitemap->createSitemapIndex(URL, 'Today'); header('location:' . URL . 'feedback'); }