function staminatest_run()
{
    global $session;
    page_header("Stamina Testing");
    switch (httpget("op")) {
        case "start":
            output("Testing Testing!");
            break;
        case "add":
            output("Attempting to install an action called Sexins, with these parameters:`n`nStarting and Maximum costs: 500`nMinimum cost: 200`nReps for a Reduction: 20`nReduction: 10`n");
            install_action("Sexins", array("maxcost" => 25000, "mincost" => 10000, "expperrep" => 100, "expforlvl" => 1000, "costreduction" => 10, "dkpct" => 2.5));
            break;
        case "process":
            output("Processing the Sexins action");
            process_action("Sexins");
            break;
        case "newday":
            output("Processing a New Day");
            stamina_process_newday();
            break;
        case "buff":
            output("Applying a stamina buff to Sexins for the current user, for 20 rounds, reducing action cost to half.");
            apply_stamina_buff('ultra-sexy-buff-for-sexins', array("name" => "Ultra Sexy Buff for Sexins", "action" => "Sexins", "costmod" => 0.5, "expmod" => 0.8, "rounds" => 5, "roundmsg" => "Round Message!", "wearoffmsg" => "Wearoff Message!"));
            output("Also applying a Stamina Class buff to all Hunting actions, reducing their cost to half for twenty rounds.");
            apply_stamina_buff('huntclasstest', array("name" => "Hunting Class test buff", "class" => "Hunting", "costmod" => 0.5, "expmod" => 0.8, "rounds" => 20, "roundmsg" => "Round Message!", "wearoffmsg" => "Wearoff Message!"));
            break;
        case "get":
            $thingtodebug = get_player_action("Sexins");
            debug($thingtodebug);
            break;
        case "uninstall":
            output("Uninstalling the Sexins action, deleting all actions entries and associated buffs");
            uninstall_action("Sexins");
            break;
        case "dragonkill":
            output("Processing a Dragon Kill");
            stamina_process_dragonkill();
            break;
        case "calcbuffs":
            output("Calculating Buffs");
            stamina_calculate_buffed_cost("Sexins");
            break;
        case "calcexp":
            output("Calculating Buffed EXP");
            stamina_calculate_buffed_exp("Sexins");
            break;
    }
    addnav("Install an action called Sexins", "runmodule.php?module=staminatest&op=add");
    addnav("Uninstall", "runmodule.php?module=staminatest&op=uninstall");
    addnav("Process the Sexins Action for the current user", "runmodule.php?module=staminatest&op=process");
    addnav("Process newday", "runmodule.php?module=staminatest&op=newday");
    addnav("Add a buff", "runmodule.php?module=staminatest&op=buff");
    addnav("Get Stamina", "runmodule.php?module=staminatest&op=get");
    addnav("Process a Dragon Kill", "runmodule.php?module=staminatest&op=dragonkill");
    addnav("Calculate Buffed Cost", "runmodule.php?module=staminatest&op=calcbuffs");
    addnav("Calculate Buffed exp", "runmodule.php?module=staminatest&op=calcexp");
    addnav("Back to the Grotto", "superuser.php");
    page_footer();
    return true;
}
function iitems_crates_gypsy_run()
{
    global $session;
    page_header("Crate Locations");
    $cost = get_module_setting("cost", "iitems_crates_gypsy");
    if ($cost == 1) {
        $p = "Cigarette";
    } else {
        $p = "Cigarettes";
    }
    if ($session['user']['gems'] >= $cost) {
        $session['user']['gems'] -= $cost;
        output("`5You hand over the %s and the old man chuckles.  \"`!Aaah, thank ye kindly.  Now, here we are!  I'd recommend you write these down.  And be quick about it - these crates tend to disappear `ifast!`i`5\"`n`nHe reaches under his desk and brings up a chalkboard with all the locations of the Island's crates written upon it, corresponding to the squares on your crudely-drawn World Map and laid out as X and Y co-ordinates.  You spend a few minutes studying the board.`n`n", $p);
        $crates = unserialize(get_module_setting("crates", "iitemcrates"));
        foreach ($crates as $key => $vals) {
            output("%s,%s`n", $vals['loc']['x'], $vals['loc']['y']);
        }
    } else {
        output("`5You enthusiastically agree to the price, before realising that you don't actually have that many cigarettes.  Whoops.");
    }
    addnav("Leave");
    addnav("Return to the Outpost", "village.php");
    page_footer();
    return true;
}
    function main()
    {
        $sql = 'SELECT *
				FROM ' . $this->points_values_table;
        $result = $this->db->sql_query($sql);
        $points_values = $this->db->sql_fetchrow($result);
        $this->db->sql_freeresult($result);
        // Add part to bar
        $this->template->assign_block_vars('navlinks', array('U_VIEW_FORUM' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'info')), 'FORUM_NAME' => sprintf($this->user->lang['POINTS_INFO'], $this->config['points_name'])));
        // Read out all the need values
        $info_attach = $points_values['points_per_attach'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_attach']) . ' ' . $this->config['points_name']);
        $info_addtional_attach = $points_values['points_per_attach_file'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_attach_file']) . ' ' . $this->config['points_name']);
        $info_poll = $points_values['points_per_poll'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_poll']) . ' ' . $this->config['points_name']);
        $info_poll_option = $points_values['points_per_poll_option'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_poll_option']) . ' ' . $this->config['points_name']);
        $info_topic_word = $points_values['points_per_topic_word'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_topic_word']) . ' ' . $this->config['points_name']);
        $info_topic_character = $points_values['points_per_topic_character'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_topic_character']) . ' ' . $this->config['points_name']);
        $info_post_word = $points_values['points_per_post_word'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_post_word']) . ' ' . $this->config['points_name']);
        $info_post_character = $points_values['points_per_post_character'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_post_character']) . ' ' . $this->config['points_name']);
        $info_cost_warning = $points_values['points_per_warn'] == 0 ? sprintf($this->user->lang['INFO_NO_COST'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['points_per_warn']) . ' ' . $this->config['points_name']);
        $info_reg_bonus = $points_values['reg_points_bonus'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->functions_points->number_format_points($points_values['reg_points_bonus']) . ' ' . $this->config['points_name']);
        $info_points_bonus = $points_values['points_bonus_chance'] == 0 ? sprintf($this->user->lang['INFO_NO_POINTS'], $this->config['points_name']) : sprintf($this->user->lang['INFO_BONUS_CHANCE_EXPLAIN'], $this->functions_points->number_format_points($points_values['points_bonus_chance']), $this->functions_points->number_format_points($points_values['points_bonus_min']), $this->functions_points->number_format_points($points_values['points_bonus_max']), $this->config['points_name']);
        $this->template->assign_vars(array('USER_POINTS' => sprintf($this->functions_points->number_format_points($this->user->data['user_points'])), 'POINTS_NAME' => $this->config['points_name'], 'LOTTERY_NAME' => $points_values['lottery_name'], 'BANK_NAME' => $points_values['bank_name'], 'POINTS_INFO_DESCRIPTION' => sprintf($this->user->lang['POINTS_INFO_DESCRIPTION'], $this->config['points_name']), 'INFO_ATTACH' => $info_attach, 'INFO_ADD_ATTACH' => $info_addtional_attach, 'INFO_POLL' => $info_poll, 'INFO_POLL_OPTION' => $info_poll_option, 'INFO_TOPIC_WORD' => $info_topic_word, 'INFO_TOPIC_CHARACTER' => $info_topic_character, 'INFO_POST_WORD' => $info_post_word, 'INFO_POST_CHARACTER' => $info_post_character, 'INFO_COST_WARNING' => $info_cost_warning, 'INFO_REG_BONUS' => $info_reg_bonus, 'INFO_POINTS_BONUS' => $info_points_bonus, 'U_TRANSFER_USER' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'transfer_user')), 'U_LOGS' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'logs')), 'U_LOTTERY' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'lottery')), 'U_BANK' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank')), 'U_ROBBERY' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'robbery')), 'U_INFO' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'info')), 'U_USE_TRANSFER' => $this->auth->acl_get('u_use_transfer'), 'U_USE_LOGS' => $this->auth->acl_get('u_use_logs'), 'U_USE_LOTTERY' => $this->auth->acl_get('u_use_lottery'), 'U_USE_BANK' => $this->auth->acl_get('u_use_bank'), 'U_USE_ROBBERY' => $this->auth->acl_get('u_use_robbery')));
        // Generate the page
        page_header($this->user->lang['POINTS_INFO']);
        // Generate the page template
        $this->template->set_filenames(array('body' => 'points/points_info.html'));
        page_footer();
    }
Example #4
0
 public function buildpage(viewNavigation $Navigation)
 {
     global $config, $phpbb_root_path, $phpEx, $user, $template;
     $item_id = request_var(URI_ITEM, 0);
     if (!class_exists('\\bbdkp\\controller\\loot\\Loot')) {
         require "{$phpbb_root_path}includes/bbdkp/controller/loot/Loot.{$phpEx}";
     }
     if (!class_exists('\\bbdkp\\controller\\members\\Members')) {
         require "{$phpbb_root_path}includes/bbdkp/controller/members/Members.{$phpEx}";
     }
     if (!class_exists('\\bbdkp\\controller\\raids\\Raids')) {
         require "{$phpbb_root_path}includes/bbdkp/controller/raids/Raids.{$phpEx}";
     }
     $loot = new \bbdkp\controller\loot\Loot($item_id);
     $purchased_items = $loot->Loothistory($loot->item_name);
     $title = $user->lang['ITEM'] . ' : ' . $loot->item_name;
     $sort_order = array(0 => array('item_date desc, item_value desc', 'item_date asc, item_value desc'), 1 => array('member_name asc, item_value desc', 'member_name desc, item_value desc'), 2 => array('item_value desc', 'item_value asc'));
     $current_order = $Navigation->switch_order($sort_order);
     foreach ($purchased_items as $key => $item) {
         $buyer = new \bbdkp\controller\members\Members($item['member_id']);
         $raid = new \bbdkp\controller\raids\Raids($item['raid_id']);
         $template->assign_block_vars('items_row', array('DATE' => !empty($item['item_date']) ? date('d.m.y', $item['item_date']) : ' ', 'CLASS_COLOR' => $buyer->colorcode, 'CLASS_IMAGE' => $buyer->class_image, 'RACE_IMAGE' => $buyer->race_image, 'RACE' => $buyer->member_race, 'BUYER' => $buyer->member_name, 'U_VIEW_BUYER' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=member&" . URI_NAMEID . '=' . $item['member_id'] . '&' . URI_DKPSYS . '=' . $item['dkpid']), 'U_VIEW_RAID' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=raid&' . URI_RAID . '=' . $item['raid_id']), 'EVENT_COLOR' => $raid->event_color, 'RAID' => $raid->event_name, 'VALUE' => sprintf("%.2f", $item['item_value']), 'DECAY' => sprintf("%.2f", $item['item_decay']), 'TOTAL' => sprintf("%.2f", $item['item_net'])));
         unset($raid);
         unset($buyer);
     }
     $navlinks_array = array(array('DKPPAGE' => $user->lang['MENU_ITEMVAL'], 'U_DKPPAGE' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=listitems")), array('DKPPAGE' => $user->lang['MENU_VIEWITEM'], 'U_DKPPAGE' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=item&" . URI_ITEM . '=' . $item_id)));
     foreach ($navlinks_array as $name) {
         $template->assign_block_vars('dkpnavlinks', array('DKPPAGE' => $name['DKPPAGE'], 'U_DKPPAGE' => $name['U_DKPPAGE']));
     }
     $template->assign_vars(array('S_SHOWDECAY' => $config['bbdkp_decay'] == '1' ? true : false, 'L_PURCHASE_HISTORY_FOR' => sprintf($user->lang['PURCHASE_HISTORY_FOR'], '<strong>' . $loot->item_name . '</strong>'), 'O_DATE' => $current_order['uri'][0], 'O_BUYER' => $current_order['uri'][1], 'O_VALUE' => $current_order['uri'][2], 'U_VIEW_ITEM' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=item&amp;' . URI_ITEM . '=' . $item_id), 'VIEWITEM_FOOTCOUNT' => sprintf($user->lang['VIEWITEM_FOOTCOUNT'], count($purchased_items)), 'S_DISPLAY_VIEWITEM' => true));
     unset($purchased_items);
     // Output page
     page_header($title);
 }
 public function main()
 {
     $topic_id = $this->request->variable('t', 0);
     $post_id = $this->request->variable('p', 0);
     $forum_id = $this->request->variable('f', 0);
     $mode = $this->request->variable('mode', '');
     $book_submit = $this->request->variable('book', false);
     $viewtopic_url = append_sid("{$this->phpbb_root_path}viewtopic." . $this->php_ext . "", "f={$forum_id}&amp;t={$topic_id}");
     $return_link = '<br /><br />' . sprintf($this->user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
     $body = 'add_bookmark';
     if ($mode == 'delete') {
         $sql = 'DELETE FROM ' . $this->postbookmark_table . "\n\t\t\t\tWHERE user_id = {$this->user->data['user_id']}\n\t\t\t\t\tAND post_id = {$post_id}";
         $this->db->sql_query($sql);
         $message = $this->user->lang['POST_BOOKMARK_REMOVED'];
         $this->helper->output_response($message, $return_link, $viewtopic_url);
     } else {
         if ($mode == 'find') {
             $body = 'find_bookmark';
             $this->helper->get_bookmarks($mode);
         } else {
             $bookmark_desc = $this->request->variable('bookmark_desc', '', true);
             if ($book_submit) {
                 $sql = 'INSERT INTO ' . $this->postbookmark_table . ' ' . $this->db->sql_build_array('INSERT', array('user_id' => $this->user->data['user_id'], 'post_id' => $post_id, 'topic_id' => $topic_id, 'bookmark_time' => time(), 'bookmark_desc' => $bookmark_desc));
                 $this->db->sql_query($sql);
                 $message = $this->user->lang['POST_BOOKMARK_ADDED'];
                 $this->helper->output_response($message, $return_link, $viewtopic_url);
             }
         }
     }
     $this->template->assign_vars(array('U_POST_ACTION' => append_sid("{$this->phpbb_root_path}postbookmark", "f={$forum_id}&amp;t={$topic_id}&amp;p={$post_id}&amp;mode={$mode}")));
     page_header($this->user->lang['POST_BOOKMARK_ADD']);
     $this->template->set_filenames(array('body' => $body . '.html'));
     page_footer();
     return new Response('', 200);
 }
Example #6
0
 function main($id, $mode)
 {
     global $config, $db, $user, $table_prefix, $auth, $template, $phpbb_root_path, $phpEx;
     define('TABLE_PREFIX', $table_prefix);
     require_once 'class_ulogin.php';
     $uLogin = new uLogin($db);
     if ($config['require_activation'] == USER_ACTIVATION_DISABLE) {
         trigger_error('UCP_REGISTER_DISABLE');
     }
     if (!($user_id = $uLogin->auth())) {
         $user_id = $uLogin->register();
     }
     if ($user_id) {
         $session = $user->session_create($user_id, 0, 1);
     }
     if (!$session) {
         page_header($user->lang['LOGIN'], false);
         $template->set_filenames(array('body' => 'login_body.html'));
         make_jumpbox(append_sid("{$phpbb_root_path}viewforum.{$phpEx}"));
         page_footer();
         exit;
     }
     $redirect = request_var('redirect', "{$phpbb_root_path}index.{$phpEx}");
     $message = $user->lang['LOGIN_REDIRECT'];
     $l_redirect = $redirect === "{$phpbb_root_path}index.{$phpEx}" || $redirect === "index.{$phpEx}" ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE'];
     $redirect = reapply_sid($redirect);
     if (defined('IN_CHECK_BAN') && $session['user_row']['user_type'] != USER_FOUNDER) {
         return false;
     }
     $redirect = meta_refresh(3, $redirect);
     trigger_error($message . '<br /><br />' . sprintf($l_redirect, '<a href="' . $redirect . '">', '</a>'));
 }
function auth_error($exception = null)
{
    global $connection, $adminer, $token;
    $session_name = session_name();
    $error = "";
    if (!$_COOKIE[$session_name] && $_GET[$session_name] && ini_bool("session.use_only_cookies")) {
        $error = lang('Session support must be enabled.');
    } elseif (isset($_GET["username"])) {
        if (($_COOKIE[$session_name] || $_GET[$session_name]) && !$token) {
            $error = lang('Session expired, please login again.');
        } else {
            $password =& get_session("pwds");
            if (isset($password)) {
                $error = h($exception ? $exception->getMessage() : (is_string($connection) ? $connection : lang('Invalid credentials.')));
                $password = null;
            }
        }
    }
    page_header(lang('Login'), $error, null);
    echo "<form action='' method='post' onclick='eventStop(event);'>\n";
    $adminer->loginForm();
    echo "<div>";
    hidden_fields($_POST, array("driver", "server", "username", "password", "permanent"));
    // expired session
    echo "</div>\n";
    echo "</form>\n";
    page_footer("auth");
}
function binarypuzzle_run()
{
    global $session;
    page_header("Binary Puzzle Thing!");
    addnav("O?Back to the Outpost", "village.php");
    switch (httpget('op')) {
        case "start":
            //first set up the board
            $switches = array(1 => array("val" => 1, "status" => 0), 2 => array("val" => 2, "status" => 0), 3 => array("val" => 4, "status" => 0), 4 => array("val" => 8, "status" => 0), 5 => array("val" => 16, "status" => 0), 6 => array("val" => 32, "status" => 0), 7 => array("val" => 64, "status" => 0), 8 => array("val" => 128, "status" => 0));
            shuffle($switches);
            set_module_pref("switches", serialize($switches));
            //Now set up the clues
            $clues = array();
            for ($i = 1; $i <= 8; $i++) {
                $toprange = $i * 32;
                $bottomrance = $toprange - 32;
                $clues[$i] = e_rand($bottomrange, $toprange);
            }
            $goal = e_rand(129, 255);
            set_module_pref("clues", serialize($clues));
            binarypuzzle_show($switches, $goal);
            break;
        case "switch":
            $sw = httpget('switch');
            $goal = httpget('goal');
            $switches = binarypuzzle_switch($sw);
            binarypuzzle_show($switches, $goal);
            break;
    }
    page_footer();
}
function worldmapen_editor_real()
{
    global $session;
    page_header("World Editor");
    require_once "lib/superusernav.php";
    superusernav();
    // initialize the internal static maps
    worldmapen_loadMap();
    worldmapen_loadTerrainDefs();
    $op = httpget("op");
    $act = httpget("act");
    $subop = httpget("subop");
    debug("op={$op}, act={$act}, subop={$subop}");
    switch ($subop) {
        case "regen":
            worldmapen_editor_regen($op, $subop, $act);
            break;
        case "manual":
            worldmapen_editor_manual($op, $subop, $act);
            break;
        case "terrain":
            worldmapen_editor_terrain($op, $subop, $act);
            break;
        default:
            worldmapen_viewmap(false);
            break;
    }
    addnav("Replace Cities", "runmodule.php?module=worldmapen&op=edit&subop=regen");
    addnav("Manually Place Cities", "runmodule.php?module=worldmapen&op=edit&subop=manual");
    addnav("Edit terrain type", "runmodule.php?module=worldmapen&op=edit&subop=terrain");
    page_footer();
}
function rail_peddler_run()
{
    global $session, $inventory;
    $op = httpget("op");
    $loc = rail_peddler_getloc();
    $hid = $loc["peddlerhid"];
    $rid = $loc["peddlerrid"];
    $price = get_module_setting("peddlerprice");
    if ($op == "buy") {
        $headertext = "Why sure, I'll take one of those!";
    } else {
        $headertext = "Go away, I'm busy.";
    }
    page_header($headertext);
    switch ($op) {
        case "buy":
            output("The scruffy vendor's eyes gleam. Was that a fla`gs`0h of green, or no? \"`2Verra wise, %s. Ye willna be sorry!`0\"`n`n", translate_inline($session['user']['sex'] ? 'lass' : 'lad'));
            give_item("cardcase");
            //			if (!$success){
            //				output("Then -- a frown. \"`2Wait, no, I canna sell t'ye. Ye'd better petition the Big Boss, tell 'im t'see what's gaen wrong wiv all dis.`0\"`n`n");
            //			} else {
            output("You have a fine leather card case. Pleased, you admire its soft texture. What an excellent purchase you have made!`n`n");
            //			}
            $session['user']['gems'] -= $price;
            break;
        case "pass":
            output("\"`2Bleedin' smart-arse.`0\" The scruffy vendor shrugs and goes off to pester someone else.`n`n");
            break;
    }
    addnav("Back to the Concourse", "runmodule.php?module=improbablehousing&op=interior&hid={$hid}&rid={$rid}");
    page_footer();
}
Example #11
0
function process_form()
{
    if ($_POST['xsrf_token'] != $_SESSION['xsrf_token']) {
        trigger_error('XSRF code incorrect', E_USER_ERROR);
    }
    $file = '';
    $name = '';
    if (isset($_GET['Home'])) {
        $file = '../.content/Home.txt';
        $name = 'Home';
    } else {
        if (isset($_GET['Contests'])) {
            $file = '../.content/Contests.txt';
            $name = 'Contests';
        } else {
            trigger_error('Show: Unknown contest', E_USER_ERROR);
        }
    }
    file_put_contents($file, $_POST['text']);
    page_header('Edit Page');
    echo <<<HEREDOC
      <h1>Edit Page</h1>
      
      <div class="alert">The {$name} page was saved successfully&nbsp;&nbsp;(<a href="../{$name}">View</a>)</div>
HEREDOC;
}
Example #12
0
 public function buildpage(viewNavigation $Navigation)
 {
     global $user;
     $this->leaderboard($Navigation);
     $this->dkplisting($Navigation);
     page_header($user->lang['LISTMEMBERS_TITLE']);
 }
Example #13
0
function content()
{
    if (!user_logged_in()) {
        return must_log_in();
    }
    $user = fetch_one_or_none('users', 'id', user_logged_in());
    if (!array_key_exists('token', $_GET) || !$_GET['token'] || $_GET['token'] != sha1($user->new_email_address)) {
        $errors[] = 'Invalid reset token';
    }
    # This can happen if two accounts try to change address at similar times.
    if (count($errors) == 0 && count(fetch_all('users', 'email_address', $user->new_email_address))) {
        $errors[] = "A user with this email address already exists";
    }
    if (count($errors) == 0) {
        update_all('users', array('email_address' => $user->new_email_address, 'new_email_address' => null), 'id', user_logged_in());
        ?>
    <h2>Address changed</h2>
    <p>Your email address has been changed to
      <tt><?php 
        esc($user->new_email_address);
        ?>
</tt>.</p>
    <?php 
        return;
    }
    page_header('Address verification failed');
    show_error_list($errors);
}
Example #14
0
function show_manage($profile_id_)
{
    $profiledb = ProfileDB::getInstance();
    $profile = $profiledb->import($profile_id_);
    if (!is_object($profile)) {
        redirect('profiles.php');
    }
    $used_users = $profile->getUsers();
    page_header();
    echo '<div id="profiles_div">';
    echo '<h1>' . sprintf(_("Profile: %s"), $profile->id) . '</h1>';
    echo '<div>';
    echo '<h2>' . _('Server') . '</h2>';
    echo '<a href="servers.php?action=manage&fqdn=' . $profile->server . '"> ' . $profile->server . '</a>';
    echo '</div>';
    echo '<br />';
    echo '<div>';
    echo '<h2>' . _('Used by') . '</h2>';
    echo '<table border="0" cellspacing="1" cellpadding="3">';
    foreach ($used_users as $user) {
        echo '<tr>';
        echo '<td><a href="users.php?action=manage&amp;id=' . $user->getAttribute('login') . '">' . $user->getAttribute('displayname') . '</a></td>';
        echo '</tr>';
    }
    echo '</table>';
    echo '</div>';
    echo '</div>';
    page_footer();
}
function specialcomments_run()
{
    global $session;
    page_header("The Hunter's Lodge");
    $config = unserialize($session['user']['donationconfig']);
    if (!is_array($config)) {
        $config = array();
    }
    if (httpget('op') == "buy1") {
        $session['user']['donationspent'] += 25;
        increment_module_pref("commentsleft", 1);
        $config = array_push($config, "spent 25 points for 1 Special Comment in the lodge.");
    }
    if (httpget('op') == "buy5") {
        $session['user']['donationspent'] += 100;
        increment_module_pref("commentsleft", 5);
        $config = array_push($config, "spent 100 points for 5 Special Comments in the lodge.");
    }
    if (httpget('op') == "buy60") {
        $session['user']['donationspent'] += 1000;
        increment_module_pref("commentsleft", 60);
        $config = array_push($config, "spent 1000 points for 60 Special Comments in the lodge.");
    }
    if (httpget('op') == "buy200") {
        $session['user']['donationspent'] += 2000;
        increment_module_pref("commentsleft", 200);
        $config = array_push($config, "spent 2000 points for 200 Special Comments in the lodge.");
    }
    $session['user']['donationconfig'] = $config;
    output("You now have %s Special Comments stored up.  To use them, simply use the /special switch, like this:`n/special Admin CavemanJoe saunters through town, oblivious to the fact that he's stark bollock naked.`n/special A cold wind blows through the Outpost, carrying with it a somewhat chilling sense of foreboding.`n/special The clock at the center of AceHigh strikes thirteen, and the Jokers' eyes flash `4red`0 for a second.`n`nColour codes can be used within Special Comments.`n`n`bA quick note on the etiquette of using Special Comments:`b`nThe cost of posting a Special Comment is deliberately high, to ensure that players think carefully about what they want to say.  By all means, use them for mischief, but keep it playful rather than malicious.  If a group of players is engaging in a roleplaying exercise in a given Outpost, try to avoid stepping on the toes of their plotline.  Special Comments are anonymous, but are subject to the same rules of the rest of the Island (the two rules being \"Dont be a dick\" and \"Don't take it seriously\"), and drama-inducing comments will be deleted without refund.  If in doubt, ask a moderator.  Have fun!`n`n", get_module_pref("commentsleft"));
    addnav("Return to the Lodge", "lodge.php");
    page_footer();
}
Example #16
0
function process_form()
{
    if ($_POST['xsrf_token'] != $_SESSION['xsrf_token']) {
        show_page('Huh? ERROR: big kablooie');
        return;
    }
    $query = 'SELECT id, name FROM users WHERE id="' . mysqli_real_escape_string(DB::get(), $_POST['account_id']) . '"';
    $result = DB::queryRaw($query);
    if (mysqli_num_rows($result) != 1) {
        show_page('Nonexistent ID');
        return;
    }
    $row = mysqli_fetch_assoc($result);
    $id = $row['id'];
    $name = $row['name'];
    // ** FORM VALIDATED AT THIS POINT **
    // perform elevation
    $query = 'UPDATE users SET permissions="A", approved="1" WHERE id="' . $id . '" LIMIT 1';
    DB::queryRaw($query);
    // show confirmation page
    page_header('Super-Admin');
    echo <<<HEREDOC
      <h1>Super-Admin</h1>
      
      <span class="b">{$name}</span> was approved and elevated. Now clear the Super-Admin password.
HEREDOC;
    //$names[0] = 'Super-Admin';
    //$pages[0] = '';
    //page_footer($names, $pages);
}
Example #17
0
function show_page()
{
    $msg = '';
    if (isset($_SESSION['INVITE_done'])) {
        $msg = "\n        <div class=\"alert\">An invitation email has been sent. The addresses listed below are invalid or already exist.</div><br />\n";
        $invalid_members = $_SESSION['INVITE_done'];
        unset($_SESSION['INVITE_done']);
    }
    if (!isset($invalid_members)) {
        $invalid_members = '';
    }
    page_header('Invite Members');
    echo <<<HEREDOC
      <h1>Invite Members</h1>
      {$msg}
      
      <form method="post" action="{$_SERVER['REQUEST_URI']}"><div>
        To invite new members, enter one email address per line:<br /><br />
        
        <textarea name="new_members" rows="25" cols="50">{$invalid_members}</textarea><br />
        <input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}"/>
        <input type="submit" name="do_invite_members" value="Send Invitations"/>
      </div></form>
HEREDOC;
}
Example #18
0
 /**
  * Default dispatcher
  *
  * @param string $action
  * @param string $subaction
  */
 public function index($type = NULL)
 {
     $q = $this->input->get('q');
     page_header($q ? t('Search results for «%s»', $q) : t('Search'));
     $tpl = new Template('Search/templates/form');
     $tpl->action = l('/search/') . $type;
     $q && ($tpl->value = $q);
     $tpl->show('info');
     new Menu_Tabs(array('name' => 'search', 'elements' => array('posts' => array('label' => t('Посты'), 'link' => l('/search' . ($q ? '?q=' . $q : '')), 'active' => check_route('search$')), 'blogs' => array('label' => t('Блоги'), 'link' => l('/search/blogs' . ($q ? '?q=' . $q : '')), 'active' => check_route('search/blogs')), 'users' => array('label' => t('Пользователи'), 'link' => l('/search/users' . ($q ? '?q=' . $q : '')), 'active' => check_route('search/users')), 'comments' => array('label' => t('Комментарии'), 'link' => l('/search/comments' . ($q ? '?q=' . $q : '')), 'active' => check_route('search/comments')))));
     if (!$q) {
         return event('empty');
     }
     switch ($type) {
         case 'blogs':
             new Blog_List(array('name' => 'search.blogs', 'like' => array(array('name', $q, 'both'), array('login', $q, 'both'), array('body', $q, 'both'))));
             break;
         case 'users':
             new User_List(array('name' => 'search.users', 'where' => array('login !=' => ''), 'like' => array(array('name', $q, 'both'), array('login', $q, 'both'))));
             break;
         case 'comments':
             new Comments_List(array('name' => 'search.comments', 'where' => array('published' => 1), 'like' => array(array('body', $q, 'both')), 'per_page' => config('User.comments.per_page', 10), 'flat' => TRUE));
             break;
         default:
             new Post_List(array('name' => 'search.posts', 'where' => array('published' => 1), 'like' => array(array('name', $q, 'both'), array('body', $q, 'both'))));
     }
 }
function changelog_run()
{
    $op = httpget('op');
    $ret = httpget('ret');
    $offset = httpget('offset') ?: 1;
    $offset = ($offset - 1) * 25;
    $offset = filter_var($offset, FILTER_SANITIZE_NUMBER_INT);
    $gamelog = db_prefix('gamelog');
    $accounts = db_prefix('accounts');
    $category = addslashes(get_module_setting('category'));
    page_header('Server Changelog');
    $sql = db_query("SELECT count(logid) AS n FROM {$gamelog} WHERE category = '{$category}'");
    $row = db_fetch_assoc($sql);
    addnav('Go back', "{$ret}.php");
    addnav('Changes');
    for ($i = 1; $i < $row['n'] / 25 + 1; $i++) {
        addnav(sprintf("%sPage %s (%s-%s)", $offset / 25 + 1 == $i ? '`^' : '', $i, ($i - 1) * 25 + 1, $i * 25 < $row['n'] ? $i * 25 : $row['n']), "runmodule.php?module=changelog&offset={$i}&ret={$ret}");
    }
    $sql = db_query("SELECT g.*, a.name FROM {$gamelog} AS g\n        LEFT JOIN {$accounts} AS a ON g.who = a.acctid\n        WHERE category = '{$category}' ORDER BY logid+0 DESC LIMIT {$offset}, 25");
    output("`c`@`bChangelog`b`c`n");
    while ($row = db_fetch_assoc($sql)) {
        output(get_module_setting('format'), $row['name'], $row['message']);
    }
    page_footer();
}
Example #20
0
function show_page()
{
    $yog = (int) date('Y') - 1;
    if ((int) date('n') > 4) {
        $yog++;
    }
    $msg = '';
    if (isset($_SESSION['ALUMNI_set'])) {
        $msg = "\n        <div class=\"alert\">The list of alumni has been updated</div><br />\n";
        unset($_SESSION['ALUMNI_set']);
    }
    page_header('Alumni');
    echo <<<HEREDOC
      <h1>Alumni</h1>
      {$msg}
      <div class="instruction">Members marked as Alumni retain access to the site, but do not have test scores
      and do not show up in some of the autocomplete lists. Making a user an Alumnus will also take them off of
      the mailing list, though they may rejoin later. Note that administrators are not automatically made
      Alumni.</div><br /><br />
      
      <form method="post" action="{$_SERVER['REQUEST_URI']}"><div>
      <span class="b">Mark all members in YOG {$yog} as Alumni:</span>
        <input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}"/>
        <input type="submit" name="do_set_alumni" value="Update"/>
      </div></form>
HEREDOC;
}
 /**
  * This listener is run when the KernelEvents::EXCEPTION event is triggered
  *
  * @param GetResponseForExceptionEvent $event
  * @return null
  */
 public function on_kernel_exception(GetResponseForExceptionEvent $event)
 {
     $exception = $event->getException();
     $message = $exception->getMessage();
     if ($exception instanceof \phpbb\exception\exception_interface) {
         $message = $this->language->lang_array($message, $exception->get_parameters());
     }
     if (!$event->getRequest()->isXmlHttpRequest()) {
         page_header($this->language->lang('INFORMATION'));
         $this->template->assign_vars(array('MESSAGE_TITLE' => $this->language->lang('INFORMATION'), 'MESSAGE_TEXT' => $message));
         $this->template->set_filenames(array('body' => 'message_body.html'));
         page_footer(true, false, false);
         $response = new Response($this->template->assign_display('body'), 500);
     } else {
         $data = array();
         if (!empty($message)) {
             $data['message'] = $message;
         }
         if (defined('DEBUG')) {
             $data['trace'] = $exception->getTrace();
         }
         $response = new JsonResponse($data, 500);
     }
     if ($exception instanceof HttpExceptionInterface) {
         $response->setStatusCode($exception->getStatusCode());
         $response->headers->add($exception->getHeaders());
     }
     $event->setResponse($response);
 }
function monsterkills_run()
{
    page_header("Most Monster Kills");
    $acc = db_prefix("accounts");
    $mp = db_prefix("module_userprefs");
    $sql = "SELECT {$acc}.name AS name,\r\n\t\t{$acc}.acctid AS acctid,\r\n\t\t{$mp}.value AS kills,\r\n\t\t{$mp}.userid FROM {$mp} INNER JOIN {$acc}\r\n\t\tON {$acc}.acctid = {$mp}.userid \r\n\t\tWHERE {$mp}.modulename = 'monsterkills' \r\n\t\tAND {$mp}.setting = 'kills' \r\n\t\tAND {$mp}.value > 0 ORDER BY ({$mp}.value+0)\t\r\n\t\tDESC limit " . get_module_setting("list") . "";
    $result = db_query($sql);
    $rank = translate_inline("Kills");
    $name = translate_inline("Name");
    output("`n`b`c`@Most`\$ Monster `@Kills`n`n`c`b");
    rawoutput("<table border='0' cellpadding='2' cellspacing='1' align='center'>");
    rawoutput("<tr class='trhead'><td align=center>{$name}</td><td align=center>{$rank}</td></tr>");
    for ($i = 0; $i < db_num_rows($result); $i++) {
        $row = db_fetch_assoc($result);
        if ($row['name'] == $session['user']['name']) {
            rawoutput("<tr class='trhilight'><td>");
        } else {
            rawoutput("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'><td align=left>");
        }
        output_notl("%s", $row['name']);
        rawoutput("</td><td align=right>");
        output_notl("%s", $row['kills']);
        rawoutput("</td></tr>");
    }
    rawoutput("</table>");
    addnav("Back to HoF", "hof.php");
    villagenav();
    page_footer();
}
function serverloadperpage_run()
{
    global $session;
    page_header("Server Load by Page Execution Times");
    //Show player number table
    $sql = "SELECT * FROM " . db_prefix("performancepage") . " ORDER BY totalpages DESC";
    $result = db_query($sql);
    output("`bAverage Page Generation Times by script request`b`n");
    rawoutput("<table border='0' cellpadding='2' cellspacing='1' align='center' width='100%'>");
    rawoutput("<tr class='trhead'><td>URL</td><td>Total Count</td><td>Total Time</td><td>Average Time / Page</td></tr>");
    for ($i = 0; $i < db_num_rows($result); $i++) {
        $row = db_fetch_assoc($result);
        if ($row['totalpages'] >= 1) {
            $avg = $row['totaltime'] / $row['totalpages'];
            $max = 100;
            $bwidth = round($avg * 100);
            $bnonwidth = $max - $bwidth;
            if ($bnonwidth > 0) {
                $bar = "<table style='border: solid 1px #000000' width='{$max}' height='7' bgcolor='#333333' cellpadding=0 cellspacing=0><tr><td width='{$bwidth}' bgcolor='#00ff00'></td><td width='{$bnonwidth}'></td></tr></table>";
            } else {
                $over = $bwidth - $max;
                $total = $max + $over;
                $bar = "<table style='border: solid 1px #000000' height='7' width='{$total}' cellpadding=0 cellspacing=0><tr><td width='{$max}' bgcolor='#990000'></td><td width='{$over}' bgcolor='#ff0000'></td></tr></table>";
            }
            rawoutput("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'>");
            rawoutput("<td>" . $row['page'] . "</td><td>" . number_format($row['totalpages']) . "</td><td>" . $row['totaltime'] . "</td><td>" . $bar . round($row['totaltime'] / $row['totalpages'], 4) . "</td></tr>");
        }
    }
    rawoutput("</table>");
    page_footer();
}
function translationconvert_run()
{
    global $session;
    page_header("Translations Convertor Thing");
    output("Outputting all known translations, so that you can do a find-and-replace in the files themselves and we can stop doing this silly translate thing.`n`n");
    if (httpget('delete')) {
        $del = httpget('delete');
        $sql = "UPDATE " . db_prefix("translations") . " SET version='updated' WHERE tid={$del}";
        db_query($sql);
    }
    $sql = "SELECT * FROM " . db_prefix("translations") . " WHERE version='dragonbones' ORDER BY uri";
    $result = db_query($sql);
    $total = 0;
    while ($row = db_fetch_assoc($result)) {
        if ($row['intext'] != $row['outtext']) {
            $total++;
            rawoutput("<a href=\"runmodule.php?module=translationconvert&delete=" . $row['tid'] . "\">MARK</a>");
            addnav("", "runmodule.php?module=translationconvert&delete=" . $row['tid']);
            output_notl("`n`0`b%s`b:", $row['uri']);
            rawoutput("<table width=100%><tr><td width=50% border=1px solid #cccccc>" . $row['intext'] . "</td><td width=50%>" . $row['outtext'] . "</td></tr></table>");
            output_notl("`n`n");
        }
    }
    debug($total);
    addnav("Back to the Grotto", "superuser.php");
    page_footer();
}
function cakeordeath_run()
{
    global $session;
    page_header("Cake Or Death");
    switch (httpget("op")) {
        case "examine":
            // Tell the player what the deal with Cake Or Death is
            $counter = number_format(get_module_setting("counter"));
            output("`0A shiny wooden table sits back from the main street.  Behind it, a man sits idly reading the Improbable Island Enquirer.  Before him, sat on the table, is a large sponge cake.  Above him is a banner, displaying the name of his game:`b'`5Cake`0 or `4Death!`0'`b`n`nHe sees you pondering the sign, and calls over to you.  `b'`5Cake`0 or `4Death!`0  `b`5Cake`0 or `4Death!`0' he cries.  'Ninety-nine per cent chance of `b`5Cake`0`b!'`n`nIt's not often that an immaculately-dressed gentleman with glowing green eyes offers you a 99% chance of cake.  What would you like to do?");
            //add navs
            addnav("CAKE!", "runmodule.php?module=cakeordeath&op=play");
            addnav("Back away slowly", "village.php");
            break;
        case "play":
            $counter = get_module_setting("counter");
            addnav("Back to the Outpost", "village.php");
            if ($counter > 0) {
                output("The green-eyed gentleman hands you a slice of cake, on a paper plate.  You thank him, and walk away merrily wolfing down your prize.`n`nYou feel `5Full Of Cake!`0");
                set_module_setting("counter", get_module_setting("counter") - 1);
                apply_buff('tastycake', array("name" => "`5Full Of Cake`0", "rounds" => 10, "atkmod" => 1.1, "defmod" => 1.1, "roundmsg" => "`5The cake you ate earlier has boosted your energy!`n", "schema" => "module-cakeordeath"));
            }
            if ($counter <= 0) {
                output("The green-eyed gentleman hands you a slice of cake, on a paper plate.  You thank him, and walk away merrily wolfing down your prize.`n`nYou feel `5Full Of Cake!`0`n`nMoments later, the slow-acting poison starts to take effect.  The world begins to melt in front of you.  Grey spots dance on the edges of your vision.  Behind you, a green-eyed monster offers you another slice of cake, laughing and pointing.`n`nYou curse your luck as the hallucinations begin to kick in.");
                set_module_setting("counter", 100);
                apply_buff('failcake', array("name" => "`5Full Of FailCake`0", "rounds" => -1, "regen" => -10, "startmsg" => "`5You are walking on pink icing.  The sky is made of jam.  Your eyes are two cherries.  That cake was awesome.`0`n", "roundmsg" => "`5The poisoned cake saps your strength, and you lose ten hitpoints!`0`n", "schema" => "module-cakeordeath"));
                if (is_module_active("medals")) {
                    require_once "modules/medals.php";
                    medals_award_medal("failcake", "Failcake Fancier", "This player was unfortunate at the Cake or Death stand...", "medal_failcake.png");
                }
            }
            break;
    }
    page_footer();
}
function sethsong_run()
{
    $op = httpget('op');
    $visits = get_module_setting("visits");
    $been = get_module_pref("been");
    $iname = getsetting("innname", LOCATION_INN);
    tlschema("inn");
    page_header($iname);
    rawoutput("<span style='color: #9900FF'>");
    output_notl("`c`b");
    output($iname);
    output_notl("`b`c");
    tlschema();
    // Short circuit out if we've heard enough
    if ($been >= $visits) {
        output("%s`0 clears his throat and drinks some water.", getsetting("bard", "`^Seth"));
        output("\"I'm sorry, my throat is just too dry.\"");
    } else {
        sethsong_sing();
    }
    addnav("Where to?");
    addnav("I?Return to the Inn", "inn.php");
    villagenav();
    rawoutput("</span>");
    page_footer();
}
function oneshotteleporter_run()
{
    global $session;
    $to = httpget("to");
    if ($to == "") {
        page_header("The Void");
        output("You press the button on your One-Shot Teleporter.  One obligatory blinding flash of light and pain later, you find yourself floating around in empty black nothingness!`n`nA flashing red light and an annoying BEEPing noise from your device insists that you select a destination, and quickly, before you find yourself stuck here or imploded.");
        $vloc = array();
        $vname = getsetting("villagename", LOCATION_FIELDS);
        $vloc[$vname] = "village";
        $vloc = modulehook("validlocation", $vloc);
        ksort($vloc);
        reset($vloc);
        addnav("Choose a Destination");
        foreach ($vloc as $loc => $val) {
            addnav(array("Go to %s", $loc), "runmodule.php?module=oneshotteleporter&to=" . htmlentities($loc));
        }
    } else {
        page_header("Back to Reality");
        output("You quickly select an outpost from the list.  With a sudden jolt, you find yourself standing in the middle of your chosen outpost!  You look around for your teleporting device, but realise that it must have only teleported you, not itself.  What a piece of junk.");
        $session['user']['location'] = $to;
        $session['user']['specialinc'] = "";
        addnav("Continue");
        addnav("Back to the Outpost", "village.php");
    }
    page_footer();
    return true;
}
Example #28
0
 /**
  * Automate setting up the page and creating the response object.
  *
  * @param string $template_file The template handle to render
  * @param string $page_title The title of the page to output
  * @param int $status_code The status code to be sent to the page header
  * @param bool $display_online_list Do we display online users list
  *
  * @return Response object containing rendered page
  */
 public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false)
 {
     page_header($page_title, $display_online_list);
     $this->template->set_filenames(array('body' => $template_file));
     page_footer(true, false, false);
     return new Response($this->template->assign_display('body'), $status_code);
 }
function dwellings_run()
{
    checkday();
    page_header("Dwellings");
    global $session;
    $op = httpget("op");
    $dwid = httpget('dwid');
    $type = httpget('type');
    debug(get_module_pref("location_saver"));
    if ($type == "" && $dwid > 0) {
        $sql = "SELECT type FROM " . db_prefix("dwellings") . " WHERE dwid={$dwid}";
        $result = db_query($sql);
        $row = db_fetch_assoc($result);
        $type = $row['type'];
    }
    $cityid = httpget('cityid');
    require_once "modules/dwellings/run/case_{$op}.php";
    if ($op != "list" && $op != "") {
        addnav("Leave");
        addnav("Return to Hamlet", "runmodule.php?module=dwellings");
    } else {
        addnav("Navigation");
        villagenav();
    }
    page_footer();
}
Example #30
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&amp;' . URI_DKPSYS . '=' . $Navigation->getDkpsysId() . '&amp;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&amp;' . URI_DKPSYS . '=' . $Navigation->getDkpsysId() . '&amp;guild_id=' . $Navigation->getGuildId());
     } else {
         $pagination = generate_pagination(append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=listraids&amp;' . URI_DKPSYS . '=All&amp;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&amp;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']) : '&nbsp;', 'NAME' => $raid['event_name'], 'U_VIEW_RAID' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=raid&amp;' . URI_RAID . '=' . $raid['raid_id'] . '&amp;guild_id=' . $Navigation->getGuildId()), 'U_VIEW_EVENT' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=event&amp;' . URI_EVENT . '=' . $raid['event_id'] . '&amp;' . URI_DKPSYS . '=' . $raid['event_dkpid'] . '&amp;guild_id=' . $Navigation->getGuildId()), 'POOL' => $Navigation->getDkpsysName(), 'EVENTCOLOR' => !empty($raid['event_color']) ? $raid['event_color'] : '#254689', 'NOTE' => !empty($raid['raid_note']) ? $raid['raid_note'] : '&nbsp;', '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']);
 }