Exemple #1
0
        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')));
// Make a listing of our current locales
if ($roster->config['header_locale']) {
    foreach ($roster->multilanguages as $language) {
        $roster->tpl->assign_block_vars('locale_select', array('LOCALE' => $language, 'LOCALE_NAME' => $roster->locale->wordings[$language]['langname'], 'S_SELECTED' => $language == $roster->config['locale'] ? true : false));
    }
}
/**
 * Make the data selection list
Exemple #2
0
    // Include addon's inc/conf.php file
    if (file_exists($addon['conf_file'])) {
        include_once $addon['conf_file'];
    }
    // The addon will now assign its output to $content
    $content = '';
    ob_start();
    require $path;
    $content .= ob_get_clean();
    // Pass all the css to $roster->output['html_head'] which is a placeholder in roster_header for more css style defines
    if ($addon['css_url'] != '') {
        $roster->output['html_head'] .= '<link rel="stylesheet" type="text/css" href="' . $addon['css_url'] . '" />' . "\n";
    }
    if ($addon['tpl_css_url'] != '') {
        $roster->output['html_head'] .= '<link rel="stylesheet" type="text/css" href="' . $addon['tpl_css_url'] . '" />' . "\n";
    }
    if ($roster->output['show_header']) {
        include_once ROSTER_BASE . 'header.php';
    }
    if ($roster->output['show_menu']) {
        $roster_menu = new RosterMenu();
        $roster_menu->makeMenu($roster->output['show_menu']);
    }
    echo $content;
    if ($roster->output['show_footer']) {
        include_once ROSTER_BASE . 'footer.php';
    }
} else {
    roster_die(sprintf($roster->locale->act['addon_disabled'], $addon['basename']), $roster->locale->act['addon_error']);
}
$roster->db->close_db();
/**
 * Draw a message box with the specified border color, then die cleanly
 *
 * @param string $text | The message to display inside the box
 * @param string $title | The box title (default = 'Message')
 * @param string $style | The border style (default = sred)
 */
function roster_die($text, $title = 'Message', $style = 'sred')
{
    global $roster;
    if ($roster->pages[0] == 'ajax') {
        ajax_die($text, $title, null, null, null);
    }
    // Set scope to util
    $roster->scope = 'util';
    if (!defined('ROSTER_MENU_INC') && is_array($roster->config)) {
        $roster_menu = new RosterMenu();
        $roster_menu->makeMenu($roster->output['show_menu']);
    }
    if (!defined('ROSTER_HEADER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'header.php';
    }
    $roster_menu->displayMenu();
    echo messagebox($text, $title, $style);
    if (!defined('ROSTER_FOOTER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'footer.php';
    }
    if (is_object($roster->db)) {
        $roster->db->close_db();
    }
    exit;
}
/**
 * Draw a message box with the specified border color, then die cleanly
 *
 * @param string $message | The message to display inside the box
 * @param string $title | The box title (default = 'Message')
 * @param string $style | The border style (default = sred)
 */
function roster_die($message, $title = 'Message', $style = 'sred')
{
    global $roster;
    if ($roster->pages[0] == 'ajax') {
        ajax_die($message, $title, null, null, null);
    }
    if (!defined('ROSTER_HEADER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'header.php';
    }
    if (!defined('ROSTER_MENU_INC') && is_array($roster->config)) {
        $roster_menu = new RosterMenu();
        $roster_menu->makeMenu($roster->output['show_menu']);
    }
    if (is_object($roster->db)) {
        $roster->db->close_db();
    }
    echo messagebox('<div align="center">' . $message . '</div>', $title, $style);
    if (!defined('ROSTER_FOOTER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'footer.php';
    }
    exit;
}