示例#1
0
function mch_role_bkshow($options)
{
    include_once XOOPS_ROOT_PATH . '/modules/match/class/mchfunctions.php';
    RMTemplate::get()->add_xoops_style('blocks.css', 'match');
    $ch = rmc_server_var($_GET, 'champ', $options[0]);
    $champ = $ch <= 0 ? MCHFunctions::current_championship() : new MCHChampionship($ch);
    if (!is_object($champ)) {
        $champ = MCHFunctions::last_championship();
    }
    $ch = rmc_server_var($_GET, 'cat', $options[1]);
    $category = $ch <= 0 ? MCHFunctions::first_category() : new MCHCategory($ch);
    // Role
    $data = MCHFunctions::next_matches($category->id(), $champ->id(), $options[2]);
    $block = array();
    $block['role'] = $data;
    $mc = RMUtilities::module_config('match');
    $block['link'] = $mc['urlmode'] ? XOOPS_URL . '/' . $mc['htbase'] : XOOPS_URL . '/modules/match';
    $block['lang_viewrol'] = __('View full roleplay &raquo;');
    $block['category'] = $category->id();
    return $block;
}
示例#2
0
// 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')));
// Get category
$id_team = rmc_server_var($_REQUEST, 'team', 0);
if ($id_team > 0) {
    $team = new MCHTeam($id_team);
    $xoopsTpl->assign('team', array('id' => $team->id(), 'name' => $team->getVar('name'), 'desc' => $team->getVar('info')));
}
// Role
$data = MCHFunctions::next_matches($category->id(), $champ->id(), 0, $id_team);
$xoopsTpl->assign('roleplay', $data);
$categories = array();
MCHFunctions::categories_tree($categories);
foreach ($categories as $k => $cat) {
    $categories[$k]['guion'] = str_repeat("&#151;", $cat['indent']);
}
$xoopsTpl->assign('categories', $categories);
// Championships
$xoopsTpl->assign('champs', MCHFunctions::all_championships());
// Constants
$xoopsTpl->assign('mch_upurl', MCH_UP_URL);
// Labguage
$xoopsTpl->assign('lang_selectchamp', __('Select championship...', 'match'));
$xoopsTpl->assign('lang_selectcat', __('Select category...', 'match'));
$xoopsTpl->assign('lang_roleplay', __('Role Play', 'match'));