Cheetah
ChEventsSiteMaps.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbSiteMaps');
9 ch_import('ChWsbPrivacy');
10 
15 {
16  protected $_oModule;
17 
18  protected function __construct($aSystem)
19  {
20  parent::__construct($aSystem);
21 
22  $this->_aQueryParts = array (
23  'fields' => "`ID`, `EntryUri`, `Date`, `EventStart`, `EventEnd`", // fields list
24  'field_date' => "Date", // date field name
25  'field_date_type' => "timestamp", // date field type
26  'table' => "`ch_events_main`", // table name
27  'join' => "", // join SQL part
28  'where' => "AND `Status` = 'approved' AND `allow_view_event_to` = '" . CH_WSB_PG_ALL . "'", // SQL condition, without WHERE
29  'order' => " `Date` ASC ", // SQL order, without ORDER BY
30  );
31 
32  $this->_oModule = ChWsbModule::getInstance('ChEventsModule');
33  }
34 
35  protected function _genUrl ($a)
36  {
37  return CH_WSB_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . 'view/' . $a['EntryUri'];
38  }
39 
40  protected function _genChangeFreq ($a)
41  {
42  // calculate the date which is closest to now
43  $iDiffMin = PHP_INT_MAX;
44  $aDateFields = array ('Date', 'EventStart', 'EventEnd');
45  foreach ($aDateFields as $sField) {
46  $iDiff = abs(time() - $a[$sField]);
47  if ($iDiff < $iDiffMin)
48  $iDiffMin = $iDiff;
49  }
50 
51  if ($iDiffMin != PHP_INT_MAX)
52  $a[$this->_aQueryParts['field_date']] = time() - $iDiffMin;
53 
54  return parent::_genChangeFreq ($a);
55  }
56 }
ChEventsSiteMaps\_genUrl
_genUrl($a)
Definition: ChEventsSiteMaps.php:35
ChWsbModule\getInstance
static getInstance($sClassName)
Definition: ChWsbModule.php:89
ChEventsSiteMaps\$_oModule
$_oModule
Definition: ChEventsSiteMaps.php:16
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChEventsSiteMaps\__construct
__construct($aSystem)
Definition: ChEventsSiteMaps.php:18
php
ChWsbSiteMaps
Definition: ChWsbSiteMaps.php:32
time
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
Definition: license.txt:56
CH_WSB_PG_ALL
const CH_WSB_PG_ALL
Definition: ChWsbPrivacy.php:12
ChEventsSiteMaps
Definition: ChEventsSiteMaps.php:15
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChEventsSiteMaps\_genChangeFreq
_genChangeFreq($a)
Definition: ChEventsSiteMaps.php:40