/** * @desc Muestra la lista de categorías existentes */ function showCategories() { global $tpl, $xoopsModule, $db, $adminTemplate; $result = $db->query("SELECT * FROM " . $db->prefix("coach_categos") . " ORDER BY name"); $categos = array(); while ($row = $db->fetchArray($result)) { $cat = new TCCategory(); $cat->assignVars($row); $categos[] = array('id' => $cat->id(), 'name' => $cat->getVar('name'), 'teams' => count($cat->teams())); } xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . _AS_TC_CATSLOC); xoops_cp_header(); include RMTemplate::get()->get_template("admin/coach_categories.php", 'module', 'team'); xoops_cp_footer(); }
// -------------------------------------------------------- // @copyright: 2008 Red México define('TC_LOCATION', 'categories'); include '../../mainfile.php'; $id = TCFunctions::get('id'); if ($id == '') { redirect_header(XOOPS_URL . '/modules/team/', 1, _MS_TC_ERRID); die; } $myts =& MyTextSanitizer::getInstance(); $id = $myts->addSlashes($id); $id = str_replace("/", "", $id); $cat = new TCCategory($id); if ($cat->isNew()) { redirect_header(XOOPS_URL . '/modules/team/', 1, _MS_TC_ERRNOEXISTIS); die; } $xoopsOption['template_main'] = "coach_category.html"; include 'header.php'; $tpl->assign('coach_title', $cat->name()); $tpl->assign('lang_comment', _MS_TC_COMMENT); $tpl->assign('lang_in', _MS_TC_TEAMIN); $tpl->assign('xoops_pagetitle', sprintf(_MS_TC_PTITLE, $cat->name())); $location = "<a href='" . TC_URL . "'>" . $xoopsModule->name() . "</a> » " . sprintf(_MS_TC_PTITLE, $cat->name()); $tpl->assign('coach_location', $location); $teams = $cat->teams(); foreach ($teams as $team) { $link = TC_URL . '/' . ($mc['urlmode'] ? 't/' . $team->nameId() . '/' : 'team.php?id=' . $team->id()); $tpl->append('teams', array('id' => $team->id(), 'name' => $team->name(), 'image' => $team->image(), 'link' => $link, 'desc' => substr($util->filterTags($team->desc()), 0, 200))); } include 'footer.php';