コード例 #1
0
ファイル: category.php プロジェクト: laiello/bitcero-modules
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
// MA 02111-1307 USA
// --------------------------------------------------------
// @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> &raquo; " . 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)));
コード例 #2
0
ファイル: cats.php プロジェクト: laiello/bitcero-modules
function deleteCategory()
{
    $id = TCFunctions::get('id');
    if ($id <= 0) {
        redirectMsg('cats.php', __('Id no válido', 'admin_team'), 1);
        die;
    }
    $cat = new TCCategory($id);
    if ($cat->isNew()) {
        redirectMsg('cats.php', __('La categoría especificada no existe', 'admin_team'), 1);
        die;
    }
    if ($cat->delete()) {
        redirectMsg('cats.php', __('Base de datos actualizada correctamente', 'admin_team'), 0);
    } else {
        redirectMsg('cats.php', __('No se puedo actualizar la base de datos', 'admin_team') . "<br />" . $cat->errors(), 1);
    }
}