function cs_cups_team($cs_lang, $type, $team_id, $team_name, $autoseed, $seed, $html = false, $grid = false) { $options = cs_sql_option(__FILE__, 'cups'); if ($grid && $options['max_gridname'] > 0) { $team_name = cs_textcut($team_name, $options['max_gridname']); } $new_name = ''; switch ($team_id) { case CS_CUPS_TEAM_UNKNOWN: $new_name = ''; break; case CS_CUPS_TEAM_BYE: $new_name = $cs_lang['bye_grid']; break; default: if (empty($team_name) and !empty($team_id)) { $new_name = '? ID:' . $team_id; } else { switch ($type) { case CS_CUPS_TYPE_USERS: if ($html) { $new_name = cs_user($team_id, $team_name); } else { $new_name = cs_secure($team_name); } break; case CS_CUPS_TYPE_TEAMS: if ($html) { $new_name = cs_link(cs_secure($team_name), 'squads', 'view', 'id=' . $team_id); } else { $new_name = cs_secure($team_name); } break; } } if ($autoseed == 0) { $new_name .= ' (#' . $seed . ')'; } break; } return $new_name; }
<?php // ClanSphere 2010 - www.clansphere.net // $Id: navlist.php 4819 2011-03-01 22:27:33Z hajo $ $data = array(); $cs_option = cs_sql_option(__FILE__, 'cups'); $cells = 'cups_id, cups_name, cups_start'; $where = 'cups_access <= ' . $account['access_cups'] . ' AND cups_access <> 0'; $data['cups'] = cs_sql_select(__FILE__, 'cups', $cells, $where, 'cups_start DESC', 0, $cs_option['max_navlist']); $count_cups = count($data['cups']); for ($i = 0; $i < $count_cups; $i++) { $data['cups'][$i]['view_url'] = cs_url('cups', 'view', 'id=' . $data['cups'][$i]['cups_id']); if (strlen($data['cups'][$i]['cups_name']) > $cs_option['max_headline']) { $data['cups'][$i]['cups_name'] = cs_textcut($data['cups'][$i]['cups_name'], $options['max_headline']); } $data['cups'][$i]['cups_start'] = cs_date('unix', $data['cups'][$i]['cups_start']); } echo cs_subtemplate(__FILE__, $data, 'cups', 'navlist');