Esempio n. 1
0
function printPageList($start, $numItems, $url)
{
    global $cfg_ServersPerPage;
    $page = floor(($start + 1) / $cfg_ServersPerPage);
    $str = generate_pagination($url, $numItems, $cfg_ServersPerPage, $page * $cfg_ServersPerPage);
    echo "{$str}<P>";
}
Esempio n. 2
0
 public function display()
 {
     //Sort
     $sort = $this->in->get('sort');
     $sort_suffix = '&amp;sort=' . $sort;
     //redirect on event management
     if ($this->in->exists('manage_b') && $this->in->get('manage_b') == $this->user->lang('manage_events')) {
         $manage_link = './admin/listevents.php';
         redirect($manage_link);
     }
     $start = 0;
     $pagination_suffix = '';
     if ($this->in->exists('start')) {
         $start = $this->in->get('start', 0);
         $pagination_suffix = '&amp;start=' . $start;
     }
     //Output
     $view_list = $this->pdh->get('event', 'id_list');
     //footer
     $event_count = count($view_list);
     $footer_text = sprintf($this->user->lang('listevents_footcount'), $event_count, $this->user->data['user_elimit']);
     $hptt_page_settings = $this->pdh->get_page_settings('listevents', 'hptt_listevents_eventlist');
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $view_list, array('%link_url%' => 'viewevent.php', '%link_url_suffix%' => ''));
     $this->tpl->assign_vars(array('EVENT_OUT' => $hptt->get_html_table($sort, $pagination_suffix, $start, $this->user->data['user_elimit'], $footer_text), 'MANAGE_LINK' => $this->user->check_auth('a_event_', false) ? '<a href="admin/manage_events.php' . $this->SID . '" title="' . $this->user->lang('manevents_title') . '"><img src="' . $this->root_path . 'images/glyphs/edit.png" alt="' . $this->user->lang('manevents_title') . '" /></a>' : '', 'EVENT_PAGINATION' => generate_pagination('listevents.php' . $this->SID . $sort_suffix, $event_count, $this->user->data['user_elimit'], $start)));
     $this->core->set_vars(array('page_title' => $this->user->lang('events'), 'template_file' => 'listevents.html', 'display' => true));
 }
    function main($id, $mode)
    {
        global $db, $user, $auth, $template;
        global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
        $error = $notify = array();
        $user->add_lang(array('mods/info_acp_emails_users_list'));
        $mode = request_var('mode', '');
        $start = request_var('start', 0);
        if ($mode == 'list') {
            // How many Users do we have?
            $sql = 'SELECT COUNT(user_id) AS total_users
	FROM ' . USERS_TABLE . '
	WHERE user_type <> ' . USER_IGNORE;
            $result = $db->sql_query($sql);
            $total_users = (int) $db->sql_fetchfield('total_users');
            $db->sql_freeresult($result);
            // want more to display...change the 20 to a higher number
            $tf = 20;
            //Pull Users from the database
            $sql = 'SELECT *
	FROM ' . USERS_TABLE . '
	WHERE user_type <> ' . USER_IGNORE . '
	ORDER BY user_id';
            $result = $db->sql_query_limit($sql, $tf, $start);
            // Assign specific vars
            while ($row = $db->sql_fetchrow($result)) {
                $template->assign_block_vars('list', array('ID' => $row['user_id'], 'EMAIL' => $row['user_email'], 'REGDATE' => $user->format_date($row['user_regdate']), 'LASTVISIT' => $user->format_date($row['user_lastvisit']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour'])));
            }
            $this->tpl_name = 'acp_emails_users_list';
            $this->page_title = 'EMAILS_USERS_LIST';
            $template->assign_vars(array('PAGINATION' => generate_pagination($this->u_action, $total_users, $tf, $start), 'PAGE_NUMBER' => on_page($total_users, $tf, $start), 'U_CSV_LIST' => append_sid("{$phpbb_root_path}list.{$phpEx}", 'mode=list'), 'U_ACTION' => $this->u_action, 'TOTAL_USERS' => $total_users == 1 ? $user->lang['USER_COUNT'] : sprintf($user->lang['USER_COUNTS'], $total_users)));
            $db->sql_freeresult($result);
        }
    }
Esempio n. 4
0
 public function display()
 {
     //Sort
     $sort = $this->in->get('sort');
     $sort_suffix = '&amp;sort=' . $sort;
     //redirect on member management
     if ($this->in->exists('manage_b') && $this->in->get('manage_b') == $this->user->lang('manage_items')) {
         $manage_link = './admin/listitems.php';
         redirect($manage_link);
     }
     $start = $this->in->get('start', 0);
     $pagination_suffix = $start ? '&amp;start=' . $start : '';
     //Output
     $view_list = $filtered_list = $this->pdh->get('item', 'id_list');
     if ($this->in->exists('search')) {
         $mySearch = $this->in->get('search');
         $searchType = $this->in->get('search_type') ? $this->in->get('search_type') : 'itemname';
         $filtered_list = $this->filter($view_list, $searchType, $mySearch);
     }
     $item_count = count($filtered_list) > 0 ? count($filtered_list) : count($view_list);
     $footer_text = sprintf($this->user->lang('listitems_footcount'), $item_count, $this->user->data['user_ilimit']);
     //init infotooltip
     infotooltip_js();
     $hptt_page_settings = $this->pdh->get_page_settings('listitems', 'hptt_listitems_itemlist');
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $filtered_list, array('%link_url%' => 'viewitem.php', '%link_url_suffix%' => '', '%raid_link_url%' => 'viewraid.php', '%raid_link_url_suffix%' => '', '%itt_lang%' => false, '%itt_direct%' => 0, '%onlyicon%' => 0, '%noicon%' => 0));
     $this->tpl->assign_vars(array('SEARCH_LINK' => '<input type="image" src="' . $this->root_path . 'images/glyphs/view.png" name="search_b" value="1" alt="' . $this->user->lang('Itemsearch_searchby') . '" title="' . $this->user->lang('Itemsearch_searchby') . '" class="absmiddle" />', 'MANAGE_LINK' => $this->user->check_auth('a_item_', false) ? '<a href="admin/manage_items.php' . $this->SID . '" title="' . $this->user->lang('manage_items') . '"><img src="' . $this->root_path . 'images/glyphs/edit.png" alt="' . $this->user->lang('manage_items') . '" /></a>' : '', 'PAGE_OUT' => $hptt->get_html_table($sort, $pagination_suffix, $start, $this->user->data['user_ilimit'], $footer_text), 'ITEM_PAGINATION' => generate_pagination('listitems.php' . $this->SID . $sort_suffix, $item_count, $this->user->data['user_ilimit'], $start)));
     $this->core->set_vars(array('page_title' => $this->user->lang('listitems_title'), 'template_file' => 'listitems.html', 'display' => true));
 }
 public function display()
 {
     //Output
     $hptt_page_settings = array('name' => 'hptt_guildrequest', 'table_main_sub' => '%request_id%', 'table_subs' => array('%request_id%', '%field_id%'), 'page_ref' => 'myapplications.php', 'show_numbers' => false, 'show_select_boxes' => false, 'show_detail_twink' => false, 'table_sort_col' => 0, 'table_sort_dir' => 'asc', 'table_presets' => array(0 => array('name' => 'gr_date', 'sort' => true, 'th_add' => '', 'td_add' => 'nowrap="nowrap"'), 1 => array('name' => 'gr_name', 'sort' => true, 'th_add' => 'width="50%"', 'td_add' => 'nowrap="nowrap"')));
     $arrCombinedFields = $this->pdh->get('guildrequest_fields', 'combined_fields', array());
     foreach ($arrCombinedFields as $key => $val) {
         if (count($val) == 1) {
             $hptt_page_settings['table_presets'][] = array('name' => 'gr_field_' . $val[0], 'sort' => true, 'th_add' => '', 'td_add' => '');
         } else {
             $hptt_page_settings['table_presets'][] = array('name' => 'gr_combined_field_' . $key, 'sort' => true, 'th_add' => '', 'td_add' => '');
         }
     }
     $hptt_page_settings['table_presets'][] = array('name' => 'gr_status', 'sort' => true, 'th_add' => '', 'td_add' => '');
     $hptt_page_settings['table_presets'][] = array('name' => 'gr_closed', 'sort' => true, 'th_add' => '', 'td_add' => 'align="center"');
     //Sort
     $sort = $this->in->get('sort');
     $sort_suffix = '&amp;sort=' . $sort;
     $start = $this->in->get('start', 0);
     $pagination_suffix = $start ? '&amp;start=' . $start : '';
     $view_list = $this->pdh->get('guildrequest_requests', 'id_list', array($this->user->id, !$this->user->check_auth('u_guildrequest_view_closed', false)));
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $view_list, array('%link_url%' => 'viewraid.php', '%link_url_suffix%' => ''), $this->user->id);
     $hptt->setPageRef($this->strPath);
     //footer
     $raid_count = count($view_list);
     $footer_text = sprintf($this->user->lang('gr_footer'), $raid_count, $this->user->data['user_rlimit']);
     $this->tpl->assign_vars(array('PAGE_OUT' => $hptt->get_html_table($sort, $pagination_suffix, $start, $this->user->data['user_rlimit'], $footer_text), 'GR_PAGINATION' => generate_pagination($this->strPath . $this->SID . $sort_suffix, $raid_count, $this->user->data['user_rlimit'], $start)));
     $this->core->set_vars(array('page_title' => $this->user->lang('gr_myapplications'), 'template_path' => $this->pm->get_data('guildrequest', 'template_path'), 'template_file' => 'myapplications.html', 'display' => true));
 }
Esempio n. 6
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']);
 }
Esempio n. 7
0
function browse_tickets(&$sqlc)
{
    global $output, $lang_global, $lang_ticket, $characters_db, $realm_id, $action_permission, $user_lvl, $itemperpage;
    //==========================$_GET and SECURE=================================
    $start = isset($_GET['start']) ? $sqlc->quote_smart($_GET['start']) : 0;
    if (is_numeric($start)) {
    } else {
        $start = 0;
    }
    $order_by = isset($_GET['order_by']) ? $sqlc->quote_smart($_GET['order_by']) : 'guid';
    if (preg_match('/^[_[:lower:]]{1,10}$/', $order_by)) {
    } else {
        $order_by = 'guid';
    }
    $dir = isset($_GET['dir']) ? $sqlc->quote_smart($_GET['dir']) : 1;
    if (preg_match('/^[01]{1}$/', $dir)) {
    } else {
        $dir = 1;
    }
    $order_dir = $dir ? 'ASC' : 'DESC';
    $dir = $dir ? 0 : 1;
    //==========================$_GET and SECURE end=============================
    //get total number of items
    $query_1 = $sqlc->query('SELECT count(*) FROM gm_tickets');
    $all_record = $sqlc->result($query_1, 0);
    unset($query_1);
    $query = $sqlc->query("SELECT gm_tickets.guid, gm_tickets.guid, SUBSTRING_INDEX(gm_tickets.message,' ',6), characters.name, characters.online\r\n                            FROM gm_tickets,characters\r\n                                WHERE gm_tickets.guid = characters.guid\r\n                                  ORDER BY {$order_by} {$order_dir} LIMIT {$start}, {$itemperpage}");
    $output .= "\r\n                <script type=\"text/javascript\" src=\"libs/js/check.js\"></script>\r\n                <center>\r\n                    <table class=\"top_hidden\">\r\n                        <tr>\r\n                            <td width=\"25%\" align=\"right\">";
    $output .= generate_pagination("ticket.php?action=browse_tickets&amp;order_by={$order_by}&amp;dir=" . !$dir, $all_record, $itemperpage, $start);
    $output .= "\r\n                            </td>\r\n                        </tr>\r\n                    </table>";
    $output .= "\r\n                <form method=\"get\" action=\"ticket.php\" name=\"form\">\r\n                    <input type=\"hidden\" name=\"action\" value=\"delete_tickets\" />\r\n                    <input type=\"hidden\" name=\"start\" value=\"{$start}\" />\r\n                    <table class=\"lined\">\r\n                        <tr>";
    if ($user_lvl >= $action_permission['delete']) {
        $output .= "\r\n                            <th width=\"7%\"><input name=\"allbox\" type=\"checkbox\" value=\"Check All\" onclick=\"CheckAll(document.form);\" /></th>";
    }
    if ($user_lvl >= $action_permission['update']) {
        $output .= "\r\n                            <th width=\"7%\">{$lang_global['edit']}</th>";
    }
    $output .= "\r\n                            <th width=\"10%\"><a href=\"ticket.php?order_by=guid&amp;start={$start}&amp;dir={$dir}\">" . ($order_by == 'guid' ? "<img src=\"img/arr_" . ($dir ? "up" : "dw") . ".gif\" alt=\"\" /> " : "") . "{$lang_ticket['id']}</a></th>\r\n                            <th width=\"16%\"><a href=\"ticket.php?order_by=online&amp;start={$start}&amp;dir={$dir}\">" . ($order_by == 'online' ? "<img src=\"img/arr_" . ($dir ? "up" : "dw") . ".gif\" alt=\"\" /> " : "") . "Online?</a></th>\r\n                            <th width=\"16%\"><a href=\"ticket.php?order_by=playerGuid&amp;start={$start}&amp;dir={$dir}\">" . ($order_by == 'playerGuid' ? "<img src=\"img/arr_" . ($dir ? "up" : "dw") . ".gif\" alt=\"\" /> " : "") . "{$lang_ticket['sender']}</a></th>";
    $output .= "\r\n                            <th width=\"60%\">{$lang_ticket['ticket_text']}</th>\r\n                        </tr>";
    while ($ticket = $sqlc->fetch_row($query)) {
        $output .= "\r\n                        <tr>";
        if ($user_lvl >= $action_permission['delete']) {
            $output .= "\r\n                            <td><input type=\"checkbox\" name=\"check[]\" value=\"{$ticket['0']}\" onclick=\"CheckCheckAll(document.form);\" /></td>";
        }
        if ($user_lvl >= $action_permission['update']) {
            $output .= "\r\n                            <td><a href=\"ticket.php?action=edit_ticket&amp;error=4&amp;id={$ticket['0']}\">{$lang_global['edit']}</a></td>";
        }
        $output .= "\r\n                            <td>{$ticket['0']}</td>\r\n                            <td>" . ($ticket[4] ? "<img src=\"img/up.gif\" alt=\"online\">" : "<img src=\"img/down.gif\" alt=\"offline\">") . "</td>\r\n                            <td><a href=\"char.php?id={$ticket['1']}\">" . htmlentities($ticket[3]) . "</a></td>\r\n                            <td>" . htmlentities($ticket[2]) . " ...</td>\r\n                        </tr>";
    }
    unset($query);
    unset($ticket);
    $output .= "\r\n                        <tr>\r\n                            <td colspan=\"5\" align=\"right\" class=\"hidden\" width=\"25%\">";
    $output .= generate_pagination("ticket.php?action=browse_tickets&amp;order_by={$order_by}&amp;dir=" . !$dir, $all_record, $itemperpage, $start);
    $output .= "\r\n                            </td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td colspan=\"3\" align=\"left\" class=\"hidden\">";
    if ($user_lvl >= $action_permission['delete']) {
        makebutton($lang_ticket['del_selected_tickets'], "javascript:do_submit()\" type=\"wrn", 230);
    }
    $output .= "\r\n                            </td>\r\n                            <td colspan=\"2\" align=\"right\" class=\"hidden\">{$lang_ticket['tot_tickets']}: {$all_record}</td>\r\n                        </tr>\r\n                    </table>\r\n                </form>\r\n                <br />\r\n            </center>";
}
Esempio n. 8
0
function printPageList($start, $numItems, $url, $username)
{
    global $cfg_ServersPerPage;
    $page = floor(($start + 1) / $cfg_ServersPerPage);
    $url .= "?player=" . urlencode($username);
    $str = generate_pagination($url, $numItems, $cfg_ServersPerPage, $page * $cfg_ServersPerPage);
    echo "{$str}<P>";
}
Esempio n. 9
0
function show_list()
{
    global $lang_global, $lang_banned, $output, $realm_db, $itemperpage, $action_permission, $user_lvl;
    valid_login($action_permission['read']);
    $sqlr = new SQL();
    $sqlr->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    $ban_type = isset($_GET['ban_type']) ? $sqlr->quote_smart($_GET['ban_type']) : "account_banned";
    $key_field = $ban_type == 'account_banned' ? 'id' : 'ip';
    //==========================$_GET and SECURE=================================
    $start = isset($_GET['start']) ? $sqlr->quote_smart($_GET['start']) : 0;
    if (is_numeric($start)) {
    } else {
        $start = 0;
    }
    $order_by = isset($_GET['order_by']) ? $sqlr->quote_smart($_GET['order_by']) : "{$key_field}";
    if (!preg_match("/^[_[:lower:]]{1,12}\$/", $order_by)) {
        $order_by = "{$key_field}";
    }
    $dir = isset($_GET['dir']) ? $sqlr->quote_smart($_GET['dir']) : 1;
    if (!preg_match("/^[01]{1}\$/", $dir)) {
        $dir = 1;
    }
    $order_dir = $dir ? "ASC" : "DESC";
    $dir = $dir ? 0 : 1;
    //==========================$_GET and SECURE end=============================
    $fromwhere = $ban_type == 'account_banned' ? $ban_type . " WHERE active = '1'" : $ban_type;
    $query_1 = $sqlr->query("SELECT count(*) FROM {$fromwhere}");
    $all_record = $sqlr->result($query_1, 0);
    $result = $sqlr->query("SELECT {$key_field}, bandate, unbandate, bannedby, SUBSTRING_INDEX(banreason,' ',3) FROM {$fromwhere} ORDER BY {$order_by} {$order_dir} LIMIT {$start}, {$itemperpage}");
    $this_page = $sqlr->num_rows($result);
    $output .= "\r\n        <center>\r\n            <table class=\"top_hidden\">\r\n                <tr>\r\n                    <td>";
    if ($user_lvl >= $action_permission['insert']) {
        makebutton($lang_banned['add_to_banned'], "banned.php?action=add_entry\" type=\"wrn", 180);
    }
    if ($ban_type === "account_banned") {
        makebutton($lang_banned['banned_ips'], "banned.php?ban_type=ip_banned", 130);
    } else {
        makebutton($lang_banned['banned_accounts'], "banned.php?ban_type=account_banned", 130);
    }
    makebutton($lang_global['back'], "javascript:window.history.back()\" type=\"def", 130);
    $output .= "\r\n                    </td>\r\n                    <td align=\"right\">" . generate_pagination("banned.php?action=show_list&amp;order_by={$order_by}&amp;ban_type={$ban_type}&amp;dir=" . !$dir, $all_record, $itemperpage, $start) . "</td>\r\n                </tr>\r\n            </table>\r\n            <script type=\"text/javascript\">\r\n                answerbox.btn_ok='{$lang_global['yes_low']}';\r\n                answerbox.btn_cancel='{$lang_global['no']}';\r\n                var del_banned = 'banned.php?action=do_delete_entry&amp;ban_type={$ban_type}&amp;{$key_field}=';\r\n            </script>\r\n            <table class=\"lined\">\r\n                <tr>\r\n                    <th width=\"5%\">{$lang_global['delete_short']}</th>\r\n                    <th width=\"19%\"><a href=\"banned.php?order_by={$key_field}&amp;ban_type={$ban_type}&amp;dir={$dir}\"" . ($order_by == $key_field ? " class=\"{$order_dir}\"" : "") . ">{$lang_banned['ip_acc']}</a></th>\r\n                    <th width=\"18%\"><a href=\"banned.php?order_by=bandate&amp;ban_type={$ban_type}&amp;dir={$dir}\"" . ($order_by == 'bandate' ? " class=\"{$order_dir}\"" : "") . ">{$lang_banned['bandate']}</a></th>\r\n                    <th width=\"18%\"><a href=\"banned.php?order_by=unbandate&amp;ban_type={$ban_type}&amp;dir={$dir}\"" . ($order_by == 'unbandate' ? " class=\"{$order_dir}\"" : "") . ">{$lang_banned['unbandate']}</a></th>\r\n                    <th width=\"15%\"><a href=\"banned.php?order_by=bannedby&amp;ban_type={$ban_type}&amp;dir={$dir}\"" . ($order_by == 'bannedby' ? " class=\"{$order_dir}\"" : "") . ">{$lang_banned['bannedby']}</a></th>\r\n                    <th width=\"25%\"><a href=\"banned.php?order_by=banreason&amp;ban_type={$ban_type}&amp;dir={$dir}\"" . ($order_by == 'banreason' ? " class=\"{$order_dir}\"" : "") . ">{$lang_banned['banreason']}</a></th>\r\n                </tr>";
    while ($ban = $sqlr->fetch_row($result)) {
        if ($ban_type === "account_banned") {
            $result1 = $sqlr->query("SELECT username FROM account WHERE id ='{$ban['0']}'");
            $owner_acc_name = $sqlr->result($result1, 0, 'username');
            $name_out = "<a href=\"user.php?action=edit_user&amp;error=11&amp;id={$ban['0']}\">{$owner_acc_name}</a>";
        } else {
            $name_out = $ban[0];
            $owner_acc_name = $ban[0];
        }
        $output .= "\r\n                <tr>\r\n                    <td>";
        if ($user_lvl >= $action_permission['delete']) {
            $output .= "\r\n                        <img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>{$owner_acc_name}</font><br />{$lang_global['are_you_sure']}', del_banned + '{$ban['0']}');\" style=\"cursor:pointer;\" alt=\"\" />";
        }
        $output .= "\r\n                    </td>\r\n                    <td>{$name_out}</td>\r\n                    <td>" . date('d-m-Y G:i', $ban[1]) . "</td>\r\n                    <td>" . date('d-m-Y G:i', $ban[2]) . "</td>\r\n                    <td>{$ban['3']}</td>\r\n                    <td>{$ban['4']}</td>\r\n                </tr>";
    }
    $output .= "\r\n                <tr>\r\n                    <td colspan=\"6\" align=\"right\" class=\"hidden\">{$lang_banned['tot_banned']} : {$all_record}</td>\r\n                </tr>\r\n            </table>\r\n            <br/>\r\n        </center>";
}
Esempio n. 10
0
function search()
{
    global $lang_global, $output, $itemperpage, $item_datasite, $mangos_db, $characters_db, $realm_id, $sql_search_limit;
    wowhead_tt();
    if (!isset($_GET['search_value']) || !isset($_GET['search_by'])) {
        redirect("mail_on.php?error=2");
    }
    $sql = new SQL();
    $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    $search_value = $sql->quote_smart($_GET['search_value']);
    $search_by = $sql->quote_smart($_GET['search_by']);
    $search_menu = array('sender', 'receiver');
    // if (!array_key_exists($search_by, $search_menu)) $search_by = 'sender';
    $start = isset($_GET['start']) ? $sql->quote_smart($_GET['start']) : 0;
    $order_by = isset($_GET['order_by']) ? $sql->quote_smart($_GET['order_by']) : "id";
    $dir = isset($_GET['dir']) ? $sql->quote_smart($_GET['dir']) : 1;
    $order_dir = $dir ? "ASC" : "DESC";
    $dir = $dir ? 0 : 1;
    $temp = $sql->query("SELECT guid FROM `characters` WHERE name like '%{$search_value}%'");
    $search_value = $sql->result($temp, 0, 'guid');
    $query_1 = $sql->query("SELECT count(*) FROM `mail`");
    $query = $sql->query("SELECT a.id, a.messageType, a.sender, a.receiver, a.subject, a.itemTextId, a.has_items, a.money, a.cod, a.checked, b.item_template\r\n            FROM mail a\r\n            INNER JOIN mail_items b ON a.id = b.mail_id\r\n            WHERE {$search_by} = {$search_value}\r\n            ORDER BY {$order_by} {$order_dir} LIMIT {$start}, {$itemperpage}");
    $this_page = $sql->num_rows($query);
    $all_record = $sql->result($query_1, 0);
    $total_found = $sql->num_rows($query);
    //==========================top page navigation starts here========================
    $output .= "<center><table class=\"top_hidden\">\r\n    <tr><td>\r\n            <table class=\"hidden\">\r\n                <tr><td>\r\n            <form action=\"mail_on.php\" method=\"get\" name=\"form\">\r\n            <input type=\"hidden\" name=\"action\" value=\"search\" />\r\n            <input type=\"hidden\" name=\"error\" value=\"4\" />\r\n            <input type=\"text\" size=\"45\" name=\"search_value\" />\r\n            <select name=\"search_by\">\r\n                <option value=\"sender\">Sender</option>\r\n                <option value=\"receiver\">Receiver</option>\r\n            </select></form></td><td>";
    makebutton($lang_global['search'], "javascript:do_submit()", 80);
    $output .= "</td></tr></table>\r\n            <td align=\"right\">";
    $output .= generate_pagination("mail_on.php?action=search&amp;order_by={$order_by}&amp;dir=" . !$dir, $all_record, $itemperpage, $start);
    $output .= "</td></tr></table>";
    //==========================top page navigation ENDS here ========================
    $output .= "<table class=\"lined\">\r\n  <tr>\r\n    <th width=\"5%\">ID</th>\r\n    <th width=\"5%\">Source</th>\r\n    <th width=\"10%\">Sender</th>\r\n    <th width=\"10%\">Receiver</th>\r\n    <th width=\"15%\">Subject</th>\r\n    <th width=\"5%\">Has Items</th>\r\n    <th width=\"25%\">Text</th>\r\n    <th width=\"15%\">Money</th>\r\n    <th width=\"5%\">Checked</th>\r\n  </tr>";
    while ($mail = $sql->fetch_array($query)) {
        $g = floor($mail[7] / 10000);
        $mail[7] -= $g * 10000;
        $s = floor($mail[7] / 100);
        $mail[7] -= $s * 100;
        $c = $mail[7];
        $money = "";
        if ($mail[7] > 0) {
            $money = $g . "<img src=\"./img/gold.gif\" /> " . $s . "<img src=\"./img/silver.gif\" /> " . $c . "<img src=\"./img/copper.gif\" /> ";
        }
        $output .= "<tr valign=top>\r\n                    <td>{$mail['0']}</td>\r\n                    <td>" . get_mail_source($mail[1]) . "</td>\r\n                    <td><a href=\"char.php?id={$mail['2']}\">" . get_char_name($mail[2]) . "</a></td>\r\n                    <td><a href=\"char.php?id={$mail['3']}\">" . get_char_name($mail[3]) . "</a></td>\r\n                    <td>{$mail['4']}</td>\r\n            ";
        $output .= "<td>";
        $output .= "\r\n                    <a style=\"padding:2px;\" href=\"{$item_datasite}{$mail[10]}\" target=\"_blank\">\r\n                      <img class=\"bag_icon\" src=\"" . get_item_icon($mail[10]) . "\" alt=\"\" />\r\n                  </a>";
        //maketooltip("<img src=\"./img/up.gif\" alt=\"\">", $item_datasite{$mail[10]}, $mail[10], "item_tooltip", "target=\"_blank\"");
        $output .= "</td>";
        $output .= "<td>" . get_mail_text($mail[5]) . "</td>\r\n                        <td>{$money}</td>\r\n        <td>" . get_check_state($mail[9]) . "</td>\r\n                   </tr>";
    }
    /*--------------------------------------------------*/
    $output .= "<tr><td colspan=\"6\" class=\"hidden\" align=\"right\">All Mails: {$all_record}</td></tr>\r\n </table></center>";
    $sql->close();
}
 /**
  * {@inheritdoc}
  */
 public function execute(Template $template, Context $context, $args, $source)
 {
     $parsed_args = $template->parseArguments($args);
     if (count($parsed_args) < 1 || count($parsed_args) > 2) {
         throw new \InvalidArgumentException('"generatePagination" helper expects one or two arguments.');
     }
     $pagination_info = $context->get($parsed_args[0]);
     $bottom = empty($parsed_args[1]) ? true : $context->get($parsed_args[1]);
     $pagination = generate_pagination($pagination_info, $bottom === "false" ? false : true);
     return new SafeString($pagination);
 }
 /**
  * Display
  * display abbreviations
  */
 public function display()
 {
     $this->tpl->add_js("\n                        \$(\"#article_categories-table tbody\").sortable({\n                                cancel: '.not-sortable, input, tr th.footer, th',\n                                cursor: 'pointer',\n                        });\n                ", "docready");
     $view_list = $this->pdh->get('abbreviations_mappings', 'id_list', array());
     $hptt_page_settings = array('name' => 'hptt_abbreviations_admin_manage_abbreviations', 'table_main_sub' => '%abbreviationId%', 'table_subs' => array('%abbreviationId%', '%link_url%', '%link_url_suffix%'), 'page_ref' => 'manage_abbreviations.php', 'show_numbers' => false, 'show_select_boxes' => true, 'selectboxes_checkall' => true, 'show_detail_twink' => false, 'table_sort_dir' => 'asc', 'table_sort_col' => 0, 'table_presets' => array(array('name' => 'abbreviations_mappings_id', 'sort' => true, 'th_add' => 'width="20"', 'td_add' => ''), array('name' => 'abbreviations_mappings_abbreviation', 'sort' => true, 'th_add' => '', 'td_add' => ''), array('name' => 'abbreviations_mappings_full_text', 'sort' => true, 'th_add' => 'width="20"', 'td_add' => 'style="text-align:right"')));
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $view_list, array('%link_url%' => $this->root_path . 'plugins/abbreviations/admin/manage_abbreviations.php', '%link_url_suffix%' => ''));
     $page_suffix = '&amp;start=' . $this->in->get('start', 0);
     $sort_suffix = '?sort=' . $this->in->get('sort');
     $item_count = count($view_list);
     $this->tpl->assign_vars(array('ABBREVIATIONS_LIST' => $hptt->get_html_table($this->in->get('sort'), $page_suffix, $this->in->get('start', 0), 20, $strfootertext), 'PAGINATION' => generate_pagination('manage_abbreviations.php' . $sort_suffix, $item_count, 20, $this->in->get('start', 0)), 'HPTT_COLUMN_COUNT' => $hptt->get_column_count()));
     // -- EQDKP ---------------------------------------------------------------
     $this->core->set_vars(array('page_title' => $this->user->lang('abbreviations_manage_abbreviations'), 'template_path' => $this->pm->get_data('abbreviations', 'template_path'), 'template_file' => 'admin/manage_abbreviations.html', 'display' => true));
 }
 public function display_logs()
 {
     if ($this->user->check_auth('a_cal_revent_conf', false) || $this->check_permission() || $this->user->check_auth('a_logs_view', false)) {
     } else {
         $this->user->check_auth('a_something');
     }
     //Show Logs
     $view_list = $this->pdh->get('logs', 'filtered_id_list', array('calendar', false, false, false, false, false, false, false, false, $this->url_id));
     $hptt_psettings = array('name' => 'hptt_managelogs_actions', 'table_main_sub' => '%log_id%', 'table_subs' => array('%log_id%', '%link_url%', '%link_url_suffix%'), 'page_ref' => $this->strPath, 'show_numbers' => false, 'show_select_boxes' => false, 'selectboxes_checkall' => false, 'show_detail_twink' => false, 'table_sort_dir' => 'desc', 'table_sort_col' => 0, 'table_presets' => array(array('name' => 'logdatetime', 'sort' => true, 'th_add' => '', 'td_add' => 'class="nowrap desktopOnly"'), array('name' => 'logtype', 'sort' => true, 'th_add' => 'width="10%"', 'td_add' => 'class="nowrap desktopOnly"'), array('name' => 'logvalue', 'sort' => true, 'th_add' => 'width="80%"', 'td_add' => ''), array('name' => 'loguser', 'sort' => true, 'th_add' => 'width="100" class="hiddenSmartphone"', 'td_add' => 'class="hiddenSmartphone"')));
     $hptt = $this->get_hptt($hptt_psettings, $view_list, $view_list, array('%link_url%' => 'manage_logs.php', '%link_url_suffix%' => '', md5($strFilterSuffix)));
     $page_suffix = '&amp;start=' . $this->in->get('start', 0) . '&logs&eventid=' . $this->url_id . '&simple_head=true';
     $sort_suffix = $this->SID . '&amp;sort=' . $this->in->get('sort');
     $logs_list = $hptt->get_html_table($this->in->get('sort', ''), $page_suffix);
     $this->tpl->assign_vars(array('LOGS_LIST' => $logs_list, 'LOGS_PAGINATION' => generate_pagination('manage_logs.php' . $sort_suffix . $strFilterSuffix, $actionlog_count, 100, $this->in->get('start', 0)), 'HPTT_LOGS_COUNT' => $hptt->get_column_count(), 'S_COMMENTS' => false));
     $this->core->set_vars(array('page_title' => sprintf($this->pdh->get('event', 'name', array($eventdata['extension']['raid_eventid'])), $this->user->lang('raidevent_raid_show_title')) . ', ' . $this->time->user_date($eventdata['timestamp_start']) . ' ' . $this->time->user_date($eventdata['timestamp_start'], false, true), 'template_file' => 'calendar/viewlogs.html', 'header_format' => $this->simple_head, 'display' => true));
 }
Esempio n. 14
0
 public function display()
 {
     // The jQuery stuff
     $this->confirm_delete($this->user->lang('confirm_delete_calevents'));
     $this->jquery->Dialog('newCalevent', $this->user->lang('calendar_win_add'), array('url' => $this->routing->build('editcalendarevent') . "&simple_head=true", 'width' => '920', 'height' => '730', 'onclose' => $this->env->link . 'admin/manage_calevents.php' . $this->SID));
     $this->jquery->Dialog('editEvent', $this->user->lang('calendar_win_edit'), array('url' => $this->routing->build('editcalendarevent') . "&eventid='+editid+'&simple_head=true", 'width' => '920', 'height' => '730', 'withid' => 'editid', 'onclose' => $this->env->link . 'admin/manage_calevents.php' . $this->SID));
     // Build the HPTT Table
     $view_list = $this->pdh->get('calendar_events', 'id_list');
     $hptt_psettings = $this->pdh->get_page_settings('admin_manage_calevents', 'hptt_managecalevents_actions');
     $hptt = $this->get_hptt($hptt_psettings, $view_list, $view_list, array('%link_url%' => 'manage_calevents.php'));
     $footer_text = sprintf($this->user->lang('calevents_footcount'), count($view_list));
     $page_suffix = '&amp;start=' . $this->in->get('start', 0);
     $sort_suffix = '?sort=' . $this->in->get('sort');
     $this->tpl->assign_vars(array('CALEVENTS' => $hptt->get_html_table($this->in->get('sort', ''), $page_suffix, $this->in->get('start', 0), 40, $footer_text), 'HPTT_COLUMN_COUNT' => $hptt->get_column_count(), 'PAGINATION' => generate_pagination('manage_calevents.php' . $sort_suffix, count($view_list), 40, $this->in->get('start', 0))));
     $this->core->set_vars(array('page_title' => $this->user->lang('manage_calevents'), 'template_file' => 'admin/manage_calevents.html', 'display' => true));
 }
Esempio n. 15
0
 public function buildpage(viewNavigation $Navigation)
 {
     global $db, $config, $phpbb_root_path, $phpEx, $user, $template;
     $loot = new \bbdkp\controller\loot\Loot();
     $total_items = $loot->countloot('history', $Navigation->getGuildId(), $Navigation->getDkpsysId());
     if ($Navigation->getDkpsysId() > 0) {
         $u_list_items = append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=loothistory&amp;guild_id=' . $Navigation->getGuildId() . '&amp;' . URI_DKPSYS . '=' . $Navigation->getDkpsysId());
     } else {
         $u_list_items = append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=loothistory&amp;guild_id=' . $Navigation->getGuildId());
     }
     $listitems_footcount = sprintf($user->lang['LISTPURCHASED_FOOTCOUNT'], $total_items, $config['bbdkp_user_ilimit']);
     $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_name asc, item_value desc', 'item_name desc, item_value desc'), 3 => array('event_name asc, item_value desc', 'event_name desc, item_value desc'), 4 => array('item_value desc', 'item_value asc'));
     $current_order = $Navigation->switch_order($sort_order);
     $start = request_var('start', 0);
     $pagination = generate_pagination($u_list_items . '&amp;o=' . $current_order['uri']['current'], $total_items, $config['bbdkp_user_ilimit'], $start, true);
     $items_result = $loot->GetAllLoot($current_order['sql'], $Navigation->getGuildId(), $Navigation->getDkpsysId(), 0, $start, 0);
     $number_items = 0;
     $item_value = 0.0;
     $item_decay = 0.0;
     $item_total = 0.0;
     while ($item = $db->sql_fetchrow($items_result)) {
         if ($Navigation->bbtips == true && $item['item_gameid'] == 'wow') {
             $valuename = '<strong>' . $Navigation->bbtips->parse('[itemdkp]' . $item['item_name'] . '[/itemdkp]') . '</strong>';
         } else {
             $valuename = $item['item_name'];
         }
         $member = new \bbdkp\controller\members\Members($item['member_id']);
         $template->assign_block_vars('items_row', array('DATE' => !empty($item['item_date']) ? date($config['bbdkp_date_format'], $item['item_date']) : '&nbsp;', 'ITEMNAME' => $valuename, 'U_VIEW_ITEM' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=item&amp;" . URI_ITEM . '=' . $item['item_id']), 'RAID' => !empty($item['event_name']) ? $item['event_name'] : '&lt;<i>' . $user->lang['NOT_AVAILABLE'] . '</i>&gt;', 'U_VIEW_RAID' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=raid&amp;" . URI_RAID . '=' . $item['raid_id']), 'EVENT_COLOR' => !empty($item['event_color']) ? $item['event_color'] : '#254689', 'ITEMVALUE' => sprintf("%.2f", $item['item_value']), 'DECAYVALUE' => sprintf("%.2f", $item['item_decay']), 'TOTAL' => sprintf("%.2f", $item['item_net']), 'BUYER' => $item['member_name'], 'U_VIEW_BUYER' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=member&amp;" . URI_NAMEID . '=' . $item['member_id'] . '&amp;' . URI_DKPSYS . '=' . $item['event_dkpid']), 'RACE_IMAGE' => $member->race_image, 'S_RACE_IMAGE_EXISTS' => strlen($member->race_image) > 1 ? true : false, 'CLASSCOLOR' => $member->colorcode, 'CLASS_IMAGE' => $member->class_image, 'S_CLASS_IMAGE_EXISTS' => strlen($member->class_image) > 1 ? true : false));
         unset($member);
         $number_items++;
         $item_value += $item['item_value'];
         $item_decay += $item['item_decay'];
         $item_total += $item['item_net'];
     }
     $db->sql_freeresult($items_result);
     // breadcrumbs menu
     $navlinks_array = array(array('DKPPAGE' => $user->lang['MENU_ITEMHIST'], 'U_DKPPAGE' => $u_list_items));
     foreach ($navlinks_array as $name) {
         $template->assign_block_vars('dkpnavlinks', array('DKPPAGE' => $name['DKPPAGE'], 'U_DKPPAGE' => $name['U_DKPPAGE']));
     }
     $template->assign_vars(array('F_LISTITEM' => $u_list_items, 'O_DATE' => $u_list_items . '&amp;o=' . $current_order['uri'][0] . '&amp;start=' . $start, 'O_BUYER' => $u_list_items . '&amp;o=' . $current_order['uri'][1] . '&amp;start=' . $start, 'O_ITEMNAME' => $u_list_items . '&amp;o=' . $current_order['uri'][2] . '&amp;start=' . $start, 'O_RAID' => $u_list_items . '&amp;o=' . $current_order['uri'][3] . '&amp;start=' . $start, 'O_VALUE' => $u_list_items . '&amp;o=' . $current_order['uri'][4] . '&amp;start=' . $start, 'S_SHOWTIME' => $config['bbdkp_timebased'] == '1' ? true : false, 'S_SHOWDECAY' => $config['bbdkp_decay'] == '1' ? true : false, 'S_SHOWEPGP' => $config['bbdkp_epgp'] == '1' ? true : false, 'TOTAL_ITEMVALUE' => sprintf("%.2f", $item_value), 'TOTAL_ITEMDECAY' => sprintf("%.2f", $item_decay), 'TOTAL_ITEMTOTAL' => sprintf("%.2f", $item_total), 'LISTITEMS_FOOTCOUNT' => $listitems_footcount, 'ITEM_PAGINATION' => $pagination, 'S_DISPLAY_LOOTHISTORY' => true));
     $title = $user->lang['MENU_ITEMHIST'];
     // Output page
     page_header($title);
 }
Esempio n. 16
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&amp;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&amp;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']);
 }
 public function display()
 {
     require_once $this->root_path . 'plugins/guildbank/includes/systems/guildbank.esys.php';
     $bid_list = $this->pdh->get('guildbank_auction_bids', 'id_list', array($this->url_id));
     $hptt_bids = $this->get_hptt($systems_guildbank['pages']['hptt_guildbank_bids'], $bid_list, $bid_list, array());
     $page_suffix = '&amp;start=' . $this->in->get('start', 0);
     $sort_suffix = '&amp;sort=' . $this->in->get('sort');
     $bids_count = count($bid_list);
     $footer_bids = sprintf($this->user->lang('gb_bids_footcount'), $bid_list, $this->user->data['user_ilimit']);
     // data
     $dkppool = $this->pdh->get('guildbank_auctions', 'multidkppool', array($this->url_id));
     $actual_bid = $this->pdh->get('guildbank_auction_bids', 'highest_value', array($this->url_id));
     $mainchar = $this->pdh->get('member', 'mainchar', array($this->user->data['user_id']));
     $points = $this->pdh->get('points', 'current', array($mainchar, $dkppool, 0, 0, false));
     $bidsteps = $this->pdh->get('guildbank_auctions', 'bidsteps', array($this->url_id));
     $bidspinner = (int) $actual_bid > 0 ? $actual_bid + $bidsteps : $this->pdh->get('guildbank_auctions', 'startvalue', array($this->url_id));
     $this->pdh->get('guildbank_auctions', 'counterJS');
     $this->tpl->assign_vars(array('ROUTING_BANKER' => $this->routing->build('guildbank'), 'ERROR_WARNING' => !$this->url_id || !$this->user->is_signedin() ? true : false, 'DD_MYCHARS' => new hdropdown('memberid', array('value' => $mainchar, 'options' => $this->pdh->aget('member', 'name', 0, array($this->pdh->get('member', 'connection_id', array($this->user->data['user_id'])))))), 'MY_DKPPOINTS' => $points . ' ' . $this->config->get('dkp_name'), 'BID_SPINNER' => new hspinner('bidvalue', array('value' => $bidspinner, 'step' => 10, 'min' => $bidspinner, 'max' => $points, 'onlyinteger' => true)), 'TIMELEFT' => $this->pdh->get('guildbank_auctions', 'atime_left_html', array($this->url_id)), 'BIDS_TABLE' => $hptt_bids->get_html_table($this->in->get('sort'), $page_suffix, $this->in->get('start', 0), $this->user->data['user_ilimit'], $footer_bids), 'PAGINATION_BIDS' => generate_pagination($this->routing->build('guildauction') . $sort_suffix, $bids_count, $this->user->data['user_ilimit'], $this->in->get('start', 0))));
     $this->core->set_vars(array('page_title' => $this->user->lang('gb_auction_window'), 'template_path' => $this->pm->get_data('guildbank', 'template_path'), 'template_file' => 'auction.html', 'display' => true));
 }
Esempio n. 18
0
 public function display()
 {
     if ($this->in->get('from') && $this->in->get('to')) {
         if (!$this->in->exists('timestamps')) {
             $date1 = $this->time->fromformat($this->in->get('from'));
             $date2 = $this->time->fromformat($this->in->get('to'));
             $date2 += 86400;
             // Includes raids/items ON that day
         } else {
             $date1 = $this->in->get('from');
             $date2 = $this->in->get('to');
         }
         $date_suffix = '&amp;timestamps=1&amp;from=' . $date1 . '&amp;to=' . $date2;
         $view_list = $this->pdh->get('raid', 'raididsindateinterval', array($date1, $date2));
         $date2 -= 86400;
         // Shows THAT day
     } else {
         $view_list = $this->pdh->get('raid', 'id_list');
         $date1 = $date2 = time();
         $date_suffix = '';
     }
     //Sort
     $sort = $this->in->get('sort');
     $sort_suffix = '&amp;sort=' . $sort;
     //redirect on member management
     if ($this->in->exists('manage_b') && $this->in->get('manage_b') == $this->user->lang('manage_raids')) {
         $manage_link = './admin/listraids.php';
         redirect($manage_link);
     }
     $start = $this->in->get('start', 0);
     $pagination_suffix = $start ? '&amp;start=' . $start : '';
     //Output
     $hptt_page_settings = $this->pdh->get_page_settings('listraids', 'hptt_listraids_raidlist');
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $view_list, array('%link_url%' => 'viewraid.php', '%link_url_suffix%' => ''));
     //footer
     $raid_count = count($view_list);
     $footer_text = sprintf($this->user->lang('listraids_footcount'), $raid_count, $this->user->data['user_rlimit']);
     $this->tpl->assign_vars(array('MANAGE_LINK' => $this->user->check_auth('a_raid_', false) ? '<a href="admin/manage_raids.php' . $this->SID . '" title="' . $this->user->lang('manage_raids') . '"><img src="' . $this->root_path . 'images/glyphs/edit.png" alt="' . $this->user->lang('manage_raids') . '" /></a>' : '', 'PAGE_OUT' => $hptt->get_html_table($sort, $pagination_suffix . $date_suffix, $start, $this->user->data['user_rlimit'], $footer_text), 'RAID_PAGINATION' => generate_pagination('listraids.php' . $this->SID . $sort_suffix . $date_suffix, $raid_count, $this->user->data['user_rlimit'], $start), 'DATEPICK_DATE_FROM' => $this->jquery->Calendar('from', $this->time->user_date($date1, false, false, false, function_exists('date_create_from_format'))), 'DATEPICK_DATE_TO' => $this->jquery->Calendar('to', $this->time->user_date($date2, false, false, false, function_exists('date_create_from_format')))));
     $this->core->set_vars(array('page_title' => $this->user->lang('listraids_title'), 'template_file' => 'listraids.html', 'display' => true));
 }
Esempio n. 19
0
 public function display()
 {
     //Sort
     $sort = $this->in->get('sort');
     $sort_suffix = '&amp;sort=' . $sort;
     $start = 0;
     $pagination_suffix = '';
     if ($this->in->exists('start')) {
         $start = $this->in->get('start', 0);
         $pagination_suffix = '&amp;start=' . $start;
     }
     //Output
     $view_list = $this->pdh->get('event', 'id_list');
     //footer
     $event_count = count($view_list);
     $footer_text = sprintf($this->user->lang('listevents_footcount'), $event_count, $this->user->data['user_elimit']);
     $hptt_page_settings = $this->pdh->get_page_settings('listevents', 'hptt_listevents_eventlist');
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $view_list, array('%link_url%' => $this->routing->simpleBuild('events'), '%link_url_suffix%' => '', '%use_controller%' => true));
     $hptt->setPageRef($this->strPath);
     $this->tpl->assign_vars(array('EVENT_OUT' => $hptt->get_html_table($sort, $pagination_suffix, $start, $this->user->data['user_elimit'], $footer_text), 'EVENT_PAGINATION' => generate_pagination($this->strPath . $this->SID . $sort_suffix, $event_count, $this->user->data['user_elimit'], $start)));
     $this->set_vars(array('template_file' => 'listevents.html', 'display' => true));
 }
Esempio n. 20
0
 public function display()
 {
     $groupID = $this->url_id;
     if ($this->pdh->get('user_groups', 'hide', array($groupID))) {
         redirect($this->controller_path_plain . 'User/' . $this->SID);
     }
     //Sort
     $sort = $this->in->get('sort');
     $sort_suffix = '&amp;sort=' . $sort . '&amp;g=' . $groupID;
     $start = $this->in->get('start', 0);
     $pagination_suffix = $start ? '&amp;start=' . $start . '&amp;g=' . $groupID : '';
     $arrUsers = $this->pdh->get('user_groups_users', 'user_list', array($groupID));
     $view_list = $view_list_grpleader = array();
     foreach ($arrUsers as $user_id) {
         if ($this->pdh->get('user_groups_users', 'is_grpleader', array($user_id, $groupID))) {
             $view_list_grpleader[] = $user_id;
         } else {
             $view_list[] = $user_id;
         }
     }
     //Output
     $hptt_page_settings = $this->pdh->get_page_settings('listusers', 'hptt_listusers_userlist');
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $view_list, array('%link_url%' => $this->routing->simpleBuild('user'), '%link_url_suffix%' => '', '%use_controller%' => true), $groupID);
     $hptt->setPageRef($this->strPath);
     //footer
     $user_count = count($view_list);
     $footer_text = sprintf($this->user->lang('listusers_footcount'), $user_count, $this->user->data['user_rlimit']);
     $this->tpl->add_meta('<link rel="canonical" href="' . $this->env->link . $this->routing->build('Usergroup', $this->pdh->get('user_groups', 'name', array($groupID)), $groupID, false, true) . '" />');
     $this->tpl->assign_vars(array('PAGE_OUT' => $hptt->get_html_table($sort, $pagination_suffix, $start, $this->user->data['user_rlimit'], $footer_text), 'USER_PAGINATION' => generate_pagination($this->strPath . $this->SID . $sort_suffix, $user_count, $this->user->data['user_rlimit'], $start), 'GROUPNAME' => $this->pdh->get('user_groups', 'name', array($groupID)), 'S_DISPLAY_GROUP' => true));
     $hptt_grpleader = $this->get_hptt($hptt_page_settings, $view_list_grpleader, $view_list_grpleader, array('%link_url%' => $this->routing->simpleBuild('user'), '%link_url_suffix%' => '', '%use_controller%' => true), $groupID . '_grpleader');
     $hptt_grpleader->setPageRef($this->strPath);
     //footer
     $user_count = count($view_list_grpleader);
     $footer_text = sprintf($this->user->lang('listusers_footcount'), $user_count, $this->user->data['user_rlimit']);
     $this->tpl->assign_vars(array('PAGE_OUT_GRPLEADER' => $hptt_grpleader->get_html_table($sort, $pagination_suffix)));
     $this->jquery->Dialog('usermailer', $this->user->lang('adduser_send_mail'), array('url' => $this->server_path . "email.php" . $this->SID . "&user='******'", 'width' => '660', 'height' => '450', 'withid' => 'userid'));
     $this->core->set_vars(array('page_title' => $this->user->lang('user_list'), 'template_file' => 'listusers.html', 'display' => true));
 }
Esempio n. 21
0
function setupPage($list, $action, $idfield, $valuefield)
{
    global $token, $threadid, $TML;
    $pagination = setup_pagination($list);
    if (!empty($pagination)) {
        $page = array();
        $page['pagination'] = $pagination['pagination'];
        $page['pagination_items'] = $pagination['pagination_items'];
        $page['params'] = array('thread' => $threadid, 'token' => $token);
        $TML->assign('pagination', generate_pagination($page['pagination']));
    }
    $out = array();
    if (!empty($page['pagination_items'])) {
        foreach ($page['pagination_items'] as $v) {
            $page['params']['nextoperatorid'] = $v[$idfield];
            $params = array('servlet_root' => WEBIM_ROOT, 'servlet' => '/operator/redirect.php', 'path_vars' => $page['params']);
            $href = generate_get($params);
            $value = $v[$valuefield];
            $out[] = '<li><a href="' . $href . '" title="' . $value . '">' . $value . '</a></li>';
        }
    }
    return $out;
}
Esempio n. 22
0
        //-- add
        $u_from_user_profile = $get->url('userlist', array('mode' => 'viewprofile', POST_USERS_URL => $msg_userid), true);
        //-- fin mod : rank color system -----------------------------------------------
        $msg_subject = $row['privmsgs_subject'];
        if (count($orig_word)) {
            $msg_subject = preg_replace($orig_word, $replacement_word, $msg_subject);
        }
        $u_subject = append_sid("privmsg.{$phpEx}?folder={$folder}&amp;mode=read&amp;" . POST_POST_URL . "={$privmsg_id}");
        $msg_date = create_date($board_config['default_dateformat'], $row['privmsgs_date'], $board_config['board_timezone']);
        if ($flag == PRIVMSGS_NEW_MAIL && $folder == 'inbox') {
            $msg_subject = '<b>' . $msg_subject . '</b>';
            $msg_date = '<b>' . $msg_date . '</b>';
            $msg_username = '******' . $msg_username . '</b>';
        }
        $row_color = !($i % 2) ? $theme['td_color1'] : $theme['td_color2'];
        $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
        $i++;
        // Start Smilies Invasion Mod
        if ($board_config['allow_smilies']) {
            $msg_subject = smilies_pass($msg_subject);
        }
        // End Smilies Invasion Mod
        $template->assign_block_vars('listrow', array('ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'STYLE' => $rcs->get_colors($row), 'FROM' => $msg_username, 'SUBJECT' => $msg_subject, 'DATE' => $msg_date, 'PRIVMSG_ATTACHMENTS_IMG' => privmsgs_attachment_image($privmsg_id), 'PRIVMSG_FOLDER_IMG' => $icon_flag, 'L_PRIVMSG_FOLDER_ALT' => $icon_flag_alt, 'S_MARK_ID' => $privmsg_id, 'U_READ' => $u_subject, 'U_FROM_USER_PROFILE' => $u_from_user_profile));
    } while ($row = $db->sql_fetchrow($result));
    $template->assign_vars(array('PAGINATION' => generate_pagination("privmsg.{$phpEx}?folder={$folder}", $pm_total, $board_config['topics_per_page'], $start), 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $board_config['topics_per_page']) + 1, ceil($pm_total / $board_config['topics_per_page'])), 'L_GOTO_PAGE' => $lang['Goto_page']));
} else {
    $template->assign_vars(array('L_NO_MESSAGES' => $lang['No_messages_folder']));
    $template->assign_block_vars("switch_no_messages", array());
}
$template->pparse('body');
include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
Esempio n. 23
0
function motd(&$sqlm)
{
    global $output, $lang_motd, $lang_global, $lang_index, $action_permission, $user_lvl, $user_id, $motd_display_poster, $realm_id, $mmfpm_db;
    // minimum permission to view page
    valid_login($action_permission['read']);
    //MOTD part
    $sqlm = new SQL();
    $sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    $start_m = isset($_GET['start_m']) ? $sqlm->quote_smart($_GET['start_m']) : 0;
    if (is_numeric($start_m)) {
    } else {
        $start_m = 0;
    }
    // get all entries, need to add total to page
    $all_record_m = $sqlm->result($sqlm->query('
		SELECT count(*) 
		FROM mm_motd'), 0);
    // to delete MOTD
    if ($user_lvl >= $action_permission['delete']) {
        $output .= '
<script type="text/javascript">
	// <![CDATA[
		answerbox.btn_ok="' . $lang_global['yes_low'] . '";
		answerbox.btn_cancel="' . $lang_global['no'] . '";
		var del_motd = "motd.php?action=delete_motd&amp;id=";
	// ]]>
</script>';
    }
    $output .= '
<center>
<table class="lined">
	<tr>
		<th align="center">';
    // to add new MOTD
    if ($user_lvl >= $action_permission['insert']) {
        $output .= '
			<font size="2"><a href="motd.php?action=add_motd&amp;error=4">' . $lang_index['add_motd'] . '</a></font>';
    } else {
        $output .= '
			<font size="2">' . $lang_index['motd'] . '</a></font>
		</th>
	</tr>';
    }
    // if is there any record
    if ($all_record_m) {
        // here we get MOTD content
        $result = $sqlm->query('
			SELECT id, realmid, type, content 
			FROM mm_motd 
			WHERE realmid = ' . $realm_id . ' 
			ORDER BY id DESC 
			LIMIT ' . $start_m . ', 10');
        while ($post = $sqlm->fetch_assoc($result)) {
            $output .= '
	<tr>
		<td align="left" class="large">
			<blockquote>' . bbcode_bbc2html($post['content']) . '</blockquote>
		</td>
	</tr>
	<tr>
		<td align="left">';
            $motd_display_poster ? $output .= $post['type'] : '';
            // to delete MOTD
            if ($user_lvl >= $action_permission['delete']) {
                $output .= '
			<img src="img/cross.png" width="12" height="12" onclick="answerBox(\'' . $lang_global['delete'] . ': &lt;font color=white&gt;' . $post['id'] . '&lt;/font&gt;&lt;br /&gt;' . $lang_global['are_you_sure'] . '\', del_motd + ' . $post['id'] . ');" style="cursor:pointer;" alt="" />';
            }
            // to edit MOTD
            if ($user_lvl >= $action_permission['update']) {
                $output .= '
			<a href="motd.php?action=edit_motd&amp;error=3&amp;id=' . $post['id'] . '">
				<img src="img/edit.png" width="14" height="14" alt="" />
			</a>';
            }
            $output .= '
		</td>
	</tr>
	<tr>
		<td class="hidden"></td>
	</tr>';
        }
        $output .= '
	<tr>
		<td align="right" class="hidden">' . generate_pagination('motd.php?start=0', $all_record_m, 10, $start_m, 'start_m') . '</td>
	</tr>';
    }
    $output .= '
</table>';
}
Esempio n. 24
0
/**
* Display user notes
*/
function mcp_notes_user_view($action)
{
    global $_CLASS, $_CORE_CONFIG, $config;
    $user_id = request_var('u', 0);
    $username = request_var('username', '');
    $start = request_var('start', 0);
    $st = request_var('st', 0);
    $sk = request_var('sk', 'b');
    $sd = request_var('sd', 'd');
    $url = 'forums&amp;file=mcp&amp;i=notes&mode=user_notes';
    $sql_where = $user_id ? "user_id = {$user_id}" : "username = '******'";
    $sql = 'SELECT *
		FROM ' . CORE_USERS_TABLE . "\n\t\tWHERE {$sql_where}";
    $result = $_CLASS['core_db']->query($sql);
    $userrow = $_CLASS['core_db']->fetch_row_assoc($result);
    $_CLASS['core_db']->free_result($result);
    if (!$userrow) {
        trigger_error('NO_USER');
    }
    $user_id = $userrow['user_id'];
    $deletemark = $action === 'del_marked';
    $deleteall = $action === 'del_all';
    $marked = get_variable('marknote', 'REQUEST', false, 'array:int');
    $usernote = request_var('usernote', '', true);
    // Handle any actions
    if (($deletemark || $deleteall) && $_CLASS['forums_auth']->acl_get('a_clearlogs')) {
        $where_sql = '';
        if ($deletemark && !empty($marked)) {
            $where_sql = ' AND log_id IN (' . implode(', ', $marked) . ')';
        }
        if ($where_sql || $deleteall) {
            $sql = 'DELETE FROM ' . FORUMS_LOG_TABLE . '
				WHERE log_type = ' . LOG_USERS . " \n\t\t\t\t\tAND reportee_id = {$user_id}\n\t\t\t\t\t{$where_sql}";
            $_CLASS['core_db']->query($sql);
            add_log('admin', 'LOG_CLEAR_USER', $userrow['username']);
            $msg = $deletemark ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED';
            $redirect = generate_link($url . '&amp;u=' . $user_id);
            $_CLASS['core_display']->meta_refresh(3, $redirect);
            trigger_error($_CLASS['core_user']->lang[$msg] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
        }
    }
    if ($usernote && $action === 'add_feedback') {
        add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']);
        add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
        $redirect = generate_link($url . '&amp;u=' . $user_id);
        $_CLASS['core_display']->meta_refresh(3, $redirect);
        trigger_error($_CLASS['core_user']->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
    }
    // Generate the appropriate user information for the user we are looking at
    $rank_title = $rank_img = '';
    //get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
    $avatar_img = '';
    if (!empty($userrow['user_avatar'])) {
        switch ($userrow['user_avatar_type']) {
            case AVATAR_UPLOAD:
                $avatar_img = $_CORE_CONFIG['global']['path_avatar_upload'] . '/';
                break;
            case AVATAR_GALLERY:
                $avatar_img = $_CORE_CONFIG['global']['path_avatar_gallery'] . '/';
                break;
        }
        $avatar_img .= $userrow['user_avatar'];
        $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />';
    }
    $limit_days = array(0 => $_CLASS['core_user']->lang['ALL_ENTRIES'], 1 => $_CLASS['core_user']->lang['1_DAY'], 7 => $_CLASS['core_user']->lang['7_DAYS'], 14 => $_CLASS['core_user']->lang['2_WEEKS'], 30 => $_CLASS['core_user']->lang['1_MONTH'], 90 => $_CLASS['core_user']->lang['3_MONTHS'], 180 => $_CLASS['core_user']->lang['6_MONTHS'], 365 => $_CLASS['core_user']->lang['1_YEAR']);
    $sort_by_text = array('a' => $_CLASS['core_user']->lang['SORT_USERNAME'], 'b' => $_CLASS['core_user']->lang['SORT_DATE'], 'c' => $_CLASS['core_user']->lang['SORT_IP'], 'd' => $_CLASS['core_user']->lang['SORT_ACTION']);
    $sort_by_sql = array('a' => 'l.username', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
    $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
    gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
    // Define where and sort sql for use in displaying logs
    $sql_where = $st ? $_CLASS['core_user']->time - $st * 86400 : 0;
    $sql_sort = $sort_by_sql[$sk] . ' ' . ($sd == 'd' ? 'DESC' : 'ASC');
    $log_data = array();
    $log_count = 0;
    view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
    $_CLASS['core_template']->assign('S_USER_NOTES', false);
    if ($log_count) {
        $_CLASS['core_template']->assign('S_USER_NOTES', true);
        foreach ($log_data as $row) {
            $_CLASS['core_template']->assign_vars_array('usernotes', array('REPORT_BY' => $row['username'], 'REPORT_AT' => $_CLASS['core_user']->format_date($row['time']), 'ACTION' => $row['action'], 'IP' => $row['ip'], 'ID' => $row['id']));
        }
    }
    $pagination = generate_pagination($url . "&amp;u={$user_id}&amp;st={$st}&amp;sk={$sk}&amp;sd={$sd}", $log_count, $config['posts_per_page'], $start);
    $_CLASS['core_template']->assign_array(array('U_POST_ACTION' => generate_link($url . '&amp;u=' . $user_id), 'S_CLEAR_ALLOWED' => $_CLASS['forums_auth']->acl_get('a_clearlogs'), 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, 'L_TITLE' => $_CLASS['core_user']->get_lang('MCP_NOTES_USER'), 'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start), 'PAGINATION' => $pagination['formated'], 'PAGINATION_ARRAY' => $pagination['array'], 'TOTAL_REPORTS' => $log_count == 1 ? $_CLASS['core_user']->get_lang('LIST_REPORT') : sprintf($_CLASS['core_user']->get_lang('LIST_REPORTS'), $log_count), 'USERNAME' => $userrow['username'], 'USER_COLOR' => !empty($userrow['user_colour']) ? $userrow['user_colour'] : '', 'RANK_TITLE' => $rank_title, 'JOINED' => $_CLASS['core_user']->format_date($userrow['user_reg_date']), 'POSTS' => $userrow['user_posts'] ? $userrow['user_posts'] : 0, 'WARNINGS' => @$userrow['user_warnings'] ? $userrow['user_warnings'] : 0, 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img));
}
Esempio n. 25
0
                }
                $memberrow = array_merge(show_profile($row), array('ROW_NUMBER' => $i + ($start + 1), 'S_CUSTOM_PROFILE' => isset($cp_row['row']) && sizeof($cp_row['row']) ? true : false, 'S_GROUP_LEADER' => $is_leader, 'U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&amp;u=' . $user_id)));
                if (isset($cp_row['row']) && sizeof($cp_row['row'])) {
                    $memberrow = array_merge($memberrow, $cp_row['row']);
                }
                $template->assign_block_vars('memberrow', $memberrow);
                if (isset($cp_row['blockrow']) && sizeof($cp_row['blockrow'])) {
                    foreach ($cp_row['blockrow'] as $field_data) {
                        $template->assign_block_vars('memberrow.custom_fields', $field_data);
                    }
                }
                unset($id_cache[$user_id]);
            }
        }
        // Generate page
        $template->assign_vars(array('PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start), 'TOTAL_USERS' => $total_users == 1 ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $total_users), 'PROFILE_IMG' => $user->img('icon_user_profile', $user->lang['PROFILE']), 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']), 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']), 'WWW_IMG' => $user->img('icon_contact_www', $user->lang['WWW']), 'ICQ_IMG' => $user->img('icon_contact_icq', $user->lang['ICQ']), 'AIM_IMG' => $user->img('icon_contact_aim', $user->lang['AIM']), 'MSN_IMG' => $user->img('icon_contact_msnm', $user->lang['MSNM']), 'YIM_IMG' => $user->img('icon_contact_yahoo', $user->lang['YIM']), 'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']), 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), 'U_FIND_MEMBER' => $config['load_search'] || $auth->acl_get('a_') ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser' . ($start ? "&amp;start={$start}" : '') . (!empty($params) ? '&amp;' . implode('&amp;', $params) : '')) : '', 'U_HIDE_FIND_MEMBER' => $mode == 'searchuser' ? $u_hide_find_member : '', 'U_SORT_USERNAME' => $sort_url . '&amp;sk=a&amp;sd=' . ($sort_key == 'a' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_FROM' => $sort_url . '&amp;sk=b&amp;sd=' . ($sort_key == 'b' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_JOINED' => $sort_url . '&amp;sk=c&amp;sd=' . ($sort_key == 'c' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_POSTS' => $sort_url . '&amp;sk=d&amp;sd=' . ($sort_key == 'd' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_EMAIL' => $sort_url . '&amp;sk=e&amp;sd=' . ($sort_key == 'e' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_WEBSITE' => $sort_url . '&amp;sk=f&amp;sd=' . ($sort_key == 'f' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_LOCATION' => $sort_url . '&amp;sk=b&amp;sd=' . ($sort_key == 'b' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_ICQ' => $sort_url . '&amp;sk=g&amp;sd=' . ($sort_key == 'g' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_AIM' => $sort_url . '&amp;sk=h&amp;sd=' . ($sort_key == 'h' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_MSN' => $sort_url . '&amp;sk=i&amp;sd=' . ($sort_key == 'i' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_YIM' => $sort_url . '&amp;sk=j&amp;sd=' . ($sort_key == 'j' && $sort_dir == 'a' ? 'd' : 'a'), 'U_SORT_ACTIVE' => $auth->acl_get('u_viewonline') ? $sort_url . '&amp;sk=l&amp;sd=' . ($sort_key == 'l' && $sort_dir == 'a' ? 'd' : 'a') : '', 'U_SORT_RANK' => $sort_url . '&amp;sk=m&amp;sd=' . ($sort_key == 'm' && $sort_dir == 'a' ? 'd' : 'a'), 'U_LIST_CHAR' => $sort_url . '&amp;sk=a&amp;sd=' . ($sort_key == 'l' && $sort_dir == 'a' ? 'd' : 'a'), 'S_SHOW_GROUP' => $mode == 'group' ? true : false, 'S_VIEWONLINE' => $auth->acl_get('u_viewonline'), 'S_LEADERS_SET' => $leaders_set, 'S_MODE_SELECT' => $s_sort_key, 'S_ORDER_SELECT' => $s_sort_dir, 'S_CHAR_OPTIONS' => $s_char_options, 'S_MODE_ACTION' => $pagination_url));
}
// Output the page
page_header($page_title);
$template->set_filenames(array('body' => $template_html));
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.{$phpEx}"));
page_footer();
/**
* Prepare profile data
*/
function show_profile($data)
{
    global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
    $username = $data['username'];
    $user_id = $data['user_id'];
    $rank_title = $rank_img = $rank_img_src = '';
Esempio n. 26
0
    /**
     * Build and assign topiclist for bookmarks/subscribed topics
     */
    function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
    {
        global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx;
        $table = $mode == 'subscribed' ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;
        $start = request_var('start', 0);
        // Grab icons
        $icons = $cache->obtain_icons();
        $sql_array = array('SELECT' => 'COUNT(t.topic_id) as topics_count', 'FROM' => array($table => 'i', TOPICS_TABLE => 't'), 'WHERE' => 'i.topic_id = t.topic_id
				AND i.user_id = ' . $user->data['user_id'] . '
				AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true));
        $sql = $db->sql_build_query('SELECT', $sql_array);
        $result = $db->sql_query($sql);
        $topics_count = (int) $db->sql_fetchfield('topics_count');
        $db->sql_freeresult($result);
        if ($topics_count) {
            $template->assign_vars(array('PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => $topics_count == 1 ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)));
        }
        if ($mode == 'subscribed') {
            $sql_array = array('SELECT' => 't.*, f.forum_name, f.forum_solve_text, f.forum_solve_color, f.forum_allow_solve', 'FROM' => array(TOPICS_WATCH_TABLE => 'tw', TOPICS_TABLE => 't'), 'WHERE' => 'tw.user_id = ' . $user->data['user_id'] . '
					AND t.topic_id = tw.topic_id
					AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), 'ORDER_BY' => 't.topic_last_post_time DESC');
            $sql_array['LEFT_JOIN'] = array();
        } else {
            $sql_array = array('SELECT' => 't.*, f.forum_name, f.forum_solve_text, f.forum_solve_color, f.forum_allow_solve, b.topic_id as b_topic_id', 'FROM' => array(BOOKMARKS_TABLE => 'b'), 'WHERE' => 'b.user_id = ' . $user->data['user_id'] . '
					AND ' . $db->sql_in_set('f.forum_id', $forbidden_forum_ary, true, true), 'ORDER_BY' => 't.topic_last_post_time DESC');
            $sql_array['LEFT_JOIN'] = array();
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TABLE => 't'), 'ON' => 'b.topic_id = t.topic_id');
        }
        $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 't.forum_id = f.forum_id');
        if ($config['load_db_lastread']) {
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id']);
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_TRACK_TABLE => 'tt'), 'ON' => 'tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id']);
            $sql_array['SELECT'] .= ', tt.mark_time, ft.mark_time AS forum_mark_time';
        }
        if ($config['load_db_track']) {
            $sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id']);
            $sql_array['SELECT'] .= ', tp.topic_posted';
        }
        $sql = $db->sql_build_query('SELECT', $sql_array);
        $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
        $topic_list = $topic_forum_list = $global_announce_list = $rowset = array();
        while ($row = $db->sql_fetchrow($result)) {
            $topic_id = isset($row['b_topic_id']) ? $row['b_topic_id'] : $row['topic_id'];
            $topic_list[] = $topic_id;
            $rowset[$topic_id] = $row;
            $topic_forum_list[$row['forum_id']]['forum_mark_time'] = $config['load_db_lastread'] ? $row['forum_mark_time'] : 0;
            $topic_forum_list[$row['forum_id']]['topics'][] = $topic_id;
            if ($row['topic_type'] == POST_GLOBAL) {
                $global_announce_list[] = $topic_id;
            }
        }
        $db->sql_freeresult($result);
        $topic_tracking_info = array();
        if ($config['load_db_lastread']) {
            foreach ($topic_forum_list as $f_id => $topic_row) {
                $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), $f_id == 0 ? $global_announce_list : false);
            }
        } else {
            foreach ($topic_forum_list as $f_id => $topic_row) {
                $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics'], $global_announce_list);
            }
        }
        foreach ($topic_list as $topic_id) {
            $row =& $rowset[$topic_id];
            $forum_id = $row['forum_id'];
            $topic_id = isset($row['b_topic_id']) ? $row['b_topic_id'] : $row['topic_id'];
            $unread_topic = isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id] ? true : false;
            // Replies
            $replies = $auth->acl_get('m_approve', $forum_id) ? $row['topic_replies_real'] : $row['topic_replies'];
            if ($row['topic_status'] == ITEM_MOVED && !empty($row['topic_moved_id'])) {
                $topic_id = $row['topic_moved_id'];
            }
            // Get folder img, topic status/type related information
            $folder_img = $folder_alt = $topic_type = '';
            topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
            $view_topic_url_params = "f={$forum_id}&amp;t={$topic_id}";
            $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params);
            // Send vars to template
            $template->assign_block_vars('topicrow', array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'S_DELETED_TOPIC' => !$row['topic_id'] ? true : false, 'S_GLOBAL_TOPIC' => !$forum_id ? true : false, 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . ($row['forum_id'] ? $row['forum_id'] : $forum_id) . "&amp;t={$topic_id}")), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, 'FORUM_NAME' => $row['forum_name'], 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 'TOPIC_ICON_IMG' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => !empty($icons[$row['icon_id']]) ? $icons[$row['icon_id']]['height'] : '', 'ATTACH_ICON_IMG' => $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment'] ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => !empty($row['topic_posted']) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params . '&amp;view=unread') . '#unread', 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", $view_topic_url_params . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $forum_id), 'SOLVED_TOPIC' => $row['topic_solved'] && $row['forum_allow_solve'] ? $row['forum_solve_text'] ? $row['forum_solve_text'] : $user->img('icon_topic_solved_list', 'TOPIC_SOLVED') : '', 'U_SOLVED_TOPIC' => $row['topic_solved'] && $row['forum_allow_solve'] ? append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'p=' . $row['topic_solved'] . '#p' . $row['topic_solved']) : '', 'SOLVED_STYLE' => $row['forum_solve_color'] ? ' style="color: #' . $row['forum_solve_color'] . '"' : ''));
        }
    }
    echo $row['JobID'];
    ?>
" >View Details</a><!--<a href="edit_category.php?id=<?php 
    echo $row['JobID'];
    ?>
" >Edit</a>--></td>
        </tr>
        <?php 
    $j++;
}
?>
      </table>
      <br></td>
  </tr>
</table>
<div class="rws-pagination"><?php 
echo generate_pagination("view_recruiterjobs.php?page=viewrct&rid=" . $_GET["rid"], $totalrows, $perpage, $currentpage);
?>
</div>
            </form>
          </div>
          <div> </div>
        </div>
      </div>
    </div>
    <div id="footer"> &#169; Copyright 2010 Jobs Admin // Powered by <a href="http://www.raghwendra.com" target="_blank">Raghwendra Web Services</a> // <a href="#">Top</a></div>
  </div>
</div>
</body>
</html>
Esempio n. 28
0
 /**
  * main Settings function
  *
  * @param int $id
  * @param String $mode
  */
 function main($id, $mode)
 {
     global $db, $user, $template, $cache, $config, $phpbb_admin_path, $phpEx;
     $link = '<br /><a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=mainpage") . '"><h3>' . $user->lang['RETURN_DKPINDEX'] . '</h3></a>';
     switch ($mode) {
         /**
          * MAINPAGE
          */
         case 'mainpage':
             $sql = 'SELECT count(*) as member_count FROM ' . MEMBER_LIST_TABLE . " WHERE member_status='0'";
             $result = $db->sql_query($sql);
             $total_members_inactive = (int) $db->sql_fetchfield('member_count');
             $sql = 'SELECT count(*) as member_count FROM ' . MEMBER_LIST_TABLE . " WHERE member_status='1'";
             $result = $db->sql_query($sql);
             $total_members_active = (int) $db->sql_fetchfield('member_count');
             $total_members = $total_members_active . ' / ' . $total_members_inactive;
             $sql = 'SELECT count(*) as dkp_count  FROM ' . MEMBER_DKP_TABLE;
             $result = $db->sql_query($sql);
             $total_dkpcount = (int) $db->sql_fetchfield('dkp_count');
             $sql = 'SELECT count(*) as pool_count  FROM ' . DKPSYS_TABLE;
             $result = $db->sql_query($sql);
             $total_poolcount = (int) $db->sql_fetchfield('pool_count');
             $sql = 'SELECT count(*) as adjustment_count  FROM ' . ADJUSTMENTS_TABLE;
             $result = $db->sql_query($sql);
             $total_adjustmentcount = (int) $db->sql_fetchfield('adjustment_count');
             $sql = 'SELECT count(*) as event_count  FROM ' . EVENTS_TABLE;
             $result = $db->sql_query($sql);
             $total_eventcount = (int) $db->sql_fetchfield('event_count');
             $sql = 'SELECT count(*) as guild_count  FROM ' . GUILD_TABLE;
             $result = $db->sql_query($sql);
             $total_guildcount = (int) $db->sql_fetchfield('guild_count');
             $total_raids = 0;
             $sql = 'SELECT count(*) as raid_count  FROM ' . RAIDS_TABLE;
             $result = $db->sql_query($sql);
             $total_raids = (int) $db->sql_fetchfield('raid_count');
             $days = (time() - $config['bbdkp_eqdkp_start']) / 86400;
             $raids_per_day = sprintf("%.2f", $total_raids / $days);
             $sql = 'SELECT count(*) as item_count FROM ' . RAID_ITEMS_TABLE;
             if ($raids_per_day > $total_raids) {
                 $raids_per_day = $total_raids;
             }
             $total_items = (int) $db->sql_fetchfield('item_count');
             $db->sql_freeresult($result);
             $items_per_day = sprintf("%.2f", $total_items / $days);
             if ($items_per_day > $total_items) {
                 $items_per_day = $total_items;
             }
             if ($config['bbdkp_eqdkp_start'] != 0) {
                 $bbdkp_started = date($config['bbdkp_date_format'], $config['bbdkp_eqdkp_start']);
             } else {
                 $bbdkp_started = '';
             }
             // read verbose log
             $logs = \bbdkp\admin\log::Instance();
             $listlogs = $logs->read_log('', false, true, '', '');
             if (isset($listlogs)) {
                 foreach ($listlogs as $key => $log) {
                     $template->assign_block_vars('actions_row', array('U_VIEW_LOG' => append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=dkp&amp;mode=dkp_logs&amp;' . URI_LOG . '=' . $log['log_id']), 'LOGDATE' => $log['datestamp'], 'ACTION' => $log['log_line']));
                 }
             }
             $latest_version_info = false;
             if (($latest_version_info = parent::get_productversion('bbdkp', request_var('versioncheck_force', false))) === false) {
                 $template->assign_var('S_VERSIONCHECK_FAIL', true);
             } else {
                 if (phpbb_version_compare($latest_version_info, $config['bbdkp_version'], '<=')) {
                     $template->assign_vars(array('S_VERSION_UP_TO_DATE' => true));
                 } else {
                     // you have an old version
                     $template->assign_vars(array('BBDKP_NOT_UP_TO_DATE_TITLE' => sprintf($user->lang['NOT_UP_TO_DATE_TITLE'], 'bbDKP'), 'BBDKP_LATESTVERSION' => $latest_version_info[0], 'BBDKPVERSION' => $user->lang['BBDKP_YOURVERSION'] . $config['bbdkp_version'], 'UPDATEINSTR' => $user->lang['BBDKP_LATESTVERSION'] . $latest_version_info[0] . ', <a href="' . $user->lang['WEBURL'] . '">' . $user->lang['DOWNLOAD'] . '</a>'));
                 }
             }
             //LOOP PLUGINS TABLE
             $plugin_versioninfo = (array) parent::get_plugin_info(request_var('versioncheck_force', false));
             foreach ($plugin_versioninfo as $pname => $pdetails) {
                 $a = phpbb_version_compare(trim($pdetails['latest']), $pdetails['version'], '<=');
                 $template->assign_block_vars('plugin_row', array('PLUGINNAME' => ucwords($pdetails['name']), 'VERSION' => $pdetails['version'], 'ISUPTODATE' => phpbb_version_compare(trim($pdetails['latest']), $pdetails['version'], '<='), 'LATESTVERSION' => $pdetails['latest'], 'UPDATEINSTR' => '<a href="' . BBDKP_PLUGINURL . '">' . $user->lang['DOWNLOAD_LATEST_PLUGINS'] . $pdetails['latest'] . '</a>', 'INSTALLDATE' => $pdetails['installdate']));
             }
             $template->assign_vars(array('GLYPH' => "{$phpbb_admin_path}/images/glyphs/view.gif", 'NUMBER_OF_MEMBERS' => $total_members, 'NUMBER_OF_RAIDS' => $total_raids, 'NUMBER_OF_ITEMS' => $total_items, 'NUMBER_OF_MEMBERDKP' => $total_dkpcount, 'NUMBER_OF_DKPSYS' => $total_poolcount, 'NUMBER_OF_GUILDS' => $total_guildcount, 'NUMBER_OF_EVENTS' => $total_eventcount, 'NUMBER_OF_ADJUSTMENTS' => $total_adjustmentcount, 'RAIDS_PER_DAY' => $raids_per_day, 'ITEMS_PER_DAY' => $items_per_day, 'BBDKP_STARTED' => $bbdkp_started, 'BBDKP_VERSION' => $config['bbdkp_version'], 'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=mainpage&amp;versioncheck_force=1"), 'GAMES_INSTALLED' => count($this->games) > 0 ? implode(", ", $this->games) : $user->lang['NA']));
             $this->page_title = 'ACP_DKP_MAINPAGE';
             $this->tpl_name = 'dkp/acp_mainpage';
             break;
             /**
              *
              * DKP CONFIG
              */
         /**
          *
          * DKP CONFIG
          */
         case 'dkp_config':
             $action = request_var('action', '');
             switch ($action) {
                 case 'addconfig':
                     if (!check_form_key('acp_dkp')) {
                         trigger_error($user->lang['FV_FORMVALIDATION'], E_USER_WARNING);
                     }
                     $day = request_var('bbdkp_start_dd', 0);
                     $month = request_var('bbdkp_start_mm', 0);
                     $year = request_var('bbdkp_start_yy', 0);
                     $bbdkp_start = mktime(0, 0, 0, $month, $day, $year);
                     $settings = array('bbdkp_default_realm' => utf8_normalize_nfc(request_var('realm', '', true)), 'bbdkp_default_region' => utf8_normalize_nfc(request_var('region', '', true)), 'bbdkp_dkp_name' => utf8_normalize_nfc(request_var('dkp_name', '', true)), 'bbdkp_eqdkp_start' => $bbdkp_start, 'bbdkp_user_nlimit' => request_var('bbdkp_user_nlimit', 0), 'bbdkp_date_format' => request_var('date_format', ''), 'bbdkp_date_format' => request_var('date_format', ''), 'bbdkp_lang' => request_var('language', 'en'), 'bbdkp_maxchars' => request_var('maxchars', 2), 'bbdkp_minrosterlvl' => request_var('bbdkp_minrosterlvl', 0), 'bbdkp_roster_layout' => request_var('rosterlayout', 0), 'bbdkp_show_achiev' => request_var('showachievement', 0), 'bbdkp_hide_inactive' => isset($_POST['hide_inactive']) ? request_var('hide_inactive', '') : '0', 'bbdkp_inactive_period' => request_var('inactive_period', 0), 'bbdkp_list_p1' => request_var('list_p1', 0), 'bbdkp_list_p2' => request_var('list_p2', 0), 'bbdkp_list_p3' => request_var('list_p3', 0), 'bbdkp_user_llimit' => request_var('bbdkp_user_llimit', 0), 'bbdkp_user_elimit' => request_var('bbdkp_user_elimit', 0), 'bbdkp_event_viewall' => isset($_POST['event_viewall']) ? request_var('event_viewall', '') : '0', 'bbdkp_user_elimit' => request_var('bbdkp_user_elimit', 0), 'bbdkp_user_alimit' => request_var('bbdkp_user_alimit', 0), 'bbdkp_active_point_adj' => request_var('bbdkp_active_point_adj', 0.0), 'bbdkp_inactive_point_adj' => request_var('bbdkp_inactive_point_adj', 0.0), 'bbdkp_starting_dkp' => request_var('starting_dkp', 0.0), 'bbdkp_user_ilimit' => request_var('bbdkp_user_ilimit', 0), 'bbdkp_user_rlimit' => request_var('bbdkp_user_rlimit', 0));
                     set_config('bbdkp_default_realm', $settings['bbdkp_default_realm'], true);
                     set_config('bbdkp_default_region', $settings['bbdkp_default_region'], true);
                     set_config('bbdkp_dkp_name', $settings['bbdkp_dkp_name'], true);
                     set_config('bbdkp_eqdkp_start', $settings['bbdkp_eqdkp_start'], true);
                     set_config('bbdkp_user_nlimit', $settings['bbdkp_user_nlimit'], true);
                     set_config('bbdkp_date_format', $settings['bbdkp_date_format'], true);
                     set_config('bbdkp_lang', $settings['bbdkp_lang'], true);
                     set_config('bbdkp_maxchars', $settings['bbdkp_maxchars'], true);
                     //roster
                     set_config('bbdkp_minrosterlvl', $settings['bbdkp_minrosterlvl'], true);
                     set_config('bbdkp_roster_layout', $settings['bbdkp_roster_layout'], true);
                     set_config('bbdkp_show_achiev', $settings['bbdkp_show_achiev'], true);
                     //standings
                     set_config('bbdkp_hide_inactive', $settings['bbdkp_hide_inactive'], true);
                     set_config('bbdkp_inactive_period', $settings['bbdkp_inactive_period'], true);
                     set_config('bbdkp_list_p1', $settings['bbdkp_list_p1'], true);
                     set_config('bbdkp_list_p2', $settings['bbdkp_list_p2'], true);
                     set_config('bbdkp_list_p3', $settings['bbdkp_list_p3'], true);
                     set_config('bbdkp_user_llimit', $settings['bbdkp_user_llimit'], true);
                     //events
                     set_config('bbdkp_user_elimit', $settings['bbdkp_user_elimit'], true);
                     set_config('bbdkp_event_viewall', $settings['bbdkp_event_viewall'], true);
                     //adjustments
                     set_config('bbdkp_user_alimit', $settings['bbdkp_user_alimit'], true);
                     set_config('bbdkp_active_point_adj', $settings['bbdkp_active_point_adj'], true);
                     set_config('bbdkp_inactive_point_adj', $settings['bbdkp_inactive_point_adj'], true);
                     set_config('bbdkp_starting_dkp', $settings['bbdkp_starting_dkp'], true);
                     //items
                     set_config('bbdkp_user_ilimit', $settings['bbdkp_user_ilimit'], true);
                     //raids
                     set_config('bbdkp_user_rlimit', $settings['bbdkp_user_rlimit'], true);
                     // reg id
                     set_config('bbdkp_regid', 1, true);
                     $cache->destroy('config');
                     //
                     // Logging
                     //
                     $log_action = array('header' => 'L_ACTION_SETTINGS_CHANGED', 'L_SETTINGS' => json_encode($settings));
                     $this->log_insert(array('log_type' => 'L_ACTION_SETTINGS_CHANGED', 'log_action' => $log_action));
                     trigger_error($user->lang['ACTION_SETTINGS_CHANGED'] . $link, E_USER_NOTICE);
                     break;
                 case 'register':
                     $regdata = array('domainname' => request_var('domainname', ''), 'phpbbversion' => request_var('phpbbversion', ''), 'bbdkpversion' => request_var('bbdkpversion', ''));
                     $this->post_register_request($regdata);
             }
             $s_lang_options = '';
             foreach ($this->languagecodes as $lang => $langname) {
                 $selected = $config['bbdkp_lang'] == $lang ? ' selected="selected"' : '';
                 $s_lang_options .= '<option value="' . $lang . '" ' . $selected . '> ' . $langname . '</option>';
             }
             $template->assign_block_vars('hide_row', array('VALUE' => "YES", 'SELECTED' => $config['bbdkp_hide_inactive'] == 1 ? ' selected="selected"' : '', 'OPTION' => "YES"));
             $template->assign_block_vars('hide_row', array('VALUE' => "NO", 'SELECTED' => $config['bbdkp_hide_inactive'] == 0 ? ' selected="selected"' : '', 'OPTION' => "NO"));
             // Default Region
             foreach ($this->regions as $regionid => $regionvalue) {
                 $template->assign_block_vars('region_row', array('VALUE' => $regionid, 'SELECTED' => $regionid == $config['bbdkp_default_region'] ? ' selected="selected"' : '', 'OPTION' => $regionvalue));
             }
             //roster layout
             $rosterlayoutlist = array(0 => $user->lang['ARM_STAND'], 1 => $user->lang['ARM_CLASS']);
             foreach ($rosterlayoutlist as $lid => $lname) {
                 $template->assign_block_vars('rosterlayout_row', array('VALUE' => $lid, 'SELECTED' => $lid == $config['bbdkp_roster_layout'] ? ' selected="selected"' : '', 'OPTION' => $lname));
             }
             $template->assign_vars(array('S_LANG_OPTIONS' => $s_lang_options, 'REALM' => $config['bbdkp_default_realm'], 'EQDKP_START_DD' => date('d', $config['bbdkp_eqdkp_start']), 'EQDKP_START_MM' => date('m', $config['bbdkp_eqdkp_start']), 'EQDKP_START_YY' => date('Y', $config['bbdkp_eqdkp_start']), 'DATE_FORMAT' => $config['bbdkp_date_format'], 'DKP_NAME' => $config['bbdkp_dkp_name'], 'DEFAULT_GAME' => count($this->games) > 0 ? implode(", ", $this->games) : $user->lang['NA'], 'HIDE_INACTIVE_YES_CHECKED' => $config['bbdkp_hide_inactive'] == '1' ? ' checked="checked"' : '', 'HIDE_INACTIVE_NO_CHECKED' => $config['bbdkp_hide_inactive'] == '0' ? ' checked="checked"' : '', 'USER_ELIMIT' => $config['bbdkp_user_elimit'], 'EVENT_VIEWALL_YES_CHECKED' => $config['bbdkp_event_viewall'] == '1' ? ' checked="checked"' : '', 'EVENT_VIEWALL_NO_CHECKED' => $config['bbdkp_event_viewall'] == '0' ? ' checked="checked"' : '', 'USER_NLIMIT' => $config['bbdkp_user_nlimit'], 'INACTIVE_PERIOD' => $config['bbdkp_inactive_period'], 'LIST_P1' => $config['bbdkp_list_p1'], 'LIST_P2' => $config['bbdkp_list_p2'], 'LIST_P3' => $config['bbdkp_list_p3'], 'F_SHOWACHIEV' => $config['bbdkp_show_achiev'], 'USER_ALIMIT' => $config['bbdkp_user_alimit'], 'STARTING_DKP' => $config['bbdkp_starting_dkp'], 'INACTIVE_POINT' => $config['bbdkp_inactive_point_adj'], 'ACTIVE_POINT' => $config['bbdkp_active_point_adj'], 'USER_ILIMIT' => $config['bbdkp_user_ilimit'], 'USER_RLIMIT' => $config['bbdkp_user_rlimit'], 'MAXCHARS' => $config['bbdkp_maxchars'], 'USER_LLIMIT' => $config['bbdkp_user_llimit'], 'MINLEVEL' => $config['bbdkp_minrosterlvl'], 'U_REGISTER' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_config&amp;action=register"), 'U_ADDCONFIG' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_config&amp;action=addconfig"), 'DOMAINNAME' => $_SERVER['HTTP_HOST'], 'PHPBBVER' => $config['version'], 'BBDKPVER' => $config['bbdkp_version'], 'REGID' => isset($config['bbdkp_regid']) ? $config['bbdkp_regid'] : '', 'S_BBDKPREGISTERED' => isset($config['bbdkp_regid']) ? $config['bbdkp_regid'] : ''));
             add_form_key('acp_dkp');
             $this->page_title = 'ACP_DKP_CONFIG';
             $this->tpl_name = 'dkp/acp_' . $mode;
             break;
             /**
              * PORTAL CONFIG
              */
         /**
          * PORTAL CONFIG
          */
         case 'dkp_indexpageconfig':
             $submit = isset($_POST['update']) ? true : false;
             if ($submit) {
                 if (!check_form_key('acp_dkp_portal')) {
                     trigger_error($user->lang['FV_FORMVALIDATION'], E_USER_WARNING);
                 }
                 if (isset($config['bbdkp_gameworld_version'])) {
                     set_config('bbdkp_portal_bossprogress', request_var('show_bosspblock', 0), true);
                 }
                 set_config('bbdkp_news_forumid', request_var('news_id', 0), true);
                 set_config('bbdkp_n_news', request_var('n_news', 0), true);
                 set_config('bbdkp_n_items', request_var('n_items', 0), true);
                 set_config('bbdkp_recruitment', request_var('bbdkp_recruitment', 0), true);
                 set_config('bbdkp_portal_loot', request_var('show_lootblock', 0), true);
                 set_config('bbdkp_portal_recruitment', request_var('show_recrblock', 0), true);
                 set_config('bbdkp_portal_links', request_var('show_linkblock', 0), true);
                 set_config('bbdkp_portal_menu', request_var('show_menublock', 0), true);
                 set_config('bbdkp_portal_welcomemsg', request_var('show_welcomeblock', 0), true);
                 set_config('bbdkp_portal_recent', request_var('show_recenttopics', 0), true);
                 set_config('bbdkp_portal_rtlen', request_var('n_rclength', 0), true);
                 set_config('bbdkp_portal_rtno', request_var('n_rcno', 0), true);
                 set_config('bbdkp_portal_newmembers', request_var('show_newmembers', 0), true);
                 set_config('bbdkp_portal_maxnewmembers', request_var('num_newmembers', 0), true);
                 set_config('bbdkp_portal_whoisonline', request_var('show_onlineblock', 0), true);
                 set_config('bbdkp_portal_onlineblockposition', request_var('onlineblockposition', 0), true);
                 $cache->destroy('config');
                 $welcometext = utf8_normalize_nfc(request_var('welcome_message', '', true));
                 $uid = $bitfield = $options = '';
                 // will be modified by generate_text_for_storage
                 $allow_bbcode = $allow_urls = $allow_smilies = true;
                 generate_text_for_storage($welcometext, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
                 $sql = 'UPDATE ' . WELCOME_MSG_TABLE . " SET\n\t\t\t\t\t\t\twelcome_msg = '" . (string) $db->sql_escape($welcometext) . "' ,\n\t\t\t\t\t\t\twelcome_timestamp = " . (int) time() . " ,\n\t\t\t\t\t\t\tbbcode_bitfield = \t'" . (string) $bitfield . "' ,\n\t\t\t\t\t\t\tbbcode_uid = \t\t'" . (string) $uid . "'\n\t\t\t\t\t\t\tWHERE welcome_id = 1";
                 $db->sql_query($sql);
                 trigger_error($user->lang['ADMIN_PORTAL_SETTINGS_SAVED'] . $link, E_USER_NOTICE);
             }
             // get welcome msg
             $sql = 'SELECT welcome_msg, bbcode_bitfield, bbcode_uid FROM ' . WELCOME_MSG_TABLE;
             $db->sql_query($sql);
             $result = $db->sql_query($sql);
             while ($row = $db->sql_fetchrow($result)) {
                 $welcometext = $row['welcome_msg'];
                 $bitfield = $row['bbcode_bitfield'];
                 $uid = $row['bbcode_uid'];
             }
             $textarr = generate_text_for_edit($welcometext, $uid, $bitfield, 7);
             // number of news and items to show on front page
             $n_news = $config['bbdkp_n_news'];
             $n_items = $config['bbdkp_n_items'];
             add_form_key('acp_dkp_portal');
             if (isset($config['bbdkp_gameworld_version'])) {
                 $template->assign_vars(array('S_BP_SHOW' => true, 'SHOW_BOSS_YES_CHECKED' => $config['bbdkp_portal_bossprogress'] == '1' ? ' checked="checked"' : '', 'SHOW_BOSS_NO_CHECKED' => $config['bbdkp_portal_bossprogress'] == '0' ? ' checked="checked"' : ''));
             } else {
                 $template->assign_var('S_BP_SHOW', false);
             }
             $template->assign_vars(array('WELCOME_MESSAGE' => $textarr['text'], 'N_NEWS' => $n_news, 'FORUM_NEWS_OPTIONS' => make_forum_select($config['bbdkp_news_forumid'], false, false, true), 'SHOW_WELCOME_YES_CHECKED' => $config['bbdkp_portal_welcomemsg'] == '1' ? 'checked="checked"' : '', 'SHOW_WELCOME_NO_CHECKED' => $config['bbdkp_portal_welcomemsg'] == '0' ? 'checked="checked"' : '', 'SHOW_ONLINE_YES_CHECKED' => $config['bbdkp_portal_whoisonline'] == '1' ? 'checked="checked"' : '', 'SHOW_ONLINE_NO_CHECKED' => $config['bbdkp_portal_whoisonline'] == '0' ? 'checked="checked"' : '', 'SHOW_ONLINE_BOTTOM_CHECKED' => $config['bbdkp_portal_onlineblockposition'] == '1' ? 'checked="checked"' : '', 'SHOW_ONLINE_SIDE_CHECKED' => $config['bbdkp_portal_onlineblockposition'] == '0' ? 'checked="checked"' : '', 'SHOW_REC_YES_CHECKED' => $config['bbdkp_portal_recruitment'] == '1' ? ' checked="checked"' : '', 'SHOW_REC_NO_CHECKED' => $config['bbdkp_portal_recruitment'] == '0' ? ' checked="checked"' : '', 'SHOW_LOOT_YES_CHECKED' => $config['bbdkp_portal_loot'] == '1' ? ' checked="checked"' : '', 'SHOW_LOOT_NO_CHECKED' => $config['bbdkp_portal_loot'] == '0' ? ' checked="checked"' : '', 'N_ITEMS' => $n_items, 'N_RTNO' => $config['bbdkp_portal_rtno'], 'N_RTLENGTH' => $config['bbdkp_portal_rtlen'], 'SHOW_RT_YES_CHECKED' => $config['bbdkp_portal_recent'] == '1' ? ' checked="checked"' : '', 'SHOW_RT_NO_CHECKED' => $config['bbdkp_portal_recent'] == '0' ? ' checked="checked"' : '', 'SHOW_LINK_YES_CHECKED' => $config['bbdkp_portal_links'] == '1' ? ' checked="checked"' : '', 'SHOW_LINK_NO_CHECKED' => $config['bbdkp_portal_links'] == '0' ? ' checked="checked"' : '', 'SHOW_MENU_YES_CHECKED' => $config['bbdkp_portal_menu'] == '1' ? ' checked="checked"' : '', 'SHOW_MENU_NO_CHECKED' => $config['bbdkp_portal_menu'] == '0' ? ' checked="checked"' : '', 'SHOW_NEWM_YES_CHECKED' => $config['bbdkp_portal_newmembers'] == '1' ? ' checked="checked"' : '', 'SHOW_NEWM_NO_CHECKED' => $config['bbdkp_portal_newmembers'] == '0' ? ' checked="checked"' : '', 'N_NUMNEWM' => $config['bbdkp_portal_maxnewmembers']));
             $this->page_title = $user->lang['ACP_INDEXPAGE'];
             $this->tpl_name = 'dkp/acp_' . $mode;
             break;
             /**
              * DKP LOGS
              *
              **/
         /**
          * DKP LOGS
          *
          **/
         case 'dkp_logs':
             $this->page_title = 'ACP_DKP_LOGS';
             $this->tpl_name = 'dkp/acp_' . $mode;
             $logs = \bbdkp\admin\log::Instance();
             $log_id = isset($_GET[URI_LOG]) ? request_var(URI_LOG, 0) : false;
             $search = isset($_GET['search']) ? true : false;
             if ($log_id) {
                 $action = 'view';
             } else {
                 $action = 'list';
             }
             switch ($action) {
                 case 'list':
                     $deletemark = isset($_POST['delmarked']) ? true : false;
                     $marked = request_var('mark', array(0));
                     $search_term = request_var('search', '');
                     $start = request_var('start', 0);
                     if ($deletemark) {
                         global $db, $user, $phpEx;
                         //if marked array isnt empty
                         if (sizeof($marked) && is_array($marked)) {
                             if (confirm_box(true)) {
                                 $marked = request_var('mark', array(0));
                                 $logs = \bbdkp\admin\log::Instance();
                                 $log_action = array('header' => 'L_ACTION_LOG_DELETED', 'L_ADDED_BY' => $user->data['username'], 'L_LOG_ID' => implode(",", $logs->delete_log($marked)));
                                 $this->log_insert(array('log_type' => $log_action['header'], 'log_action' => $log_action));
                                 //redirect to listing
                                 $meta_info = append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs");
                                 meta_refresh(3, $meta_info);
                                 $message = '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs") . '">' . $user->lang['RETURN_LOG'] . '</a><br />' . sprintf($user->lang['ADMIN_LOG_DELETE_SUCCESS'], implode($marked));
                                 trigger_error($message, E_USER_WARNING);
                             } else {
                                 // display confirmation
                                 confirm_box(false, $user->lang['CONFIRM_DELETE_BBDKPLOG'], build_hidden_fields(array('delmarked' => true, 'mark' => $marked)));
                             }
                             // they hit no
                             $message = '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs") . '">' . $user->lang['RETURN_LOG'] . '</a><br />' . sprintf($user->lang['ADMIN_LOG_DELETE_FAIL'], implode($marked));
                             trigger_error($message, E_USER_WARNING);
                         }
                     }
                     $sort_order = array(0 => array('log_id desc', 'log_id'), 1 => array('log_date desc', 'log_date'), 2 => array('log_type', 'log_type desc'), 3 => array('username', 'username dsec'), 4 => array('log_ipaddress', 'log_ipaddress desc'), 5 => array('log_result', 'log_result desc'));
                     $current_order = $this->switch_order($sort_order);
                     $verbose = true;
                     $listlogs = $logs->read_log($current_order['sql'], $search, $verbose, $search_term, $start);
                     foreach ($listlogs as $key => $log) {
                         $template->assign_block_vars('logs_row', array('ID' => $log['log_id'], 'DATE' => $log['datestamp'], 'TYPE' => $log['log_type'], 'U_VIEW_LOG' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs&amp;" . URI_LOG . '=' . $log['log_id'] . '&amp;search=' . $search_term . '&amp;start=' . $start . '&amp;'), 'VERBOSE' => $verbose, 'USER' => $log['username'], 'ACTION' => $log['log_line'], 'IP' => $log['log_ipaddress'], 'RESULT' => $log['log_result'], 'C_RESULT' => $log['cssresult'], 'ENCODED_TYPE' => urlencode($log['log_type']), 'ENCODED_USER' => urlencode($log['username']), 'ENCODED_IP' => urlencode($log['log_ipaddress'])));
                     }
                     $logcount = $logs->getTotalLogs();
                     $template->assign_vars(array('S_LIST' => true, 'L_TITLE' => $user->lang['ACP_DKP_LOGS'], 'L_EXPLAIN' => $user->lang['ACP_DKP_LOGS_EXPLAIN'], 'O_DATE' => $current_order['uri'][0], 'O_TYPE' => $current_order['uri'][1], 'O_USER' => $current_order['uri'][2], 'O_IP' => $current_order['uri'][3], 'O_RESULT' => $current_order['uri'][4], 'U_LOGS' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs&amp;") . '&amp;search=' . $search_term . '&amp;start=' . $start . '&amp;', 'U_LOGS_SEARCH' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs"), 'CURRENT_ORDER' => $current_order['uri']['current'], 'START' => $start, 'VIEWLOGS_FOOTCOUNT' => sprintf($user->lang['VIEWLOGS_FOOTCOUNT'], $logcount, USER_LLIMIT), 'VIEWLOGS_PAGINATION' => generate_pagination(append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs&amp;") . '&amp;search=' . $search_term . '&amp;o=' . $current_order['uri']['current'], $logcount, USER_LLIMIT, $start)));
                     break;
                 case 'view':
                     $viewlog = $logs->get_logentry($log_id);
                     $log_actionxml = $viewlog['log_action'];
                     $search_term = request_var('search', '');
                     $start = request_var('start', 0);
                     $log_action = (array) simplexml_load_string($log_actionxml);
                     // loop the action elements and fill template
                     foreach ($log_action as $key => $value) {
                         switch (strtolower($key)) {
                             case 'usercolour':
                             case 'id':
                                 break;
                             case 'header':
                                 if (in_array($log_action['header'], $logs::$valid_action_types)) {
                                     $log_actionstr = $logs->getLogMessage($log_action['header'], false);
                                 }
                                 break;
                             default:
                                 $template->assign_block_vars('logaction_row', array('KEY' => isset($user->lang[$key]) ? $user->lang[$key] . ': ' : $key, 'VALUE' => $value));
                         }
                     }
                     // fill constant template elements
                     $template->assign_vars(array('S_LIST' => false, 'L_TITLE' => $user->lang['ACP_DKP_LOGS'], 'L_EXPLAIN' => $user->lang['ACP_DKP_LOGS_EXPLAIN'], 'LOG_DATE' => !empty($viewlog['log_date']) ? $user->format_date($viewlog['log_date']) : '&nbsp;', 'LOG_USERNAME' => $viewlog['colouruser'], 'LOG_IP_ADDRESS' => $viewlog['log_ipaddress'], 'LOG_SESSION_ID' => $viewlog['log_sid'], 'LOG_RESULT' => $viewlog['log_result'], 'LOG_ACTION' => $log_actionstr));
                     break;
             }
             $template->assign_vars(array('U_BACK' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp&amp;mode=dkp_logs&amp;") . '&amp;search=' . $search_term . '&amp;start=' . $start . '&amp;'));
             break;
     }
 }
Esempio n. 29
0
/**
* View topic in MCP
*/
function mcp_topic_view($id, $mode, $action)
{
    global $phpEx, $phpbb_root_path, $config;
    global $template, $db, $user, $auth, $cache;
    $url = append_sid("{$phpbb_root_path}mcp.{$phpEx}?" . extra_url());
    $user->add_lang('viewtopic');
    $topic_id = request_var('t', 0);
    $topic_info = get_topic_data(array($topic_id), false, true);
    if (!sizeof($topic_info)) {
        trigger_error('TOPIC_NOT_EXIST');
    }
    $topic_info = $topic_info[$topic_id];
    // Set up some vars
    $icon_id = request_var('icon', 0);
    $subject = utf8_normalize_nfc(request_var('subject', '', true));
    $start = request_var('start', 0);
    $sort_days_old = request_var('st_old', 0);
    $forum_id = request_var('f', 0);
    $to_topic_id = request_var('to_topic_id', 0);
    $to_forum_id = request_var('to_forum_id', 0);
    $sort = isset($_POST['sort']) ? true : false;
    $submitted_id_list = request_var('post_ids', array(0));
    $checked_ids = $post_id_list = request_var('post_id_list', array(0));
    // Resync Topic?
    if ($action == 'resync') {
        if (!function_exists('mcp_resync_topics')) {
            include $phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx;
        }
        mcp_resync_topics(array($topic_id));
    }
    // Split Topic?
    if ($action == 'split_all' || $action == 'split_beyond') {
        if (!$sort) {
            split_topic($action, $topic_id, $to_forum_id, $subject);
        }
        $action = 'split';
    }
    // Merge Posts?
    if ($action == 'merge_posts') {
        if (!$sort) {
            merge_posts($topic_id, $to_topic_id);
        }
        $action = 'merge';
    }
    if ($action == 'split' && !$subject) {
        $subject = $topic_info['topic_title'];
    }
    // Approve posts?
    if ($action == 'approve' && $auth->acl_get('m_approve', $topic_info['forum_id'])) {
        include $phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx;
        include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
        include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
        if (!sizeof($post_id_list)) {
            trigger_error('NO_POST_SELECTED');
        }
        if (!$sort) {
            approve_post($post_id_list, $id, $mode);
        }
    }
    // Jumpbox, sort selects and that kind of things
    make_jumpbox($url . "&amp;i={$id}&amp;mode=forum_view", $topic_info['forum_id'], false, 'm_', true);
    $where_sql = $action == 'reports' ? 'WHERE post_reported = 1 AND ' : 'WHERE';
    $sort_days = $total = 0;
    $sort_key = $sort_dir = '';
    $sort_by_sql = $sort_order_sql = array();
    mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql);
    $limit_time_sql = $sort_days ? 'AND p.post_time >= ' . (time() - $sort_days * 86400) : '';
    if ($total == -1) {
        if ($auth->acl_get('m_approve', $topic_info['forum_id'])) {
            $total = $topic_info['topic_replies_real'] + 1;
        } else {
            $total = $topic_info['topic_replies'] + 1;
        }
    }
    $posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page'])));
    if ($posts_per_page == 0) {
        $posts_per_page = $total;
    }
    if (!empty($sort_days_old) && $sort_days_old != $sort_days || $total <= $posts_per_page) {
        $start = 0;
    }
    // Make sure $start is set to the last page if it exceeds the amount
    if ($start < 0 || $start >= $total) {
        $start = $start < 0 ? 0 : floor(($total - 1) / $posts_per_page) * $posts_per_page;
    }
    $sql = 'SELECT u.username, u.username_clean, u.user_colour, p.*
		FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
		WHERE ' . ($action == 'reports' ? 'p.post_reported = 1 AND ' : '') . '
			p.topic_id = ' . $topic_id . ' ' . (!$auth->acl_get('m_approve', $topic_info['forum_id']) ? ' AND p.post_approved = 1 ' : '') . '
			AND p.poster_id = u.user_id ' . $limit_time_sql . '
		ORDER BY ' . $sort_order_sql;
    $result = $db->sql_query_limit($sql, $posts_per_page, $start);
    $rowset = $post_id_list = array();
    $bbcode_bitfield = '';
    while ($row = $db->sql_fetchrow($result)) {
        $rowset[] = $row;
        $post_id_list[] = $row['post_id'];
        $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
    }
    $db->sql_freeresult($result);
    if ($bbcode_bitfield !== '') {
        include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
        $bbcode = new bbcode(base64_encode($bbcode_bitfield));
    }
    $topic_tracking_info = array();
    // Get topic tracking info
    if ($config['load_db_lastread']) {
        $tmp_topic_data = array($topic_id => $topic_info);
        $topic_tracking_info = get_topic_tracking($topic_info['forum_id'], $topic_id, $tmp_topic_data, array($topic_info['forum_id'] => $topic_info['forum_mark_time']));
        unset($tmp_topic_data);
    } else {
        $topic_tracking_info = get_complete_topic_tracking($topic_info['forum_id'], $topic_id);
    }
    $has_unapproved_posts = false;
    // Grab extensions
    $extensions = $attachments = array();
    if ($topic_info['topic_attachment'] && sizeof($post_id_list)) {
        $extensions = $cache->obtain_attach_extensions($topic_info['forum_id']);
        // Get attachments...
        if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_info['forum_id'])) {
            $sql = 'SELECT *
				FROM ' . ATTACHMENTS_TABLE . '
				WHERE ' . $db->sql_in_set('post_msg_id', $post_id_list) . '
					AND in_message = 0
				ORDER BY filetime DESC, post_msg_id ASC';
            $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result)) {
                $attachments[$row['post_msg_id']][] = $row;
            }
            $db->sql_freeresult($result);
        }
    }
    foreach ($rowset as $i => $row) {
        $message = $row['post_text'];
        $post_subject = $row['post_subject'] != '' ? $row['post_subject'] : $topic_info['topic_title'];
        if ($row['bbcode_bitfield']) {
            $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
        }
        $message = bbcode_nl2br($message);
        $message = smiley_text($message);
        if (!empty($attachments[$row['post_id']])) {
            $update_count = array();
            parse_attachments($topic_info['forum_id'], $message, $attachments[$row['post_id']], $update_count);
        }
        if (!$row['post_approved']) {
            $has_unapproved_posts = true;
        }
        $post_unread = isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id] ? true : false;
        $template->assign_block_vars('postrow', array('POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_DATE' => $user->format_date($row['post_time']), 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'POST_ID' => $row['post_id'], 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 't=' . $topic_id) . '">', '</a>'), 'MINI_POST_IMG' => $post_unread ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), 'S_POST_REPORTED' => $row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id']), 'S_POST_UNAPPROVED' => !$row['post_approved'] && $auth->acl_get('m_approve', $topic_info['forum_id']), 'S_CHECKED' => $submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list) || in_array(intval($row['post_id']), $checked_ids) ? true : false, 'S_HAS_ATTACHMENTS' => !empty($attachments[$row['post_id']]) ? true : false, 'U_POST_DETAILS' => "{$url}&amp;i={$id}&amp;p={$row['post_id']}&amp;mode=post_details" . ($forum_id ? "&amp;f={$forum_id}" : ''), 'U_MCP_APPROVE' => $auth->acl_get('m_approve', $topic_info['forum_id']) ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '', 'U_MCP_REPORT' => $auth->acl_get('m_report', $topic_info['forum_id']) ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : ''));
        // Display not already displayed Attachments for this post, we already parsed them. ;)
        if (!empty($attachments[$row['post_id']])) {
            foreach ($attachments[$row['post_id']] as $attachment) {
                $template->assign_block_vars('postrow.attachment', array('DISPLAY_ATTACHMENT' => $attachment));
            }
        }
        unset($rowset[$i]);
    }
    // Display topic icons for split topic
    $s_topic_icons = false;
    if ($auth->acl_gets('m_split', 'm_merge', (int) $topic_info['forum_id'])) {
        include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
        $s_topic_icons = posting_gen_topic_icons('', $icon_id);
        // Has the user selected a topic for merge?
        if ($to_topic_id) {
            $to_topic_info = get_topic_data(array($to_topic_id), 'm_merge');
            if (!sizeof($to_topic_info)) {
                $to_topic_id = 0;
            } else {
                $to_topic_info = $to_topic_info[$to_topic_id];
                if (!$to_topic_info['enable_icons'] || $auth->acl_get('!f_icons', $topic_info['forum_id'])) {
                    $s_topic_icons = false;
                }
            }
        }
    }
    $s_hidden_fields = build_hidden_fields(array('st_old' => $sort_days, 'post_ids' => $post_id_list));
    $template->assign_vars(array('TOPIC_TITLE' => $topic_info['topic_title'], 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']), 'TO_TOPIC_ID' => $to_topic_id, 'TO_TOPIC_INFO' => $to_topic_id ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '', 'SPLIT_SUBJECT' => $subject, 'POSTS_PER_PAGE' => $posts_per_page, 'ACTION' => $action, 'REPORTED_IMG' => $user->img('icon_topic_reported', 'POST_REPORTED'), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'), 'INFO_IMG' => $user->img('icon_post_info', 'VIEW_INFO'), 'S_MCP_ACTION' => "{$url}&amp;i={$id}&amp;mode={$mode}&amp;action={$action}&amp;start={$start}", 'S_FORUM_SELECT' => $to_forum_id ? make_forum_select($to_forum_id, false, false, true, true, true) : make_forum_select($topic_info['forum_id'], false, false, true, true, true), 'S_CAN_SPLIT' => $auth->acl_get('m_split', $topic_info['forum_id']) ? true : false, 'S_CAN_MERGE' => $auth->acl_get('m_merge', $topic_info['forum_id']) ? true : false, 'S_CAN_DELETE' => $auth->acl_get('m_delete', $topic_info['forum_id']) ? true : false, 'S_CAN_APPROVE' => $has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id']) ? true : false, 'S_CAN_LOCK' => $auth->acl_get('m_lock', $topic_info['forum_id']) ? true : false, 'S_CAN_REPORT' => $auth->acl_get('m_report', $topic_info['forum_id']) ? true : false, 'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']), 'S_REPORT_VIEW' => $action == 'reports' ? true : false, 'S_MERGE_VIEW' => $action == 'merge' ? true : false, 'S_SPLIT_VIEW' => $action == 'split' ? true : false, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, 'S_TOPIC_ICON' => $icon_id, 'U_SELECT_TOPIC' => "{$url}&amp;i={$id}&amp;mode=forum_view&amp;action=merge_select" . ($forum_id ? "&amp;f={$forum_id}" : ''), 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start={$start}") . '">', '</a>'), 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.{$phpEx}", "f={$topic_info['forum_id']}&amp;start={$start}") . '">', '</a>'), 'PAGE_NUMBER' => on_page($total, $posts_per_page, $start), 'PAGINATION' => !$posts_per_page ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i={$id}&amp;t={$topic_info['topic_id']}&amp;mode={$mode}&amp;action={$action}&amp;to_topic_id={$to_topic_id}&amp;posts_per_page={$posts_per_page}&amp;st={$sort_days}&amp;sk={$sort_key}&amp;sd={$sort_dir}"), $total, $posts_per_page, $start), 'TOTAL_POSTS' => $total == 1 ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total)));
}
Esempio n. 30
0
    function main($id, $mode)
    {
        global $auth, $db, $user, $template, $cache;
        global $config, $phpbb_root_path, $phpEx, $action;
        include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
        $forum_id = request_var('f', 0);
        $start = request_var('start', 0);
        $this->page_title = 'MCP_REPORTS';
        switch ($action) {
            case 'close':
            case 'delete':
                include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
                $report_id_list = request_var('report_id_list', array(0));
                if (!sizeof($report_id_list)) {
                    trigger_error('NO_REPORT_SELECTED');
                }
                close_report($report_id_list, $mode, $action);
                break;
        }
        switch ($mode) {
            case 'report_details':
                $user->add_lang(array('posting', 'viewforum', 'viewtopic'));
                $post_id = request_var('p', 0);
                // closed reports are accessed by report id
                $report_id = request_var('r', 0);
                $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
					FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
					WHERE ' . ($report_id ? 'r.report_id = ' . $report_id : "r.post_id = {$post_id}") . '
						AND rr.reason_id = r.reason_id
						AND r.user_id = u.user_id
						AND r.pm_id = 0
					ORDER BY report_closed ASC';
                $result = $db->sql_query_limit($sql, 1);
                $report = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
                if (!$report) {
                    trigger_error('NO_REPORT');
                }
                if (!$report_id && $report['report_closed']) {
                    trigger_error('REPORT_CLOSED');
                }
                $post_id = $report['post_id'];
                $report_id = $report['report_id'];
                $post_info = get_post_data(array($post_id), 'm_report', true);
                if (!sizeof($post_info)) {
                    trigger_error('NO_REPORT_SELECTED');
                }
                $post_info = $post_info[$post_id];
                $reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']);
                if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])])) {
                    $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])];
                    $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])];
                }
                if (topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false)) {
                    $template->assign_vars(array('S_TOPIC_REVIEW' => true, 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], 'TOPIC_TITLE' => $post_info['topic_title']));
                }
                $topic_tracking_info = $extensions = $attachments = array();
                // Get topic tracking info
                if ($config['load_db_lastread']) {
                    $tmp_topic_data = array($post_info['topic_id'] => $post_info);
                    $topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time']));
                    unset($tmp_topic_data);
                } else {
                    $topic_tracking_info = get_complete_topic_tracking($post_info['forum_id'], $post_info['topic_id']);
                }
                $post_unread = isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']] ? true : false;
                // Process message, leave it uncensored
                $message = $post_info['post_text'];
                if ($post_info['bbcode_bitfield']) {
                    include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
                    $bbcode = new bbcode($post_info['bbcode_bitfield']);
                    $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
                }
                $message = bbcode_nl2br($message);
                $message = smiley_text($message);
                if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) {
                    $sql = 'SELECT *
						FROM ' . ATTACHMENTS_TABLE . '
						WHERE post_msg_id = ' . $post_id . '
							AND in_message = 0
						ORDER BY filetime DESC';
                    $result = $db->sql_query($sql);
                    while ($row = $db->sql_fetchrow($result)) {
                        $attachments[] = $row;
                    }
                    $db->sql_freeresult($result);
                    if (sizeof($attachments)) {
                        $update_count = array();
                        parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);
                    }
                    // Display not already displayed Attachments for this post, we already parsed them. ;)
                    if (!empty($attachments)) {
                        $template->assign_var('S_HAS_ATTACHMENTS', true);
                        foreach ($attachments as $attachment) {
                            $template->assign_block_vars('attachment', array('DISPLAY_ATTACHMENT' => $attachment));
                        }
                    }
                }
                $template->assign_vars(array('S_MCP_REPORT' => true, 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], 'S_USER_NOTES' => true, 'U_EDIT' => $auth->acl_get('m_edit', $post_info['forum_id']) ? append_sid("{$phpbb_root_path}posting.{$phpEx}", "mode=edit&amp;f={$post_info['forum_id']}&amp;p={$post_info['post_id']}") : '', 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id), 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']), 'U_MCP_WARN_REPORTER' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '', 'U_MCP_WARN_USER' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '', 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $post_info['forum_id']), 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), 'MINI_POST_IMG' => $post_unread ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports' . ($post_info['post_reported'] ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'REPORT_DATE' => $user->format_date($report['report_time']), 'REPORT_ID' => $report_id, 'REPORT_REASON_TITLE' => $reason['title'], 'REPORT_REASON_DESCRIPTION' => $reason['description'], 'REPORT_TEXT' => $report['report_text'], 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']), 'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']), 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $post_info['post_subject'] ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => $auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '') ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], 'U_LOOKUP_IP' => $auth->acl_get('m_info', $post_info['forum_id']) ? $this->u_action . '&amp;r=' . $report_id . '&amp;p=' . $post_id . '&amp;f=' . $forum_id . '&amp;lookup=' . $post_info['poster_ip'] . '#ip' : ''));
                $this->tpl_name = 'mcp_post';
                break;
            case 'reports':
            case 'reports_closed':
                $topic_id = request_var('t', 0);
                $forum_info = array();
                $forum_list_reports = get_forum_list('m_report', false, true);
                $forum_list_read = array_flip(get_forum_list('f_read', true, true));
                // Flipped so we can isset() the forum IDs
                // Remove forums we cannot read
                foreach ($forum_list_reports as $k => $forum_data) {
                    if (!isset($forum_list_read[$forum_data['forum_id']])) {
                        unset($forum_list_reports[$k]);
                    }
                }
                unset($forum_list_read);
                if ($topic_id) {
                    $topic_info = get_topic_data(array($topic_id));
                    if (!sizeof($topic_info)) {
                        trigger_error('TOPIC_NOT_EXIST');
                    }
                    if ($forum_id != $topic_info[$topic_id]['forum_id']) {
                        $topic_id = 0;
                    } else {
                        $topic_info = $topic_info[$topic_id];
                        $forum_id = (int) $topic_info['forum_id'];
                    }
                }
                $forum_list = array();
                if (!$forum_id) {
                    foreach ($forum_list_reports as $row) {
                        $forum_list[] = $row['forum_id'];
                    }
                    if (!sizeof($forum_list)) {
                        trigger_error('NOT_MODERATOR');
                    }
                    $global_id = $forum_list[0];
                    $sql = 'SELECT SUM(forum_topics) as sum_forum_topics
						FROM ' . FORUMS_TABLE . '
						WHERE ' . $db->sql_in_set('forum_id', $forum_list);
                    $result = $db->sql_query($sql);
                    $forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics');
                    $db->sql_freeresult($result);
                } else {
                    $forum_info = get_forum_data(array($forum_id), 'm_report');
                    if (!sizeof($forum_info)) {
                        trigger_error('NOT_MODERATOR');
                    }
                    $forum_info = $forum_info[$forum_id];
                    $forum_list = array($forum_id);
                    $global_id = $forum_id;
                }
                $forum_list[] = 0;
                $forum_data = array();
                $forum_options = '<option value="0"' . ($forum_id == 0 ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
                foreach ($forum_list_reports as $row) {
                    $forum_options .= '<option value="' . $row['forum_id'] . '"' . ($forum_id == $row['forum_id'] ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp; &nbsp;', $row['padding']) . $row['forum_name'] . '</option>';
                    $forum_data[$row['forum_id']] = $row;
                }
                unset($forum_list_reports);
                $sort_days = $total = 0;
                $sort_key = $sort_dir = '';
                $sort_by_sql = $sort_order_sql = array();
                mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
                $forum_topics = $total == -1 ? $forum_info['forum_topics'] : $total;
                $limit_time_sql = $sort_days ? 'AND r.report_time >= ' . (time() - $sort_days * 86400) : '';
                if ($mode == 'reports') {
                    $report_state = 'AND p.post_reported = 1 AND r.report_closed = 0';
                } else {
                    $report_state = 'AND r.report_closed = 1';
                }
                $sql = 'SELECT r.report_id
					FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . REPORTS_TABLE . ' r ' . ($sort_order_sql[0] == 'u' ? ', ' . USERS_TABLE . ' u' : '') . ($sort_order_sql[0] == 'r' ? ', ' . USERS_TABLE . ' ru' : '') . '
					WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . "\n\t\t\t\t\t\t{$report_state}\n\t\t\t\t\t\tAND r.post_id = p.post_id\n\t\t\t\t\t\t" . ($sort_order_sql[0] == 'u' ? 'AND u.user_id = p.poster_id' : '') . '
						' . ($sort_order_sql[0] == 'r' ? 'AND ru.user_id = r.user_id' : '') . '
						' . ($topic_id ? 'AND p.topic_id = ' . $topic_id : '') . "\n\t\t\t\t\t\tAND t.topic_id = p.topic_id\n\t\t\t\t\t\tAND r.pm_id = 0\n\t\t\t\t\t\t{$limit_time_sql}\n\t\t\t\t\tORDER BY {$sort_order_sql}";
                $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
                $i = 0;
                $report_ids = array();
                while ($row = $db->sql_fetchrow($result)) {
                    $report_ids[] = $row['report_id'];
                    $row_num[$row['report_id']] = $i++;
                }
                $db->sql_freeresult($result);
                if (sizeof($report_ids)) {
                    $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id
						FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru
						WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . '
							AND t.topic_id = p.topic_id
							AND r.post_id = p.post_id
							AND u.user_id = p.poster_id
							AND ru.user_id = r.user_id
							AND r.pm_id = 0
						ORDER BY ' . $sort_order_sql;
                    $result = $db->sql_query($sql);
                    $report_data = $rowset = array();
                    while ($row = $db->sql_fetchrow($result)) {
                        $global_topic = $row['forum_id'] ? false : true;
                        if ($global_topic) {
                            $row['forum_id'] = $global_id;
                        }
                        $template->assign_block_vars('postrow', array('U_VIEWFORUM' => !$global_topic ? append_sid("{$phpbb_root_path}viewforum.{$phpEx}", 'f=' . $row['forum_id']) : '', 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'], 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i=reports&amp;start={$start}&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"), 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']), 'REPORTER_FULL' => get_username_string('full', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), 'REPORTER_COLOUR' => get_username_string('colour', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), 'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), 'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), 'FORUM_NAME' => !$global_topic ? $forum_data[$row['forum_id']]['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'POST_ID' => $row['post_id'], 'POST_SUBJECT' => $row['post_subject'] ? $row['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_TIME' => $user->format_date($row['post_time']), 'REPORT_ID' => $row['report_id'], 'REPORT_TIME' => $user->format_date($row['report_time']), 'TOPIC_TITLE' => $row['topic_title']));
                    }
                    $db->sql_freeresult($result);
                    unset($report_ids, $row);
                }
                // Now display the page
                $template->assign_vars(array('L_EXPLAIN' => $mode == 'reports' ? $user->lang['MCP_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_REPORTS_CLOSED_EXPLAIN'], 'L_TITLE' => $mode == 'reports' ? $user->lang['MCP_REPORTS_OPEN'] : $user->lang['MCP_REPORTS_CLOSED'], 'L_ONLY_TOPIC' => $topic_id ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '', 'S_MCP_ACTION' => $this->u_action, 'S_FORUM_OPTIONS' => $forum_options, 'S_CLOSED' => $mode == 'reports_closed' ? true : false, 'PAGINATION' => generate_pagination($this->u_action . "&amp;f={$forum_id}&amp;t={$topic_id}&amp;st={$sort_days}&amp;sk={$sort_key}&amp;sd={$sort_dir}", $total, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start), 'TOPIC_ID' => $topic_id, 'TOTAL' => $total, 'TOTAL_REPORTS' => $total == 1 ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total)));
                $this->tpl_name = 'mcp_reports';
                break;
        }
    }