private function _checkJEvents()
 {
     if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_jevents' . DS . 'mod.defines.php') and file_exists(JPATH_SITE . DS . 'components' . DS . 'com_jevents' . DS . 'libraries' . DS . 'datamodel.php')) {
         require_once JPATH_SITE . DS . 'components' . DS . 'com_jevents' . DS . 'mod.defines.php';
         require_once JPATH_SITE . DS . 'components' . DS . 'com_jevents' . DS . 'libraries' . DS . 'datamodel.php';
     } else {
         JEventsConnector::_raiseError('Required files not found! This connector needs JEvents 1.5.2 to be installed');
         return false;
     }
     if (class_exists('JEventsDataModel')) {
         $this->jevent = new JEventsDataModel();
     } else {
         JEventsConnector::_raiseError('Required class not found! This connector needs JEvents 1.5.2 installed');
         return false;
     }
     if (!is_callable(array($this->jevent, 'getCalendarData'))) {
         JEventsConnector::_raiseError('Required function "getRangeData" is not callable! This connector needs JEvents 1.5.2 installed');
         return false;
     }
     return true;
 }
 function getMatches($month, $year)
 {
     $livescore = $this->params->get('livescore', '');
     $joomleague = $this->params->get('joomleague', '');
     $caldates = array();
     $caldates['start'] = date("{$year}-{$month}-01 00:00:00");
     $caldates['end'] = date("{$year}-{$month}-31 23:59:59");
     $jlrows = array();
     $lsrows = array();
     $usejevents = $this->params->get('jevents', 0);
     //$user = JFactory::getUser();
     //if ($user->id == 62) $usejevents = 1;
     if ($usejevents == 1) {
         $day = 0;
         require_once dirname(__FILE__) . DS . 'connectors' . DS . 'jevents.php';
         JEventsConnector::getEntries($caldates, $this->params, $this->matches);
     }
     require_once dirname(__FILE__) . DS . 'connectors' . DS . $joomleague . '.php';
     $this->params->prefix = $this->prefix;
     JoomleagueConnector::getEntries($caldates, $this->params, $this->matches);
     if ($livescore != '') {
         require_once dirname(__FILE__) . DS . 'connectors' . DS . 'livescore.php';
         $this->params->prefix = $this->params->get('prefix_livescore', '');
         LivescoreConnector::getMatches($caldates, $this->params, $this->matches);
     }
     $matches = $this->sortArray($this->matches, 'asc', 'date');
     $this->matches = $matches;
     return $matches;
 }
Beispiel #3
0
 function getMatches($month, $year)
 {
     $livescore = $this->params->get('livescore', '');
     $joomleague = $this->params->get('joomleague', '');
     $caldates = array();
     $caldates['start'] = date("{$year}-{$month}-01 00:00:00");
     $caldates['end'] = date("{$year}-{$month}-31 23:59:59");
     $jlrows = array();
     $lsrows = array();
     $usejevents = $this->params->get('jevents', 0);
     if ($usejevents == 1) {
         $day = 0;
         require_once dirname(__FILE__) . '/connectors/jevents.php';
         JEventsConnector::getEntries($caldates, $this->params, $this->matches);
     }
     require_once dirname(__FILE__) . '/connectors/' . $joomleague . '.php';
     $this->params->prefix = $this->prefix;
     // @todo Check!
     $entries = new JoomleagueConnector($this->params);
     $entries->getEntries($caldates, $this->params, $this->matches);
     /* JoomleagueConnector::getEntries($caldates, $this->params, $this->matches); */
     if ($livescore != '') {
         require_once dirname(__FILE__) . '/connectors/livescore.php';
         $this->params->prefix = $this->params->get('prefix_livescore', '');
         LivescoreConnector::getMatches($caldates, $this->params, $this->matches);
     }
     $matches = $this->sortArray($this->matches, 'asc', 'date');
     $this->matches = $matches;
     return $matches;
 }