SproutCMS

This is the code documentation for the SproutCMS project

source of /modules/HomePage/Helpers/SitemapGenHome.php

  1. <?php
  2. /*
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  */
  13.  
  14. namespace SproutModules\Karmabunny\HomePage\Helpers;
  15.  
  16. use Sprout\Helpers\Pdb;
  17. use Sprout\Helpers\SitemapGen;
  18. use Sprout\Helpers\SubsiteSelector;
  19.  
  20.  
  21. /**
  22.  * Tool to generate a sitemap entry for the home page(s)
  23.  */
  24. class SitemapGenHome extends SitemapGen
  25. {
  26.  
  27. /**
  28.   * Generate a single sitemap entry for the home page
  29.   */
  30. public function generate()
  31. {
  32. $q = "SELECT date_modified FROM ~homepages WHERE subsite_id = ?";
  33. $row = Pdb::q($q, [SubsiteSelector::$subsite_id], 'row');
  34.  
  35. $this->url('/', $row['date_modified'], null, 1.0);
  36. }
  37.  
  38. }