if (!is_object($champ)) { $champ = MCHFunctions::last_championship(); } // Time Formatter $tf = new RMTimeFormatter(0, __('%M% %d%, %Y%', 'match')); $xoopsTpl->assign('champ', array('id' => $champ->id(), 'name' => $champ->getVar('name'), 'start' => $tf->format($champ->getVar('start')), 'end' => $tf->format($champ->getVar('end')))); // Get category $id_cat = rmc_server_var($_REQUEST, 'cat', 0); if ($id_cat > 0) { $category = new MCHCategory($id_cat); } else { $category = MCHFunctions::first_category(); } $xoopsTpl->assign('category', array('id' => $category->id(), 'name' => $category->getVar('name'), 'desc' => $category->getVar('description'))); // Results $data = MCHFunctions::latest_results($category->id(), $champ->id(), 20); $xoopsTpl->assign('results', $data); $categories = array(); MCHFunctions::categories_tree($categories); foreach ($categories as $k => $cat) { $categories[$k]['guion'] = str_repeat("—", $cat['indent']); } $xoopsTpl->assign('categories', $categories); // Championships $xoopsTpl->assign('champs', MCHFunctions::all_championships()); // Constants $xoopsTpl->assign('mch_upurl', MCH_UP_URL); // Language $xoopsTpl->assign('lang_ranking', __('Ranking', 'match')); $xoopsTpl->assign('lang_results', __('Results', 'match')); $xoopsTpl->assign('lang_wons', __('Won matches:', 'match'));