public function show($id) { $this->load->model('matches_m'); $this->load->helper('matches'); $this->parser->checkFunctions(); $match = $this->matches_m->get($id); $eventData = get_event_data($match->event); $this->template->set('match', $match)->set('event', $eventData)->set('comments', $this->commentslib->render('matches', $id))->build('show.twig'); }
<?php foreach ($data as $event) { $eventName = 'Scrim'; $eventData = get_event_data($event->event); if (!empty($eventData->name)) { $eventName = $eventData->name; } ?> <div class="event"> <header class="event-header"> Match @ <?php echo date('H:i', strtotime($event->date)); ?> </header> <div class="event-content"> <h4><?php echo $eventName; ?> - Versus <?php echo get_opponent_name($event->opponent); ?> </h4> <p> Game: <?php echo get_game_name($event->game); ?> <br /> <a href="<?php echo !empty($event->matchlink) ? $event->matchlink : '#'; ?>
} if (count($add_assoc_user_errors)) { $msg .= __("Add people:"); foreach ($add_assoc_user_errors as $n => $err) { $msg .= "<br />{$err}"; } $is_display = false; $is_edit = true; } // add eventAssociations for valid login_names } // add_assoc_group $add_assoc_group_errors = array(); // declaring array so as to avoid notices for undefined variables if (isset($_POST['add_assoc_groups'])) { $ed = get_event_data(); $add_groups = $_POST['add_groups']; foreach ($add_groups as $i => $add_gid) { $add_group = Group::load_group_by_id($add_gid); $add_gname = $add_group->title; // check if user MAY add $is_member = Group::get_user_type((int) PA::$login_user->user_id, (int) $add_gid); if ($is_member == NOT_A_MEMBER) { $add_assoc_group_errors[] = sprintf(__("You cannot add an Event to the caledar of group %s, as you are not a member."), $add_gname); } else { // try to add EventAssociation for this group_id try { $ea = new EventAssociation(); $ea->event_id = $ed['event_id']; $ea->user_id = PA::$login_user->user_id; $ea->assoc_target_type = 'group';
<p> <a href="<?php echo base_url(); ?> matches/show/<?php echo $match->id; ?> " target="_blank"><?php echo get_opponent_name($match->opponent); ?> </a> <br /> <span><?php echo cms_time($match->date); ?> - <?php echo !empty(get_event_data($match->event)->name) ? get_event_data($match->event)->name : 'Scrim'; ?> </span> </p> </li> <?php } ?> <?php } else { ?> <li>No matches today.</li> <?php } ?> </ul>