Пример #1
0
 /**
  * View Bossprogress page
  * @param viewNavigation $Navigation
  */
 public function buildpage(viewNavigation $Navigation)
 {
     global $phpbb_root_path, $phpEx, $user, $template, $config;
     $igame = new \bbdkp\controller\games\Game();
     $igame->game_id = $Navigation->getGameId();
     $igame->Get();
     $Guild = new \bbdkp\controller\guilds\Guilds($Navigation->getGuildId());
     $bp = new \bbdkp\controller\Raids\GuildProgress();
     $data = $bp->GetProgress($Guild);
     $numzones = 0;
     foreach ($data as $zone_id => $zone) {
         $numzones += 1;
     }
     $start = request_var('start', 0);
     $template->assign_vars(array('S_STYLE' => $config['bbdkp_zone_style'], 'S_BPSHOW' => true, 'GAMELOGO' => $phpbb_root_path . 'images/bbdkp/gameworld/' . $Guild->game_id . '/' . $Guild->game_id . '.png', 'F_BP' => \append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=bossprogress&guild_id=' . $Navigation->getGuildId()), 'GAME_ID' => $Navigation->getGameId(), 'GAME_NAME' => $igame->getName(), 'GUILD_ID' => $Guild->guildid, 'PAGE_NUMBER' => \on_page($numzones, 2, $start), 'PAGINATION' => \generate_pagination(append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=bossprogress&guild_id=" . $Guild->guildid), $numzones, 2, $start, true), 'U_BPIMG' => "{$phpbb_root_path}images/bbdkp/gameworld/{$Navigation->getGameId()}/{$Navigation->getGameId()}.png"));
     $i = 0;
     $j = 0;
     //loop the zones
     foreach ($data as $zone_id => $zone) {
         $i += 1;
         if ($i >= $start) {
             $j += 1;
             //show max 2 zones per page
             if ($j <= 2) {
                 $template->assign_block_vars('zone', array('ZONE_NAME' => $zone['zonename'], 'ZONE_ID' => $zone['zoneid'], 'ZONE_PROGRESSIMG' => $zone['zoneimage'], 'ZONE_BACKGROUNDIMG' => $zone['zonebackground'], 'ZONECOMPLETE' => $zone['zonecomplete'], 'ZONESTATS' => $zone['zonestats']));
                 foreach ($zone['bosses'] as $boss_id => $boss) {
                     $killdate = '';
                     if ($boss['bosskilldate'] != '') {
                         $killdate = date($config['bbdkp_date_format'], $boss['bosskilldate']);
                         // convert UNIX timestamp to PHP DateTime
                     }
                     if ($boss['bosskilled'] == 0) {
                         $bossimg = "{$phpbb_root_path}images/bbdkp/gameworld/" . $Guild->game_id . '/bosses/' . $boss['imagename'] . '_b.png';
                     } else {
                         $bossimg = "{$phpbb_root_path}images/bbdkp/gameworld/" . $Guild->game_id . '/bosses/' . $boss['imagename'] . '.png';
                     }
                     $template->assign_block_vars('zone.boss', array('BOSS_NAME' => $boss['bossname'], 'BOSS_IMAGENAME' => $bossimg, 'BOSS_ID' => $boss['id'], 'BOSS_WEBID' => $boss['webid'], 'BOSS_TYPE' => $boss['type'], 'BOSS_URL' => sprintf($igame->getBossbaseurl(), $boss['webid']), 'BOSS_URLVIEW' => $phpbb_root_path . "images/bbdkp/icons/view.gif", 'BOSS_KILLED' => $boss['bosskilled'] == 1 ? 'checked="checked"' : '', 'BOSS_SHOW' => $boss['bossshow'] == 1 ? "checked=checked" : '', 'BOSS_KILLDATE' => $killdate, 'BOSS_COUNTER' => $boss['bosscounter'], 'S_BOSS_KILLED' => $boss['bosskilled']));
                 }
             }
         }
     }
     page_header($user->lang['MENU_BOSS']);
 }
Пример #2
0
 /**
  * Delete Game from bbDKP
  * @param \bbdkp\controller\games\Game $editgame
  *
  */
 private function DeleteGame(\bbdkp\controller\games\Game $editgame)
 {
     global $user;
     if (confirm_box(true)) {
         $deletegame = new \bbdkp\controller\games\Game();
         $deletegame->game_id = request_var('hidden_game_id', '');
         $deletegame->Get();
         $deletegame->Delete();
         $log_action = array('header' => 'L_ACTION_GAME_DELETED', 'L_GAME' => $deletegame->game_id);
         $this->log_insert(array('log_type' => 'L_ACTION_GAME_DELETED', 'log_action' => $log_action));
         //meta_refresh(1, append_sid ( "{$phpbb_admin_path}index.$phpEx", "i=dkp_game&amp;mode=listgames") );
         trigger_error(sprintf($user->lang['ADMIN_DELETE_GAME_SUCCESS'], $deletegame->getName()), E_USER_WARNING);
     } else {
         // get field content
         $s_hidden_fields = build_hidden_fields(array('gamedelete' => true, 'hidden_game_id' => $editgame->game_id));
         confirm_box(false, sprintf($user->lang['CONFIRM_DELETE_GAME'], $editgame->getName()), $s_hidden_fields);
     }
 }