$category = htmlspecialchars($_REQUEST["category"]); $user = htmlspecialchars($_REQUEST["user"]); $input = array(); $input[] = "locations.locationID = events.locationID"; $input[] = "categories.categoryID = events.categoryID"; $input[] = "users.userID = events.userID"; if (strlen($event) > 0) { $input[] = "events.eventName = '{$event}'"; } if (strlen($location) > 0) { $input[] = "locations.locationName = '{$location}'"; } if (strlen($category) > 0) { $input[] = "categories.categoryName = '{$category}'"; } if (strlen($user) > 0) { $input[] = "users.displayName = '{$user}'"; } $query = "SELECT events.eventID FROM events, locations, categories, users "; $querypt2 = "WHERE " . implode(" AND ", $input); $query .= $querypt2; $resource = mysql_query($query); if (!$resource) { mysql_error(); } $eventIDs = array(); while ($row = mysql_fetch_row($resource)) { $eventIDs[] = $row[0]; } listEvents($eventIDs); mysql_close();
$notify->add($lang->get('tournament'), $lang->get('tournament_remove_done')); } else { $smarty->assign('path', $template_dir . "/removetournament.tpl"); $smarty->assign('url_no', makeURL($mod, array('tournamentid' => $tournamentid))); //$tournament = $tournamentList->getTournament($tournamentid); $breadcrumbs->addElement($tournament['event']['name'], makeURL($mod, array('eventid' => $tournament['event']['eventid']))); $breadcrumbs->addElement($tournament['title'], makeURL($mod, array('tournamentid' => $tournamentid))); $breadcrumbs->addElement($lang->get('tournament_remove'), makeURL($mod, array('tournamentid' => $tournamentid, 'mode' => 'removetournament'))); } break; case 'addtournament': if (!$right['add_remove_edit']) { break; } // List events $eventList = listEvents(); if (count($eventList) > 0) { foreach ($eventList as $event) { $list[$event['eventid']] = $event['name']; } } $smarty->assign('eventlist', $list); $breadcrumbs->addElement($lang->get('tournament_add'), makeURL($mod, array('mode' => 'addtournament'))); if (isset($_POST['save'])) { if (trim($_POST['title']) == '' || (int) $_POST['playerlimit'] < 2 || trim($_POST['game']) == '') { $notify->add($lang->get('tournament'), $lang->get('fill_all_fields')); } else { $start = mktime($_POST['Time_Hour'], $_POST['Time_Minute'], 0, $_POST['Date_Month'], $_POST['Date_Day'], $_POST['Date_Year']); // create new tournament $tournamentid = $tournamentList->addTournament($_POST['eventid'], $_POST['title'], $_POST['playerlimit'], $_POST['game'], $_POST['mappool'], $_POST['mode'], $_POST['playerperteam'], $_POST['picture'], $_POST['credits'], $_POST['wwclgameid'], $_POST['rules'], $start, $_POST['duration'], $_POST['breaktime']); // Update mode specific settings