예제 #1
0
 public function buildpage(viewNavigation $Navigation)
 {
     global $db, $config, $phpbb_root_path, $phpEx, $user, $template;
     $raids = new \bbdkp\controller\raids\Raids();
     $start = request_var('start', 0);
     // get sort order
     $sort_order = array(0 => array('raid_start desc', 'raid_start'), 1 => array('dkpsys_name', 'dkpsys_name desc'), 2 => array('event_name', 'event_name desc'), 3 => array('raid_note', 'raid_note desc'), 4 => array('raid_value desc', 'raid_value'));
     $current_order = $Navigation->switch_order($sort_order);
     //total raids in the last year
     $total_raids = $raids->raidcount($Navigation->getDkpsysId(), 365, 0, 1, true, $Navigation->getGuildId());
     if ($Navigation->getQueryByPool()) {
         $pagination = generate_pagination(append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=listraids&' . URI_DKPSYS . '=' . $Navigation->getDkpsysId() . '&o=' . $current_order['uri']['current']), $total_raids, $config['bbdkp_user_rlimit'], $start, true);
         $u_list_raids = append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=listraids&' . URI_DKPSYS . '=' . $Navigation->getDkpsysId() . '&guild_id=' . $Navigation->getGuildId());
     } else {
         $pagination = generate_pagination(append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=listraids&' . URI_DKPSYS . '=All&o=' . $current_order['uri']['current']), $total_raids, $config['bbdkp_user_rlimit'], $start, true);
         $u_list_raids = append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=listraids&guild_id=' . $Navigation->getGuildId());
     }
     $raids_result = $raids->getRaids('r.raid_start DESC', $Navigation->getDkpsysId(), 0, $start, 0, $Navigation->getGuildId());
     while ($raid = $db->sql_fetchrow($raids_result)) {
         $template->assign_block_vars('raids_row', array('DATE' => !empty($raid['raid_start']) ? date($config['bbdkp_date_format'], $raid['raid_start']) : ' ', 'NAME' => $raid['event_name'], 'U_VIEW_RAID' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=raid&' . URI_RAID . '=' . $raid['raid_id'] . '&guild_id=' . $Navigation->getGuildId()), 'U_VIEW_EVENT' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=event&' . URI_EVENT . '=' . $raid['event_id'] . '&' . URI_DKPSYS . '=' . $raid['event_dkpid'] . '&guild_id=' . $Navigation->getGuildId()), 'POOL' => $Navigation->getDkpsysName(), 'EVENTCOLOR' => !empty($raid['event_color']) ? $raid['event_color'] : '#254689', 'NOTE' => !empty($raid['raid_note']) ? $raid['raid_note'] : ' ', 'ATTENDEES' => $raid['attendees'], 'RAIDVALUE' => $raid['raid_value'], 'TIMEBONUS' => $raid['time_value'], 'ZSBONUS' => $raid['zs_value'], 'DECAYVALUE' => $raid['raiddecay'], 'TOTAL' => $raid['net_earned']));
     }
     $sortlink = array();
     for ($i = 0; $i <= 4; $i++) {
         if ($Navigation->getQueryByPool()) {
             $sortlink[$i] = append_sid($phpbb_root_path . 'dkp.' . $phpEx, 'page=listraids&amp;o=' . $current_order['uri'][$i] . '&amp;start=' . $start . '&amp;' . URI_DKPSYS . '=' . $Navigation->getDkpsysId());
         } else {
             $sortlink[$i] = append_sid($phpbb_root_path . 'dkp.' . $phpEx, 'page=listraids&amp;o=' . $current_order['uri'][$i] . '&amp;start=' . $start . '&amp;' . URI_DKPSYS . '=All');
         }
     }
     // breadcrumbs
     $template->assign_block_vars('dkpnavlinks', array('DKPPAGE' => $user->lang['MENU_RAIDS'], 'U_DKPPAGE' => $u_list_raids));
     $template->assign_vars(array('S_SHOWZS' => $config['bbdkp_zerosum'] == '1' ? true : false, 'S_SHOWTIME' => $config['bbdkp_timebased'] == '1' ? true : false, 'S_SHOWDECAY' => $config['bbdkp_decay'] == '1' ? true : false, 'S_EPGP' => $config['bbdkp_epgp'] == '1' ? true : false, 'O_DATE' => $sortlink[0], 'O_POOL' => $sortlink[1], 'O_NAME' => $sortlink[2], 'O_NOTE' => $sortlink[3], 'O_VALUE' => $sortlink[4], 'U_LIST_RAIDS' => $u_list_raids, 'LISTRAIDS_FOOTCOUNT' => sprintf($user->lang['LISTRAIDS_FOOTCOUNT'], $total_raids, $config['bbdkp_user_rlimit']), 'START' => $start, 'RAID_PAGINATION' => $pagination, 'S_DISPLAY_RAIDS' => true));
     // Output page
     page_header($user->lang['RAIDS']);
 }
예제 #2
0
 function __construct(viewNavigation $Navigation)
 {
     global $phpbb_root_path, $phpEx;
     $this->Raids = new \bbdkp\controller\raids\Raids();
     $this->PointsController = new \bbdkp\controller\points\PointsController();
     $this->PointsController->guild_id = $Navigation->getGuildId();
     $this->PointsController->query_by_pool = $Navigation->getQueryByPool();
     $this->PointsController->dkpsys_id = $Navigation->getDkpsysId();
     $this->PointsController->show_inactive = $Navigation->getShowAll();
     $this->PointsController->query_by_armor = $Navigation->getQueryByArmor();
     $this->PointsController->armor_filter = '';
     if ($this->PointsController->query_by_armor) {
         $this->PointsController->armor_filter = $Navigation->getFilter();
     }
     $this->PointsController->query_by_class = $Navigation->getQueryByClass();
     $this->PointsController->class_id = 0;
     if ($this->PointsController->query_by_class) {
         $this->PointsController->class_id = $Navigation->getClassId();
     }
     $this->PointsController->query_by_rank = false;
     $this->PointsController->rankfilter = '';
     if (request_var('rank', '') != '') {
         $this->PointsController->query_by_rank = true;
         $this->PointsController->rankfilter = request_var('rank', '');
     }
     $this->PointsController->member_filter = utf8_normalize_nfc(request_var('member_name', '', true));
     $this->PointsController->query_by_name = false;
     if ($this->PointsController->member_filter != '') {
         $this->PointsController->query_by_name = true;
     }
     $this->start = request_var('start', 0, false);
     $this->u_listmemberdkp = append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=standings' . '&amp;guild_id=' . $Navigation->getGuildId() . '&amp;' . URI_DKPSYS . '=' . $this->PointsController->dkpsys_id . '&amp;member_name=' . urlencode($this->PointsController->member_filter));
     $this->buildpage($Navigation);
 }