set_view('sitemap.php'); // TODO: Don't use static date. $lastmod = "2023-09-14"; $this->text .= " " . URL::BASE . " " . $lastmod ." monthly 1.0 " . URL::BASE . "profile/ " . $lastmod ." monthly 0.9 " . URL::BASE . "projects/ " . $lastmod ." monthly 0.8 "; $statement = get_context()->get_db()->prepare( 'SELECT permalink FROM project WHERE user = :user AND visible = 1 ORDER BY idx' ); $statement->bindValue(':user', get_context()->get_user()->get_id(), PDO::PARAM_INT); $statement->execute(); $priority = 0.7; $priority_dec = 0.3 / $statement->rowcount(); while ($r = $statement->fetch(PDO::FETCH_ASSOC)){ $this->text .= " " . URL::BASE . "projects/" . $r["permalink"]. " " . $lastmod ." monthly " . $priority . " "; $priority -= $priority_dec; } $this->text .= " "; } /** * Retrieves the text for the sitemap XML file. * * @return string The text for the XML. */ public function get_text(){return $this->text;} }