Esempio n. 1
0
    case 'user':
    case 'page':
        $roster_title = ' [ ' . $roster->config['default_name'] . ' ] ' . (isset($roster->output['title']) ? $roster->output['title'] : '');
        $roster->tpl->assign_vars(array('PAGE_INFO' => isset($roster->output['title']) ? $roster->output['title'] : '', 'ROSTER_TITLE' => $roster->config['default_name'], 'ROSTER_SUBTITLE' => isset($roster->config['default_desc']) ? '<br />' . $roster->config['default_desc'] : '', 'ROSTER_3RDTITLE' => false, 'LAST_UPDATED' => false));
        break;
    case 'realm':
        $roster_title = ' [ ' . $roster->data['region'] . '-' . $roster->data['server'] . ' ] ' . (isset($roster->output['title']) ? $roster->output['title'] : '');
        $roster->tpl->assign_vars(array('ROSTER_TITLE' => $roster->data['region'] . '-' . $roster->data['server'], 'ROSTER_SUBTITLE' => isset($roster->config['default_desc']) && $roster->config['default_desc'] != '' ? '<br />' . $roster->config['default_desc'] : false, 'ROSTER_3RDTITLE' => false, 'LAST_UPDATED' => false));
        break;
    case 'guild':
        $roster_title = ' [ ' . $roster->data['guild_name'] . ' @ ' . $roster->data['region'] . '-' . $roster->data['server'] . ' ] ' . (isset($roster->output['title']) ? $roster->output['title'] : '');
        $roster->tpl->assign_vars(array('ROSTER_TITLE' => $roster->data['guild_name'], 'ROSTER_SUBTITLE' => '@ ' . $roster->data['region'] . '-' . $roster->data['server'], 'ROSTER_3RDTITLE' => $roster->data['guild_num_members'], 'LAST_UPDATED' => isset($roster->data['update_time']) ? readbleDate($roster->data['update_time']) . (!empty($roster->config['timezone']) ? ' (' . $roster->config['timezone'] . ')' : '') : ''));
        break;
    case 'char':
        $roster_title = ' [ ' . $roster->data['guild_name'] . ' @ ' . $roster->data['region'] . '-' . $roster->data['server'] . ' ] ' . (isset($roster->output['title']) ? $roster->output['title'] : '');
        $roster->tpl->assign_vars(array('ROSTER_TITLE' => $roster->data['name'], 'ROSTER_SUBTITLE' => '@ ' . $roster->data['region'] . '-' . $roster->data['server'], 'ROSTER_3RDTITLE' => false, 'FACTION' => isset($roster->data['factionEn']) ? strtolower($roster->data['factionEn']) : false, 'LAST_UPDATED' => isset($roster->data['update_time']) ? readbleDate($roster->data['update_time']) . (!empty($roster->config['timezone']) ? ' (' . $roster->config['timezone'] . ')' : '') : ''));
        break;
    default:
        $roster_title = isset($roster->output['title']) ? $roster->output['title'] : '';
        $roster->tpl->assign_vars(array('ROSTER_TITLE' => isset($roster->output['title']) ? $roster->output['title'] : '', 'ROSTER_SUBTITLE' => false, 'ROSTER_3RDTITLE' => false, 'LAST_UPDATED' => false));
        break;
}
if ($roster->output['show_menu']) {
    $roster_menu = new RosterMenu();
    $roster_menu->makeMenu($roster->output['show_menu']);
    $roster_menu->displayMenu();
}
/**
 * Assign template vars
 */
$roster->tpl->assign_vars(array('S_SEO_URL' => $roster->config['seo_url'], 'S_HEADER_LOGO' => !empty($roster->config['logo']) ? true : false, 'U_MAKELINK' => makelink(), 'ROSTER_URL' => ROSTER_URL, 'ROSTER_PATH' => ROSTER_PATH, 'WEBSITE_ADDRESS' => $roster->config['website_address'], 'HEADER_LOGO' => $roster->config['logo'], 'IMG_URL' => $roster->config['img_url'], 'INTERFACE_URL' => $roster->config['interface_url'], 'IMG_SUFFIX' => $roster->config['img_suffix'], 'ROSTER_VERSION' => $roster->config['version'], 'ROSTER_CREDITS' => sprintf($roster->locale->act['roster_credits'], makelink('credits')), 'XML_LANG' => substr($roster->config['locale'], 0, 2), 'ROSTER_SCOPE' => $roster->scope, 'PAGE_TITLE' => $roster_title, 'ROSTER_HEAD' => $roster->output['html_head'], 'ROSTER_HEAD_JS' => roster_get_js(), 'ROSTER_HEAD_CSS' => roster_get_css(), 'ROSTER_BODY' => !empty($roster->output['body_attr']) ? ' ' . $roster->output['body_attr'] : '', 'ROSTER_ONLOAD' => !empty($roster->output['body_onload']) ? $roster->output['body_onload'] : '', 'ROSTER_TOP' => $roster->output['top'], 'L_MENU_LABEL' => $roster->scope, 'L_MENU_LABEL_NAME' => $roster->locale->act[$roster->scope], 'S_LOCALE_SELECT' => (bool) $roster->config['header_locale'], 'S_HEADER_SEARCH' => (bool) $roster->config['header_search'], 'S_HEADER_LOGIN' => (bool) $roster->config['header_login'], 'S_REALMSTATUS' => (bool) $roster->config['rs_display'], 'T_BAR_USER_ILI' => is_object($roster->auth) ? $roster->auth->allow_login : '', 'T_BAR_USER_MSG' => is_object($roster->auth) ? $roster->auth->message : '', 'T_BAR_USER_OTR' => '', 'LOGIN_FORM' => is_object($roster->auth) ? $roster->auth->getMenuLoginForm() : '', 'REALMSTATUS' => isset($roster->data['server']) ? makeRealmStatus() : '', 'FACTION' => isset($roster->data['factionEn']) ? strtolower($roster->data['factionEn']) : false, 'MENU_FACTION' => isset($roster->data['factionEn']) ? strtolower($roster->data['factionEn']) : false, 'U_SEARCH_FORM_ACTION' => makelink('search'), 'U_MENU_UPDATE_LUA' => makelink('update')));
Esempio n. 2
0
    tableHeaderRow(array('<a href="' . makelink($url . '&amp;s=date') . '">' . $roster->locale->act['when'] . '</a>', '<a href="' . makelink($url . '&amp;s=name') . '">' . $roster->locale->act['them'] . '</a>', '<a href="' . makelink($url . '&amp;s=gn') . '">' . $roster->locale->act['us'] . '</a>', '<a href="' . makelink($url . '&amp;s=result') . '">' . $roster->locale->act['result'] . '</a>', '<a href="' . makelink($url . '&amp;s=zone') . '">' . $roster->locale->act['zone'] . '</a>', '<a href="' . makelink($url . '&amp;s=subzone') . '">' . $roster->locale->act['subzone'] . '</a>', '<a href="' . makelink($url . '&amp;s=diff') . '">' . $roster->locale->act['leveldiff'] . '</a>'));
    $query = "SELECT `pvp`.*, `members`.`name` AS gn" . " FROM `" . $roster->db->table('pvp2', $addon['basename']) . "` AS pvp" . " LEFT JOIN `" . $roster->db->table('members') . "` AS members ON `members`.`member_id` = `pvp`.`member_id`" . " WHERE `pvp`.`guild` = '" . $guild . "'";
    if ($sort == 'name') {
        $query .= ' ORDER BY `name`, `leveldiff` DESC, `guild`;';
    } elseif ($sort == 'gn') {
        $query .= ' ORDER BY `gn`, `leveldiff` DESC;';
    } elseif ($sort == 'race') {
        $query .= ' ORDER BY `race`, `name`, `leveldiff` DESC;';
    } elseif ($sort == 'class') {
        $query .= ' ORDER BY `class`, `name`, `leveldiff` DESC;';
    } elseif ($sort == 'diff') {
        $query .= ' ORDER BY `leveldiff` DESC, `name`;';
    } elseif ($sort == 'result') {
        $query .= ' ORDER BY `win` DESC, `name`;';
    } elseif ($sort == 'zone') {
        $query .= ' ORDER BY `zone`, `name`;';
    } elseif ($sort == 'subzone') {
        $query .= ' ORDER BY `subzone`, `name`;';
    } elseif ($sort == 'date') {
        $query .= ' ORDER BY `date` DESC, `name`;';
    } else {
        $query .= ' ORDER BY `date` DESC, `name`;';
    }
    $result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
    while ($row = $roster->db->fetch($result)) {
        $roster->tpl->assign_block_vars('rows', array('ROW_CLASS' => $roster->switch_row_class(), 'DATE' => readbleDate($row['date']), 'LINK' => makelink('guild-' . $addon['basename'] . '&amp;type=playerinfo&amp;player=' . urlencode($row['name'])), 'NAME' => $row['name'], 'GLINK' => makelink('char-' . $addon['basename'] . '-pvp&amp;a=c:' . $row['member_id']), 'GNAME' => $row['gn'], 'WIN' => $row['win'] == '1' ? true : false, 'ZONE' => $row['zone'], 'SUBZONE' => $row['subzone'], 'LEVELDIFF' => $row['leveldiff']));
    }
    $roster->db->free_result($result);
}
$roster->tpl->set_handle('body', $addon['basename'] . '/guild.html');
$roster->tpl->display('body');
Esempio n. 3
0
                     $addon['icon'] = ROSTER_PATH . 'addons/' . $addon['basename'] . '/images/' . $addon['icon'];
                 } else {
                     $addon['icon'] = $roster->config['interface_url'] . 'Interface/Icons/' . $addon['icon'] . '.' . $roster->config['img_suffix'];
                 }
             } else {
                 $addon['icon'] = $roster->config['interface_url'] . 'Interface/Icons/inv_misc_questionmark.' . $roster->config['img_suffix'];
             }
             $search_count = new $addon['search_class']();
             $search_count->data = $addon;
             $search_count->search($query, 0, 0);
             $roster->tpl->assign_block_vars('addon_results', array('BASENAME' => $addon['basename'], 'FULLNAME' => $addon['fullname'], 'ICON' => $addon['icon'], 'COUNT' => $page * $limit + $search->result_count, 'TIME' => round($search->time_search, 4), 'OPEN_TABLE' => $search->open_table, 'CLOSE_TABLE' => $search->close_table, 'TOTAL' => $search_count->result_count, 'PREV' => $page > 0 ? makelink('search&amp;search=' . $url_query . '&amp;s_addon=' . $search->data['basename'] . $search->search_url . '&amp;page=' . ($page - 1)) : '', 'NEXT' => $search->result_count >= $limit ? makelink('search&amp;search=' . $url_query . '&amp;s_addon=' . $search->data['basename'] . $search->search_url . '&amp;page=' . ($page + 1)) : ''));
             foreach ($search->result as $result) {
                 // if html is set with in the addon search class it will display
                 // html is good for creating search results with multi opetions in the display
                 // for instance creating a table that displays char names, professions, guild, server all in the same search result
                 $roster->tpl->assign_block_vars('addon_results.row', array('ROW_CLASS' => $roster->switch_row_class(), 'HTML' => isset($result['html']) && $result['html'] != '' ? $result['html'] : '', 'RESULTS_HEADER' => isset($result['results_header']) ? $result['results_header'] : '', 'RESULTS_FOOTER' => isset($result['results_footer']) ? $result['results_footer'] : '', 'HEADER' => isset($result['header']) ? $result['header'] . '<br />' : '', 'AUTHOR' => isset($result['author']) ? $result['author'] : '', 'DATE' => isset($result['date']) ? readbleDate($result['date']) : '', 'LINK' => isset($result['url']) ? $result['url'] : '', 'TITLE' => isset($result['title']) ? $result['title'] : '', 'SHORT_TEXT' => isset($result['short_text']) ? $result['short_text'] : '', 'MORE_TEXT' => isset($result['more_text']) ? $result['more_text'] : '', 'FOOTER' => isset($result['footer']) ? $result['footer'] : ''));
             }
         }
         unset($search, $search_count);
     }
 }
 $addon = '';
 //this is where we want to set up item searches
 // a loop to add all the non included addons into the did not find box which also has a counter to show the count of results
 if ($total_search_results == 0) {
     $roster->tpl->assign_var('S_NO_RESULTS', true);
 }
 $more = false;
 foreach ($roster->addon_data as $leftover) {
     // Continue if we have already searched the addon above
     if (isset($addons[$leftover['basename']])) {
Esempio n. 4
0
function vault_log($parent)
{
    global $roster, $addon, $armory;
    $sqlstring = "SELECT * FROM `" . $roster->db->table('log', $addon['basename']) . "` WHERE `parent` = '" . $parent . "' AND `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `log_id` DESC;";
    $result = $roster->db->query($sqlstring);
    while ($row = $roster->db->fetch($result, SQL_ASSOC)) {
        if ($row['amount'] > 0) {
            $db_money = $row['amount'];
            $mail_money['c'] = $db_money % 100;
            $db_money = floor($db_money / 100);
            $money_item = $mail_money['c'] . '<img src="' . $roster->config['img_url'] . 'coin_copper.gif" alt="c" />';
            if (!empty($db_money)) {
                $mail_money['s'] = $db_money % 100;
                $db_money = floor($db_money / 100);
                $money_item = $mail_money['s'] . '<img src="' . $roster->config['img_url'] . 'coin_silver.gif" alt="s" /> ' . $money_item;
            }
            if (!empty($db_money)) {
                $mail_money['g'] = $db_money;
                $money_item = $mail_money['g'] . '<img src="' . $roster->config['img_url'] . 'coin_gold.gif" alt="g" /> ' . $money_item;
            }
        } elseif ($row['item_id'] != '') {
            $money_item = itemidname($row['item_id']);
            //aprint($armory->fetchItemInfo($row['item_id'],$roster->config['locale']));
        }
        $roster->tpl->assign_block_vars('tab_data.log', array('TYPE' => sprintf($roster->locale->act['vault_log_' . $row['type']], $row['member'], $money_item), 'TIME' => readbleDate($row['time'])));
    }
}
Esempio n. 5
0
 /**
  * Build the top pane
  */
 function makeTop()
 {
     global $roster;
     $roster->tpl->assign_vars(array('S_MENU_TOP_LOCALE' => (bool) $roster->config['menu_top_locale'], 'S_MENU_ICON' => $roster->config['menu_top_faction'], 'L_LANGUAGE' => $roster->locale->act['language'], 'L_MENU_LABEL' => $roster->scope, 'L_MENU_LABEL_NAME' => $roster->locale->act[$roster->scope]));
     if ($roster->config['menu_top_faction']) {
         $faction = isset($roster->data['factionEn']) ? $roster->data['factionEn'] : '';
         switch (substr($faction, 0, 1)) {
             case 'A':
                 $roster->tpl->assign_var('ROSTER_MENU_ICON', 'icon_alliance.png');
                 break;
             case 'H':
                 $roster->tpl->assign_var('ROSTER_MENU_ICON', 'icon_horde.png');
                 break;
             default:
                 $roster->tpl->assign_var('ROSTER_MENU_ICON', 'icon_neutral.png');
                 break;
         }
     }
     // Lets make a list of our current locales
     if ($roster->config['menu_top_locale']) {
         foreach ($roster->multilanguages as $language) {
             $roster->tpl->assign_block_vars('menu_locale_select', array('LOCALE' => $language, 'LOCALE_NAME' => $roster->locale->wordings[$language]['langname'], 'S_SELECTED' => $language == $roster->config['locale'] ? true : false));
         }
     }
     $menu_select = array();
     $roster->tpl->assign_var('S_MENU_SELECT', false);
     if ($roster->scope == 'realm') {
         // Get the scope select data
         $query = "SELECT DISTINCT `server`, `region`" . " FROM `" . $roster->db->table('guild') . "`" . " UNION SELECT DISTINCT `server`, `region` FROM `" . $roster->db->table('players') . "`" . " ORDER BY `server` ASC;";
         $result = $roster->db->query($query);
         if (!$result) {
             die_quietly($roster->db->error(), 'Database error', __FILE__, __LINE__, $query);
         }
         $realms = 0;
         while ($data = $roster->db->fetch($result, SQL_NUM)) {
             $menu_select[$data[1]][] = $data[0];
             $realms++;
         }
         $roster->db->free_result($result);
         $roster->tpl->assign_var('S_MENU_SELECT', $realms > 1 ? true : false);
         if ($realms > 1) {
             foreach ($menu_select as $region => $realmsArray) {
                 $roster->tpl->assign_block_vars('menu_select_group', array('U_VALUE' => $region));
                 foreach ($realmsArray as $name) {
                     $roster->tpl->assign_block_vars('menu_select_group.menu_select_row', array('TEXT' => $name, 'U_VALUE' => makelink("&amp;a=r:{$region}-{$name}", true), 'S_SELECTED' => $name == $roster->data['server'] ? true : false));
                 }
             }
         }
     } elseif ($roster->scope == 'guild') {
         // Get the scope select data
         $query = "SELECT `guild_name`, CONCAT(`region`,'-',`server`), `guild_id` FROM `" . $roster->db->table('guild') . "`" . " ORDER BY `region` ASC, `server` ASC, `guild_name` ASC;";
         $result = $roster->db->query($query);
         if (!$result) {
             die_quietly($roster->db->error(), 'Database error', __FILE__, __LINE__, $query);
         }
         $guilds = 0;
         while ($data = $roster->db->fetch($result, SQL_NUM)) {
             $menu_select[$data[1]][$data[2]] = $data[0];
             $guilds++;
         }
         $roster->db->free_result($result);
         $roster->tpl->assign_var('S_MENU_SELECT', $guilds > 1 ? true : false);
         if (count($menu_select) > 0) {
             foreach ($menu_select as $realm => $guild) {
                 $roster->tpl->assign_block_vars('menu_select_group', array('U_VALUE' => $realm));
                 foreach ($guild as $id => $name) {
                     $roster->tpl->assign_block_vars('menu_select_group.menu_select_row', array('TEXT' => $name, 'U_VALUE' => makelink('&amp;a=g:' . $id, true), 'S_SELECTED' => $id == $roster->data['guild_id'] ? true : false));
                 }
             }
         }
     } elseif ($roster->scope == 'char') {
         // Get the scope select data
         $query = "SELECT `name`, `member_id` FROM `" . $roster->db->table('players') . "`" . " WHERE `guild_id` = '" . $roster->data['guild_id'] . "'" . " ORDER BY `name` ASC;";
         $result = $roster->db->query($query);
         if (!$result) {
             die_quietly($roster->db->error(), 'Database error', __FILE__, __LINE__, $query);
         }
         while ($data = $roster->db->fetch($result, SQL_NUM)) {
             $menu_select[$data[1]] = $data[0];
         }
         $roster->tpl->assign_var('S_MENU_SELECT', $roster->db->num_rows() > 1 ? true : false);
         $roster->db->free_result($result);
         if (count($menu_select) > 0) {
             $roster->tpl->assign_block_vars('menu_select_group', array('U_VALUE' => $roster->data['guild_name']));
             foreach ($menu_select as $id => $name) {
                 $roster->tpl->assign_block_vars('menu_select_group.menu_select_row', array('TEXT' => $name, 'U_VALUE' => makelink('&amp;a=c:' . $id, true), 'S_SELECTED' => $id == $roster->data['member_id'] ? true : false));
             }
         }
     }
     switch ($roster->scope) {
         case 'util':
         case 'page':
             $roster->tpl->assign_vars(array('S_MENU_SUBTITLE' => isset($roster->config['default_desc']), 'S_MENU_3RDTITLE' => false, 'ROSTER_MENU_TITLE' => $roster->config['default_name'], 'ROSTER_MENU_SUBTITLE' => isset($roster->config['default_desc']) ? '<br />' . $roster->config['default_desc'] : ''));
             break;
         case 'realm':
             $roster->tpl->assign_vars(array('S_MENU_SUBTITLE' => isset($roster->config['default_desc']), 'S_MENU_3RDTITLE' => false, 'ROSTER_MENU_TITLE' => $roster->data['region'] . '-' . $roster->data['server'], 'ROSTER_MENU_SUBTITLE' => ''));
             break;
         case 'guild':
             $roster->tpl->assign_vars(array('S_MENU_SUBTITLE' => isset($roster->config['default_desc']), 'S_MENU_3RDTITLE' => isset($roster->data['update_time']) ? true : false, 'ROSTER_MENU_TITLE' => $roster->data['guild_name'], 'ROSTER_MENU_SUBTITLE' => '@ ' . $roster->data['region'] . '-' . $roster->data['server'], 'ROSTER_MENU_3RDTITLE' => isset($roster->data['update_time']) ? readbleDate($roster->data['update_time']) . (!empty($roster->config['timezone']) ? ' (' . $roster->config['timezone'] . ')' : '') : '', 'L_LAST_UPDATE' => $roster->locale->act['lastupdate']));
             break;
         case 'char':
             $roster->tpl->assign_vars(array('S_MENU_SUBTITLE' => isset($roster->config['default_desc']), 'S_MENU_3RDTITLE' => isset($roster->data['update_time']) ? true : false, 'ROSTER_MENU_TITLE' => $roster->data['name'], 'ROSTER_MENU_SUBTITLE' => '@ ' . $roster->data['region'] . '-' . $roster->data['server'], 'ROSTER_MENU_3RDTITLE' => $roster->data['update_format'], 'L_LAST_UPDATE' => $roster->locale->act['lastupdate']));
             break;
     }
 }