function formatRows($rows, &$matches) { $newrows = array(); foreach ($rows as $key => $row) { $newrows[$key]['type'] = 'ls'; $newrows[$key]['date'] = $row->mdate; $newrows[$key]['result'] = 'LIVE!'; $newrows[$key]['headingtitle'] = parent::jl_utf8_convert('LiveScore', 'iso-8859-1', 'utf-8'); $newrows[$key]['homename'] = parent::jl_utf8_convert($row->heim, 'iso-8859-1', 'utf-8'); $newrows[$key]['homepic'] = ''; $newrows[$key]['awaypic'] = ''; $newrows[$key]['awayname'] = parent::jl_utf8_convert($row->gast, 'iso-8859-1', 'utf-8'); $newrows[$key]['matchcode'] = $row->saison; $newrows[$key]['project_id'] = 'LIVE!'; $matches[] = $newrows[$key]; } return $newrows; }
function showCal(&$params, $year, $month, $ajax = 0, $modid) { global $mainframe; $offset = 0; //$mainframe->getCfg('offset'); $language = JFactory::getLanguage(); //get the current language $language->load('mod_joomleague_calendar'); //load the language ini file of the module $article = $language->_('MOD_JOOMLEAGUE_CALENDAR_VALUEMATCH'); $articles = $language->_('MOD_JOOMLEAGUE_CALENDAR_VALUEMATCHES'); //this strings are used for the titles of the links $article2 = $language->_('MOD_JOOMLEAGUE_CALENDAR_MATCHTHISDAY'); $cal = new JLCalendar(); //this object creates the html for the calendar $dayNamLen = $params->get('cal_length_days'); $cal->dayNames = array(substr(JText::_('SUN'), 0, $dayNamLen), substr(JText::_('MON'), 0, $dayNamLen), substr(JText::_('TUE'), 0, $dayNamLen), substr(JText::_('WED'), 0, $dayNamLen), substr(JText::_('THU'), 0, $dayNamLen), substr(JText::_('FRI'), 0, $dayNamLen), substr(JText::_('SAT'), 0, $dayNamLen)); $cal->monthNames = array(JText::_('JANUARY'), JText::_('FEBRUARY'), JText::_('MARCH'), JText::_('APRIL'), JText::_('MAY'), JText::_('JUNE'), JText::_('JULY'), JText::_('AUGUST'), JText::_('SEPTEMBER'), JText::_('OCTOBER'), JText::_('NOVEMBER'), JText::_('DECEMBER')); $cal->startDay = $params->get('cal_start_day'); //set the startday (this is the day that appears in the first column). Sunday = 0 //it is loaded from the language ini because it may vary from one country to another, in Spain //for example, the startday is Monday (1) $cal->lightbox = $params->get('lightbox'); $cal->lightbox_on_pageload = $params->get('lightbox_on_pageload'); $cal->prefix = $params->get('custom_prefix'); $cal->usedteams = $params->get('usedteams'); $cal->usedclubs = $params->get('usedclubs'); $cal->params = $params; //set the link for the month, this will be the link for the calendar header (ex. December 2007) $cal->monthLink = JRoute::_('index.php?option=com_joomleague_calendar' . '&year=' . $year . '&month=' . $month . '&modid=' . $modid); $cal->modid = $modid; $cal->ajax = $ajax; $cal->getMatches($month, $year); $counter = array(); jimport('joomla.utilities.date'); foreach ($cal->matches as $row) { $created = new JDate($row['date'], -$offset); $createdYear = $created->toFormat('%Y'); $createdMonth = $created->toFormat('%m'); $createdDay = $created->toFormat('%d'); //have to use %d because %e doesn't works on windows $createdDate = $createdYear . $createdMonth . $createdDay; //this makes an unique variable for every day $counter[$createdDate]['createdYear'] = $createdYear; $counter[$createdDate]['createdMonth'] = $createdMonth; $counter[$createdDate]['createdDay'] = $createdDay; $counter[$createdDate]['tiptitle'] = $created->toFormat('%A, %d.%m.%Y'); if (!isset($counter[$createdDate]['count'])) { $counter[$createdDate]['count'] = 1; } else { $counter[$createdDate]['count'] += 1; } //$counter[$date] counts the number of articles in each day, to display it as a title in the link of the day } foreach ($counter as $createdDate => $val) { $title = $counter[$createdDate]['tiptitle'] . ' :: ' . $counter[$createdDate]['count'] . ' '; $title .= $counter[$createdDate]['count'] > 1 ? $articles : $article; $title .= ' ' . $article2; $inject = $params->get('inject', 0); $update_module = $params->get('update_module', 0); $cal->linklist[$createdDate]['click'] = 'javascript:jlCalmod_showhide(\'jlCalList-' . $modid . '\', \'jlcal_' . $counter[$createdDate]['createdYear'] . '-' . $counter[$createdDate]['createdMonth'] . '-' . $counter[$createdDate]['createdDay'] . '-' . $modid . '\', \'' . str_replace(' :: ', ': ', $title) . '\', ' . $inject . ', ' . $modid . ');'; //$cal->linklist[$createdDate]['click']= 'jlcnewDate('.$counter[$createdDate]['createdMonth'].",". $counter[$createdDate]['createdYear'].",".$modid."," .$day.');'; $cal->linklist[$createdDate]['link'] = 'javascript:void(0)'; $cal->linklist[$createdDate]['link'] .= "\" title=\""; //the calendar class sets the links this way: <a href=" . THE LINK STRING . "> //so, the easiest way to add a title to that link is by setting THE LINK STRING = the link" title="the title //the result link would be <a href="the link" title="the title"> $cal->linklist[$createdDate]['link'] .= $title; //the above 3 lines output something like: 3 articles on this day. Or: 1 article on this day } return $cal->getMonthView($month, $year); }
function buildImage($team) { global $mainframe; $image = $this->xparams->get('team_logos', 'logo_small'); if ($image == '-') { return ''; } $logo = ''; if ($team->{$image} != '' && file_exists($mainframe->getCfg('absolute_path') . '/' . $team->{$image})) { $h = $this->xparams->get('logo_height', 20); $logo = '<img src="' . JUri::root(true) . '/' . $team->{$image} . '" alt="' . parent::jl_utf8_convert($team->short_name, 'iso-8859-1', 'utf-8') . '" title="' . parent::jl_utf8_convert($team->name, 'iso-8859-1', 'utf-8') . '"'; if ($h > 0) { $logo .= ' style="height:' . $h . 'px;"'; } $logo .= ' />'; } return $logo; }