コード例 #1
0
/**
 * Remove ocPortal's strictness, to help integration of third-party code.
 *
 * @param  boolean		Whether to also set the content type to plain-HTML
 * @param  boolean		Whether to destrictify MySQL commands over the ocPortal database driver
 */
function destrictify($change_content_type = true, $mysql_too = false)
{
    // Turn off strictness
    if (!headers_sent() && $change_content_type) {
        @header('Content-type: text/html; charset=' . get_charset());
    }
    $GLOBALS['SCREEN_TEMPLATE_CALLED'] = '';
    $GLOBALS['TITLE_CALLED'] = true;
    error_reporting(E_ALL ^ E_NOTICE);
    if (function_exists('set_time_limit')) {
        @set_time_limit(200);
    }
    if (get_forum_type() == 'ocf' && $mysql_too) {
        $GLOBALS['SITE_DB']->query('SET sql_mode=\'\'', NULL, NULL, true);
    }
    @ini_set('ocproducts.type_strictness', '0');
    global $PREVIOUS_XSS_STATE;
    array_push($PREVIOUS_XSS_STATE, ini_get('ocproducts.xss_detect'));
    $include_path = './';
    $include_path .= PATH_SEPARATOR . get_file_base() . '/';
    $include_path .= PATH_SEPARATOR . get_file_base() . '/sources_custom/';
    $include_path .= PATH_SEPARATOR . get_file_base() . '/uploads/website_specific/';
    if (get_zone_name() != '') {
        $include_path .= PATH_SEPARATOR . get_file_base() . '/' . get_zone_name() . '/';
    }
    @ini_set('include_path', $include_path);
    //disable_php_memory_limit();	Don't do this, recipe for disaster
    @ini_set('allow_url_fopen', '1');
    @ini_set('suhosin.executor.disable_emodifier', '0');
    @ini_set('suhosin.executor.multiheader', '0');
    $GLOBALS['NO_DB_SCOPE_CHECK'] = true;
    $GLOBALS['NO_QUERY_LIMIT'] = true;
}
コード例 #2
0
ファイル: splurgh.php プロジェクト: erico-deh/ocPortal
/**
 * Get a splurghified version of the specified item.
 *
 * @param  string			The name of what the key we want to reference is in our array of maps (e.g. 'id')
 * @param  array			A row of maps for data we are splurghing; this is probably just the result of $GLOBALS['SITE_DB']->query_select
 * @param  URLPATH		The stub that links will be passed through
 * @param  ID_TEXT		The page name we will be saving customised HTML under
 * @param  TIME			The time we did our last change to the data being splurghed (so it can see if we can simply decache instead of deriving)
 * @param  ?AUTO_LINK	The ID that is at the root of our tree (NULL: db_get_first_id)
 * @return string			A string of HTML that represents our splurghing (will desplurgh in the users browser)
 */
function splurgh_master_build($key_name, $map, $url_stub, $_cache_file, $last_change_time, $first_id = NULL)
{
    if (is_null($first_id)) {
        $first_id = db_get_first_id();
    }
    if (!array_key_exists($first_id, $map)) {
        return '';
    }
    if (!has_js()) {
        warn_exit(do_lang_tempcode('MSG_JS_NEEDED'));
    }
    require_javascript('javascript_splurgh');
    if (is_browser_decacheing()) {
        $last_change_time = time();
    }
    $cache_file = zone_black_magic_filterer(get_custom_file_base() . '/' . get_zone_name() . '/pages/html_custom/' . filter_naughty(user_lang()) . '/' . filter_naughty($_cache_file) . '.htm');
    if (!file_exists($cache_file) || is_browser_decacheing() || filesize($cache_file) == 0 || $last_change_time > filemtime($cache_file)) {
        $myfile = @fopen($cache_file, 'wt');
        if ($myfile === false) {
            intelligent_write_error($cache_file);
        }
        $fulltable = array();
        $splurgh = _splurgh_do_node($map, $first_id, '', $fulltable, 0);
        $page = do_template('SPLURGH', array('_GUID' => '8775edfc5a386fdf2cec69b0fc889952', 'KEY_NAME' => $key_name, 'URL_STUB' => $url_stub, 'SPLURGH' => str_replace('"', '\'', $splurgh)));
        $ev = $page->evaluate();
        if (fwrite($myfile, $ev) < strlen($ev)) {
            warn_exit(do_lang_tempcode('COULD_NOT_SAVE_FILE'));
        }
        fclose($myfile);
        fix_permissions($cache_file);
        sync_file($cache_file);
        return $ev;
    }
    return file_get_contents($cache_file, FILE_TEXT);
}
コード例 #3
0
ファイル: site_adminzone.php プロジェクト: erico-deh/ocPortal
/**
 * Extend breadcrumbs for the Admin Zone (called by breadcrumbs_get_default_stub).
 *
 * @param  tempcode		Reference to the breadcrumbs stub we're assembling
 */
function adminzone_extend_breadcrumbs(&$stub)
{
    global $BREADCRUMB_SET_PARENTS;
    if (count($BREADCRUMB_SET_PARENTS) > 0 && !is_object($BREADCRUMB_SET_PARENTS[0][0])) {
        // Works by finding where our oldest ancestor connects on to the do-next menus, and carries from there
        list($zone, $attributes, ) = page_link_decode($BREADCRUMB_SET_PARENTS[0][0]);
        $type = array_key_exists('type', $attributes) ? $attributes['type'] : 'misc';
        $page = $attributes['page'];
        if ($page == '_SELF') {
            $page = get_page_name();
        }
        if ($zone == '_SEARCH') {
            $zone = get_module_zone($page);
        }
        if ($zone == '_SELF') {
            $zone = get_zone_name();
        }
    } else {
        // Works by finding where we connect on to the do-next menus, and carries from there
        $type = get_param('type', 'misc');
        $page = get_page_name();
        $zone = get_zone_name();
    }
    if ($page != 'admin' && $page != 'cms') {
        // Loop over menus, hunting for connection
        $hooks = find_all_hooks('systems', 'do_next_menus');
        $_hooks = array();
        $page_looking = $page;
        $page_looking = preg_replace('#^(cms|admin)\\_#', '', $page_looking);
        if (array_key_exists($page_looking, $hooks)) {
            $_hooks[$page_looking] = $hooks[$page_looking];
            unset($hooks[$page_looking]);
            $hooks = array_merge($_hooks, $hooks);
        }
        foreach ($hooks as $hook => $sources_dir) {
            $run_function = extract_module_functions(get_file_base() . '/' . $sources_dir . '/hooks/systems/do_next_menus/' . $hook . '.php', array('run'));
            if ($run_function[0] !== NULL) {
                $info = is_array($run_function[0]) ? call_user_func_array($run_function[0][0], $run_function[0][1]) : eval($run_function[0]);
                foreach ($info as $i) {
                    if ($i === NULL) {
                        continue;
                    }
                    if ($page == $i[2][0] && (!array_key_exists('type', $i[2][1]) && $type == 'misc' || array_key_exists('type', $i[2][1]) && ($type == $i[2][1]['type'] || $i[2][1]['type'] == 'misc')) && $zone == $i[2][2]) {
                        if ($i[0] == 'cms') {
                            $url = build_url(array('page' => 'cms', 'type' => $i[0] == 'cms' ? NULL : $i[0]), 'cms');
                        } else {
                            $url = build_url(array('page' => 'admin', 'type' => $i[0]), 'adminzone');
                        }
                        require_lang('menus');
                        require_lang('security');
                        $stub->attach(hyperlink($url, do_lang_tempcode(strtoupper($i[0])), false, false, do_lang_tempcode('GO_BACKWARDS_TO', @html_entity_decode(strip_tags(do_lang(strtoupper($i[0]))), ENT_QUOTES, get_charset()))));
                        //if ((!array_key_exists('type',$i[2][1])) || ($type==$i[2][1]['type'])) break;
                        return;
                    }
                }
            }
        }
    }
}
コード例 #4
0
function get_map_zone($id, &$sqlm)
{
    $map_zone = $sqlm->fetch_assoc($sqlm->query('
		SELECT area_id
		FROM dbc_map
		WHERE id=' . $id . ' LIMIT 1'));
    return get_zone_name($map_zone['area_id'], $sqlm);
}
コード例 #5
0
 function __update($data)
 {
     $this->list->clear();
     foreach ($data as $char) {
         $z = get_zone_name($char['map'], $char["xpos"], $char["ypos"]);
         if ($z == " ") {
             $z = get_map_name($char['map']);
         }
         $this->list->append(array($char['name'], GdkPixbuf::new_from_file("./img/{$char['race']}-{$char['gender']}.gif"), GdkPixbuf::new_from_file("./img/{$char['class']}.gif"), $char['level'], $char['latency'], $z));
     }
     $this->list->set_sort_column_id(0, Gtk::SORT_ASCENDING);
 }
コード例 #6
0
/**
 * Put the contents of a page inside an iframe. This is typically used when a page is being used to traverse a result-set that spans multiple screens.
 *
 * @param  tempcode		The title
 * @param  ?integer		The time between refreshes (NULL: do not refresh)
 * @param  ?mixed			Data. A refresh will only happen if an AJAX-check indicates this data has changed (NULL: no check)
 * @return ?tempcode		The page output to finish off our current page stream such that it will spawn the iframe (NULL: not internalised)
 */
function internalise_own_screen($title, $refresh_time = NULL, $refresh_if_changed = NULL)
{
    if (get_value('no_frames') === '1' || get_param_integer('no_frames', 0) == 1 || get_param_integer('keep_no_frames', 0) == 1) {
        return NULL;
    }
    if (!has_js()) {
        return NULL;
    }
    // We need JS to make this a seamless process
    if (strpos(ocp_srv('REQUEST_URI'), '/iframe.php') !== false) {
        return NULL;
    }
    // This is already in the iframe
    require_javascript('javascript_ajax');
    require_javascript('javascript_iframe_screen');
    $url = find_script('iframe') . '?zone=' . rawurlencode(get_zone_name()) . '&wide_high=1&utheme=' . rawurlencode($GLOBALS['FORUM_DRIVER']->get_theme());
    foreach (array_merge($_GET, $_POST) as $key => $param) {
        if (!is_string($param)) {
            continue;
        }
        if (substr($key, 0, 5) == 'keep_' && skippable_keep($key, $param)) {
            continue;
        }
        if (get_magic_quotes_gpc()) {
            $param = stripslashes($param);
        }
        $url .= '&' . $key . '=' . urlencode($param);
    }
    if (!is_null($refresh_if_changed)) {
        require_javascript('javascript_sound');
        $change_detection_url = find_script('change_detection') . '?whatever=1';
        foreach ($_GET as $key => $param) {
            if (!is_string($param)) {
                continue;
            }
            if (substr($key, 0, 5) == 'keep_' && skippable_keep($key, $param)) {
                continue;
            }
            if (get_magic_quotes_gpc()) {
                $param = stripslashes($param);
            }
            $change_detection_url .= '&' . $key . '=' . urlencode($param);
        }
    } else {
        $refresh_if_changed = '';
        $change_detection_url = '';
    }
    return do_template('IFRAME_SCREEN', array('_GUID' => '06554eb227428fd5c648dee3c5b38185', 'TITLE' => $title, 'REFRESH_IF_CHANGED' => md5(serialize($refresh_if_changed)), 'CHANGE_DETECTION_URL' => $change_detection_url, 'REFRESH_TIME' => is_null($refresh_time) ? '' : strval($refresh_time), 'IFRAME_URL' => $url));
}
コード例 #7
0
ファイル: downloads.php プロジェクト: erico-deh/ocPortal
 /**
  * The UI to view a download.
  *
  * @return tempcode		The UI
  */
 function dloadinfo_screen()
 {
     $id = get_param_integer('id');
     $root = get_param_integer('root', db_get_first_id(), true);
     // Basic Init
     $rows = $GLOBALS['SITE_DB']->query_select('download_downloads', array('*'), array('id' => $id), '', 1);
     if (!array_key_exists(0, $rows)) {
         return warn_screen(get_page_title('SECTION_DOWNLOADS'), do_lang_tempcode('MISSING_RESOURCE'));
     }
     $myrow = $rows[0];
     $GLOBALS['FEED_URL'] = find_script('backend') . '?mode=downloads&filter=' . strval($myrow['category_id']);
     if (!has_category_access(get_member(), 'downloads', strval($myrow['category_id']))) {
         access_denied('CATEGORY_ACCESS');
     }
     $name = get_translated_text($myrow['name']);
     list($rating_details, $comment_details, $trackback_details) = embed_feedback_systems(get_page_name(), strval($id), $myrow['allow_rating'], $myrow['allow_comments'], $myrow['allow_trackbacks'], $myrow['validated'], $myrow['submitter'], build_url(array('page' => '_SELF', 'type' => 'entry', 'id' => $id), '_SELF', NULL, false, false, true), $name, get_value('comment_forum__downloads'));
     // Views
     if (get_db_type() != 'xml') {
         $myrow['download_views']++;
         $GLOBALS['SITE_DB']->query_update('download_downloads', array('download_views' => $myrow['download_views']), array('id' => $id), '', 1, NULL, false, true);
     }
     // Tree
     $tree = download_breadcrumbs($myrow['category_id'], $root, false, get_zone_name());
     $title_to_use = do_lang_tempcode('DOWNLOAD_TITLE', escape_html($name));
     $title_to_use_2 = do_lang('DOWNLOAD_TITLE', $name);
     if (addon_installed('awards')) {
         require_code('awards');
         $awards = find_awards_for('download', strval($id));
     } else {
         $awards = array();
     }
     $title = get_page_title($title_to_use, false, NULL, NULL, $awards);
     seo_meta_load_for('downloads_download', strval($id), $title_to_use_2);
     $warning_details = new ocp_tempcode();
     // Validation
     if ($myrow['validated'] == 0) {
         if (!has_specific_permission(get_member(), 'jump_to_unvalidated')) {
             access_denied('SPECIFIC_PERMISSION', 'jump_to_unvalidated');
         }
         $warning_details->attach(do_template('WARNING_TABLE', array('_GUID' => '5b1781b8fbb1ef9b8f47693afcff02b9', 'WARNING' => do_lang_tempcode(get_param_integer('redirected', 0) == 1 ? 'UNVALIDATED_TEXT_NON_DIRECT' : 'UNVALIDATED_TEXT'))));
     }
     // Cost warning
     if ($myrow['download_cost'] != 0 && addon_installed('points')) {
         require_lang('points');
         $warning_details->attach(do_template('WARNING_TABLE', array('_GUID' => '05fc448bf79b373385723c5af5ec93af', 'WARNING' => do_lang_tempcode('WILL_COST', integer_format($myrow['download_cost'])))));
     }
     // Admin functions
     $edit_url = new ocp_tempcode();
     $add_img_url = new ocp_tempcode();
     if (has_actual_page_access(NULL, 'cms_downloads', NULL, NULL) && has_edit_permission('mid', get_member(), $myrow['submitter'], 'cms_downloads', array('downloads', $myrow['category_id']))) {
         $edit_url = build_url(array('page' => 'cms_downloads', 'type' => '_ed', 'id' => $id), get_module_zone('cms_downloads'));
     }
     if (addon_installed('galleries')) {
         if (has_actual_page_access(NULL, 'cms_galleries', NULL, NULL) && has_edit_permission('mid', get_member(), $myrow['submitter'], 'cms_galleries', array('galleries', 'download_' . strval($id)))) {
             require_lang('galleries');
             $add_img_url = build_url(array('page' => 'cms_galleries', 'type' => 'ad', 'cat' => 'download_' . strval($id)), get_module_zone('cms_galleries'));
         }
     }
     // Outmoding
     if (!is_null($myrow['out_mode_id'])) {
         $outmode_url = build_url(array('page' => '_SELF', 'type' => 'entry', 'id' => $myrow['out_mode_id'], 'root' => $root == db_get_first_id() ? NULL : $root), '_SELF');
     } else {
         $outmode_url = new ocp_tempcode();
     }
     // Stats
     $add_date = get_timezoned_date($myrow['add_date'], false);
     // Additional information
     $additional_details = get_translated_tempcode($myrow['comments']);
     // Edit date
     if (!is_null($myrow['edit_date'])) {
         $edit_date = make_string_tempcode(get_timezoned_date($myrow['edit_date'], false));
     } else {
         $edit_date = new ocp_tempcode();
     }
     $images_details = new ocp_tempcode();
     $image_url = '';
     $counter = 0;
     if (addon_installed('galleries')) {
         // Images
         require_lang('galleries');
         $cat = 'download_' . strval($id);
         $map = array('cat' => $cat);
         if (!has_specific_permission(get_member(), 'see_unvalidated')) {
             $map['validated'] = 1;
         }
         $rows = $GLOBALS['SITE_DB']->query_select('images', array('*'), $map, 'ORDER BY id', 200);
         $div = 2;
         $_out = new ocp_tempcode();
         $_row = new ocp_tempcode();
         require_code('images');
         while (array_key_exists($counter, $rows)) {
             $row = $rows[$counter];
             //		$view_url=build_url(array('page'=>'galleries','type'=>'image','wide'=>1,'id'=>$row['id']),get_module_zone('galleries'));
             $view_url = $row['url'];
             if ($image_url == '') {
                 $image_url = $row['url'];
             }
             if (url_is_local($view_url)) {
                 $view_url = get_custom_base_url() . '/' . $view_url;
             }
             $thumb_url = ensure_thumbnail($row['url'], $row['thumb_url'], 'galleries', 'images', $row['id']);
             $comment = get_translated_tempcode($row['comments']);
             $thumb = do_image_thumb($thumb_url, '');
             if (has_actual_page_access(NULL, 'cms_galleries', NULL, NULL) && has_edit_permission('mid', get_member(), $row['submitter'], 'cms_galleries', array('galleries', 'download_' . strval($id)))) {
                 $iedit_url = build_url(array('page' => 'cms_galleries', 'type' => '_ed', 'id' => $row['id']), get_module_zone('cms_galleries'));
             } else {
                 $iedit_url = new ocp_tempcode();
             }
             $_content = do_template('DOWNLOAD_SCREEN_IMAGE', array('_GUID' => 'fba0e309aa0ae04891e32c65a625b177', 'ID' => strval($row['id']), 'VIEW_URL' => $view_url, 'EDIT_URL' => $iedit_url, 'THUMB' => $thumb, 'COMMENT' => $comment));
             $_row->attach(do_template('DOWNLOAD_GALLERY_IMAGE_CELL', array('_GUID' => '8400a832dbed64bb63f264eb3a038895', 'CONTENT' => $_content)));
             if ($counter % $div == 1 && $counter != 0) {
                 $_out->attach(do_template('DOWNLOAD_GALLERY_ROW', array('_GUID' => '205c4f5387e98c534d5be1bdfcccdd7d', 'CELLS' => $_row)));
                 $_row = new ocp_tempcode();
             }
             $counter++;
         }
         if (!$_row->is_empty()) {
             $_out->attach(do_template('DOWNLOAD_GALLERY_ROW', array('_GUID' => 'e9667ca2545ac72f85a873f236cbbd6f', 'CELLS' => $_row)));
         }
         $images_details = $_out;
     }
     // Download link
     $author = $myrow['author'];
     $author_url = addon_installed('authors') ? build_url(array('page' => 'authors', 'type' => 'misc', 'id' => $author), get_module_zone('authors')) : new ocp_tempcode();
     // Licence
     $licence_title = NULL;
     $licence_url = NULL;
     $licence_hyperlink = NULL;
     $licence = $myrow['download_licence'];
     if (!is_null($licence)) {
         $licence_title = $GLOBALS['SITE_DB']->query_value_null_ok('download_licences', 'l_title', array('id' => $licence));
         if (!is_null($licence_title)) {
             $keep = symbol_tempcode('KEEP');
             $licence_url = find_script('download_licence') . '?id=' . strval($licence) . $keep->evaluate();
             $licence_hyperlink = do_template('HYPERLINK_POPUP_WINDOW', array('_GUID' => '10582f28c37ee7e9e462fdbd6a2cb8dd', 'TITLE' => '', 'CAPTION' => $licence_title, 'URL' => $licence_url, 'WIDTH' => '600', 'HEIGHT' => '500', 'REL' => 'license'));
         } else {
             $licence = NULL;
             // Orphaned
         }
     }
     breadcrumb_add_segment($tree, $title_to_use);
     $GLOBALS['META_DATA'] += array('created' => date('Y-m-d', $myrow['add_date']), 'creator' => $myrow['author'], 'publisher' => $GLOBALS['FORUM_DRIVER']->get_username($myrow['submitter']), 'modified' => is_null($myrow['edit_date']) ? '' : date('Y-m-d', $myrow['edit_date']), 'type' => 'Download', 'title' => get_translated_text($myrow['name']), 'identifier' => '_SEARCH:downloads:view:' . strval($id), 'description' => get_translated_text($myrow['description']), 'image' => $image_url);
     return do_template('DOWNLOAD_SCREEN', array('_GUID' => 'a9af438f84783d0d38c20b5f9a62dbdb', 'ORIGINAL_FILENAME' => $myrow['original_filename'], 'URL' => $myrow['url'], 'NUM_IMAGES' => strval($counter), 'TAGS' => get_loaded_tags('downloads'), 'LICENCE' => is_null($licence) ? NULL : strval($licence), 'LICENCE_TITLE' => $licence_title, 'LICENCE_HYPERLINK' => $licence_hyperlink, 'SUBMITTER' => strval($myrow['submitter']), 'EDIT_DATE' => $edit_date, 'EDIT_DATE_RAW' => is_null($myrow['edit_date']) ? '' : strval($myrow['edit_date']), 'VIEWS' => integer_format($myrow['download_views']), 'NAME' => $name, 'DATE' => $add_date, 'DATE_RAW' => strval($myrow['add_date']), 'NUM_DOWNLOADS' => integer_format($myrow['num_downloads']), 'TITLE' => $title, 'OUTMODE_URL' => $outmode_url, 'WARNING_DETAILS' => $warning_details, 'EDIT_URL' => $edit_url, 'ADD_IMG_URL' => $add_img_url, 'DESCRIPTION' => get_translated_tempcode($myrow['description']), 'ADDITIONAL_DETAILS' => $additional_details, 'IMAGES_DETAILS' => $images_details, 'ID' => strval($id), 'FILE_SIZE' => clean_file_size($myrow['file_size']), 'AUTHOR_URL' => $author_url, 'AUTHOR' => $author, 'TRACKBACK_DETAILS' => $trackback_details, 'RATING_DETAILS' => $rating_details, 'COMMENTS_DETAILS' => $comment_details));
 }
コード例 #8
0
ファイル: support.php プロジェクト: erico-deh/ocPortal
/**
 * Get the default page for a zone.
 *
 * @param  ID_TEXT		Zone name
 * @return ID_TEXT		Default page
 */
function get_zone_default_page($zone_name)
{
    if ($zone_name == '_SELF') {
        $zone_name = get_zone_name();
    }
    $p_test = persistant_cache_get(array('ZONE', $zone_name));
    if ($p_test !== NULL) {
        return $p_test['zone_default_page'];
    }
    global $ZONE;
    if ($ZONE['zone_name'] == $zone_name && $ZONE['zone_default_page'] !== NULL) {
        return $ZONE['zone_default_page'];
    } else {
        global $ZONE_DEFAULT_PAGES;
        if (!isset($ZONE_DEFAULT_PAGES[$zone_name])) {
            $_zone_default_page = NULL;
            if (function_exists('persistant_cache_set')) {
                $temp = persistant_cache_get('ALL_ZONES_TITLED');
                if ($temp !== NULL) {
                    $_zone_default_page = array();
                    foreach ($temp as $_temp) {
                        list($_zone_name, , , $zone_default_page) = $_temp;
                        $_zone_default_page[] = array('zone_name' => $_zone_name, 'zone_default_page' => $zone_default_page);
                    }
                }
            }
            if ($_zone_default_page === NULL) {
                $_zone_default_page = $GLOBALS['SITE_DB']->query_select('zones', array('zone_name', 'zone_default_page'), NULL, 'ORDER BY zone_title', 50);
            }
            $ZONE_DEFAULT_PAGES[$zone_name] = 'start';
            $ZONE_DEFAULT_PAGES['collaboration'] = 'start';
            // Set this in case collaboration zone removed but still referenced. Performance tweak!
            foreach ($_zone_default_page as $zone_row) {
                $ZONE_DEFAULT_PAGES[$zone_row['zone_name']] = $zone_row['zone_default_page'];
            }
        }
        return $ZONE_DEFAULT_PAGES[$zone_name];
    }
}
コード例 #9
0
 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     $param = array_key_exists('param', $map) ? $map['param'] : '';
     if ($param == '') {
         return new ocp_tempcode();
     }
     $striptitle = array_key_exists('striptitle', $map) ? intval($map['striptitle']) : 1;
     $onlyifpermissions = array_key_exists('onlyifpermissions', $map) ? intval($map['onlyifpermissions']) : 1;
     $leave_page_and_zone = array_key_exists('leave_page_and_zone', $map) ? $map['leave_page_and_zone'] == '1' : false;
     $merge_parameters = array_key_exists('merge_parameters', $map) ? $map['merge_parameters'] == '1' : false;
     list($zone, $attributes, ) = page_link_decode($param);
     if (!array_key_exists('page', $attributes)) {
         return new ocp_tempcode();
     }
     if ($zone == '_SEARCH') {
         $zone = get_page_zone($attributes['page'], false);
     } elseif ($zone == '_SELF') {
         $zone = get_zone_name();
     }
     if (is_null($zone)) {
         return new ocp_tempcode();
     }
     if ($onlyifpermissions == 1 && !has_actual_page_access(get_member(), $attributes['page'], $zone)) {
         return new ocp_tempcode();
     }
     global $SKIP_TITLING;
     if ($striptitle == 1) {
         $temp = $SKIP_TITLING;
         $SKIP_TITLING = true;
     }
     $temp_get = $_GET;
     if (!$merge_parameters) {
         $_GET = array();
     }
     if ($striptitle == 1) {
         $_GET['no_frames'] = '1';
     }
     foreach ($attributes as $key => $val) {
         $_GET[$key] = get_magic_quotes_gpc() ? addslashes($val) : $val;
     }
     foreach ($temp_get as $key => $val) {
         if (substr($key, 0, 5) == 'keep_') {
             $_GET[$key] = get_magic_quotes_gpc() ? addslashes($val) : $val;
         }
     }
     $_GET['in_main_include_module'] = '1';
     $current_page = $GLOBALS['PAGE_NAME_CACHE'];
     $current_zone = $GLOBALS['ZONE'];
     if (!$leave_page_and_zone) {
         $GLOBALS['PAGE_NAME_CACHE'] = $attributes['page'];
         if ($zone != get_zone_name()) {
             $_zone = $GLOBALS['SITE_DB']->query_select('zones', array('*'), array('zone_name' => $zone), '', 1);
             if (array_key_exists(0, $_zone)) {
                 $_zone[0]['zone_header_text_trans'] = get_translated_text($_zone[0]['zone_header_text']);
                 $GLOBALS['ZONE'] = $_zone[0];
             }
         }
     }
     $temp_displayed_title = $GLOBALS['DISPLAYED_TITLE'];
     $temp_seo_title = $GLOBALS['SEO_TITLE'];
     $temp_current_breadcrumb_extra_segments = $GLOBALS['BREADCRUMB_EXTRA_SEGMENTS'];
     $GLOBALS['BREADCRUMB_EXTRA_SEGMENTS'] = new ocp_tempcode();
     // Force a new object, so we don't just reassign the tainted reference
     $temp_current_breadcrumbs = $GLOBALS['BREADCRUMBS'];
     $GLOBALS['BREADCRUMBS'] = NULL;
     $temp_current_breadcrumb_set_parents = $GLOBALS['BREADCRUMB_SET_PARENTS'];
     $temp_current_breadcrumb_set_self = $GLOBALS['BREADCRUMB_SET_SELF'];
     $GLOBALS['SEO_TITLE'] = 'DO_NOT_REPLACE';
     $out = request_page($attributes['page'], false, $zone, NULL, true);
     $ret = make_string_tempcode($out->evaluate());
     $GLOBALS['DISPLAYED_TITLE'] = $temp_displayed_title;
     $GLOBALS['SEO_TITLE'] = $temp_seo_title;
     $GLOBALS['BREADCRUMB_EXTRA_SEGMENTS'] = $temp_current_breadcrumb_extra_segments;
     $GLOBALS['BREADCRUMBS'] = $temp_current_breadcrumbs;
     $GLOBALS['BREADCRUMB_SET_PARENTS'] = $temp_current_breadcrumb_set_parents;
     $GLOBALS['BREADCRUMB_SET_SELF'] = $temp_current_breadcrumb_set_self;
     $GLOBALS['PAGE_NAME_CACHE'] = $current_page;
     $GLOBALS['ZONE'] = $current_zone;
     $_GET = $temp_get;
     if (is_null($out)) {
         $out = new ocp_tempcode();
     }
     if ($striptitle == 1) {
         $SKIP_TITLING = $temp;
     }
     return $ret;
 }
コード例 #10
0
 function m_ssdata_set($ar)
 {
     $im = count($ar);
     if ($im > 14) {
         $im = 14;
     }
     $this->m_ssdata_clear();
     for ($i = 0; $i <= $im; $i++) {
         if (!empty($ar[$i]['name']) and is_array($this->m_ssdata[$i])) {
             $this->m_ssdata[$i]['name']->show();
             $this->m_ssdata[$i]['level']->show();
             $this->m_ssdata[$i]['ping']->show();
             $this->m_ssdata[$i]['end']->show();
             $this->m_ssdata[$i]['map']->show();
             $this->m_ssdata[$i]['Img1']->show();
             $this->m_ssdata[$i]['Img2']->show();
             $this->m_ssdata[$i]['paned']->show();
             $z = get_zone_name($ar[$i]['map'], $ar[$i]["xpos"], $ar[$i]["ypos"]);
             if ($z == " ") {
                 $z = get_map_name($ar[$i]['map']);
             }
             $this->m_ssdata[$i]['map']->set_markup("Zone: \n" . $z);
             $this->m_ssdata[$i]['name']->set_markup("Name: \n{$ar[$i]['name']}");
             $this->m_ssdata[$i]['level']->set_markup("Level: {$ar[$i]['level']}");
             $this->m_ssdata[$i]['ping']->set_markup("Ping: {$ar[$i]['latency']}");
             $this->m_ssdata[$i]['Img1']->set_from_file("./img/{$ar[$i]['race']}-{$ar[$i]['gender']}.gif");
             $this->m_ssdata[$i]['Img2']->set_from_file("./img/{$ar[$i]['class']}.gif");
         }
     }
 }
コード例 #11
0
ファイル: aed_module.php プロジェクト: erico-deh/ocPortal
 /**
  * Standard modular UI to choose an entry to edit.
  *
  * @return tempcode	The UI
  */
 function ed()
 {
     if (!is_null($this->permissions_require) && is_null($this->permissions_cat_require)) {
         check_some_edit_permission($this->permissions_require, NULL, $this->permission_page_name);
     }
     $doing = 'EDIT_' . $this->lang_type;
     if ($this->catalogue && get_param('catalogue_name', '') != '') {
         $catalogue_title = get_translated_text($GLOBALS['SITE_DB']->query_value('catalogues', 'c_title', array('c_name' => get_param('catalogue_name'))));
         if ($this->type_code == 'd') {
             $doing = do_lang('CATALOGUE_GENERIC_EDIT', escape_html($catalogue_title));
         } elseif ($this->type_code == 'c') {
             $doing = do_lang('CATALOGUE_GENERIC_EDIT_CATEGORY', escape_html($catalogue_title));
         }
     }
     $title = get_page_title($doing);
     $test = $this->choose_catalogue($title);
     if (!is_null($test)) {
         return $test;
     }
     $text = paragraph(do_lang_tempcode('CHOOSE_EDIT_LIST'));
     $next_type = '_e' . $this->type_code;
     if (get_param('type', 'ed') == 'edit_catalogue') {
         $next_type = '_edit_catalogue';
     }
     $map = array('page' => '_SELF', 'type' => $next_type);
     if (either_param('catalogue_name', '') != '') {
         $map['catalogue_name'] = either_param('catalogue_name');
     }
     if (!is_null(get_param('redirect', NULL))) {
         $map['redirect'] = get_param('redirect');
     }
     if (!is_null(get_param('continue', NULL))) {
         $map['continue'] = get_param('continue');
     }
     $description = $this->select_name_description != '' ? do_lang_tempcode($this->select_name_description) : new ocp_tempcode();
     if (method_exists($this, 'nice_get_radio_entries')) {
         $entries = $this->nice_get_radio_entries();
         if ($entries->is_empty()) {
             inform_exit(do_lang_tempcode($this->type_code == 'd' ? 'NO_ENTRIES' : 'NO_CATEGORIES'));
         }
         $fields = form_input_radio(do_lang_tempcode($this->select_name), $description, 'id', $entries, $this->no_blank_ids, true, '');
     } elseif (method_exists($this, 'nice_get_ajax_tree') && ($_fields = $this->nice_get_ajax_tree()) !== NULL) {
         if (is_array($_fields)) {
             $text = paragraph(do_lang_tempcode('CHOOSE_EDIT_LIST_EXTRA', escape_html($_fields[1]->evaluate()), escape_html($_fields[2]->evaluate())));
             $fields = $_fields[0];
         } else {
             $fields = $_fields;
         }
     } elseif (method_exists($this, 'nice_get_choose_table')) {
         list($test, ) = $this->get_entry_rows();
         if (count($test) == 0) {
             inform_exit(do_lang_tempcode($this->type_code == 'd' ? 'NO_ENTRIES' : 'NO_CATEGORIES'));
         }
         $table_result = $this->nice_get_choose_table($map);
         if (is_null($table_result)) {
             inform_exit(do_lang_tempcode($this->type_code == 'd' ? 'NO_ENTRIES' : 'NO_CATEGORIES'));
         }
         $table = $table_result[0];
         $has_ordering = $table_result[1];
         if (array_key_exists(2, $table_result) && !is_null($table_result[2])) {
             $text = paragraph(do_lang_tempcode('CHOOSE_EDIT_TABLE_EXTRA', escape_html($table_result[2]->evaluate()), escape_html($table_result[3]->evaluate())));
         } else {
             $text = paragraph(do_lang_tempcode('CHOOSE_EDIT_TABLE'));
         }
         return do_template('TABLE_TABLE_SCREEN', array('TITLE' => $title, 'TEXT' => $text, 'TABLE' => $table, 'SUBMIT_NAME' => $has_ordering ? do_lang_tempcode('ORDER') : NULL, 'POST_URL' => get_self_url()));
     } else {
         $_entries = $this->nice_get_entries();
         if (is_array($_entries)) {
             $text = paragraph(do_lang_tempcode('CHOOSE_EDIT_LIST_EXTRA', escape_html($_entries[1]->evaluate()), escape_html($_entries[2]->evaluate())));
             $entries = $_entries[0];
         } else {
             $entries = $_entries;
         }
         if ($entries->is_empty()) {
             inform_exit(do_lang_tempcode($this->type_code == 'd' ? 'NO_ENTRIES' : 'NO_CATEGORIES'));
         }
         $fields = form_input_list(do_lang_tempcode($this->select_name), $description, 'id', $entries, NULL, true, $this->no_blank_ids);
     }
     $post_url = build_url($map, '_SELF', NULL, false, true);
     //$submit_name=(strpos($doing,' ')!==false)?protect_from_escaping($doing):do_lang($doing);
     $submit_name = do_lang_tempcode('PROCEED');
     $keep = symbol_tempcode('KEEP');
     $iframe_url = NULL;
     if (!$this->special_edit_frontend && has_js()) {
         $iframe_url = find_script('iframe') . '?zone=' . get_zone_name() . '&wide_high=1&opens_below=1';
         foreach ($map as $key => $val) {
             $iframe_url .= '&' . $key . '=' . urlencode(str_replace('_SELF', get_page_name(), $val));
         }
         $iframe_url .= $keep->evaluate();
     }
     return do_template('FORM_SCREEN', array('_GUID' => '228a05e24253f324ea286ea8ac3d8b02' . get_class($this), 'GET' => true, 'IFRAME_URL' => $iframe_url, 'HIDDEN' => '', 'TITLE' => $title, 'TEXT' => $text, 'URL' => $post_url, 'FIELDS' => $fields->evaluate(), 'SUBMIT_NAME' => $submit_name, 'SKIP_VALIDATION' => true));
 }
コード例 #12
0
    }
    if ($gm_player && $show_player || $gm_player && !$show_player && $status_gm_include_all) {
        $gm_online++;
    }
    if ($gm_player && $show_player == false) {
        continue;
    }
    $char_data = explode(';', $result['data']);
    $char_flags = $char_data[$PLAYER_FLAGS];
    $char_dead = $char_flags & 0x11 ? 1 : 0;
    $arr[$i]['x'] = $result['positionx'];
    $arr[$i]['y'] = $result['positiony'];
    $arr[$i]['dead'] = $char_dead;
    $arr[$i]['name'] = $result['name'];
    $arr[$i]['map'] = $result['mapid'];
    $arr[$i]['zone'] = get_zone_name($result['zoneid']);
    $arr[$i]['cl'] = $result['class'];
    $arr[$i]['race'] = $result['race'];
    $arr[$i]['level'] = $result['level'];
    $arr[$i]['gender'] = $result['gender'];
    $arr[$i]['Extention'] = $Extention;
    $arr[$i]['leaderGuid'] = isset($groups[$char_data[0]]) ? $groups[$char_data[0]] : 0;
    $i++;
}
$characters_db_PM->close();
unset($characters_db_PM);
if (!count($arr) && !test_realm()) {
    $res['online'] = NULL;
} else {
    usort($arr, "sort_players");
    $arr = array_merge($Count, $arr);
コード例 #13
0
/**
 * Find the cache signature for the block.
 *
 * @param  array	The block parameters.
 * @return array	The cache signature.
 */
function block_side_stored_menu__cache_on($map)
{
    $menu = array_key_exists('param', $map) ? $map['param'] : '';
    return array($GLOBALS['FORUM_DRIVER']->get_members_groups(get_member()), substr($menu, 0, 1) != '_' && substr($menu, 0, 3) != '!!!' && has_actual_page_access(get_member(), 'admin_menus'), get_zone_name(), get_page_name(), array_key_exists('type', $map) ? $map['type'] : 'tree', $menu, array_key_exists('caption', $map) ? $map['caption'] : '', array_key_exists('silent_failure', $map) ? $map['silent_failure'] : '0', array_key_exists('tray_status', $map) ? $map['tray_status'] : '');
}
コード例 #14
0
ファイル: char_tools.php プロジェクト: xhaher/CoreManager
function char_tools_form()
{
    global $output, $characters_db, $realm_id, $action_permission, $site_encoding, $showcountryflag, $sql;
    valid_login($action_permission["delete"]);
    if (isset($_GET["char"])) {
        $id = $_GET["char"];
    } else {
        error(lang("global", "empty_fields"));
    }
    if ($core == 1) {
        $result = $sql["char"]->query("SELECT guid, name, race, class, level, zoneid, mapid, online, gender\r\n      acct, data \r\n      FROM characters WHERE guid='" . $id . "'");
    } elseif ($core == 2) {
        $result = $sql["char"]->query("SELECT guid, name, race, class, level, zone AS zoneid, map AS mapid, \r\n      online, gender, totaltime, account AS acct,\r\n      arenaPoints, totalHonorPoints, totalKills\r\n      FROM characters WHERE guid='" . $id . "'");
    } else {
        $result = $sql["char"]->query("SELECT guid, name, race, class, level, zone AS zoneid, map AS mapid, \r\n      online, gender, totaltime, account AS acct, arenaPoints, totalHonorPoints, totalKills\r\n      FROM characters WHERE guid='" . $id . "'");
    }
    $char = $sql["char"]->fetch_assoc($result);
    if ($core == 1) {
        $char_data = $char["data"];
        if (empty($char_data)) {
            $char_data = str_repeat("0;", PLAYER_END);
        }
        $char_data = explode(";", $char_data);
    } else {
        $query = "SELECT * FROM characters\r\n                LEFT JOIN character_stats ON characters.guid=character_stats.guid\r\n              WHERE characters.guid='" . $id . "'";
        $char_data_result = $sql["char"]->query($query);
        $char_data_fields = $sql["char"]->fetch_assoc($char_data_result);
        $char_data[PLAYER_FIELD_HONOR_CURRENCY] = isset($char["totalHonorPoints"]) ? $char["totalHonorPoints"] : '&nbsp;';
        $char_data[PLAYER_FIELD_ARENA_CURRENCY] = isset($char["arenaPoints"]) ? $char["arenaPoints"] : '&nbsp;';
        $char_data[PLAYER_FIELD_LIFETIME_HONORBALE_KILLS] = isset($char["totalKills"]) ? $char["totalKills"] : '&nbsp;';
    }
    if ($core == 1) {
        $guild_id = $sql["char"]->result($sql["char"]->query("SELECT guildid FROM guild_data WHERE playerid='" . $char["guid"] . "'"), 0);
        $guild_rank = $sql["char"]->result($sql["char"]->query("SELECT guildRank FROM guild_data WHERE playerid='" . $char["guid"] . "'"), 0);
        $guild_name = $sql["char"]->result($sql["char"]->query("SELECT guildName FROM guilds WHERE guildid='" . $guild_id . "'"));
    } else {
        $guild_id = $sql["char"]->result($sql["char"]->query("SELECT guildid FROM guild_member WHERE guid='" . $char["guid"] . "'"), 0);
        $guild_rank = $sql["char"]->result($sql["char"]->query("SELECT rank AS guildRank FROM guild_member WHERE guid='" . $char["guid"] . "'"), 0);
        $guild_name = $sql["char"]->result($sql["char"]->query("SELECT name AS guildName FROM guild WHERE guildid='" . $guild_id . "'"));
    }
    $online = $char["online"] ? lang("char", "online") : lang("char", "offline");
    if ($guild_id) {
        $guild_name = '<a href="guild.php?action=view_guild&amp;realm=' . $realmid . '&amp;error=3&amp;id=' . $guild_id . '" >' . $guild_name . '</a>';
        $mrank = $guild_rank;
        if ($core == 1) {
            $guild_rank = $sql["char"]->result($sql["char"]->query('SELECT rankname FROM guild_ranks WHERE guildid=' . $guild_id . ' AND rankId=' . $mrank . ''), 0, 'rankname');
        } else {
            $guild_rank = $sql["char"]->result($sql["char"]->query('SELECT rname AS rankname FROM guild_rank WHERE guildid=' . $guild_id . ' AND rid=' . $mrank . ''), 0, 'rankname');
        }
    } else {
        $guild_name = lang("global", "none");
        $guild_rank = lang("global", "none");
    }
    $output .= '
          <center>
            <table class="hidden char_list_char_tools">
              <tr>
                <td class="char_tools_avatar">
                  <div>
                    <img src="' . char_get_avatar_img($char["level"], $char["gender"], $char["race"], $char["class"], 0) . '" alt="avatar" />
                  </div>
                </td>
                <td colspan="3">
                  <font class="bold">
                    ' . htmlentities($char["name"], ENT_COMPAT, $site_encoding) . ' -
                    <img src="img/c_icons/' . $char["race"] . '-' . $char["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($char["race"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                    <img src="img/c_icons/' . $char["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($char["class"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                   - ' . lang("char", "level_short") . char_get_level_color($char["level"]) . '
                  </font>
                  <br />' . lang("char", "location") . ': ' . get_map_name($char["mapid"]) . ' - ' . get_zone_name($char["zoneid"]) . '
                  <br />' . lang("char", "honor_points") . ': ' . $char_data[PLAYER_FIELD_HONOR_CURRENCY] . ' | ' . lang("char", "arena_points") . ': ' . $char_data[PLAYER_FIELD_ARENA_CURRENCY] . ' | ' . lang("char", "honor_kills") . ': ' . $char_data[PLAYER_FIELD_LIFETIME_HONORBALE_KILLS] . '
                  <br />' . lang("char", "guild") . ': ' . $guild_name . ' | ' . lang("char", "rank") . ': ' . htmlentities($guild_rank, ENT_COMPAT, $site_encoding) . '
                  <br />' . lang("char", "online") . ': ' . ($char["online"] ? '<img src="img/up.gif" onmousemove="oldtoolTip(\'' . lang("char", "online") . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="online" />' : '<img src="img/down.gif" onmousemove="oldtoolTip(\'' . lang("char", "offline") . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="offline" />');
    if ($showcountryflag) {
        require_once 'libs/misc_lib.php';
        $country = misc_get_country_by_account($char["acct"]);
        $output .= ' | ' . lang("global", "country") . ': ' . ($country["code"] ? '<img src="img/flags/' . $country["code"] . '.png" onmousemove="oldtoolTip(\'' . $country["country"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />' : '-');
        unset($country);
    }
    $output .= '
                </td>
              </tr>
            </table>
            <br />
            <table class="hidden char_list_char_tools">
              <tr>
                <td>';
    makebutton(lang("xname", "changename"), "char_tools.php?char=" . $id, 150);
    $output .= '
                </td>
                <td>';
    makebutton(lang("xrace", "changerace"), "char_tools.php?char=" . $id, 150);
    $output .= '
                </td>
                <td>';
    makebutton(lang("unstuck", "unstuck"), "hearthstone.php?action=approve&amp;char=" . $id, 150);
    $output .= '
                </td>
              </tr>
              <tr>
                <td>';
    makebutton(lang("char_list", "transfer"), "change_char_account.php?action=chooseacct&amp;priority=1&amp;char=" . $id, 150);
    $output .= '
                </td>
                <td>';
    makebutton(lang("global", "back"), "char_list.php", 150);
    $output .= '
                </td>
              </tr>
            </table>
          </center>';
}
コード例 #15
0
function char_friends(&$sqlr, &$sqlc)
{
    global $output, $lang_global, $lang_char, $realm_id, $realm_db, $mmfpm_db, $characters_db, $action_permission, $user_lvl, $user_name;
    //==========================$_GET and SECURE=================================
    // id and multi realm security to prevent sql injection
    require_once './include/char/include/char_multi_realm_security.php';
    $order_by = isset($_GET['order_by']) ? $sqlc->quote_smart($_GET['order_by']) : 'name';
    if (preg_match('/^[[:lower:]]{1,6}$/', $order_by)) {
    } else {
        $order_by = 'name';
    }
    $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;
    if ($order_by === 'map') {
        $order_by = 'map ' . $order_dir . ', zone';
    } elseif ($order_by === 'zone') {
        $order_by = 'zone ' . $order_dir . ', map';
    }
    //==========================$_GET and SECURE end========================
    // getting character data from database
    $result = $sqlc->query('
		SELECT account, name, race, class, gender, level
		FROM characters
		WHERE guid = ' . $id . '
		LIMIT 1');
    // no point going further if character does not exist
    if ($sqlc->num_rows($result)) {
        $char = $sqlc->fetch_assoc($result);
        // we get user permissions first
        $owner_acc_id = $sqlc->result($result, 0, 'account');
        $result = $sqlr->query('
			SELECT gmlevel, username 
			FROM account 
			WHERE id = ' . $char['account'] . '');
        $owner_gmlvl = $sqlr->result($result, 0, 'gmlevel');
        $owner_name = $sqlr->result($result, 0, 'username');
        // check user permission
        if ($user_lvl > $owner_gmlvl || $owner_name === $user_name) {
            // character sub header
            $output .= '
<center>
<div id="tab_content">
	<h1>' . $lang_char['friends'] . '</h1>
	<br />';
            // character menu tab
            require_once './include/char/include/char_header.php';
            // character info
            require_once './include/char/include/char_info.php';
            //---------------Page Specific Data Starts Here--------------------------
            $output .= '
<script type="text/javascript">
	// <![CDATA[
		function wrap()
		{
			if (getBrowserWidth() > 1024)
				document.write(\'</table></td><td><table class="lined" style="width: 1%;">\');
		}
		// ]]>
</script>
	<div id="tab_content2">
		<table class="lined" style="width: 1%;">';
            $sqlm = new SQL();
            $sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
            $result = $sqlc->query('
				SELECT name, race, class, map, zone, level, gender, online, account, guid
				FROM characters 
				WHERE guid in 
					(SELECT friend 
					FROM character_social 
					WHERE guid = ' . $id . ' and flags <= 1) 
				ORDER BY ' . $order_by . ' ' . $order_dir . '');
            if ($sqlc->num_rows($result)) {
                $output .= '
			<tr>
				<th colspan="7" align="left">' . $lang_char['friends'] . '</th>
			</tr>
			<tr>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=name&amp;dir=' . $dir . '"' . ($order_by === 'name' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['name'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=race&amp;dir=' . $dir . '"' . ($order_by === 'race' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['race'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=class&amp;dir=' . $dir . '"' . ($order_by === 'class' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['class'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=level&amp;dir=' . $dir . '"' . ($order_by === 'level' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['level'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=map&amp;dir=' . $dir . '"' . ($order_by === 'map ' . $order_dir . ', zone' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['map'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=zone&amp;dir=' . $dir . '"' . ($order_by === 'zone ' . $order_dir . ', map' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['zone'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=online&amp;dir=' . $dir . '"' . ($order_by === 'online' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['online'] . '</a></th>
			</tr>';
                while ($data = $sqlc->fetch_assoc($result)) {
                    $char_gm_level = $sqlr->result($sqlr->query('
						SELECT gmlevel 
						FROM account 
						WHERE id = ' . $data['account'] . ''), 0, 'gmlevel');
                    $output .= '
			<tr>
				<td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output .= '
					<a href="char.php?id=' . $data['guid'] . '">' . $data['name'] . '</a>';
                    } else {
                        $output .= $data['name'];
                    }
                    $output .= '
				</td>
				<td><img src="img/c_icons/' . $data['race'] . '-' . $data['gender'] . '.gif" onmousemove="toolTip(\'' . char_get_race_name($data['race']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td><img src="img/c_icons/' . $data['class'] . '.gif" onmousemove="toolTip(\'' . char_get_class_name($data['class']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td>' . char_get_level_color($data['level']) . '</td>
				<td class="small"><span onmousemove="toolTip(\'MapID:' . $data['map'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_map_name($data['map'], $sqlm) . '</span></td>
				<td class="small"><span onmousemove="toolTip(\'ZoneID:' . $data['zone'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_zone_name($data['zone'], $sqlm) . '</span></td>
				<td>' . ($data['online'] ? '<img src="img/up.gif" alt="" />' : '-') . '</td>
			</tr>';
                }
            }
            $result = $sqlc->query('
				SELECT name, race, class, map, zone, level, gender, online, account, guid
				FROM characters 
				WHERE guid in
					(SELECT guid
					FROM character_social
					WHERE friend = ' . $id . ' and flags <= 1)
				ORDER BY ' . $order_by . ' ' . $order_dir . '');
            if ($sqlc->num_rows($result)) {
                $output .= '
			<tr>
				<th colspan="7" align="left">' . $lang_char['friendof'] . '</th>
			</tr>
			<tr>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=name&amp;dir=' . $dir . '"' . ($order_by === 'name' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['name'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=race&amp;dir=' . $dir . '"' . ($order_by === 'race' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['race'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=class&amp;dir=' . $dir . '"' . ($order_by === 'class' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['class'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=level&amp;dir=' . $dir . '"' . ($order_by === 'level' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['level'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=map&amp;dir=' . $dir . '"' . ($order_by === 'map ' . $order_dir . ', zone' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['map'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=zone&amp;dir=' . $dir . '"' . ($order_by === 'zone ' . $order_dir . ', map' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['zone'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=online&amp;dir=' . $dir . '"' . ($order_by === 'online' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['online'] . '</a></th>
			</tr>';
                while ($data = $sqlc->fetch_assoc($result)) {
                    $char_gm_level = $sqlr->result($sqlr->query('
						SELECT gmlevel
						FROM account
						WHERE id = ' . $data['account'] . ''), 0, 'gmlevel');
                    $output .= '
			<tr>
				<td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output .= '
					<a href="char.php?id=' . $data['guid'] . '">' . $data['name'] . '</a>';
                    } else {
                        $output .= $data['name'];
                    }
                    $output .= '
				</td>
				<td><img src="img/c_icons/' . $data['race'] . '-' . $data['gender'] . '.gif" onmousemove="toolTip(\'' . char_get_race_name($data['race']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td><img src="img/c_icons/' . $data['class'] . '.gif" onmousemove="toolTip(\'' . char_get_class_name($data['class']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td>' . char_get_level_color($data['level']) . '</td>
				<td class="small"><span onmousemove="toolTip(\'MapID:' . $data['map'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_map_name($data['map'], $sqlm) . '</span></td>
				<td class="small"><span onmousemove="toolTip(\'ZoneID:' . $data['zone'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_zone_name($data['zone'], $sqlm) . '</span></td>
				<td>' . ($data['online'] ? '<img src="img/up.gif" alt="" />' : '-') . '</td>
			</tr>';
                }
            }
            $output .= '
<script type="text/javascript">
	// <![CDATA[
		wrap();
	// ]]>
</script>';
            $result = $sqlc->query('
				SELECT name, race, class, map, zone, level, gender, online, account, guid
				FROM characters
				WHERE guid in
					(SELECT friend
					FROM character_social
					WHERE guid = ' . $id . ' and flags > 1)
				ORDER BY ' . $order_by . ' ' . $order_dir . '');
            if ($sqlc->num_rows($result)) {
                $output .= '
			<tr>
				<th colspan="7" align="left">' . $lang_char['ignored'] . '</th>
			</tr>
			<tr>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=name&amp;dir=' . $dir . '"' . ($order_by === 'name' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['name'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=race&amp;dir=' . $dir . '"' . ($order_by === 'race' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['race'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=class&amp;dir=' . $dir . '"' . ($order_by === 'class' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['class'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=level&amp;dir=' . $dir . '"' . ($order_by === 'level' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['level'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=map&amp;dir=' . $dir . '"' . ($order_by === 'map ' . $order_dir . ', zone' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['map'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=zone&amp;dir=' . $dir . '"' . ($order_by === 'zone ' . $order_dir . ', map' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['zone'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=online&amp;dir=' . $dir . '"' . ($order_by === 'online' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['online'] . '</a></th>
			</tr>';
                while ($data = $sqlc->fetch_assoc($result)) {
                    $char_gm_level = $sqlr->result($sqlr->query('
						SELECT gmlevel
						FROM account
						WHERE id = ' . $data['account'] . ''), 0, 'gmlevel');
                    $output .= '
			<tr>
				<td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output .= '
					<a href="char.php?id=' . $data['guid'] . '">' . $data['name'] . '</a>';
                    } else {
                        $output .= $data['name'];
                    }
                    $output .= '
				</td>
				<td><img src="img/c_icons/' . $data['race'] . '-' . $data['gender'] . '.gif" onmousemove="toolTip(\'' . char_get_race_name($data['race']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td><img src="img/c_icons/' . $data['class'] . '.gif" onmousemove="toolTip(\'' . char_get_class_name($data['class']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td>' . char_get_level_color($data['level']) . '</td>
				<td class="small"><span onmousemove="toolTip(\'MapID:' . $data['map'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_map_name($data['map'], $sqlm) . '</span></td>
				<td class="small"><span onmousemove="toolTip(\'ZoneID:' . $data['zone'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_zone_name($data['zone'], $sqlm) . '</span></td>
				<td>' . ($data['online'] ? '<img src="img/up.gif" alt="" />' : '-') . '</td>
			</tr>';
                }
            }
            $result = $sqlc->query('
				SELECT name, race, class, map, zone, level, gender, online, account, guid
				FROM characters
				WHERE guid in
					(SELECT guid
					FROM character_social
					WHERE friend = ' . $id . ' and flags > 1)
				ORDER BY ' . $order_by . ' ' . $order_dir . '');
            if ($sqlc->num_rows($result)) {
                $output .= '
			<tr>
				<th colspan="7" align="left">' . $lang_char['ignoredby'] . '</th>
			</tr>
			<tr>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=name&amp;dir=' . $dir . '"' . ($order_by === 'name' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['name'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=race&amp;dir=' . $dir . '"' . ($order_by === 'race' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['race'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=class&amp;dir=' . $dir . '"' . ($order_by === 'class' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['class'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=level&amp;dir=' . $dir . '"' . ($order_by === 'level' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['level'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=map&amp;dir=' . $dir . '"' . ($order_by === 'map ' . $order_dir . ', zone' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['map'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=zone&amp;dir=' . $dir . '"' . ($order_by === 'zone ' . $order_dir . ', map' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['zone'] . '</a></th>
				<th width="1%"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=online&amp;dir=' . $dir . '"' . ($order_by === 'online' ? ' class="' . $order_dir . '"' : '') . '>' . $lang_char['online'] . '</a></th>
			</tr>';
                while ($data = $sqlc->fetch_assoc($result)) {
                    $char_gm_level = $sqlr->result($sqlr->query('
						SELECT gmlevel
						FROM account
						WHERE id = ' . $data['account'] . ''), 0, 'gmlevel');
                    $output .= '
			<tr>
				<td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output .= '
					<a href="char.php?id=' . $data['guid'] . '">' . $data['name'] . '</a>';
                    } else {
                        $output .= $data['name'];
                    }
                    $output .= '
				</td>
				<td><img src="img/c_icons/' . $data['race'] . '-' . $data['gender'] . '.gif" onmousemove="toolTip(\'' . char_get_race_name($data['race']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td><img src="img/c_icons/' . $data['class'] . '.gif" onmousemove="toolTip(\'' . char_get_class_name($data['class']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" /></td>
				<td>' . char_get_level_color($data['level']) . '</td>
				<td class="small"><span onmousemove="toolTip(\'MapID:' . $data['map'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_map_name($data['map'], $sqlm) . '</span></td>
				<td class="small"><span onmousemove="toolTip(\'ZoneID:' . $data['zone'] . '\', \'item_tooltip\')" onmouseout="toolTip()">' . get_zone_name($data['zone'], $sqlm) . '</span></td>
				<td>' . ($data['online'] ? '<img src="img/up.gif" alt="" />' : '-') . '</td>
			</tr>';
                }
            }
            $output .= '
		</table>
	</div>
</div>
<br />';
            //---------------Page Specific Data Ends here----------------------------
            // character sub footer
            require_once './include/char/include/char_ footer.php';
            $output .= '
<br />
</center>';
        } else {
            error($lang_char['no_permission']);
        }
    } else {
        error($lang_char['no_char_found']);
    }
}
コード例 #16
0
ファイル: char_edit.php プロジェクト: BACKUPLIB/minimanager-1
function edit_char(&$sqlr, &$sqlc, &$sqlm)
{
    global $lang_global, $lang_char, $lang_item, $output, $realm_db, $characters_db, $realm_id, $mmfpm_db, $action_permission, $user_lvl, $item_datasite;
    // this page uses wowhead tooltops
    wowhead_tt();
    valid_login($action_permission['delete']);
    if (empty($_GET['id'])) {
        error($lang_global['empty_fields']);
    }
    $sqlm = new SQL();
    $sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    $id = $sqlc->quote_smart($_GET['id']);
    // getting character data from database
    $result = $sqlc->query("\r\n\t\tSELECT account \r\n\t\tFROM `characters` \r\n\t\tWHERE guid = '{$id}'");
    // no point going further if character does not exist
    if ($sqlc->num_rows($result)) {
        //resrict by owner's gmlvl
        $owner_acc_id = $sqlc->result($result, 0, 'account');
        $query = $sqlr->query("\r\n\t\t\tSELECT gmlevel, username \r\n\t\t\tFROM account \r\n\t\t\tWHERE id ='{$owner_acc_id}'");
        $owner_gmlvl = $sqlr->result($query, 0, 'gmlevel');
        $owner_name = $sqlr->result($query, 0, 'username');
        $owner_check = $sqlr->result($query, 0, 'username');
        if ($user_lvl >= $owner_gmlvl) {
            $result = $sqlc->query("\r\n\t\t\t\tSELECT c.guid, c.account, c.name, c.race, c.class, c.level, c.gender, c.online, c.money, c.totaltime,\r\n\t\t\t\t\tc.position_x, c.position_y, c.position_z, c.map, c.zone,\r\n\t\t\t\t\tc.totalHonorpoints, c.totalKills, c.arenaPoints, c.equipmentCache,\r\n\t\t\t\t\tCOALESCE(guild_member.guildid,0) AS guildid, COALESCE(guild_member.rank,0) AS grank\r\n\t\t\t\tFROM characters  c LEFT JOIN guild_member ON c.guid = guild_member.guid \r\n\t\t\t\tWHERE c.guid = '{$id}'");
            $char = $sqlc->fetch_assoc($result);
            $eq_data = explode(' ', $char['equipmentCache']);
            if ($char['online']) {
                $online = "<font class=\"error\">{$lang_char['online']}</font>{$lang_char['edit_offline_only_char']}";
            } else {
                $online = $lang_char['offline'];
            }
            if ($char['guildid']) {
                $query = $sqlc->query("\r\n\t\t\t\t\tSELECT name \r\n\t\t\t\t\tFROM guild \r\n\t\t\t\t\tWHERE guildid ='{$char['guildid']}'");
                $guild_name = $sqlc->result($query, 0, 'name');
                if ($user_lvl > 0) {
                    $guild_name = "<a href=\"guild.php?action=view_guild&amp;error=3&amp;id={$char['guildid']}\" >{$guild_name}</a>";
                }
                if ($char['grank']) {
                    $guild_rank_query = $sqlc->query("\r\n\t\t\t\t\t\tSELECT rname \r\n\t\t\t\t\t\tFROM guild_rank \r\n\t\t\t\t\t\tWHERE guildid ='{$char['guildid']}' AND rid='{$char['grank']}'");
                    $guild_rank = $sqlc->result($guild_rank_query, 0, 'rname');
                } else {
                    $guild_rank = $lang_char['guild_leader'];
                }
            } else {
                $guild_name = $lang_global['none'];
                $guild_rank = $lang_global['none'];
            }
            $output .= "\r\n                        <center>\r\n                            <form method=\"get\" action=\"char_edit.php\" name=\"form\">\r\n                                <input type=\"hidden\" name=\"action\" value=\"do_edit_char\" />\r\n                                <input type=\"hidden\" name=\"id\" value=\"{$id}\" />\r\n                                <table class=\"lined\">\r\n                                    <tr>\r\n                                        <td colspan=\"8\"><font class=\"bold\"><input type=\"text\" name=\"name\" size=\"14\" maxlength=\"12\" value=\"" . $char['name'] . "\" /> - <img src='img/c_icons/" . $char['race'] . "-" . $char['gender'] . ".gif' onmousemove='toolTip(\"" . char_get_race_name($char['race']) . "\",\"item_tooltip\")' onmouseout='toolTip()' alt=\"\" /> <img src='img/c_icons/" . $char['class'] . ".gif' onmousemove='toolTip(\"" . char_get_class_name($char['class']) . "\",\"item_tooltip\")' onmouseout='toolTip()' alt=\"\" /> - lvl " . char_get_level_color($char['level']) . "</font><br />" . $online . "</td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td colspan=\"8\">" . get_map_name($char['online'], $sqlm) . " - " . get_zone_name($char['zone'], $sqlm) . "</td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td colspan=\"8\">{$lang_char['username']}: <input type=\"text\" name=\"owner_name\" size=\"20\" maxlength=\"25\" value=\"{$owner_name}\" /> | {$lang_char['acc_id']}: {$owner_acc_id}</td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td colspan=\"8\">{$lang_char['guild']}: {$guild_name} | {$lang_char['rank']}: {$guild_rank}</td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td colspan=\"8\">{$lang_char['honor_points']}: <input type=\"text\" name=\"honor_points\" size=\"8\" maxlength=\"6\" value=\"{$char['totalHonorpoints']}\" />/\r\n                                            <input type=\"text\" name=\"arena_points\" size=\"8\" maxlength=\"6\" value=\"{$char['arenaPoints']}\" /> - {$lang_char['honor_kills']}: <input type=\"text\" name=\"total_kills\" size=\"8\" maxlength=\"6\" value=\"{$char['totalKills']}\" />\r\n                                        </td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td width=\"2%\"><input type=\"checkbox\" name=\"check[]\" value=\"a0\" /></td><td width=\"18%\">{$lang_item['head']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_HEAD]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_HEAD]) . "</a></td>\r\n                                        <td width=\"18%\">{$lang_item['gloves']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_GLOVES]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_GLOVES]) . "</a></td><td width=\"2%\"><input type=\"checkbox\" name=\"check[]\" value=\"a9\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a1\" /></td><td>{$lang_item['neck']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_NECK]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_NECK]) . "</a></td>\r\n                                        <td>{$lang_item['belt']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_BELT]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_BELT]) . "</a></td> <td><input type=\"checkbox\" name=\"check[]\" value=\"a5\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a2\" /></td><td>{$lang_item['shoulder']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_SHOULDER]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_SHOULDER]) . "</a></td>\r\n                                        <td>{$lang_item['legs']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_LEGS]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_LEGS]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a6\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a14\" /></td><td>{$lang_item['back']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_BACK]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_BACK]) . "</a></td>\r\n                                        <td>{$lang_item['feet']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_FEET]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_FEET]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a7\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a4\" /></td><td>{$lang_item['chest']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_CHEST]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_CHEST]) . "</a></td>\r\n                                        <td>{$lang_item['finger']} 1<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_FINGER1]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_FINGER1]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a10\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a3\" /></td><td>{$lang_item['shirt']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_SHIRT]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_SHIRT]) . "</a></td>\r\n                                        <td>{$lang_item['finger']} 2<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_FINGER2]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_FINGER2]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a11\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a18\" /></td><td>{$lang_item['tabard']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_TABARD]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_TABARD]) . "</a></td>\r\n                                        <td>{$lang_item['trinket']} 1<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_TRINKET1]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_TRINKET1]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a12\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a8\" /></td><td>{$lang_item['wrist']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_WRIST]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_WRIST]) . "</a></td>\r\n                                        <td>{$lang_item['trinket']} 2<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_TRINKET2]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_TRINKET2]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a13\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a15\" /></td>\r\n                                        <td colspan=\"2\">{$lang_item['main_hand']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_MAIN_HAND]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_MAIN_HAND]) . "</a></td>\r\n                                        <td colspan=\"2\"><input type=\"checkbox\" name=\"check[]\" value=\"a16\" />&nbsp;{$lang_item['off_hand']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_OFF_HAND]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_OFF_HAND]) . "</a></td>\r\n                                        <td colspan=\"2\">{$lang_item['ranged']}<br /><a href=\"{$item_datasite}{$eq_data[EQ_DATA_OFFSET_EQU_RANGED]}\" target=\"_blank\">" . get_item_name($eq_data[EQ_DATA_OFFSET_EQU_RANGED]) . "</a></td>\r\n                                        <td><input type=\"checkbox\" name=\"check[]\" value=\"a17\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td colspan=\"4\">{$lang_char['gold']}: <input type=\"text\" name=\"money\" size=\"10\" maxlength=\"8\" value=\"{$char['money']}\" /></td>\r\n                                        <td colspan=\"4\">{$lang_char['tot_paly_time']}: <input type=\"text\" name=\"tot_time\" size=\"8\" maxlength=\"14\" value=\"{$char['totaltime']}\" /></td>\r\n                                    </tr>\r\n                                    <tr>\r\n                                        <td colspan=\"5\">{$lang_char['location']}:\r\n                                            X:<input type=\"text\" name=\"x\" size=\"10\" maxlength=\"8\" value=\"{$char['position_x']}\" />\r\n                                            Y:<input type=\"text\" name=\"y\" size=\"8\" maxlength=\"16\" value=\"{$char['position_y']}\" />\r\n                                            Z:<input type=\"text\" name=\"z\" size=\"8\" maxlength=\"16\" value=\"{$char['position_z']}\" />\r\n                                            Map:<input type=\"text\" name=\"map\" size=\"8\" maxlength=\"16\" value=\"{$char['map']}\" />\r\n                                        </td>\r\n                                        <td colspan=\"3\">{$lang_char['move_to']}:<input type=\"text\" name=\"tp_to\" size=\"24\" maxlength=\"64\" value=\"\" /></td>\r\n                                    </tr>\r\n                                </table>\r\n                                <br />";
            //inventory+bank items
            $query2 = $sqlc->query("\r\n\t\t\t\tSELECT bag, slot, item, item_template \r\n\t\t\t\tFROM character_inventory \r\n\t\t\t\tWHERE guid = '{$id}' \r\n\t\t\t\tORDER BY bag, slot");
            $inv = array();
            $count = 0;
            while ($slot = $sqlc->fetch_row($query2)) {
                if ($slot[0] == 0) {
                    if ($slot[1] >= 23 && $slot[1] <= 62) {
                        $count++;
                        $inv[$count][0] = $slot[3];
                        $inv[$count][1] = $slot[2];
                    }
                } else {
                    $count++;
                    $inv[$count][0] = $slot[3];
                    $inv[$count][1] = $slot[2];
                }
            }
            $output .= "\r\n                                <table class=\"lined\">\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td>{$lang_char['inv_bank']}</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td height=\"100\" align=\"center\">\r\n\t\t\t\t\t\t\t\t\t\t\t<table>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<tr align=\"center\">";
            $j = 0;
            for ($i = 1; $i <= $count; $i++) {
                $j++;
                $output .= "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$item_datasite}{$inv[$i][0]}\" target=\"_blank\">{$inv[$i][0]}</a>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"check[]\" value=\"{$inv[$i][1]}\" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</td>";
                if ($j == 15) {
                    $output .= "\r\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<tr align=\"center\">";
                    $j = 0;
                }
            }
            $output .= "\r\n                                                </tr>\r\n                                            </table>\r\n                                        </td>\r\n                                    </tr>\r\n                                </table>\r\n                                <br />\r\n                                <table class=\"hidden\">\r\n                                    <tr>\r\n                                        <td>";
            makebutton($lang_char['update'], "javascript:do_submit()", 190);
            makebutton($lang_char['to_char_view'], "char.php?id={$id}", 160);
            makebutton($lang_char['del_char'], "char_list.php?action=del_char_form&amp;check%5B%5D={$id}", 160);
            makebutton($lang_global['back'], "javascript:window.history.back()", 160);
            $output .= "\r\n                                        </td>\r\n                                    </tr>\r\n                                </table>\r\n                                <br />\r\n                            </form>\r\n                        </center>";
            //case of non auth request
        } else {
            error($lang_char['no_permission']);
        }
    } else {
        error($lang_char['no_char_found']);
    }
}
コード例 #17
0
ファイル: char.php プロジェクト: BACKUPLIB/minimanager
function char_main(&$sqlr, &$sqlc)
{
    global $output, $lang_global, $lang_char, $lang_item, $realm_id, $realm_db, $characters_db, $world_db, $server, $mmfpm_db, $action_permission, $user_lvl, $user_name, $user_id, $item_datasite, $spell_datasite, $showcountryflag;
    // this page uses wowhead tooltops
    wowhead_tt();
    require_once 'core/char/char_security.php';
    $result = $sqlc->query('SELECT account, race FROM characters WHERE guid = ' . $id . ' LIMIT 1');
    if ($sqlc->num_rows($result)) {
        //resrict by owner's gmlvl
        $owner_acc_id = $sqlc->result($result, 0, 'account');
        $query = $sqlr->query('SELECT `username`, `gmlevel` FROM `account` LEFT JOIN `account_access` ON `account`.`id`=`account_access`.`id` WHERE `account`.`id` = ' . $owner_acc_id . ' ORDER BY `gmlevel` DESC LIMIT 1');
        $owner_name = $sqlr->result($query, 0, 'username');
        $owner_gmlvl = $sqlr->result($query, 0, 'gmlevel');
        if (empty($owner_gmlvl)) {
            $owner_gmlvl = 0;
        }
        if ($user_lvl || $server[$realmid]['both_factions']) {
            $side_v = 0;
            $side_p = 0;
        } else {
            $side_p = in_array($sqlc->result($result, 0, 'race'), array(2, 5, 6, 8, 10)) ? 1 : 2;
            $result_1 = $sqlc->query('SELECT race FROM characters WHERE account = ' . $user_id . ' LIMIT 1');
            if ($sqlc->num_rows($result)) {
                $side_v = in_array($sqlc->result($result_1, 0, 'race'), array(2, 5, 6, 8, 10)) ? 1 : 2;
            } else {
                $side_v = 0;
            }
            unset($result_1);
        }
        if ($user_lvl >= $owner_gmlvl && ($side_v === $side_p || !$side_v)) {
            $result = $sqlc->query('SELECT characters.equipmentCache, characters.name, characters.race, characters.class, characters.level, characters.zone, characters.map, characters.online, characters.totaltime, characters.gender, characters.account, character_stats.blockPct,
                                    character_stats.dodgePct, character_stats.parryPct, character_stats.critPct, character_stats.rangedCritPct, character_stats.spellCritPct, COALESCE(guild_member.guildid,0) AS guildid, COALESCE(guild_member.rank,0) AS rank, 
                                    characters.totalHonorPoints, characters.arenaPoints, characters.totalKills, character_stats.maxhealth, character_stats.maxpower1, character_stats.strength, character_stats.agility, character_stats.stamina, character_stats.intellect,
                                    character_stats.spirit, character_stats.armor, character_stats.resHoly, character_stats.resFire, character_stats.resNature, character_stats.resFrost, character_stats.resShadow, character_stats.resArcane, character_stats.attackPower,
                                    character_stats.rangedAttackPower, character_stats.spellPower, characters.power2, character_stats.maxpower2, characters.power4, character_stats.maxpower4, characters.power3, character_stats.maxpower3   
                                    FROM characters LEFT JOIN character_stats ON characters.guid = character_stats.guid LEFT JOIN guild_member ON characters.guid = guild_member.guid WHERE characters.guid = ' . $id);
            $char = $sqlc->fetch_assoc($result);
            $eq_data = explode(' ', $char['equipmentCache']);
            $online = $char['online'] ? $lang_char['online'] : $lang_char['offline'];
            if ($char['guildid'] && $char['guildid'] != 0) {
                $guild_name = $sqlc->result($sqlc->query('SELECT name FROM guild WHERE guildid =' . $char['guildid'] . ''), 0, 'name');
                $guild_name = '<a href="guild.php?action=view_guild&amp;realm=' . $realmid . '&amp;error=3&amp;id=' . $char['guildid'] . '" >' . $guild_name . '</a>';
                $mrank = $char['rank'];
                $guild_rank = $sqlc->result($sqlc->query('SELECT rname FROM guild_rank WHERE guildid =' . $char['guildid'] . ' AND rid=' . $mrank . ''), 0, 'rname');
            } else {
                $guild_name = $lang_global['none'];
                $guild_rank = $lang_global['none'];
            }
            $block = round($char['blockPct'], 2);
            $dodge = round($char['dodgePct'], 2);
            $parry = round($char['parryPct'], 2);
            $crit = round($char['critPct'], 2);
            $ranged_crit = round($char['rangedCritPct'], 2);
            $spell_crit = round($char['spellCritPct'], 2);
            $spell_damage = $char['spellPower'];
            $rage = round($char['power2'] / 10);
            $maxrage = round($char['maxpower2'] / 10);
            //preventing undefined variables, didnt want to remove all this stuff so just filling the missing variables with 0
            define('CHAR_DATA_OFFSET_MELEE_HIT', 0);
            define('CHAR_DATA_OFFSET_SPELL_HEAL', 1);
            define('CHAR_DATA_OFFSET_SPELL_HIT', 2);
            define('CHAR_DATA_OFFSET_SPELL_HASTE_RATING', 3);
            define('CHAR_DATA_OFFSET_RESILIENCE', 4);
            define('CHAR_DATA_OFFSET_RANGE_HIT', 5);
            $char_data = array(0, 0, 0, 0, 0, 0);
            $maxdamage = 0;
            $mindamage = 0;
            $maxrangeddamage = 0;
            $minrangeddamage = 0;
            $expertise = 0;
            $EQU_HEAD = $eq_data[EQ_DATA_OFFSET_EQU_HEAD];
            $EQU_NECK = $eq_data[EQ_DATA_OFFSET_EQU_NECK];
            $EQU_SHOULDER = $eq_data[EQ_DATA_OFFSET_EQU_SHOULDER];
            $EQU_SHIRT = $eq_data[EQ_DATA_OFFSET_EQU_SHIRT];
            $EQU_CHEST = $eq_data[EQ_DATA_OFFSET_EQU_CHEST];
            $EQU_BELT = $eq_data[EQ_DATA_OFFSET_EQU_BELT];
            $EQU_LEGS = $eq_data[EQ_DATA_OFFSET_EQU_LEGS];
            $EQU_FEET = $eq_data[EQ_DATA_OFFSET_EQU_FEET];
            $EQU_WRIST = $eq_data[EQ_DATA_OFFSET_EQU_WRIST];
            $EQU_GLOVES = $eq_data[EQ_DATA_OFFSET_EQU_GLOVES];
            $EQU_FINGER1 = $eq_data[EQ_DATA_OFFSET_EQU_FINGER1];
            $EQU_FINGER2 = $eq_data[EQ_DATA_OFFSET_EQU_FINGER2];
            $EQU_TRINKET1 = $eq_data[EQ_DATA_OFFSET_EQU_TRINKET1];
            $EQU_TRINKET2 = $eq_data[EQ_DATA_OFFSET_EQU_TRINKET2];
            $EQU_BACK = $eq_data[EQ_DATA_OFFSET_EQU_BACK];
            $EQU_MAIN_HAND = $eq_data[EQ_DATA_OFFSET_EQU_MAIN_HAND];
            $EQU_OFF_HAND = $eq_data[EQ_DATA_OFFSET_EQU_OFF_HAND];
            $EQU_RANGED = $eq_data[EQ_DATA_OFFSET_EQU_RANGED];
            $EQU_TABARD = $eq_data[EQ_DATA_OFFSET_EQU_TABARD];
            /*
            // reserved incase we want to use back minimanagers' built in tooltip, instead of wowheads'
            // minimanagers' item tooltip needs updating, but it can show enchantments and sockets.
            
                  $equiped_items = array
                  (
                     1 => array(($EQU_HEAD      ? get_item_tooltip($EQU_HEAD)      : 0),($EQU_HEAD      ? get_item_icon($EQU_HEAD)      : 0),($EQU_HEAD      ? get_item_border($EQU_HEAD)      : 0)),
                     2 => array(($EQU_NECK      ? get_item_tooltip($EQU_NECK)      : 0),($EQU_NECK      ? get_item_icon($EQU_NECK)      : 0),($EQU_NECK      ? get_item_border($EQU_NECK)      : 0)),
                     3 => array(($EQU_SHOULDER  ? get_item_tooltip($EQU_SHOULDER)  : 0),($EQU_SHOULDER  ? get_item_icon($EQU_SHOULDER)  : 0),($EQU_SHOULDER  ? get_item_border($EQU_SHOULDER)  : 0)),
                     4 => array(($EQU_SHIRT     ? get_item_tooltip($EQU_SHIRT)     : 0),($EQU_SHIRT     ? get_item_icon($EQU_SHIRT)     : 0),($EQU_SHIRT     ? get_item_border($EQU_SHIRT)     : 0)),
                     5 => array(($EQU_CHEST     ? get_item_tooltip($EQU_CHEST)     : 0),($EQU_CHEST     ? get_item_icon($EQU_CHEST)     : 0),($EQU_CHEST     ? get_item_border($EQU_CHEST)     : 0)),
                     6 => array(($EQU_BELT      ? get_item_tooltip($EQU_BELT)      : 0),($EQU_BELT      ? get_item_icon($EQU_BELT)      : 0),($EQU_BELT      ? get_item_border($EQU_BELT)      : 0)),
                     7 => array(($EQU_LEGS      ? get_item_tooltip($EQU_LEGS)      : 0),($EQU_LEGS      ? get_item_icon($EQU_LEGS)      : 0),($EQU_LEGS      ? get_item_border($EQU_LEGS)      : 0)),
                     8 => array(($EQU_FEET      ? get_item_tooltip($EQU_FEET)      : 0),($EQU_FEET      ? get_item_icon($EQU_FEET)      : 0),($EQU_FEET      ? get_item_border($EQU_FEET)      : 0)),
                     9 => array(($EQU_WRIST     ? get_item_tooltip($EQU_WRIST)     : 0),($EQU_WRIST     ? get_item_icon($EQU_WRIST)     : 0),($EQU_WRIST     ? get_item_border($EQU_WRIST)     : 0)),
                    10 => array(($EQU_GLOVES    ? get_item_tooltip($EQU_GLOVES)    : 0),($EQU_GLOVES    ? get_item_icon($EQU_GLOVES)    : 0),($EQU_GLOVES    ? get_item_border($EQU_GLOVES)    : 0)),
                    11 => array(($EQU_FINGER1   ? get_item_tooltip($EQU_FINGER1)   : 0),($EQU_FINGER1   ? get_item_icon($EQU_FINGER1)   : 0),($EQU_FINGER1   ? get_item_border($EQU_FINGER1)   : 0)),
                    12 => array(($EQU_FINGER2   ? get_item_tooltip($EQU_FINGER2)   : 0),($EQU_FINGER2   ? get_item_icon($EQU_FINGER2)   : 0),($EQU_FINGER2   ? get_item_border($EQU_FINGER2)   : 0)),
                    13 => array(($EQU_TRINKET1  ? get_item_tooltip($EQU_TRINKET1)  : 0),($EQU_TRINKET1  ? get_item_icon($EQU_TRINKET1)  : 0),($EQU_TRINKET1  ? get_item_border($EQU_TRINKET1)  : 0)),
                    14 => array(($EQU_TRINKET2  ? get_item_tooltip($EQU_TRINKET2)  : 0),($EQU_TRINKET2  ? get_item_icon($EQU_TRINKET2)  : 0),($EQU_TRINKET2  ? get_item_border($EQU_TRINKET2)  : 0)),
                    15 => array(($EQU_BACK      ? get_item_tooltip($EQU_BACK)      : 0),($EQU_BACK      ? get_item_icon($EQU_BACK)      : 0),($EQU_BACK      ? get_item_border($EQU_BACK)      : 0)),
                    16 => array(($EQU_MAIN_HAND ? get_item_tooltip($EQU_MAIN_HAND) : 0),($EQU_MAIN_HAND ? get_item_icon($EQU_MAIN_HAND) : 0),($EQU_MAIN_HAND ? get_item_border($EQU_MAIN_HAND) : 0)),
                    17 => array(($EQU_OFF_HAND  ? get_item_tooltip($EQU_OFF_HAND)  : 0),($EQU_OFF_HAND  ? get_item_icon($EQU_OFF_HAND)  : 0),($EQU_OFF_HAND  ? get_item_border($EQU_OFF_HAND)  : 0)),
                    18 => array(($EQU_RANGED    ? get_item_tooltip($EQU_RANGED)    : 0),($EQU_RANGED    ? get_item_icon($EQU_RANGED)    : 0),($EQU_RANGED    ? get_item_border($EQU_RANGED)    : 0)),
                    19 => array(($EQU_TABARD    ? get_item_tooltip($EQU_TABARD)    : 0),($EQU_TABARD    ? get_item_icon($EQU_TABARD)    : 0),($EQU_TABARD    ? get_item_border($EQU_TABARD)    : 0))
                  );
            */
            $sqlm = new SQL();
            $sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
            $sqlw = new SQL();
            $sqlw->connect($world_db[$realmid]['addr'], $world_db[$realmid]['user'], $world_db[$realmid]['pass'], $world_db[$realmid]['name']);
            $equiped_items = array(1 => array('', $EQU_HEAD ? get_item_icon($EQU_HEAD, $sqlm, $sqlw) : 0, $EQU_HEAD ? get_item_border($EQU_HEAD, $sqlw) : 0), 2 => array('', $EQU_NECK ? get_item_icon($EQU_NECK, $sqlm, $sqlw) : 0, $EQU_NECK ? get_item_border($EQU_NECK, $sqlw) : 0), 3 => array('', $EQU_SHOULDER ? get_item_icon($EQU_SHOULDER, $sqlm, $sqlw) : 0, $EQU_SHOULDER ? get_item_border($EQU_SHOULDER, $sqlw) : 0), 4 => array('', $EQU_SHIRT ? get_item_icon($EQU_SHIRT, $sqlm, $sqlw) : 0, $EQU_SHIRT ? get_item_border($EQU_SHIRT, $sqlw) : 0), 5 => array('', $EQU_CHEST ? get_item_icon($EQU_CHEST, $sqlm, $sqlw) : 0, $EQU_CHEST ? get_item_border($EQU_CHEST, $sqlw) : 0), 6 => array('', $EQU_BELT ? get_item_icon($EQU_BELT, $sqlm, $sqlw) : 0, $EQU_BELT ? get_item_border($EQU_BELT, $sqlw) : 0), 7 => array('', $EQU_LEGS ? get_item_icon($EQU_LEGS, $sqlm, $sqlw) : 0, $EQU_LEGS ? get_item_border($EQU_LEGS, $sqlw) : 0), 8 => array('', $EQU_FEET ? get_item_icon($EQU_FEET, $sqlm, $sqlw) : 0, $EQU_FEET ? get_item_border($EQU_FEET, $sqlw) : 0), 9 => array('', $EQU_WRIST ? get_item_icon($EQU_WRIST, $sqlm, $sqlw) : 0, $EQU_WRIST ? get_item_border($EQU_WRIST, $sqlw) : 0), 10 => array('', $EQU_GLOVES ? get_item_icon($EQU_GLOVES, $sqlm, $sqlw) : 0, $EQU_GLOVES ? get_item_border($EQU_GLOVES, $sqlw) : 0), 11 => array('', $EQU_FINGER1 ? get_item_icon($EQU_FINGER1, $sqlm, $sqlw) : 0, $EQU_FINGER1 ? get_item_border($EQU_FINGER1, $sqlw) : 0), 12 => array('', $EQU_FINGER2 ? get_item_icon($EQU_FINGER2, $sqlm, $sqlw) : 0, $EQU_FINGER2 ? get_item_border($EQU_FINGER2, $sqlw) : 0), 13 => array('', $EQU_TRINKET1 ? get_item_icon($EQU_TRINKET1, $sqlm, $sqlw) : 0, $EQU_TRINKET1 ? get_item_border($EQU_TRINKET1, $sqlw) : 0), 14 => array('', $EQU_TRINKET2 ? get_item_icon($EQU_TRINKET2, $sqlm, $sqlw) : 0, $EQU_TRINKET2 ? get_item_border($EQU_TRINKET2, $sqlw) : 0), 15 => array('', $EQU_BACK ? get_item_icon($EQU_BACK, $sqlm, $sqlw) : 0, $EQU_BACK ? get_item_border($EQU_BACK, $sqlw) : 0), 16 => array('', $EQU_MAIN_HAND ? get_item_icon($EQU_MAIN_HAND, $sqlm, $sqlw) : 0, $EQU_MAIN_HAND ? get_item_border($EQU_MAIN_HAND, $sqlw) : 0), 17 => array('', $EQU_OFF_HAND ? get_item_icon($EQU_OFF_HAND, $sqlm, $sqlw) : 0, $EQU_OFF_HAND ? get_item_border($EQU_OFF_HAND, $sqlw) : 0), 18 => array('', $EQU_RANGED ? get_item_icon($EQU_RANGED, $sqlm, $sqlw) : 0, $EQU_RANGED ? get_item_border($EQU_RANGED, $sqlw) : 0), 19 => array('', $EQU_TABARD ? get_item_icon($EQU_TABARD, $sqlm, $sqlw) : 0, $EQU_TABARD ? get_item_border($EQU_TABARD, $sqlw) : 0));
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name) {
                $output .= '
                <center>
                    <div id="tab_content">
                        <h1>' . $lang_char['char_sheet'] . '</h1><br />
                        <div id="tab">
                            <ul>
                                <li><a href="char.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['char_sheet'] . '</a></li>
                                <li><a href="char_inv.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['inventory'] . '</a></li>
                                <li><a href="char_extra.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['extra'] . '</a></li>
                                ' . ($char['level'] < 10 ? '' : '<li><a href="char_talent.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['talents'] . '</a></li>') . '
                                <li><a href="char_achieve.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['achievements'] . '</a></li>
                                <li><a href="char_rep.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['reputation'] . '</a></li>
                                <li><a href="char_skill.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['skills'] . '</a></li>
                                <li><a href="char_quest.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['quests'] . '</a></li>';
                if (char_get_class_name($char['class']) === 'Hunter') {
                    $output .= '
                                <li><a href="char_pets.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['pets'] . '</a></li>';
                }
                $output .= '
                                <li><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['friends'] . '</a></li>
                                <li><a href="char_spell.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['spells'] . '</a></li>
                                <li><a href="char_mail.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['mail'] . '</a></li>';
            } else {
                $output .= '
                <center>
                    <div id="tab_content">
                        <h1>' . $lang_char['char_sheet'] . '</h1><br />
                        <div id="tab">
                            <ul>
                                <li><a href="char.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['char_sheet'] . '</a></li>';
            }
            $output .= '
                            </ul>
                        </div>
                        <div id="tab_content2">
                            <table class="lined" style="width: 580px;">
                                <tr>
                                    <td colspan="2">
                                        <div>
                                            <img src="' . char_get_avatar_img($char['level'], $char['gender'], $char['race'], $char['class'], 0) . '" alt="avatar" />
                                        </div>
                                        <div>';
            $a_results = $sqlc->query('SELECT DISTINCT spell FROM character_aura WHERE guid = ' . $id . '');
            if ($sqlc->num_rows($a_results)) {
                while ($aura = $sqlc->fetch_assoc($a_results)) {
                    $output .= '
                                            <a style="padding:2px;" href="' . $spell_datasite . $aura['spell'] . '" target="_blank">
                                                <img src="' . spell_get_icon($aura['spell'], $sqlm) . '" alt="' . $aura['spell'] . '" width="24" height="24" />
                                            </a>';
                }
            }
            $output .= '
                                        </div>
                                    </td>
                                    <td colspan="4">
                                        <font class="bold">
                                            ' . htmlentities($char['name']) . ' -
                                            <img src="img/c_icons/' . $char['race'] . '-' . $char['gender'] . '.gif" onmousemove="toolTip(\'' . char_get_race_name($char['race']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" />
                                            <img src="img/c_icons/' . $char['class'] . '.gif" onmousemove="toolTip(\'' . char_get_class_name($char['class']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" />
                                            - lvl ' . char_get_level_color($char['level']) . '
                                        </font>
                                        <br />' . get_map_name($char['map'], $sqlm) . ' - ' . get_zone_name($char['zone'], $sqlm) . '
                                        <br />' . $lang_char['honor_points'] . ': ' . $char['totalHonorPoints'] . ' / ' . $char['arenaPoints'] . ' - ' . $lang_char['honor_kills'] . ': ' . $char['totalKills'] . '
                                        <br />' . $lang_char['guild'] . ': ' . $guild_name . ' | ' . $lang_char['rank'] . ': ' . htmlentities($guild_rank) . '
                                        <br />' . ($char['online'] ? '<img src="img/up.gif" onmousemove="toolTip(\'Online\', \'item_tooltip\')" onmouseout="toolTip()" alt="online" />' : '<img src="img/down.gif" onmousemove="toolTip(\'Offline\', \'item_tooltip\')" onmouseout="toolTip()" alt="offline" />');
            if ($showcountryflag) {
                require_once 'libs/misc_lib.php';
                $country = misc_get_country_by_account($char['account'], $sqlr, $sqlm);
                $output .= ' - ' . ($country['code'] ? '<img src="img/flags/' . $country['code'] . '.png" onmousemove="toolTip(\'' . $country['country'] . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" />' : '-');
                unset($country);
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="6%">';
            if ($equiped_items[1][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_HEAD . '" target="_blank">
                                            <img src="' . $equiped_items[1][1] . '" class="' . $equiped_items[1][2] . '" alt="Head" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_head.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td class="half_line" colspan="2" align="center" width="50%">
                                        <div class="gradient_p">' . $lang_item['health'] . ':</div>
                                        <div class="gradient_pp">' . $char['maxhealth'] . '</div>';
            if ($char['class'] == 11) {
                //druid
                $output .= '
                                        </br>
                                        <div class="gradient_p">' . $lang_item['energy'] . ':</div>
                                        <div class="gradient_pp">' . $char['power4'] . '/' . $char['maxpower4'] . '</div>';
            }
            $output .= '
                                    </td>
                                    <td class="half_line" colspan="2" align="center" width="50%">';
            if ($char['class'] == 1) {
                // warrior
                $output .= '
                                        <div class="gradient_p">' . $lang_item['rage'] . ':</div>
                                        <div class="gradient_pp">' . $rage . '/' . $maxrage . '</div>';
            } elseif ($char['class'] == 4) {
                // rogue
                $output .= '
                                        <div class="gradient_p">' . $lang_item['energy'] . ':</div>
                                        <div class="gradient_pp">' . $char['power4'] . '/' . $char['maxpower4'] . '</div>';
            } elseif ($char['class'] == 6) {
                // death knight // Don't know if FOCUS is the right one need to verify with Death Knight player.
                $output .= '
                                        <div class="gradient_p">' . $lang_item['runic'] . ':</div>
                                        <div class="gradient_pp">' . $char['power3'] . '/' . $char['maxpower3'] . '</div>';
            } elseif ($char['class'] == 11) {
                // druid
                $output .= '
                                        <div class="gradient_p">' . $lang_item['mana'] . ':</div>
                                        <div class="gradient_pp">' . $char['maxpower1'] . '</div>
                                        </br>
                                        <div class="gradient_p">' . $lang_item['rage'] . ':</div>
                                        <div class="gradient_pp">' . $rage . '/' . $maxrage . '</div>';
            } elseif ($char['class'] == 2 || $char['class'] == 3 || $char['class'] == 5 || $char['class'] == 7 || $char['class'] == 8 || $char['class'] == 9) {
                // warlock
                $output .= '
                                        <div class="gradient_p">' . $lang_item['mana'] . ':</div>
                                        <div class="gradient_pp">' . $char['maxpower1'] . '</div>';
            }
            $output .= '
                                    </td>
                                    <td width="6%">';
            if ($equiped_items[10][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_GLOVES . '" target="_blank">
                                            <img src="' . $equiped_items[10][1] . '" class="' . $equiped_items[10][2] . '" alt="Gloves" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_gloves.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="1%">';
            if ($equiped_items[2][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_NECK . '" target="_blank">
                                            <img src="' . $equiped_items[2][1] . '" class="' . $equiped_items[2][2] . '" alt="Neck" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_neck.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td class="half_line" colspan="2" rowspan="3" align="center" width="50%">
                                        <div class="gradient_p">
                                            ' . $lang_item['strength'] . ':<br />
                                            ' . $lang_item['agility'] . ':<br />
                                            ' . $lang_item['stamina'] . ':<br />
                                            ' . $lang_item['intellect'] . ':<br />
                                            ' . $lang_item['spirit'] . ':<br />
                                            ' . $lang_item['armor'] . ':
                                        </div>
                                        <div class="gradient_pp">
                                            ' . $char['strength'] . '<br />
                                            ' . $char['agility'] . '<br />
                                            ' . $char['stamina'] . '<br />
                                            ' . $char['intellect'] . '<br />
                                            ' . $char['spirit'] . '<br />
                                            ' . $char['armor'] . '
                                        </div>
                                    </td>
                                    <td class="half_line" colspan="2" rowspan="3" align="center" width="50%">
                                        <div class="gradient_p">
                                            ' . $lang_item['res_holy'] . ':<br />
                                            ' . $lang_item['res_arcane'] . ':<br />
                                            ' . $lang_item['res_fire'] . ':<br />
                                            ' . $lang_item['res_nature'] . ':<br />
                                            ' . $lang_item['res_frost'] . ':<br />
                                            ' . $lang_item['res_shadow'] . ':
                                        </div>
                                        <div class="gradient_pp">
                                            ' . $char['resHoly'] . '<br />
                                            ' . $char['resArcane'] . '<br />
                                            ' . $char['resFire'] . '<br />
                                            ' . $char['resNature'] . '<br />
                                            ' . $char['resFrost'] . '<br />
                                            ' . $char['resShadow'] . '
                                        </div>
                                    </td>
                                    <td width="1%">';
            if ($equiped_items[6][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_BELT . '" target="_blank">
                                            <img src="' . $equiped_items[6][1] . '" class="' . $equiped_items[6][2] . '" alt="Belt" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_waist.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="1%">';
            if ($equiped_items[3][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_SHOULDER . '" target="_blank">
                                            <img src="' . $equiped_items[3][1] . '" class="' . $equiped_items[3][2] . '" alt="Shoulder" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_shoulder.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td width="1%">';
            if ($equiped_items[7][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_LEGS . '" target="_blank">
                                            <img src="' . $equiped_items[7][1] . '" class="' . $equiped_items[7][2] . '" alt="Legs" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_legs.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="1%">';
            if ($equiped_items[15][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_BACK . '" target="_blank">
                                            <img src="' . $equiped_items[15][1] . '" class="' . $equiped_items[15][2] . '" alt="Back" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_chest_back.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td width="1%">';
            if ($equiped_items[8][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_FEET . '" target="_blank">
                                            <img src="' . $equiped_items[8][1] . '" class="' . $equiped_items[8][2] . '" alt="Feet" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_feet.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="1%">';
            if ($equiped_items[5][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_CHEST . '" target="_blank">
                                            <img src="' . $equiped_items[5][1] . '" class="' . $equiped_items[5][2] . '" alt="Chest" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_chest_back.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                                        <div class="gradient_p">
                                            ' . $lang_char['melee_d'] . ':<br />
                                            ' . $lang_char['melee_ap'] . ':<br />
                                            ' . $lang_char['melee_hit'] . ':<br />
                                            ' . $lang_char['melee_crit'] . ':<br />
                                            ' . $lang_char['expertise'] . ':<br />
                                        </div>
                                        <div class="gradient_pp">
                                            ' . $mindamage . '-' . $maxdamage . '<br />
                                            ' . $char['attackPower'] . '<br />
                                            ' . $char_data[CHAR_DATA_OFFSET_MELEE_HIT] . '<br />
                                            ' . $crit . '%<br />
                                            ' . $expertise . '<br />
                                        </div>
                                    </td>
                                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                                        <div class="gradient_p">
                                            ' . $lang_char['spell_d'] . ':<br />
                                            ' . $lang_char['spell_heal'] . ':<br />
                                            ' . $lang_char['spell_hit'] . ':<br />
                                            ' . $lang_char['spell_crit'] . ':<br />
                                            ' . $lang_char['spell_haste'] . '
                                        </div>
                                        <div class="gradient_pp">
                                            ' . $spell_damage . '<br />
                                            ' . $char_data[CHAR_DATA_OFFSET_SPELL_HEAL] . '<br />
                                            ' . $char_data[CHAR_DATA_OFFSET_SPELL_HIT] . '<br />
                                            ' . $spell_crit . '%<br />
                                            ' . $char_data[CHAR_DATA_OFFSET_SPELL_HASTE_RATING] . '
                                        </div>
                                    </td>
                                    <td width="1%">';
            if ($equiped_items[11][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_FINGER1 . '" target="_blank">
                                            <img src="' . $equiped_items[11][1] . '" class="' . $equiped_items[11][2] . '" alt="Finger1" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_finger.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="1%">';
            if ($equiped_items[4][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_SHIRT . '" target="_blank">
                                            <img src="' . $equiped_items[4][1] . '" class="' . $equiped_items[4][2] . '" alt="Shirt" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_shirt.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td width="1%">';
            if ($equiped_items[12][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_FINGER2 . '" target="_blank">
                                            <img src="' . $equiped_items[12][1] . '" class="' . $equiped_items[12][2] . '" alt="Finger2" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_finger.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="1%">';
            if ($equiped_items[19][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_TABARD . '" target="_blank">
                                            <img src="' . $equiped_items[19][1] . '" class="' . $equiped_items[19][2] . '" alt="Tabard" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_tabard.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                                        <div class="gradient_p">
                                            ' . $lang_char['dodge'] . ':<br />
                                            ' . $lang_char['parry'] . ':<br />
                                            ' . $lang_char['block'] . ':<br />
                                            ' . $lang_char['resilience'] . ':<br />
                                        </div>
                                        <div class="gradient_pp">
                                            ' . $dodge . '%<br />
                                            ' . $parry . '%<br />
                                            ' . $block . '%<br />
                                            ' . $char_data[CHAR_DATA_OFFSET_RESILIENCE] . '<br />
                                        </div>
                                    </td>
                                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                                        <div class="gradient_p">
                                            ' . $lang_char['ranged_d'] . ':<br />
                                            ' . $lang_char['ranged_ap'] . ':<br />
                                            ' . $lang_char['ranged_hit'] . ':<br />
                                            ' . $lang_char['ranged_crit'] . ':<br />
                                        </div>
                                        <div class="gradient_pp">
                                            ' . $minrangeddamage . '-' . $maxrangeddamage . '<br />
                                            ' . $char['rangedAttackPower'] . '<br />
                                            ' . $char_data[CHAR_DATA_OFFSET_RANGE_HIT] . '<br />
                                            ' . $ranged_crit . '%<br />
                                        </div>
                                    </td>
                                    <td width="1%">';
            if ($equiped_items[13][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_TRINKET1 . '" target="_blank">
                                            <img src="' . $equiped_items[13][1] . '" class="' . $equiped_items[13][2] . '" alt="Trinket1" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_trinket.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td width="1%">';
            if ($equiped_items[9][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_WRIST . '" target="_blank">
                                            <img src="' . $equiped_items[9][1] . '" class="' . $equiped_items[9][2] . '" alt="Wrist" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_wrist.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td width="1%">';
            if ($equiped_items[14][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_TRINKET2 . '" target="_blank">
                                            <img src="' . $equiped_items[14][1] . '" class="' . $equiped_items[14][2] . '" alt="Trinket2" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_trinket.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td width="15%">';
            if ($equiped_items[16][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_MAIN_HAND . '" target="_blank">
                                            <img src="' . $equiped_items[16][1] . '" class="' . $equiped_items[16][2] . '" alt="MainHand" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_main_hand.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td width="15%">';
            if ($equiped_items[17][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_OFF_HAND . '" target="_blank">
                                            <img src="' . $equiped_items[17][1] . '" class="' . $equiped_items[17][2] . '" alt="OffHand" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_off_hand.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td width="15%">';
            if ($equiped_items[18][1]) {
                $output .= '
                                        <a style="padding:2px;" href="' . $item_datasite . $EQU_RANGED . '" target="_blank">
                                            <img src="' . $equiped_items[18][1] . '" class="' . $equiped_items[18][2] . '" alt="Ranged" />
                                        </a>';
            } else {
                $output .= '
                                        <img src="img/INV/INV_empty_ranged.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                                    </td>
                                    <td width="15%"></td>
                                    <td></td>
                                </tr>';
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name) {
                //total time played
                $tot_time = $char['totaltime'];
                $tot_days = (int) ($tot_time / 86400);
                $tot_time = $tot_time - $tot_days * 86400;
                $total_hours = (int) ($tot_time / 3600);
                $tot_time = $tot_time - $total_hours * 3600;
                $total_min = (int) ($tot_time / 60);
                $output .= '
                                <tr>
                                    <td colspan="6">
                                        ' . $lang_char['tot_paly_time'] . ': ' . $tot_days . ' ' . $lang_char['days'] . ' ' . $total_hours . ' ' . $lang_char['hours'] . ' ' . $total_min . ' ' . $lang_char['min'] . '
                                    </td>
                                </tr>';
            }
            $output .= '
                            </table>
                        </div>
                        <br />
                    </div>
                    <br />';
            require_once 'core/char/char_footer.php';
            $output .= '
                    <br />
                </center>';
        } else {
            error($lang_char['no_permission']);
        }
    } else {
        error($lang_char['no_char_found']);
    }
}
コード例 #18
0
/**
 * Get the contents of an HTML page.
 * HTML isn't great... no dynamicness/reconfigurability at all.
 * We prefer comcode with [html]HTML goes here[/html] usage
 *
 * @param  PATH			The relative (to ocPortals base directory) path to the HTML page
 * @param  ?PATH			The file base to load from (NULL: standard)
 * @return string			The page
 */
function load_html_page($string, $file_base = NULL)
{
    if (is_null($file_base)) {
        $file_base = get_file_base();
    }
    global $PAGE_STRING;
    if (is_null($PAGE_STRING)) {
        $PAGE_STRING = $string;
    }
    $html = file_get_contents($file_base . '/' . $string, FILE_TEXT);
    // Post-processing
    if (strpos($html, '<html') !== false) {
        $matches = array();
        // Fix links to anything in same dir, by assuming either uploads/website_specific or an ocP page in same zone
        $link_attributes = array('src', 'href', 'action', 'data', 'codebase');
        foreach ($link_attributes as $attribute) {
            $num_matches = preg_match_all('#<[^<>]* ' . $attribute . '="([^&"]+\\.[^&"\\.]+)"[^<>]*>#mis', $html, $matches);
            for ($i = 0; $i < $num_matches; $i++) {
                $old_link = $matches[1][$i];
                $zone = '_SELF';
                if ($old_link[0] == '/') {
                    $old_link = substr($old_link, 1);
                    $zone = '';
                }
                $possible_zone = str_replace('/', '_', dirname($old_link));
                if ($possible_zone == '.') {
                    $possible_zone = '';
                }
                if ($possible_zone != '' && $possible_zone != get_zone_name() && file_exists(get_file_base() . '/' . $possible_zone)) {
                    $zone = $possible_zone;
                }
                if (substr($old_link, -4) == '.htm') {
                    $_new_link = build_url(array('page' => basename(substr($old_link, 0, strlen($old_link) - 4))), $zone);
                    $new_link = $_new_link->evaluate();
                } elseif (substr($old_link, -5) == '.html') {
                    $_new_link = build_url(array('page' => basename(substr($old_link, 0, strlen($old_link) - 5))), $zone);
                    $new_link = $_new_link->evaluate();
                } else {
                    $new_link = $old_link;
                    if (url_is_local($old_link)) {
                        if (is_file(get_custom_file_base() . '/' . dirname($string) . '/' . $old_link)) {
                            $new_link = get_custom_base_url() . '/' . dirname($string) . '/' . $old_link;
                        } else {
                            $new_link = get_custom_base_url() . '/uploads/website_specific/' . $old_link;
                        }
                    }
                }
                $html = str_replace(' ' . $attribute . '="' . $old_link . '"', ' ' . $attribute . '="' . $new_link . '"', $html);
            }
        }
        // Extract script, style, and link elements from head
        if (preg_match('#<\\s*head[^<>]*>(.*)<\\s*/\\s*head\\s*>#mis', $html, $matches) != 0) {
            global $EXTRA_HEAD;
            $head = $matches[1];
            $head_patterns = array('#<\\s*script.*<\\s*/\\s*script\\s*>#misU', '#<\\s*link[^<>]*>#misU', '#<\\s*style.*<\\s*/\\s*style\\s*>#misU');
            foreach ($head_patterns as $pattern) {
                $num_matches = preg_match_all($pattern, $head, $matches);
                for ($i = 0; $i < $num_matches; $i++) {
                    $EXTRA_HEAD->attach($matches[0][$i]);
                }
            }
        }
        // Extra meta keywords and description, and title
        global $SEO_KEYWORDS, $SEO_DESCRIPTION, $SEO_TITLE;
        if (preg_match('#<\\s*meta\\s+name\\s*=\\s*"keywords"\\s+content="([^"]*)"#mi', $html, $matches) != 0) {
            $SEO_KEYWORDS = explode(',', @html_entity_decode(trim($matches[1]), ENT_QUOTES, get_charset()));
        }
        if (preg_match('#<\\s*meta\\s+name\\s*=\\s*"description"\\s+content="([^"]*)"#mi', $html, $matches) != 0) {
            $SEO_DESCRIPTION = @html_entity_decode(trim($matches[1]), ENT_QUOTES, get_charset());
        }
        if (preg_match('#<\\s*title\\s*>([^<>]*)<\\s*/\\s*title\\s*>#mis', $html, $matches) != 0) {
            $SEO_TITLE = @html_entity_decode(trim($matches[1]), ENT_QUOTES, get_charset());
        }
        // Extract body
        if (preg_match('#<\\s*body[^>]*>(.*)<\\s*/\\s*body\\s*>#mis', $html, $matches) != 0) {
            $html = $matches[1];
        } else {
            $html = '';
        }
    }
    return $html;
}
コード例 #19
0
ファイル: server.chars.php プロジェクト: space77/mwfv3_sp
    } else {
        $filter = '';
    }
    if ($CHDB) {
        $query = $CHDB->select("SELECT * FROM `characters` {$filter} ORDER BY `name` LIMIT {$limit_start},{$items_per_pages}");
    }
    AddMangosFields($realm_info['Version']);
    foreach ($query as $result) {
        $my_char = new character($result, $mangos_field);
        $cc++;
        $item_res[$cc]["name"] = $my_char->name;
        $item_res[$cc]["race"] = $my_char->race;
        $item_res[$cc]["class"] = $my_char->class;
        $item_res[$cc]["gender"] = $my_char->gender;
        $item_res[$cc]["level"] = $my_char->level;
        $item_res[$cc]["pos"] = get_zone_name($my_char->map, $my_char->position_x, $my_char->position_y);
        $item_res[$cc]["current_xp"] = $my_char->current_xp;
        $item_res[$cc]["next_level_xp"] = $my_char->next_level_xp;
        $item_res[$cc]["xp_perc"] = $my_char->xp_perc;
    }
    if ($CHDB) {
        $query = $CHDB->selectcell("SELECT COUNT(*) as cnt FROM `characters` {$filter} ORDER BY `name`");
    }
    $pnum = ceil($query / $items_per_pages);
    $pages_str = default_paginate($pnum, $p, "index.php?n=server&sub=chars&realm=" . $_GET['realm'] . "&char=" . $_GET['char']);
    unset($CHDB, $query, $result, $my_char);
}
?>


コード例 #20
0
function char_main()
{
    global $output, $realm_id, $logon_db, $characters_db, $world_db, $server, $corem_db, $site_encoding, $action_permission, $user_lvl, $user_name, $user_id, $locales_search_option, $base_datasite, $item_datasite, $spell_datasite, $showcountryflag, $timezone_offset, $sql, $core;
    // this page uses wowhead tooltops
    //wowhead_tt();
    // we need at either an id or a name or we would have nothing to show
    if (empty($_GET["id"])) {
        if (empty($_GET["name"])) {
            error(lang("global", "empty_fields"));
        }
    }
    // this is multi realm support, as of writing still under development
    // this page is already implementing it
    if (empty($_GET["realm"])) {
        $realmid = $realm_id;
    } else {
        $realmid = $sql["logon"]->quote_smart($_GET["realm"]);
        if (is_numeric($realmid)) {
            $sql["char"]->connect($characters_db[$realmid]["addr"], $characters_db[$realmid]["user"], $characters_db[$realmid]["pass"], $characters_db[$realmid]["name"], $characters_db[$realmid]["encoding"]);
        } else {
            $realmid = $realm_id;
        }
    }
    if (empty($_GET["id"])) {
        $name = $sql["char"]->quote_smart($_GET["name"]);
        if ($core == 1) {
            $result = $sql["char"]->query("SELECT guid, acct, race FROM characters WHERE name='" . $name . "' LIMIT 1");
        } else {
            $result = $sql["char"]->query("SELECT guid, id AS acct, race FROM characters WHERE name='" . $name . "' LIMIT 1");
        }
        $id_result = $sql["char"]->fetch_assoc($result);
        $id = $id_result["guid"];
    } else {
        $id = $sql["char"]->quote_smart($_GET["id"]);
    }
    if (!is_numeric($id)) {
        error(lang("global", "empty_fields"));
    }
    if ($core == 1) {
        $result = $sql["char"]->query("SELECT acct, race FROM characters WHERE guid='" . $id . "' LIMIT 1");
    } else {
        $result = $sql["char"]->query("SELECT account AS acct, race FROM characters WHERE guid='" . $id . "' LIMIT 1");
    }
    if ($sql["char"]->num_rows($result)) {
        //resrict by owner's gmlvl
        $owner_acc_id = $sql["char"]->result($result, 0, "acct");
        if ($core == 1) {
            $query = $sql["logon"]->query("SELECT login FROM accounts WHERE acct='" . $owner_acc_id . "'");
        } else {
            $query = $sql["logon"]->query("SELECT username as login FROM account WHERE id='" . $owner_acc_id . "'");
        }
        $owner_name = $sql["logon"]->result($query, 0, "login");
        $s_query = "SELECT *, SecurityLevel AS gm FROM config_accounts WHERE Login='******'";
        $s_result = $sql["mgr"]->query($s_query);
        $s_fields = $sql["mgr"]->fetch_assoc($s_result);
        $owner_gmlvl = $s_fields["gm"];
        $view_mod = $s_fields["View_Mod_Sheet"];
        if ($owner_gmlvl >= 1073741824) {
            $owner_gmlvl -= 1073741824;
        }
        // owner configured overrides
        $view_override = false;
        if ($view_mod > 0) {
            if ($view_mod == 1) {
            } elseif ($view_mod == 2) {
                // only registered users may view this page
                if ($user_lvl > -1) {
                    $view_override = true;
                }
            }
        }
        if ($user_lvl || $server[$realmid]["both_factions"]) {
            $side_v = 0;
            $side_p = 0;
        } else {
            $side_p = in_array($sql["char"]->result($result, 0, "race"), array(2, 5, 6, 8, 10)) ? 1 : 2;
            if ($core == 1) {
                $result_1 = $sql["char"]->query("SELECT race FROM characters WHERE acct='" . $user_id . "' LIMIT 1");
            } else {
                $result_1 = $sql["char"]->query("SELECT race FROM characters WHERE account='" . $user_id . "' LIMIT 1");
            }
            if ($sql["char"]->num_rows($result)) {
                $side_v = in_array($sql["char"]->result($result_1, 0, "race"), array(2, 5, 6, 8, 10)) ? 1 : 2;
            } else {
                $side_v = 0;
            }
            unset($result_1);
        }
        if ($view_override || $user_lvl >= gmlevel($owner_gmlvl) && ($side_v === $side_p || !$side_v)) {
            if ($core == 1) {
                $result = $sql["char"]->query("SELECT guid, name, race, class, level, zoneid, mapid, online, gender,\n          SUBSTRING_INDEX(SUBSTRING_INDEX(playedtime, ' ', 2), ' ', -1) AS totaltime,\n          acct, data, timestamp, xp \n          FROM characters WHERE guid='" . $id . "'");
            } elseif ($core == 2) {
                $result = $sql["char"]->query("SELECT guid, name, race, class, level, zone AS zoneid, map AS mapid, \n          online, gender, totaltime, account AS acct, logout_time AS timestamp, health, \n\t\t\t\t\tpower1, power2, power3, power4, power5, power6, power7, xp,\n          arenaPoints, totalHonorPoints, totalKills\n          FROM characters WHERE guid='" . $id . "'");
            } else {
                $result = $sql["char"]->query("SELECT guid, name, race, class, level, zone AS zoneid, map AS mapid, \n          online, gender, totaltime, account AS acct, logout_time AS timestamp, health, \n\t\t\t\t\tpower1, power2, power3, power4, power5, power6, power7, xp, arenaPoints, totalHonorPoints, totalKills\n          FROM characters WHERE guid='" . $id . "'");
            }
            $char = $sql["char"]->fetch_assoc($result);
            // find out what mode we're in View or Delete (0 = View, 1 = Delete)
            $mode = isset($_GET["mode"]) ? $_GET["mode"] : 0;
            // only the character's owner or a GM with Delete privs can enter Delete Mode
            if ($owner_name != $user_name) {
                if ($user_lvl < $action_permission["delete"]) {
                    $mode = 0;
                } else {
                    $mode = $mode;
                }
            }
            // View Mode is only availble on characters that are offline
            if ($char["online"] != 0) {
                $mode = 0;
            }
            if ($core == 1) {
                $char_data = $char["data"];
                if (empty($char_data)) {
                    $char_data = str_repeat("0;", PLAYER_END);
                }
                $char_data = explode(";", $char_data);
            } else {
                $query = "SELECT * FROM characters LEFT JOIN character_stats ON characters.guid=character_stats.guid WHERE characters.guid='" . $id . "'";
                $char_data_result = $sql["char"]->query($query);
                $char_data_fields = $sql["char"]->fetch_assoc($char_data_result);
                $char_data[PLAYER_BLOCK_PERCENTAGE] = isset($char_data_fields["blockPct"]) ? $char_data_fields["blockPct"] : '&nbsp;';
                $char_data[PLAYER_DODGE_PERCENTAGE] = isset($char_data_fields["dodgePct"]) ? $char_data_fields["dodgePct"] : '&nbsp;';
                $char_data[PLAYER_PARRY_PERCENTAGE] = isset($char_data_fields["parryPct"]) ? $char_data_fields["parryPct"] : '&nbsp;';
                $char_data[PLAYER_CRIT_PERCENTAGE] = isset($char_data_fields["critPct"]) ? $char_data_fields["critPct"] : '&nbsp;';
                $char_data[PLAYER_RANGED_CRIT_PERCENTAGE] = isset($char_data_fields["rangedCritPct"]) ? $char_data_fields["rangedCritPct"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXDAMAGE] = isset($char_data_fields["attackPower"]) ? $char_data_fields["attackPower"] : '&nbsp;';
                $char_data[UNIT_FIELD_MINDAMAGE] = isset($char_data_fields["attackPower"]) ? $char_data_fields["attackPower"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXRANGEDDAMAGE] = isset($char_data_fields["rangedAttackPower"]) ? $char_data_fields["rangedAttackPower"] : '&nbsp;';
                $char_data[UNIT_FIELD_MINRANGEDDAMAGE] = isset($char_data_fields["rangedAttackPower"]) ? $char_data_fields["rangedAttackPower"] : '&nbsp;';
                $char_data[PLAYER_SPELL_CRIT_PERCENTAGE1] = isset($char_data_fields["spellCritPct"]) ? $char_data_fields["spellCritPct"] : '&nbsp;';
                $char_data[PLAYER_FIELD_MOD_DAMAGE_DONE_POS] = isset($char_data_fields["spellPower"]) ? $char_data_fields["spellPower"] : '&nbsp;';
                $char_data[UNIT_FIELD_STAT0] = isset($char_data_fields["strength"]) ? $char_data_fields["strength"] : '&nbsp;';
                $char_data[UNIT_FIELD_STAT1] = isset($char_data_fields["agility"]) ? $char_data_fields["agility"] : '&nbsp;';
                $char_data[UNIT_FIELD_STAT2] = isset($char_data_fields["stamina"]) ? $char_data_fields["stamina"] : '&nbsp;';
                $char_data[UNIT_FIELD_STAT3] = isset($char_data_fields["intellect"]) ? $char_data_fields["intellect"] : '&nbsp;';
                $char_data[UNIT_FIELD_STAT4] = isset($char_data_fields["spirit"]) ? $char_data_fields["spirit"] : '&nbsp;';
                $char_data[UNIT_FIELD_RESISTANCES] = isset($char_data_fields["armor"]) ? $char_data_fields["armor"] : '&nbsp;';
                $char_data[UNIT_FIELD_RESISTANCES + 1] = isset($char_data_fields["resHoly"]) ? $char_data_fields["resHoly"] : '&nbsp;';
                $char_data[UNIT_FIELD_RESISTANCES + 2] = isset($char_data_fields["resArcane"]) ? $char_data_fields["resArcane"] : '&nbsp;';
                $char_data[UNIT_FIELD_RESISTANCES + 3] = isset($char_data_fields["resFire"]) ? $char_data_fields["resFire"] : '&nbsp;';
                $char_data[UNIT_FIELD_RESISTANCES + 4] = isset($char_data_fields["resNature"]) ? $char_data_fields["resNature"] : '&nbsp;';
                $char_data[UNIT_FIELD_RESISTANCES + 5] = isset($char_data_fields["resFrost"]) ? $char_data_fields["resFrost"] : '&nbsp;';
                $char_data[UNIT_FIELD_RESISTANCES + 6] = isset($char_data_fields["resShadow"]) ? $char_data_fields["resShadow"] : '&nbsp;';
                $char_data[UNIT_FIELD_HEALTH] = isset($char["health"]) ? $char["health"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXHEALTH] = isset($char_data_fields["maxhealth"]) ? $char_data_fields["maxhealth"] : '&nbsp;';
                $char_data[UNIT_FIELD_POWER1] = isset($char["power1"]) ? $char["power1"] : '&nbsp;';
                $char_data[UNIT_FIELD_POWER2] = isset($char["power2"]) ? $char["power2"] : '&nbsp;';
                $char_data[UNIT_FIELD_POWER3] = isset($char["power3"]) ? $char["power3"] : '&nbsp;';
                $char_data[UNIT_FIELD_POWER4] = isset($char["power4"]) ? $char["power4"] : '&nbsp;';
                $char_data[UNIT_FIELD_POWER5] = isset($char["power5"]) ? $char["power5"] : '&nbsp;';
                $char_data[UNIT_FIELD_POWER6] = isset($char["power6"]) ? $char["power6"] : '&nbsp;';
                $char_data[UNIT_FIELD_POWER7] = isset($char["power7"]) ? $char["power7"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXPOWER1] = isset($char_data_fields["maxpower1"]) ? $char_data_fields["maxpower1"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXPOWER2] = isset($char_data_fields["maxpower2"]) ? $char_data_fields["maxpower2"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXPOWER3] = isset($char_data_fields["maxpower3"]) ? $char_data_fields["maxpower3"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXPOWER4] = isset($char_data_fields["maxpower4"]) ? $char_data_fields["maxpower4"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXPOWER5] = isset($char_data_fields["maxpower5"]) ? $char_data_fields["maxpower5"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXPOWER6] = isset($char_data_fields["maxpower6"]) ? $char_data_fields["maxpower6"] : '&nbsp;';
                $char_data[UNIT_FIELD_MAXPOWER7] = isset($char_data_fields["maxpower7"]) ? $char_data_fields["maxpower7"] : '&nbsp;';
                $char_data[PLAYER_FIELD_MOD_HEALING_DONE_POS] = "ERR";
                $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 5] = "ERR";
                $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 17] = "ERR";
                $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 6] = "ERR";
                $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 7] = "ERR";
                $char_data[PLAYER_EXPERTISE] = "ERR";
                $char_data[PLAYER_OFFHAND_EXPERTISE] = "ERR";
                $char_data[PLAYER_FIELD_HONOR_CURRENCY] = isset($char["totalHonorPoints"]) ? $char["totalHonorPoints"] : '&nbsp;';
                $char_data[PLAYER_FIELD_ARENA_CURRENCY] = isset($char["arenaPoints"]) ? $char["arenaPoints"] : '&nbsp;';
                $char_data[PLAYER_FIELD_LIFETIME_HONORBALE_KILLS] = isset($char["totalKills"]) ? $char["totalKills"] : '&nbsp;';
            }
            if ($core == 1) {
                $guild_id = $sql["char"]->result($sql["char"]->query("SELECT guildid FROM guild_data WHERE playerid='" . $char["guid"] . "'"), 0);
                $guild_rank = $sql["char"]->result($sql["char"]->query("SELECT guildRank FROM guild_data WHERE playerid='" . $char["guid"] . "'"), 0);
                $guild_name = $sql["char"]->result($sql["char"]->query("SELECT guildName FROM guilds WHERE guildid='" . $guild_id . "'"));
            } else {
                $guild_id = $sql["char"]->result($sql["char"]->query("SELECT guildid FROM guild_member WHERE guid='" . $char["guid"] . "'"), 0);
                $guild_rank = $sql["char"]->result($sql["char"]->query("SELECT rank AS guildRank FROM guild_member WHERE guid='" . $char["guid"] . "'"), 0);
                $guild_name = $sql["char"]->result($sql["char"]->query("SELECT name AS guildName FROM guild WHERE guildid='" . $guild_id . "'"));
            }
            $online = $char["online"] ? lang("char", "online") : lang("char", "offline");
            if ($guild_id) {
                //$guild_name = $sql["char"]->result($sql["char"]->query('SELECT name FROM guild WHERE guildid ='.$char_data[CHAR_DATA_OFFSET_GUILD_ID].''), 0, 'name');
                $guild_name = '<a href="guild.php?action=view_guild&amp;realm=' . $realmid . '&amp;error=3&amp;id=' . $guild_id . '" >' . $guild_name . '</a>';
                $mrank = $guild_rank;
                if ($core == 1) {
                    $guild_rank = $sql["char"]->result($sql["char"]->query("SELECT rankname FROM guild_ranks WHERE guildid='" . $guild_id . "' AND rankId='" . $mrank . "'"), 0, "rankname");
                } else {
                    $guild_rank = $sql["char"]->result($sql["char"]->query("SELECT rname AS rankname FROM guild_rank WHERE guildid='" . $guild_id . "' AND rid='" . $mrank . "'"), 0, "rankname");
                }
            } else {
                $guild_name = lang("global", "none");
                $guild_rank = lang("global", "none");
            }
            if ($core == 1) {
                $block = unpack("f", pack("L", $char_data[PLAYER_BLOCK_PERCENTAGE]));
                $block = round($block[1], 2);
                $dodge = unpack("f", pack("L", $char_data[PLAYER_DODGE_PERCENTAGE]));
                $dodge = round($dodge[1], 2);
                $parry = unpack("f", pack("L", $char_data[PLAYER_PARRY_PERCENTAGE]));
                $parry = round($parry[1], 2);
                $crit = unpack("f", pack("L", $char_data[PLAYER_CRIT_PERCENTAGE]));
                $crit = round($crit[1], 2);
                $ranged_crit = unpack("f", pack("L", $char_data[PLAYER_RANGED_CRIT_PERCENTAGE]));
                $ranged_crit = round($ranged_crit[1], 2);
                $maxdamage = unpack("f", pack("L", $char_data[UNIT_FIELD_MAXDAMAGE]));
                $maxdamage = round($maxdamage[1], 0);
                $mindamage = unpack("f", pack("L", $char_data[UNIT_FIELD_MINDAMAGE]));
                $mindamage = round($mindamage[1], 0);
                $maxrangeddamage = unpack("f", pack("L", $char_data[UNIT_FIELD_MAXRANGEDDAMAGE]));
                $maxrangeddamage = round($maxrangeddamage[1], 0);
                $minrangeddamage = unpack("f", pack("L", $char_data[UNIT_FIELD_MINRANGEDDAMAGE]));
                $minrangeddamage = round($minrangeddamage[1], 0);
            } else {
                $block = $char_data[PLAYER_BLOCK_PERCENTAGE];
                $block = round($block, 2);
                $dodge = $char_data[PLAYER_DODGE_PERCENTAGE];
                $dodge = round($dodge, 2);
                $parry = $char_data[PLAYER_PARRY_PERCENTAGE];
                $parry = round($parry, 2);
                $crit = $char_data[PLAYER_CRIT_PERCENTAGE];
                $crit = round($crit, 2);
                $ranged_crit = $char_data[PLAYER_RANGED_CRIT_PERCENTAGE];
                $ranged_crit = round($ranged_crit, 2);
                $maxdamage = $char_data[UNIT_FIELD_MAXDAMAGE];
                $maxdamage = round($maxdamage, 0);
                $mindamage = $char_data[UNIT_FIELD_MINDAMAGE];
                $mindamage = round($mindamage, 0);
                $maxrangeddamage = $char_data[UNIT_FIELD_MAXRANGEDDAMAGE];
                $maxrangeddamage = round($maxrangeddamage, 0);
                $minrangeddamage = $char_data[UNIT_FIELD_MINRANGEDDAMAGE];
                $minrangeddamage = round($minrangeddamage, 0);
            }
            if ($core == 1) {
                $spell_crit = 100;
                for ($i = 0; $i < 6; ++$i) {
                    $temp = unpack("f", pack("L", $char_data[PLAYER_SPELL_CRIT_PERCENTAGE1 + 1 + $i]));
                    if ($temp[1] < $spell_crit) {
                        $spell_crit = $temp[1];
                    }
                }
                $spell_crit = round($spell_crit, 2);
            } else {
                $spell_crit = $char_data[PLAYER_SPELL_CRIT_PERCENTAGE1];
                $spell_crit = round($spell_crit, 2);
            }
            if ($core == 1) {
                $spell_damage = 9999;
                for ($i = 0; $i < 6; ++$i) {
                    if ($char_data[PLAYER_FIELD_MOD_DAMAGE_DONE_POS + 1 + $i] < $spell_damage) {
                        $spell_damage = $char_data[PLAYER_FIELD_MOD_DAMAGE_DONE_POS + 1 + $i];
                    }
                }
            } else {
                $spell_damage = $char_data[PLAYER_FIELD_MOD_DAMAGE_DONE_POS];
            }
            $spell_heal = $char_data[PLAYER_FIELD_MOD_HEALING_DONE_POS];
            // this_is_junk: PLAYER_FIELD_COMBAT_RATING_1 +5, +6, and +7 seem to have the same value as +5
            //               I'm not sure which of these fields is which hit rating. :/
            $spell_hit = $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 5];
            // this_is_junk: PLAYER_FIELD_COMBAT_RATING_1 +18 and +19 seem to have the same value as +5
            //               I'm not sure which of these fields is really spell haste. :/
            $spell_haste = $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 17];
            // this_is_junk: PLAYER_FIELD_COMBAT_RATING_1 +5, +6, and +7 seem to have the same value as +5
            //               I'm not sure which of these fields is which hit rating. :/
            $ranged_hit = $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 6];
            // this_is_junk: PLAYER_FIELD_COMBAT_RATING_1 +5, +6, and +7 seem to have the same value as +5
            //               I'm not sure which of these fields is which hit rating. :/
            $melee_hit = $char_data[PLAYER_FIELD_COMBAT_RATING_1 + 7];
            $expertise = $char_data[PLAYER_EXPERTISE] . " / " . $char_data[PLAYER_OFFHAND_EXPERTISE];
            //if ( $core == 1 )
            //{
            /*$EQU_HEAD      = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 0];
              $EQU_NECK      = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 2];
              $EQU_SHOULDER  = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 4];
              $EQU_SHIRT     = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 6];
              $EQU_CHEST     = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 8];
              $EQU_BELT      = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 10];
              $EQU_LEGS      = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 12];
              $EQU_FEET      = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 14];
              $EQU_WRIST     = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 16];
              $EQU_GLOVES    = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 18];
              $EQU_FINGER1   = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 20];
              $EQU_FINGER2   = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 22];
              $EQU_TRINKET1  = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 24];
              $EQU_TRINKET2  = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 26];
              $EQU_BACK      = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 28];
              $EQU_MAIN_HAND = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 30];
              $EQU_OFF_HAND  = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 32];
              $EQU_RANGED    = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 34];
              $EQU_TABARD    = $char_data[PLAYER_FIELD_INV_SLOT_HEAD + 36];*/
            //}
            //else
            //{
            $world_db_name = $world_db[$realm_id]["name"];
            if ($core == 1) {
                $char_equip_query = "SELECT *, \n          playeritems.entry AS item_template, randomprop as property, enchantments AS enchantment, flags\n          FROM playeritems WHERE ownerguid='" . $id . "' AND containerslot=-1";
            } elseif ($core == 2) {
                $char_equip_query = "SELECT *,\n          SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 11), ' ', -1) AS creator,\n          SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 23), ' ', -1) AS enchantment,\n          SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 60), ' ', -1) AS property,\n          SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 62), ' ', -1) AS durability,\n          SUBSTRING_INDEX(SUBSTRING_INDEX(item_instance.data, ' ', 22), ' ', -1) AS flags\n          FROM character_inventory\n            LEFT JOIN item_instance ON character_inventory.item=item_instance.guid\n          WHERE character_inventory.guid='" . $id . "' AND character_inventory.bag=0";
            } else {
                $char_equip_query = "SELECT *,\n          creatorGuid AS creator, enchantments AS enchantment,\n          randomPropertyId AS property, durability, flags,\n          itemEntry AS item_template\n          FROM character_inventory\n            LEFT JOIN item_instance ON character_inventory.item=item_instance.guid\n          WHERE character_inventory.guid='" . $id . "' AND character_inventory.bag=0";
            }
            $char_equip_result = $sql["char"]->query($char_equip_query);
            while ($equip_row = $sql["char"]->fetch_assoc($char_equip_result)) {
                switch ($equip_row["slot"]) {
                    case 0:
                        $EQU_HEAD = $equip_row["item_template"];
                        $EQU_HEAD_ROW = $equip_row;
                        break;
                    case 1:
                        $EQU_NECK = $equip_row["item_template"];
                        $EQU_NECK_ROW = $equip_row;
                        break;
                    case 2:
                        $EQU_SHOULDER = $equip_row["item_template"];
                        $EQU_SHOULDER_ROW = $equip_row;
                        break;
                    case 3:
                        $EQU_SHIRT = $equip_row["item_template"];
                        $EQU_SHIRT_ROW = $equip_row;
                        break;
                    case 4:
                        $EQU_CHEST = $equip_row["item_template"];
                        $EQU_CHEST_ROW = $equip_row;
                        break;
                    case 5:
                        $EQU_BELT = $equip_row["item_template"];
                        $EQU_BELT_ROW = $equip_row;
                        break;
                    case 6:
                        $EQU_LEGS = $equip_row["item_template"];
                        $EQU_LEGS_ROW = $equip_row;
                        break;
                    case 7:
                        $EQU_FEET = $equip_row["item_template"];
                        $EQU_FEET_ROW = $equip_row;
                        break;
                    case 8:
                        $EQU_WRIST = $equip_row["item_template"];
                        $EQU_WRIST_ROW = $equip_row;
                        break;
                    case 9:
                        $EQU_GLOVES = $equip_row["item_template"];
                        $EQU_GLOVES_ROW = $equip_row;
                        break;
                    case 10:
                        $EQU_FINGER1 = $equip_row["item_template"];
                        $EQU_FINGER1_ROW = $equip_row;
                        break;
                    case 11:
                        $EQU_FINGER2 = $equip_row["item_template"];
                        $EQU_FINGER2_ROW = $equip_row;
                        break;
                    case 12:
                        $EQU_TRINKET1 = $equip_row["item_template"];
                        $EQU_TRINKET1_ROW = $equip_row;
                        break;
                    case 13:
                        $EQU_TRINKET2 = $equip_row["item_template"];
                        $EQU_TRINKET2_ROW = $equip_row;
                        break;
                    case 14:
                        $EQU_BACK = $equip_row["item_template"];
                        $EQU_BACK_ROW = $equip_row;
                        break;
                    case 15:
                        $EQU_MAIN_HAND = $equip_row["item_template"];
                        $EQU_MAIN_HAND_ROW = $equip_row;
                        break;
                    case 16:
                        $EQU_OFF_HAND = $equip_row["item_template"];
                        $EQU_OFF_HAND_ROW = $equip_row;
                        break;
                    case 17:
                        $EQU_RANGED = $equip_row["item_template"];
                        $EQU_RANGED_ROW = $equip_row;
                        break;
                    case 18:
                        $EQU_TABARD = $equip_row["item_template"];
                        $EQU_TABARD_ROW = $equip_row;
                        break;
                }
            }
            //}
            $equiped_items = array(1 => array("", $EQU_HEAD ? get_item_icon($EQU_HEAD) : 0, $EQU_HEAD ? get_item_border($EQU_HEAD) : 0, $EQU_HEAD_ROW), 2 => array("", $EQU_NECK ? get_item_icon($EQU_NECK) : 0, $EQU_NECK ? get_item_border($EQU_NECK) : 0, $EQU_NECK_ROW), 3 => array("", $EQU_SHOULDER ? get_item_icon($EQU_SHOULDER) : 0, $EQU_SHOULDER ? get_item_border($EQU_SHOULDER) : 0, $EQU_SHOULDER_ROW), 4 => array("", $EQU_SHIRT ? get_item_icon($EQU_SHIRT) : 0, $EQU_SHIRT ? get_item_border($EQU_SHIRT) : 0, $EQU_SHIRT_ROW), 5 => array("", $EQU_CHEST ? get_item_icon($EQU_CHEST) : 0, $EQU_CHEST ? get_item_border($EQU_CHEST) : 0, $EQU_CHEST_ROW), 6 => array("", $EQU_BELT ? get_item_icon($EQU_BELT) : 0, $EQU_BELT ? get_item_border($EQU_BELT) : 0, $EQU_BELT_ROW), 7 => array("", $EQU_LEGS ? get_item_icon($EQU_LEGS) : 0, $EQU_LEGS ? get_item_border($EQU_LEGS) : 0, $EQU_LEGS_ROW), 8 => array("", $EQU_FEET ? get_item_icon($EQU_FEET) : 0, $EQU_FEET ? get_item_border($EQU_FEET) : 0, $EQU_FEET_ROW), 9 => array("", $EQU_WRIST ? get_item_icon($EQU_WRIST) : 0, $EQU_WRIST ? get_item_border($EQU_WRIST) : 0, $EQU_WRIST_ROW), 10 => array("", $EQU_GLOVES ? get_item_icon($EQU_GLOVES) : 0, $EQU_GLOVES ? get_item_border($EQU_GLOVES) : 0, $EQU_GLOVES_ROW), 11 => array("", $EQU_FINGER1 ? get_item_icon($EQU_FINGER1) : 0, $EQU_FINGER1 ? get_item_border($EQU_FINGER1) : 0, $EQU_FINGER1_ROW), 12 => array("", $EQU_FINGER2 ? get_item_icon($EQU_FINGER2) : 0, $EQU_FINGER2 ? get_item_border($EQU_FINGER2) : 0, $EQU_FINGER2_ROW), 13 => array("", $EQU_TRINKET1 ? get_item_icon($EQU_TRINKET1) : 0, $EQU_TRINKET1 ? get_item_border($EQU_TRINKET1) : 0, $EQU_TRINKET1_ROW), 14 => array("", $EQU_TRINKET2 ? get_item_icon($EQU_TRINKET2) : 0, $EQU_TRINKET2 ? get_item_border($EQU_TRINKET2) : 0, $EQU_TRINKET2_ROW), 15 => array("", $EQU_BACK ? get_item_icon($EQU_BACK) : 0, $EQU_BACK ? get_item_border($EQU_BACK) : 0, $EQU_BACK_ROW), 16 => array("", $EQU_MAIN_HAND ? get_item_icon($EQU_MAIN_HAND) : 0, $EQU_MAIN_HAND ? get_item_border($EQU_MAIN_HAND) : 0, $EQU_MAIN_HAND_ROW), 17 => array("", $EQU_OFF_HAND ? get_item_icon($EQU_OFF_HAND) : 0, $EQU_OFF_HAND ? get_item_border($EQU_OFF_HAND) : 0, $EQU_OFF_HAND_ROW), 18 => array("", $EQU_RANGED ? get_item_icon($EQU_RANGED) : 0, $EQU_RANGED ? get_item_border($EQU_RANGED) : 0, $EQU_RANGED_ROW), 19 => array("", $EQU_TABARD ? get_item_icon($EQU_TABARD) : 0, $EQU_TABARD ? get_item_border($EQU_TABARD) : 0, $EQU_TABARD_ROW));
            // visibility overrides for specific tabs
            $view_inv_override = false;
            if ($s_fields["View_Mod_Inv"] > 0) {
                if ($s_fields["View_Mod_Inv"] == 1) {
                } elseif ($s_fields["View_Mod_Inv"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_inv_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_inv_override = true;
                }
            }
            $view_talent_override = false;
            if ($s_fields["View_Mod_Talent"] > 0) {
                if ($s_fields["View_Mod_Talent"] == 1) {
                } elseif ($s_fields["View_Mod_Talent"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_talent_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_talent_override = true;
                }
            }
            $view_achieve_override = false;
            if ($s_fields["View_Mod_Achieve"] > 0) {
                if ($s_fields["View_Mod_Achieve"] == 1) {
                } elseif ($s_fields["View_Mod_Achieve"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_achieve_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_achieve_override = true;
                }
            }
            $view_quest_override = false;
            if ($s_fields["View_Mod_Quest"] > 0) {
                if ($s_fields["View_Mod_Quest"] == 1) {
                } elseif ($s_fields["View_Mod_Quest"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_quest_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_quest_override = true;
                }
            }
            $view_friends_override = false;
            if ($s_fields["View_Mod_Friends"] > 0) {
                if ($s_fields["View_Mod_Friends"] == 1) {
                } elseif ($s_fields["View_Mod_Friends"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_friends_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_friends_override = true;
                }
            }
            $view_view_override = false;
            if ($s_fields["View_Mod_View"] > 0) {
                if ($s_fields["View_Mod_View"] == 1) {
                } elseif ($s_fields["View_Mod_View"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_view_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_view_override = true;
                }
            }
            $view_pets_override = false;
            if ($s_fields["View_Mod_Pets"] > 0) {
                if ($s_fields["View_Mod_Pets"] == 1) {
                } elseif ($s_fields["View_Mod_Pets"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_pets_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_pets_override = true;
                }
            }
            $view_rep_override = false;
            if ($s_fields["View_Mod_Rep"] > 0) {
                if ($s_fields["View_Mod_Rep"] == 1) {
                } elseif ($s_fields["View_Mod_Rep"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_rep_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_rep_override = true;
                }
            }
            $view_skill_override = false;
            if ($s_fields["View_Mod_Skill"] > 0) {
                if ($s_fields["View_Mod_Skill"] == 1) {
                } elseif ($s_fields["View_Mod_Skill"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_skill_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_skill_override = true;
                }
            }
            $view_pvp_override = false;
            if ($s_fields["View_Mod_PvP"] > 0) {
                if ($s_fields["View_Mod_PvP"] == 1) {
                } elseif ($s_fields["View_Mod_PvP"] == 2) {
                    // only registered users may view this tab
                    if ($user_lvl > -1) {
                        $view_pvp_override = true;
                    }
                }
            } else {
                if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                    $view_pvp_override = true;
                }
            }
            $output .= '
          <!-- start of char.php -->
          <div class="tab">
            <ul>
              <li class="selected"><a href="char.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "char_sheet") . '</a></li>';
            if ($view_inv_override) {
                $output .= '
              <li><a href="char_inv.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "inventory") . '</a></li>';
            }
            if ($view_talent_override) {
                $output .= '
              ' . ($char["level"] < 10 ? '' : '<li><a href="char_talent.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "talents") . '</a></li>') . '';
            }
            if ($view_achieve_override) {
                $output .= '
              <li><a href="char_achieve.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "achievements") . '</a></li>';
            }
            if ($view_quest_override) {
                $output .= '
              <li><a href="char_quest.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "quests") . '</a></li>';
            }
            if ($view_friends_override) {
                $output .= '
              <li><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "friends") . '</a></li>';
            }
            if ($view_view_override) {
                $output .= '
              <li><a href="char_view.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "view") . '</a></li>';
            }
            $output .= '
            </ul>
          </div>';
            if ($view_override || $user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                $output .= '
          <div class="tab_content center">
            <div class="tab">
              <ul>
                <li class="selected"><a href="char.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "char_sheet") . '</a></li>';
                if (char_get_class_name($char["class"]) === "Hunter" && $view_pets_override) {
                    $output .= '
                <li><a href="char_pets.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "pets") . '</a></li>';
                }
                if ($view_rep_override) {
                    $output .= '
                <li><a href="char_rep.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "reputation") . '</a></li>';
                }
                if ($view_skill_override) {
                    $output .= '
                <li><a href="char_skill.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "skills") . '</a></li>';
                }
                if ($view_pvp_override) {
                    $output .= '
                <li><a href="char_pvp.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "pvp") . '</a></li>';
                }
                if ($owner_name == $user_name || $user_lvl >= get_page_permission("insert", "char_mail.php")) {
                    $output .= '
                <li><a href="char_mail.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "mail") . '</a></li>';
                }
                $output .= '
              </ul>
            </div>';
            } else {
                $output .= '
            <div class="tab_content center">
              <div class="tab">
              </div>';
            }
            $output .= '
              <div class="tab_content2 center">
                <table class="lined" id="char_character_sheet">
                  <tr>
                    <td colspan="2">
                      <div>
                        <img src="' . char_get_avatar_img($char["level"], $char["gender"], $char["race"], $char["class"], 0) . '" alt="avatar" />
                      </div>
                      <div>';
            // this_is_junk: auras are stored in a string in the characters table.
            // not sure how to query a string as though it were a record
            if ($core == 1) {
            } else {
                $a_results = $sql["char"]->query("SELECT DISTINCT spell FROM character_aura WHERE guid='" . $id . "'");
            }
            if ($sql["char"]->num_rows($a_results)) {
                while ($aura = $sql["char"]->fetch_assoc($a_results)) {
                    $output .= '
                        <a class="char_icon_padding" href="' . $base_datasite . $spell_datasite . $aura["spell"] . '" rel="external">
                          <img src="' . spell_get_icon($aura["spell"]) . '" alt="' . $aura["spell"] . '" width="24" height="24" />
                        </a>';
                }
            }
            $output .= '
                      </div>
                    </td>
                    <td colspan="4">
                      <span class="bold">
                        ' . htmlentities($char["name"], ENT_COMPAT, $site_encoding) . ' -
                        <img src="img/c_icons/' . $char["race"] . '-' . $char["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($char["race"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        <img src="img/c_icons/' . $char["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($char["class"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                       - ' . lang("char", "level_short") . char_get_level_color($char["level"]) . '
                      </span>
                      <br />' . lang("char", "location") . ': ' . get_map_name($char["mapid"]) . ' - ' . get_zone_name($char["zoneid"]) . '
                      <br />' . lang("char", "honor_points") . ': ' . $char_data[PLAYER_FIELD_HONOR_CURRENCY] . ' | ' . lang("char", "arena_points") . ': ' . $char_data[PLAYER_FIELD_ARENA_CURRENCY] . ' | ' . lang("char", "honor_kills") . ': ' . $char_data[PLAYER_FIELD_LIFETIME_HONORBALE_KILLS] . '
                      <br />' . lang("char", "guild") . ': ' . $guild_name . ' | ' . lang("char", "rank") . ': ' . htmlentities($guild_rank, ENT_COMPAT, $site_encoding) . '
                      <br />' . lang("char", "online") . ': ' . ($char["online"] ? '<img src="img/up.gif" onmousemove="oldtoolTip(\'' . lang("char", "online") . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="online" />' : '<img src="img/down.gif" onmousemove="oldtoolTip(\'' . lang("char", "offline") . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="offline" />');
            if ($showcountryflag) {
                require_once 'libs/misc_lib.php';
                $country = misc_get_country_by_account($char["acct"]);
                $output .= ' | ' . lang("global", "country") . ': ' . ($country["code"] ? '<img src="img/flags/' . $country["code"] . '.png" onmousemove="oldtoolTip(\'' . $country["country"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />' : '-');
                unset($country);
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 6%;">';
            if ($equiped_items[1][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_HEAD . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'HEAD' . '\');" onmouseout="HideTooltip(\'_b' . 'HEAD' . '\');">
                        <img src="' . $equiped_items[1][1] . '" class="' . $equiped_items[1][2] . '" alt="Head" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[1][3]["bag"] . '&slot=' . $equiped_items[1][3]["slot"] . '&item=' . $equiped_items[1][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[1][3]["item_template"]);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'HEAD' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[1][3]["enchantment"], $equiped_items[1][3]["property"], $equiped_items[1][3]["creator"], $equiped_items[1][3]["durability"], $equiped_items[1][3]["flags"]) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_head.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" align="center" style="width: 50%;">
                      <div class="gradient_p" id="char_hp_name">' . lang("item", "health") . ':</div>
                      <div class="gradient_pp" id="char_hp_value">' . $char_data[UNIT_FIELD_HEALTH] . '/' . $char_data[UNIT_FIELD_MAXHEALTH] . '</div>';
            if ($char["class"] == 11) {
                //druid
                $output .= '
                      <br />
                      <div class="gradient_p" id="char_energy_name">' . lang("item", "mana") . ':</div>
                      <div class="gradient_pp" id="char_energy_value">' . $char_data[UNIT_FIELD_POWER1] . '/' . $char_data[UNIT_FIELD_MAXPOWER1] . '</div>';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" align="center" style="width: 50%;">';
            if ($char["class"] == 1) {
                $output .= '
                      <div class="gradient_p" id="char_energy_name">' . lang("item", "rage") . ':</div>
                      <div class="gradient_pp" id="char_energy_value">' . $char_data[UNIT_FIELD_POWER2] / 10 . '/' . $char_data[UNIT_FIELD_MAXPOWER2] / 10 . '</div>';
            } elseif ($char["class"] == 4) {
                $output .= '
                      <div class="gradient_p" id="char_energy_name">' . lang("item", "energy") . ':</div>
                      <div class="gradient_pp" id="char_energy_value">' . $char_data[UNIT_FIELD_POWER4] . '/' . $char_data[UNIT_FIELD_MAXPOWER4] . '</div>';
            } elseif ($char["class"] == 6) {
                $output .= '
                      <div class="gradient_p" id="char_energy_name">' . lang("item", "runic") . ':</div>
                      <div class="gradient_pp" id="char_energy_value">' . $char_data[UNIT_FIELD_POWER7] / 10 . '/' . $char_data[UNIT_FIELD_MAXPOWER7] / 10 . '</div>';
            } elseif ($char["class"] == 11) {
                $output .= '
                      <div class="gradient_p" id="char_energy_name">' . lang("item", "mana") . ':</div>
                      <div class="gradient_pp" id="char_energy_value">' . $char_data[UNIT_FIELD_POWER1] . '/' . $char_data[UNIT_FIELD_MAXPOWER1] . '</div>
                      <br />
                      <div class="gradient_p" id="char_energy_name">' . lang("item", "rage") . ':</div>
                      <div class="gradient_pp" id="char_energy_value">' . $char_data[UNIT_FIELD_POWER2] / 10 . '/' . $char_data[UNIT_FIELD_MAXPOWER2] / 10 . '</div>';
            } elseif ($char["class"] == 2 || $char["class"] == 3 || $char["class"] == 5 || $char["class"] == 7 || $char["class"] == 8 || $char["class"] == 9) {
                $output .= '
                      <div class="gradient_p" id="char_energy_name">' . lang("item", "mana") . ':</div>
                      <div class="gradient_pp" id="char_energy_value">' . $char_data[UNIT_FIELD_POWER1] . '/' . $char_data[UNIT_FIELD_MAXPOWER1] . '</div>';
            }
            $output .= '
                    </td>
                    <td style="width: 6%;">';
            if ($equiped_items[10][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_GLOVES . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'GLOVES' . '\');" onmouseout="HideTooltip(\'_b' . 'GLOVES' . '\');">
                        <img src="' . $equiped_items[10][1] . '" class="' . $equiped_items[10][2] . '" alt="Gloves" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[10][3]["bag"] . '&slot=' . $equiped_items[10][3]["slot"] . '&item=' . $equiped_items[10][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[10][3]["item_template"]);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'GLOVES' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[10][3]["enchantment"], $equiped_items[10][3]["property"], $equiped_items[10][3]["creator"], $equiped_items[10][3]["durability"], $equiped_items[10][3]["flags"]) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_gloves.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 1%;">';
            if ($equiped_items[2][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_NECK . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'NECK' . '\');" onmouseout="HideTooltip(\'_b' . 'NECK' . '\');">
                        <img src="' . $equiped_items[2][1] . '" class="' . $equiped_items[2][2] . '" alt="Neck" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[2][3]["bag"] . '&slot=' . $equiped_items[2][3]["slot"] . '&item=' . $equiped_items[2][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[2][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'NECK' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[2][3]['enchantment'], $equiped_items[2][3]['property'], $equiped_items[2][3]['creator'], $equiped_items[2][3]['durability'], $equiped_items[2][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_neck.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" rowspan="3" align="center" style="width: 50%;">
                      <div class="gradient_p">
                        ' . lang("item", "strength") . ':<br />
                        ' . lang("item", "agility") . ':<br />
                        ' . lang("item", "stamina") . ':<br />
                        ' . lang("item", "intellect") . ':<br />
                        ' . lang("item", "spirit") . ':<br />
                        ' . lang("item", "armor") . ':
                      </div>
                      <div class="gradient_pp">
                        ' . $char_data[UNIT_FIELD_STAT0] . '<br />
                        ' . $char_data[UNIT_FIELD_STAT1] . '<br />
                        ' . $char_data[UNIT_FIELD_STAT2] . '<br />
                        ' . $char_data[UNIT_FIELD_STAT3] . '<br />
                        ' . $char_data[UNIT_FIELD_STAT4] . '<br />
                        ' . $char_data[UNIT_FIELD_RESISTANCES] . '
                      </div>
                    </td>
                    <td class="half_line" colspan="2" rowspan="3" align="center" style="width: 50%;">
                      <div class="gradient_p">
                        ' . lang("item", "res_holy") . ':<br />
                        ' . lang("item", "res_arcane") . ':<br />
                        ' . lang("item", "res_fire") . ':<br />
                        ' . lang("item", "res_nature") . ':<br />
                        ' . lang("item", "res_frost") . ':<br />
                        ' . lang("item", "res_shadow") . ':
                      </div>
                      <div class="gradient_pp">
                        ' . $char_data[UNIT_FIELD_RESISTANCES + 1] . '<br />
                        ' . $char_data[UNIT_FIELD_RESISTANCES + 2] . '<br />
                        ' . $char_data[UNIT_FIELD_RESISTANCES + 3] . '<br />
                        ' . $char_data[UNIT_FIELD_RESISTANCES + 4] . '<br />
                        ' . $char_data[UNIT_FIELD_RESISTANCES + 5] . '<br />
                        ' . $char_data[UNIT_FIELD_RESISTANCES + 6] . '
                      </div>
                    </td>
                    <td style="width: 1%;">';
            if ($equiped_items[6][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_BELT . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'BELT' . '\');" onmouseout="HideTooltip(\'_b' . 'BELT' . '\');">
                        <img src="' . $equiped_items[6][1] . '" class="' . $equiped_items[6][2] . '" alt="Belt" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[6][3]["bag"] . '&slot=' . $equiped_items[6][3]["slot"] . '&item=' . $equiped_items[6][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[6][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'BELT' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[6][3]['enchantment'], $equiped_items[6][3]['property'], $equiped_items[6][3]['creator'], $equiped_items[6][3]['durability'], $equiped_items[6][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_waist.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 1%;">';
            if ($equiped_items[3][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_SHOULDER . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'SHOULDER' . '\');" onmouseout="HideTooltip(\'_b' . 'SHOULDER' . '\');">
                        <img src="' . $equiped_items[3][1] . '" class="' . $equiped_items[3][2] . '" alt="Shoulder" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[3][3]["bag"] . '&slot=' . $equiped_items[3][3]["slot"] . '&item=' . $equiped_items[3][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[3][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'SHOULDER' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[3][3]['enchantment'], $equiped_items[3][3]['property'], $equiped_items[3][3]['creator'], $equiped_items[3][3]['durability'], $equiped_items[3][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_shoulder.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td style="width: 1%;">';
            if ($equiped_items[7][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_LEGS . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'LEGS' . '\');" onmouseout="HideTooltip(\'_b' . 'LEGS' . '\');">
                        <img src="' . $equiped_items[7][1] . '" class="' . $equiped_items[7][2] . '" alt="Legs" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[7][3]["bag"] . '&slot=' . $equiped_items[7][3]["slot"] . '&item=' . $equiped_items[7][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[7][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'LEGS' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[7][3]['enchantment'], $equiped_items[7][3]['property'], $equiped_items[7][3]['creator'], $equiped_items[7][3]['durability'], $equiped_items[7][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_legs.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 1%;">';
            if ($equiped_items[15][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_BACK . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'BACK' . '\');" onmouseout="HideTooltip(\'_b' . 'BACK' . '\');">
                        <img src="' . $equiped_items[15][1] . '" class="' . $equiped_items[15][2] . '" alt="Back" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[15][3]["bag"] . '&slot=' . $equiped_items[15][3]["slot"] . '&item=' . $equiped_items[15][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[15][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'BACK' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[15][3]['enchantment'], $equiped_items[15][3]['property'], $equiped_items[15][3]['creator'], $equiped_items[15][3]['durability'], $equiped_items[15][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_chest_back.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td style="width: 1%;">';
            if ($equiped_items[8][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_FEET . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'FEET' . '\');" onmouseout="HideTooltip(\'_b' . 'FEET' . '\');">
                        <img src="' . $equiped_items[8][1] . '" class="' . $equiped_items[8][2] . '" alt="Feet" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[8][3]["bag"] . '&slot=' . $equiped_items[8][3]["slot"] . '&item=' . $equiped_items[8][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[8][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'FEET' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[8][3]['enchantment'], $equiped_items[8][3]['property'], $equiped_items[8][3]['creator'], $equiped_items[8][3]['durability'], $equiped_items[8][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_feet.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 1%;">';
            if ($equiped_items[5][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_CHEST . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'CHEST' . '\');" onmouseout="HideTooltip(\'_b' . 'CHEST' . '\');">
                        <img src="' . $equiped_items[5][1] . '" class="' . $equiped_items[5][2] . '" alt="Chest" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[5][3]["bag"] . '&slot=' . $equiped_items[5][3]["slot"] . '&item=' . $equiped_items[5][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[5][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'CHEST' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[5][3]['enchantment'], $equiped_items[5][3]['property'], $equiped_items[5][3]['creator'], $equiped_items[5][3]['durability'], $equiped_items[5][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_chest_back.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" style="width: 50%;">
                      <div class="gradient_p" id="char_melee_name">
                        ' . lang("char", "melee_d") . ':<br />
                        ' . lang("char", "melee_ap") . ':<br />
                        ' . lang("char", "melee_hit") . ':<br />
                        ' . lang("char", "melee_crit") . ':<br />
                        ' . lang("char", "expertise") . ':<br />
                      </div>
                      <div class="gradient_pp" id="char_melee_value">
                        ' . $mindamage . '-' . $maxdamage . '<br />
                        ' . ($char_data[UNIT_FIELD_ATTACK_POWER] + $char_data[UNIT_FIELD_ATTACK_POWER_MODS]) . '<br />
                        ' . $melee_hit . '<br />
                        ' . $crit . '%<br />
                        ' . $expertise . '<br />
                      </div>
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" style="width: 50%;">
                      <div class="gradient_p">
                        ' . lang("char", "spell_d") . ':<br />
                        ' . lang("char", "spell_heal") . ':<br />
                        ' . lang("char", "spell_hit") . ':<br />
                        ' . lang("char", "spell_crit") . ':<br />
                        ' . lang("char", "spell_haste") . '
                      </div>
                      <div class="gradient_pp">
                        ' . $spell_damage . '<br />
                        ' . $spell_heal . '<br />
                        ' . $spell_hit . '<br />
                        ' . $spell_crit . '%<br />
                        ' . $spell_haste . '
                      </div>
                    </td>
                    <td style="width: 1%;">';
            if ($equiped_items[11][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_FINGER1 . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'FINGER1' . '\');" onmouseout="HideTooltip(\'_b' . 'FINGER1' . '\');">
                        <img src="' . $equiped_items[11][1] . '" class="' . $equiped_items[11][2] . '" alt="Finger1" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[11][3]["bag"] . '&slot=' . $equiped_items[11][3]["slot"] . '&item=' . $equiped_items[11][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[11][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'FINGER1' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[11][3]['enchantment'], $equiped_items[11][3]['property'], $equiped_items[11][3]['creator'], $equiped_items[11][3]['durability'], $equiped_items[11][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_finger.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 1%;">';
            if ($equiped_items[4][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_SHIRT . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'SHIRT' . '\');" onmouseout="HideTooltip(\'_b' . 'SHIRT' . '\');">
                        <img src="' . $equiped_items[4][1] . '" class="' . $equiped_items[4][2] . '" alt="Shirt" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[4][3]["bag"] . '&slot=' . $equiped_items[4][3]["slot"] . '&item=' . $equiped_items[4][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[4][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'SHIRT' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[4][3]['enchantment'], $equiped_items[4][3]['property'], $equiped_items[4][3]['creator'], $equiped_items[4][3]['durability'], $equiped_items[4][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_shirt.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td style="width: 1%;">';
            if ($equiped_items[12][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_FINGER2 . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'FINGER2' . '\');" onmouseout="HideTooltip(\'_b' . 'FINGER2' . '\');">
                        <img src="' . $equiped_items[12][1] . '" class="' . $equiped_items[12][2] . '" alt="Finger2" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[12][3]["bag"] . '&slot=' . $equiped_items[12][3]["slot"] . '&item=' . $equiped_items[12][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[12][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'FINGER2' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[12][3]['enchantment'], $equiped_items[12][3]['property'], $equiped_items[12][3]['creator'], $equiped_items[12][3]['durability'], $equiped_items[12][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_finger.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 1%;">';
            if ($equiped_items[19][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_TABARD . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'TABARD' . '\');" onmouseout="HideTooltip(\'_b' . 'TABARD' . '\');">
                        <img src="' . $equiped_items[19][1] . '" class="' . $equiped_items[19][2] . '" alt="Tabard" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[19][3]["bag"] . '&slot=' . $equiped_items[19][3]["slot"] . '&item=' . $equiped_items[19][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[19][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'TABARD' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[19][3]['enchantment'], $equiped_items[19][3]['property'], $equiped_items[19][3]['creator'], $equiped_items[19][3]['durability'], $equiped_items[19][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_tabard.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" style="width: 50%;">
                      <div class="gradient_p">
                        ' . lang("char", "dodge") . ':<br />
                        ' . lang("char", "parry") . ':<br />
                        ' . lang("char", "block") . ':
                      </div>
                      <div class="gradient_pp">
                        ' . $dodge . '%<br />
                        ' . $parry . '%<br />
                        ' . $block . '%
                      </div>
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" style="width: 50%;">
                      <div class="gradient_p" id="char_ranged_name">
                        ' . lang("char", "ranged_d") . ':<br />
                        ' . lang("char", "ranged_ap") . ':<br />
                        ' . lang("char", "ranged_hit") . ':<br />
                        ' . lang("char", "ranged_crit") . ':<br />
                      </div>
                      <div class="gradient_pp" id="char_ranged_value">
                        ' . $minrangeddamage . '-' . $maxrangeddamage . '<br />
                        ' . ($char_data[UNIT_FIELD_RANGED_ATTACK_POWER] + $char_data[UNIT_FIELD_RANGED_ATTACK_POWER_MODS]) . '<br />
                        ' . $ranged_hit . '<br />
                        ' . $ranged_crit . '%<br />
                      </div>
                    </td>
                    <td style="width: 1%;">';
            if ($equiped_items[13][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_TRINKET1 . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'TRINKET1' . '\');" onmouseout="HideTooltip(\'_b' . 'TRINKET1' . '\');">
                        <img src="' . $equiped_items[13][1] . '" class="' . $equiped_items[13][2] . '" alt="Trinket1" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[13][3]["bag"] . '&slot=' . $equiped_items[13][3]["slot"] . '&item=' . $equiped_items[13][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[13][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'TRINKET1' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[13][3]['enchantment'], $equiped_items[13][3]['property'], $equiped_items[13][3]['creator'], $equiped_items[13][3]['durability'], $equiped_items[13][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_trinket.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td style="width: 1%;">';
            if ($equiped_items[9][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_WRIST . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'WRIST' . '\');" onmouseout="HideTooltip(\'_b' . 'WRIST' . '\');">
                        <img src="' . $equiped_items[9][1] . '" class="' . $equiped_items[9][2] . '" alt="Wrist" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[9][3]["bag"] . '&slot=' . $equiped_items[9][3]["slot"] . '&item=' . $equiped_items[9][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[9][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'WRIST' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[9][3]['enchantment'], $equiped_items[9][3]['property'], $equiped_items[9][3]['creator'], $equiped_items[9][3]['durability'], $equiped_items[9][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_wrist.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td style="width: 1%;">';
            if ($equiped_items[14][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_TRINKET2 . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'TRINKET2' . '\');" onmouseout="HideTooltip(\'_b' . 'TRINKET2' . '\');">
                        <img src="' . $equiped_items[14][1] . '" class="' . $equiped_items[14][2] . '" alt="Trinket2" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[14][3]["bag"] . '&slot=' . $equiped_items[14][3]["slot"] . '&item=' . $equiped_items[14][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[14][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'TRINKET2' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[14][3]['enchantment'], $equiped_items[14][3]['property'], $equiped_items[14][3]['creator'], $equiped_items[14][3]['durability'], $equiped_items[14][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_trinket.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td></td>
                    <td style="width: 15%;">';
            if ($equiped_items[16][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_MAIN_HAND . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'MAIN_HAND' . '\');" onmouseout="HideTooltip(\'_b' . 'MAIN_HAND' . '\');">
                        <img src="' . $equiped_items[16][1] . '" class="' . $equiped_items[16][2] . '" alt="MainHand" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[16][3]["bag"] . '&slot=' . $equiped_items[16][3]["slot"] . '&item=' . $equiped_items[16][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[16][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'MAIN_HAND' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[16][3]['enchantment'], $equiped_items[16][3]['property'], $equiped_items[16][3]['creator'], $equiped_items[16][3]['durability'], $equiped_items[16][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_main_hand.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td style="width: 15%;">';
            if ($equiped_items[17][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_OFF_HAND . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'OFF_HAND' . '\');" onmouseout="HideTooltip(\'_b' . 'OFF_HAND' . '\');">
                        <img src="' . $equiped_items[17][1] . '" class="' . $equiped_items[17][2] . '" alt="OffHand" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[17][3]["bag"] . '&slot=' . $equiped_items[17][3]["slot"] . '&item=' . $equiped_items[17][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[17][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'OFF_HAND' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[17][3]['enchantment'], $equiped_items[17][3]['property'], $equiped_items[17][3]['creator'], $equiped_items[17][3]['durability'], $equiped_items[17][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_off_hand.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td style="width: 15%;">';
            if ($equiped_items[18][1]) {
                $output .= '
                      <a class="char_icon_padding" href="' . $base_datasite . $item_datasite . $EQU_RANGED . '" rel="external" onmouseover="ShowTooltip(this,\'_b' . 'RANGED' . '\');" onmouseout="HideTooltip(\'_b' . 'RANGED' . '\');">
                        <img src="' . $equiped_items[18][1] . '" class="' . $equiped_items[18][2] . '" alt="Ranged" />
                      </a>';
                if ($mode) {
                    $output .= '
                      <div style="position: relative;">
                        <a href="char.php?action=delete_item&id=' . $id . '&bag=' . $equiped_items[18][3]["bag"] . '&slot=' . $equiped_items[18][3]["slot"] . '&item=' . $equiped_items[18][3]["item_template"] . '&mode=' . $mode . '" id="ch_item_delete">
                          <img src="img/aff_cross.png" />
                        </a>
                      </div>';
                }
                // build a tooltip object for this item
                $i_fields = get_item_info($equiped_items[18][3]['item_template']);
                $output .= '
                      <div class="item_tooltip" id="tooltip_b' . 'RANGED' . '">
                        <table>
                          <tr>
                            <td>
                              ' . get_item_tooltip($i_fields, $equiped_items[18][3]['enchantment'], $equiped_items[18][3]['property'], $equiped_items[18][3]['creator'], $equiped_items[18][3]['durability'], $equiped_items[18][3]['flags']) . '
                            </td>
                          </tr>
                        </table>
                      </div>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_ranged.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td style="width: 15%;"></td>
                    <td></td>
                  </tr>';
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                // if the character is still leveling, show an experience bar
                if ($char["level"] < 80) {
                    $xp_query = "SELECT * FROM xp_to_level WHERE level='" . $char["level"] . "'";
                    $xp_result = $sql["mgr"]->query($xp_query);
                    $xp_fields = $sql["mgr"]->fetch_assoc($xp_result);
                    $xp_to_level = $xp_fields["xp_for_next_level"];
                    $output .= '
                    <tr>
                      <td colspan="6" class="bar xp_bar" style="background-position: ' . (round(580 * $char["xp"] / $xp_to_level) - 580) . 'px;">
                        ' . lang("char", "exp") . ": " . $char["xp"] . " / " . $xp_to_level . '
                      </td>
                    </tr>';
                }
                //total time played
                $tot_time = $char["totaltime"];
                $tot_days = (int) ($tot_time / 86400);
                $tot_time = $tot_time - $tot_days * 86400;
                $total_hours = (int) ($tot_time / 3600);
                $tot_time = $tot_time - $total_hours * 3600;
                $total_min = (int) ($tot_time / 60);
                $time_offset = $timezone_offset * 3600;
                if ($char["timestamp"] != 0) {
                    $lastseen = date("F j, Y @ Hi", $char["timestamp"] + $time_offset);
                } else {
                    $lastseen = '-';
                }
                $output .= '
                  <tr>
                    <td colspan="6">
                      ' . lang("char", "tot_play_time") . ': ' . $tot_days . ' ' . lang("char", "days") . ' ' . $total_hours . ' ' . lang("char", "hours") . ' ' . $total_min . ' ' . lang("char", "min") . '
                    </td>
                  </tr>';
                $output .= '
                  <tr>
                    <td colspan="6">
                      ' . lang("char", "lastseen") . ': ' . $lastseen . '
                    </td>
                  </tr>';
            }
            $output .= '
                </table>
              </div>
              <br />
            </div>
            <br />
            <table class="hidden center">
              <tr>
                <td>';
            // button to user account page, user account page has own security
            makebutton(lang("char", "chars_acc"), 'user.php?action=edit_user&amp;acct=' . $owner_acc_id . '', 130);
            $output .= '
                </td>
                <td>';
            // only higher level GM with delete access can edit character
            //  character edit allows removal of character items, so delete permission is needed
            if ($user_lvl >= $owner_gmlvl && $user_lvl >= $action_permission["delete"]) {
                makebutton(lang("char", "edit_button"), 'char_edit.php?id=' . $id . '&amp;realm=' . $realmid, 130);
                $output .= '
                </td>
                <td>';
            }
            // only higher level GM with delete access, or character owner can delete character
            if ($user_lvl > $owner_gmlvl && $user_lvl >= $action_permission["delete"] || $owner_name === $user_name) {
                makebutton(lang("char", "del_char"), 'char_list.php?action=del_char_form&amp;check%5B%5D=' . $id . '" type="wrn', 130);
                $output .= '
                </td>
                <td>';
            }
            // show Delete Mode / View Mode button depending on current mode
            if ($mode) {
                makebutton(lang("char", "viewmode"), 'char.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;mode=0" type="def', 130);
            } else {
                makebutton(lang("char", "deletemode"), 'char.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;mode=1" type="def', 130);
            }
            $output .= '
                </td>
                <td>';
            // only GM with update permission can send mail, mail can send items, so update permission is needed
            if ($user_lvl >= $action_permission["update"]) {
                makebutton(lang("char", "send_mail"), 'mail.php?type=ingame_mail&amp;to=' . $char["name"], 130);
                $output .= '
                </td>';
            } else {
                $output .= '
                </td>';
            }
            $output .= '
              </tr>
              <tr>
                <td>';
            makebutton(lang("global", "back"), 'javascript:window.history.back()" type="def', 130);
            $output .= '
                </td>
              </tr>
            </table>
            <br />
          <!-- end of char.php -->';
        } else {
        }
        //error($lang_char["no_permission"]);
    } else {
        error(lang("char", "no_char_found"));
    }
}
コード例 #21
0
function approve()
{
    global $output, $action_permission, $characters_db, $realm_id, $user_name, $arcm_db, $user_id, $hearthstone_credits, $sql, $core;
    valid_login($action_permission["view"]);
    $guid = $sql["char"]->quote_smart($_GET["char"]);
    $new1 = '';
    if (isset($_GET["new1"])) {
        $new1 = $sql["char"]->quote_smart($_GET["new1"]);
    }
    $new2 = '';
    if (isset($_GET["new2"])) {
        $new2 = $sql["char"]->quote_smart($_GET["new2"]);
    }
    if ($core == 1) {
        $query = "SELECT * FROM characters WHERE guid='" . $guid . "'";
    } elseif ($core == 2) {
        $query = "SELECT *, characters.guid AS guid,\n      characters.map AS mapId, characters.zone AS zoneId,\n      character_homebind.map AS bindmapId, character_homebind.zone AS bindzoneId\n      FROM characters LEFT JOIN character_homebind ON characters.guid=character_homebind.guid WHERE characters.guid='" . $guid . "'";
    } else {
        $query = "SELECT *, characters.guid AS guid,\n      characters.map AS mapId, characters.zone AS zoneId,\n      character_homebind.mapId AS bindmapId, character_homebind.zoneId AS bindzoneId\n      FROM characters LEFT JOIN character_homebind ON characters.guid=character_homebind.guid WHERE characters.guid='" . $guid . "'";
    }
    $char = $sql["char"]->fetch_assoc($sql["char"]->query($query));
    // credits
    if ($hearthstone_credits >= 0) {
        // get our credit balance
        $cr_query = "SELECT Credits FROM config_accounts WHERE Login='******'";
        $cr_result = $sql["mgr"]->query($cr_query);
        $cr_result = $sql["mgr"]->fetch_assoc($cr_result);
        $credits = $cr_result["Credits"];
    }
    // MaNGOS & Trinity don't automatically add a home bind location for a character.
    if ($core != 1) {
        if (!isset($char["bindmapId"])) {
            $query = "SELECT * FROM playercreateinfo WHERE race='" . $char["race"] . "' AND class='" . $char["class"] . "'";
            $result = $sql["world"]->query($query);
            $fields = $sql["world"]->fetch_assoc($result);
            $char["bindmapId"] = $fields["map"];
            $char["bindzoneId"] = $fields["zone"];
        }
    }
    $output .= '
          <div id="xname_fieldset" class="fieldset_border center">
            <span class="legend">' . lang("unstuck", "newloc_legend") . '</span>
            <form method="get" action="hearthstone.php" id="form">
              <div>
                <input type="hidden" name="action" value="save" />
                <input type="hidden" name="guid" value="' . $char["guid"] . '" />
              </div>
              <table id="xname_char_table" class="center">
                <tr>
                  <td rowspan="4" style="width: 170px;">
                    <div style="width: 64px; margin-left: auto; margin-right: auto;">
                      <img src="' . char_get_avatar_img($char["level"], $char["gender"], $char["race"], $char["class"]) . '" alt="" />
                    </div>
                  </td>
                  <td>
                    <span class="xname_char_name">' . $char["name"] . '</span>
                  </td>
                </tr>
                <tr>
                  <td>' . lang("unstuck", "level") . ': ' . $char["level"] . '</td>
                </tr>
                <tr>
                  <td>' . lang("unstuck", "race") . ': ' . char_get_race_name($char["race"]) . '</td>
                </tr>
                <tr>
                  <td>' . lang("unstuck", "class") . ': ' . char_get_class_name($char["class"]) . '</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>';
    if ($hearthstone_credits > 0) {
        $cost_line = lang("unstuck", "credit_cost");
        $cost_line = str_replace("%1", '<b>' . $hearthstone_credits . '</b>', $cost_line);
        $output .= '
                <tr>
                  <td colspan="2">' . $cost_line . '</td>
                </tr>';
        if ($credits >= 0) {
            $credit_balance = lang("unstuck", "credit_balance");
            $credit_balance = str_replace("%1", '<b>' . (double) $credits . '</b>', $credit_balance);
            $output .= '
                <tr>
                  <td colspan="2">' . $credit_balance . '</td>
                </tr>';
            if ($credits < $hearthstone_credits) {
                $output .= '
                <tr>
                  <td colspan="2">' . lang("xacct", "insufficient_credits") . '</td>
                </tr>';
            } else {
                $output .= '
                <tr>
                  <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                  <td colspan="2">' . lang("xacct", "delay_warning") . '</td>
                </tr>';
            }
        } else {
            $output .= '
                <tr>
                  <td colspan="2">' . lang("global", "credits_unlimited") . '</td>
                </tr>';
        }
        $output .= '
                <tr>
                  <td colspan="2">&nbsp;</td>
                </tr>';
    }
    $output .= '
                <tr>
                  <td><b>' . lang("unstuck", "curloc") . ':</b></td>
                </tr>
                <tr>
                  <td>' . get_map_name($char["mapId"]) . '</td>
                  <td>' . get_zone_name($char["zoneId"]) . '</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td colspan="2"><b>' . lang("unstuck", "newloc") . ':</b></td>
                </tr>
                <tr>
                  <td>' . get_map_name($char["bindmapId"]) . '</td>
                  <td>' . get_zone_name($char["bindzoneId"]) . '</td>
                </tr>';
    // if we have unlimited credits, then we fake our credit balance here
    $credits = $credits < 0 ? $hearthstone_credits : $credits;
    if ($hearthstone_credits <= 0 || $credits >= $hearthstone_credits) {
        $output .= '
                <tr>
                  <td colspan="2">&nbsp;</td>
                </tr>
                <tr>
                  <td colspan="2">';
        makebutton(lang("unstuck", "save"), "javascript:do_submit()", 180);
        $output .= '
                  </td>
                </tr>';
    }
    $output .= '
              </table>
            </form>
          </div>
          <br />';
}
コード例 #22
0
/**
 * Get the tempcode for a results table title row. You would take the output of this, and feed it in as $fields_title, in a results_table function call.
 *
 * @param  array			The array of field titles that define the entries in the results table
 * @param  ?array			A map of sortable code (usually, db field names), to strings giving the human name for the sort order (NULL: no sortables)
 * @param  ID_TEXT		The parameter name used to store our sortable
 * @param  ID_TEXT		The current ordering ("$sortable $sort_order")
 * @param  string			GUID to pass to template
 * @return tempcode		The generated title
 */
function results_field_title($values, $sortables = NULL, $order_param = 'sort', $current_ordering = '', $guid = 'fbcaf8b021e3939bfce1dce9ff8ed63a')
{
    if (is_null($sortables)) {
        $sortables = array();
    }
    $cells = new ocp_tempcode();
    foreach ($values as $value) {
        $found = mixed();
        foreach ($sortables as $key => $sortable) {
            $_value = is_object($value) ? $value->evaluate() : $value;
            if (is_string($sortable) && $sortable == $_value || is_object($sortable) && $sortable->evaluate() == $_value) {
                $found = $key;
                break;
            }
        }
        if (!is_null($found)) {
            if (strpos(ocp_srv('REQUEST_URI'), '/iframe.php') !== false) {
                $cat_url = find_script('iframe') . '?zone=' . get_zone_name();
                $url_array = array_merge($_GET, $_POST);
                unset($url_array[$order_param]);
                foreach ($url_array as $key => $param) {
                    if (is_array($param)) {
                        continue;
                    }
                    if ($key == 'wide_high') {
                        continue;
                    }
                    if (substr($key, 0, 5) == 'keep_' && skippable_keep($key, $param)) {
                        continue;
                    }
                    if ($param === '_SELF') {
                        $param = get_page_name();
                    }
                    if (get_magic_quotes_gpc()) {
                        $param = stripslashes($param);
                    }
                    $cat_url .= '&' . $key . '=' . urlencode($param);
                }
                $sort_url_asc = $cat_url . '&' . $order_param . '=' . urlencode($found) . ' ASC';
                $sort_url_desc = $cat_url . '&' . $order_param . '=' . urlencode($found) . ' DESC';
            } else {
                $sort_url_asc = get_self_url(false, false, array($order_param => $found . ' ASC'), true);
                $sort_url_desc = get_self_url(false, false, array($order_param => $found . ' DESC'), true);
            }
            $sort_asc_selected = $current_ordering == $found . ' ASC';
            $sort_desc_selected = $current_ordering == $found . ' DESC';
            $cells->attach(do_template('RESULTS_TABLE_FIELD_TITLE_SORTABLE', array('_GUID' => $guid, 'VALUE' => $value, 'SORT_ASC_SELECTED' => $sort_asc_selected, 'SORT_DESC_SELECTED' => $sort_desc_selected, 'SORT_URL_DESC' => $sort_url_desc, 'SORT_URL_ASC' => $sort_url_asc)));
        } else {
            $cells->attach(do_template('RESULTS_TABLE_FIELD_TITLE', array('_GUID' => $guid, 'VALUE' => $value)));
        }
    }
    return $cells;
}
コード例 #23
0
ファイル: perso.php プロジェクト: galathil/coolwow2
$rep = mysql_fetch_array($req);
if ($_SESSION['auth'] == "yes" and Securite::bdd($_SESSION['gmlevel']) >= $rep['config_value2']) {
    if ($rep['config_value'] == 1) {
        mysql_connect($characters[1]['host'], $characters[1]['user'], $characters[1]['password']) or die(mysql_error());
        mysql_select_db($characters[1]['db']) or die(mysql_error());
        switch ($_GET['action']) {
            case "editer":
                require_once "../kernel/fonctions.php";
                require_once "../kernel/fonctions_armurerie.php";
                require_once "../kernel/defines/309.php";
                $id = Securite::bdd($_POST['id']);
                $id = Securite::bdd($_GET['id']);
                $reponse = mysql_query("SELECT guid,account,data,name,race,class,position_x,position_y,map,online,totaltime,position_z,zone\tFROM `characters` WHERE `name`='{$id}' OR `guid`='{$id}' ") or die(mysql_error());
                $char = mysql_fetch_row($reponse);
                $char_data = explode(' ', $char[2]);
                echo "\n\t\t\t\t<center>\n\t\t\t\t\t<form method=\"get\" action=\"index.php?module=perso&action=editer_v\" name=\"form\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"do_edit_char\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$id}\" />\n\t\t\t\t\t\t<table class=\"lined\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t    <td colspan=\"8\"><font class=\"bold\"><input type=\"text\" name=\"name\" size=\"14\" maxlength=\"12\" value=\"{$char['3']}\" /> - " . get_player_race($char[4]) . " " . get_player_class($char[5]) . " lvl {$char_data[CHAR_DATA_OFFSET_LEVEL]}</font><br />{$online}</td>\n</tr>\n<tr>\n\t\t\t\t <td colspan=\"8\">" . get_map_name($char[9]) . " - " . get_zone_name($char[12]) . "</td>\n</tr>\n<tr>\n\t\t\t\t <td colspan=\"8\">{$lang_char['guild']}: {$guild_name} | {$lang_char['rank']}: {$guild_rank}</td>\n</tr>\n<tr>\n\t\t\t\t <td colspan=\"8\">{$lang_char['honor_points']}: <input type=\"text\" name=\"honor_points\" size=\"8\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_HONOR_POINTS]}\" />/\n\t\t\t\t <input type=\"text\" name=\"arena_points\" size=\"8\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_ARENA_POINTS]}\" /> - {$lang_char['honor_kills']}: <input type=\"text\" name=\"total_kills\" size=\"8\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_HONOR_KILL]}\" /></td>\n</tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td width=\"2%\"><input type=\"checkbox\" name=\"check[]\" value=\"a0\" /></td><td width=\"18%\">{$lang_item['head']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_HEAD]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_HEAD]) . "</a></td>\n\t\t\t\t    <td width=\"15%\">{$lang_item['health']}:</td><td width=\"15%\"><input type=\"text\" name=\"health\" size=\"10\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_HEALTH]}\" /></td>\n\t\t\t\t    <td width=\"15%\">{$lang_item['res_holy']}:</td><td width=\"15%\"><input type=\"text\" name=\"res_holy\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_RES_HOLY]}\" /></td>\n\t\t\t\t    <td width=\"18%\">{$lang_item['gloves']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_GLOVES]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_GLOVES]) . "</a></td><td width=\"2%\"><input type=\"checkbox\" name=\"check[]\" value=\"a9\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a1\" /></td><td>{$lang_item['neck']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_NECK]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_NECK]) . "</a></td>\n\t\t\t\t    <td>{$lang_item['mana']}:</td><td><input type=\"text\" name=\"mana\" size=\"10\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_MANA]}\" /></td>\n\t\t\t\t    <td>{$lang_item['res_arcane']}:</td><td><input type=\"text\" name=\"res_arcane\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_RES_ARCANE]}\" /></td>\n\t\t\t\t    <td>{$lang_item['belt']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_BELT]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_BELT]) . "</a></td> <td><input type=\"checkbox\" name=\"check[]\" value=\"a5\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a2\" /></td><td>{$lang_item['shoulder']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_SHOULDER]) . "</a></td>\n\t\t\t\t    <td>{$lang_item['strength']}:</td><td><input type=\"text\" name=\"str\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_STR]}\" /></td>\n\t\t\t\t    <td>{$lang_item['res_fire']}:</td><td><input type=\"text\" name=\"res_fire\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_RES_FIRE]}\" /></td>\n\t\t\t\t    <td>{$lang_item['legs']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_LEGS]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_LEGS]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a6\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a14\" /></td><td>{$lang_item['back']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_BACK]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_BACK]) . "</a></td>\n\t\t\t\t    <td>{$lang_item['agility']}:</td><td><input type=\"text\" name=\"agi\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_AGI]}\" /></td>\n\t\t\t\t    <td>{$lang_item['res_nature']}:</td><td><input type=\"text\" name=\"res_nature\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_RES_NATURE]}\" /></td>\n\t\t\t\t    <td>{$lang_item['feet']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_FEET]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_FEET]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a7\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a4\" /></td><td>{$lang_item['chest']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_CHEST]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_CHEST]) . "</a></td>\n\t\t\t\t    <td>{$lang_item['stamina']}:</td><td><input type=\"text\" name=\"sta\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_STA]}\" /></td>\n\t\t\t\t    <td>{$lang_item['res_frost']}:</td><td><input type=\"text\" name=\"res_frost\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_RES_FROST]}\" /></td>\n\t\t\t\t    <td>{$lang_item['finger']} 1<br /><a href=\"{$item_datasite}{$char_data[380]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_FINGER1]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a10\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a3\" /></td><td>{$lang_item['shirt']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_SHIRT]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_SHIRT]) . "</a></td>\n\t\t\t\t    <td>{$lang_item['intellect']}:</td><td><input type=\"text\" name=\"int\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_INT]}\" /></td>\n\t\t\t\t    <td>{$lang_item['res_shadow']}:</td><td><input type=\"text\" name=\"res_shadow\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_RES_SHADOW]}\" /></td>\n\t\t\t\t    <td>{$lang_item['finger']} 2<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_FINGER2]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_FINGER2]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a11\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a18\" /></td><td>{$lang_item['tabard']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_TABARD]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_TABARD]) . "</a></td>\n\t\t\t\t    <td>{$lang_item['spirit']}:</td><td><input type=\"text\" name=\"spi\" size=\"10\" maxlength=\"4\" value=\"{$char_data[CHAR_DATA_OFFSET_SPI]}\" /></td>\n\t\t\t\t    <td>{$lang_char['exp']}:</td><td><input type=\"text\" name=\"exp\" size=\"10\" maxlength=\"8\" value=\"{$char_data[CHAR_DATA_OFFSET_EXP]}\" /></td>\n\t\t\t\t    <td>{$lang_item['trinket']} 1<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_TRINKET1]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a12\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a8\" /></td><td>{$lang_item['wrist']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_WRIST]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_WRIST]) . "</a></td>\n\t\t\t\t    <td>{$lang_item['armor']}:</td><td><input type=\"text\" name=\"armor\" size=\"10\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_ARMOR]}\" /></td>\n\t\t\t\t    <td>{$lang_char['melee_ap']}: <input type=\"text\" name=\"attack_power\" size=\"10\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_AP]}\" /></td><td>{$lang_char['ranged_ap']}: <input type=\"text\" name=\"range_attack_power\" size=\"10\" maxlength=\"6\" value=\"{$char_data[CHAR_DATA_OFFSET_RANGED_AP]}\" /></td>\n\t\t\t\t    <td>{$lang_item['trinket']} 2<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_TRINKET2]) . "</a></td><td><input type=\"checkbox\" name=\"check[]\" value=\"a13\" /></td>\n\t\t\t\t  </tr>\n\t\t\t\t  <tr>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a15\" /></td>\n\t\t\t\t    <td colspan=\"2\">{$lang_item['main_hand']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND]) . "</a></td>\n\t\t\t\t    <td colspan=\"2\"><input type=\"checkbox\" name=\"check[]\" value=\"a16\" />&nbsp;{$lang_item['off_hand']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND]) . "</a></td>\n\t\t\t\t    <td colspan=\"2\">{$lang_item['ranged']}<br /><a href=\"{$item_datasite}{$char_data[CHAR_DATA_OFFSET_EQU_RANGED]}\" target=\"_blank\">" . get_item_name($char_data[CHAR_DATA_OFFSET_EQU_RANGED]) . "</a></td>\n\t\t\t\t    <td><input type=\"checkbox\" name=\"check[]\" value=\"a17\" /></td>\n<tr>\n<td colspan=\"8\">{$lang_char['block']} : <input type=\"text\" name=\"block\" size=\"5\" maxlength=\"3\" value=\"{$block}\" />% \n| {$lang_char['dodge']}: <input type=\"text\" name=\"dodge\" size=\"5\" maxlength=\"3\" value=\"{$dodge}\" />% \n| {$lang_char['parry']}: <input type=\"text\" name=\"parry\" size=\"5\" maxlength=\"3\" value=\"{$parry}\" />% \n| {$lang_char['crit']}: <input type=\"text\" name=\"crit\" size=\"5\" maxlength=\"3\" value=\"{$crit}\" />%\n| {$lang_char['range_crit']}: <input type=\"text\" name=\"range_crit\" size=\"3\" maxlength=\"14\" value=\"{$range_crit}\" />%</td>\n\t\t\t\t </tr>\n\t\t\t\t <tr>\n<td colspan=\"4\">{$lang_char['gold']}: <input type=\"text\" name=\"money\" size=\"10\" maxlength=\"8\" value=\"{$char_data[CHAR_DATA_OFFSET_GOLD]}\" /></td>\n\t\t\t\t  <td colspan=\"4\">{$lang_char['tot_paly_time']}: <input type=\"text\" name=\"tot_time\" size=\"8\" maxlength=\"14\" value=\"{$char[10]}\" /></td>\n</tr>\n<tr>\n\t\t\t\t\t<td colspan=\"5\">{$lang_char['location']}: \n\t\t\t\t\tX:<input type=\"text\" name=\"x\" size=\"10\" maxlength=\"8\" value=\"{$char[6]}\" />\n\t\t\t\t\tY:<input type=\"text\" name=\"y\" size=\"8\" maxlength=\"16\" value=\"{$char[7]}\" />\n\t\t\t\t\tZ:<input type=\"text\" name=\"z\" size=\"8\" maxlength=\"16\" value=\"{$char[11]}\" />\n\t\t\t\t\tMap:<input type=\"text\" name=\"map\" size=\"8\" maxlength=\"16\" value=\"{$char[8]}\" />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td colspan=\"3\">{$lang_char['move_to']}:<input type=\"text\" name=\"tp_to\" size=\"24\" maxlength=\"64\" value=\"\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table><br />\n\t\t\t\t<a href=\"index.php?module=perso&action=inventaire&id={$id}\">Voir l'inventaire</a> - \n\t\t\t\t<a href=\"index.php?module=perso&action=monnaie&id={$id}\">Voir les Marques d'honneur</a> - \n\t\t\t\t<a href=\"index.php?module=perso&action=quetes&id={$id}\">Voir les quêtes</a> - \n\t\t\t\t<a href=\"index.php?module=perso&action=talents&id={$id}\">Voir les Talents</a> - \n\t\t\t\t<a href=\"index.php?module=perso&action=skills&id={$id}\">Voir les Compétences</a>\n\t\t\t\t";
                break;
            case "editer_v":
                break;
            case "quetes":
                $id = mysql_real_escape_string(htmlspecialchars($_GET['id'], ENT_QUOTES));
                $retour = mysql_query("SELECT * FROM character_queststatus WHERE guid = {$id} AND ( status = 3 OR status = 1 ) ORDER BY status DESC");
                echo "<p class=\"title\">Les Quêtes</p><br />";
                echo "<table class=\"lined\" width=\"99%\" style='border-collapse: collapse'; width='90%' border='1' cellspacing='1' cellpadding='1'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th width=\"30\">ID</th>\n\t\t\t\t\t\t\t\t<th width=\"30\">Niveau</th>\n\t\t\t\t\t\t\t\t<th width=\"30\">Titre</th>\n\t\t\t\t\t\t\t\t<th width=\"30\">status</th>\n\t\t\t\t\t\t\t</tr>";
                while ($donnees = mysql_fetch_assoc($retour)) {
                    $retour2 = mysql_query("SELECT QuestLevel,title FROM `" . $mangos[1]['db'] . "`.`quest_template` LEFT JOIN `" . $mangos[1]['db'] . "`.`locales_quest` ON `quest_template`.`entry` = `locales_quest`.`entry` WHERE `quest_template`.`entry` ='" . $donnees['quest'] . "'");
                    $donnees2 = mysql_fetch_array($retour2);
                    echo "<tr><td align=\"center\">";
                    echo "<a href=\"http://fr.wowhead.com/?quest=" . $donnees['quest'] . "\">" . $donnees['quest'] . "</a>";
                    echo "</td><td align=\"center\">";
                    echo "" . $donnees2['QuestLevel'] . "";
コード例 #24
0
ファイル: char_list.php プロジェクト: xhaher/CoreManager
function browse_chars()
{
    global $output, $logon_db, $corem_db, $corem_db, $characters_db, $realm_id, $site_encoding, $action_permission, $user_lvl, $user_name, $showcountryflag, $itemperpage, $timezone_offset, $sql, $core;
    //==========================$_GET and SECURE========================
    $start = isset($_GET["start"]) ? $sql["logon"]->quote_smart($_GET["start"]) : 0;
    if (!is_numeric($start)) {
        $start = 0;
    }
    $order_by = isset($_GET["order_by"]) ? $sql["logon"]->quote_smart($_GET["order_by"]) : "guid";
    if (!preg_match("/^[_[:lower:]]{1,12}\$/", $order_by)) {
        $order_by = "guid";
    }
    $dir = isset($_GET["dir"]) ? $sql["logon"]->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========================
    if ($order_by == "mapid") {
        $order_by = "mapid, zoneid";
        $order_hold = "mapid";
    } elseif ($order_by == "zoneid") {
        $order_by = "zoneid, mapid";
        $order_hold = "zoneid";
    } else {
        $order_hold = $order_by;
    }
    switch ($_GET["symbol"]) {
        case "equal":
            $symbol = "=";
            break;
        case "greater_equal":
            $symbol = ">=";
            break;
        case "greater":
            $symbol = ">";
            break;
        case "less_equal":
            $symbol = "<=";
            break;
        case "less":
            $symbol = "<";
            break;
        case "not_equal":
            $symbol = "<>";
            break;
    }
    $search_by = "";
    $search_value = "";
    if (isset($_GET["search_value"]) && isset($_GET["search_by"])) {
        $search_value = $sql["logon"]->quote_smart($_GET["search_value"]);
        $search_by = isset($_GET["search_by"]) ? $sql["logon"]->quote_smart($_GET["search_by"]) : "name";
        $search_menu = array("name", "guid", "account", "level", "greater_level", "guild", "race", "class", "mapid", "highest_rank", "greater_rank", "online", "gold", "item");
        if (!in_array($search_by, $search_menu)) {
            $search_by = "name";
        }
        unset($search_menu);
        switch ($search_by) {
            //need to get the acc id from other table since input comes as name
            case "account":
                if (preg_match('/^[\\t\\v\\b\\f\\a\\n\\r\\\\"\'\\? <>[](){}_=+-|!@#$%^&*~`.,0123456789\\0]{1,30}$/', $search_value)) {
                    redirect("charlist.php?error=2");
                }
                if ($core == 1) {
                    $result = $sql["logon"]->query("SELECT acct FROM accounts WHERE login LIKE '%" . $search_value . "%' LIMIT " . $start . ", " . $itemperpage);
                } else {
                    $result = $sql["logon"]->query("SELECT id AS acct FROM account WHERE username LIKE '%" . $search_value . "%' LIMIT " . $start . ", " . $itemperpage);
                }
                if ($core == 1) {
                    $where_out = " acct IN (0 ";
                } else {
                    $where_out = " account IN (0 ";
                }
                while ($char = $sql["logon"]->fetch_row($result)) {
                    $where_out .= ", ";
                    $where_out .= $char[0];
                }
                $where_out .= ") ";
                unset($result);
                break;
            case "level":
                if (!is_numeric($search_value)) {
                    $search_value = 1;
                }
                $where_out = "level" . $symbol . $search_value;
                break;
            case "gold":
                if (!is_numeric($search_value)) {
                    $search_value = 1;
                }
                if ($core == 1) {
                    $where_out = "gold" . $symbol . $search_value;
                } else {
                    $where_out = "money" . $symbol . $search_value;
                }
                break;
            case "guild":
                if (preg_match('/^[\\t\\v\\b\\f\\a\\n\\r\\\\"\'\\? <>[](){}_=+-|!@#$%^&*~`.,0123456789\\0]{1,30}$/', $search_value)) {
                    redirect("charlist.php?error=2");
                }
                if ($core == 1) {
                    $result = $sql["char"]->query("SELECT guildid FROM guilds WHERE guildname LIKE '%" . $search_value . "%'");
                } else {
                    $result = $sql["char"]->query("SELECT guildid FROM guild WHERE name LIKE '%" . $search_value . "%'");
                }
                $guildid = $sql["char"]->result($result, 0, 'guildid');
                if (!$search_value) {
                    $guildid = 0;
                }
                if ($core == 1) {
                    $Q1 = "SELECT playerid FROM guild_data WHERE guildid=" . $guildid;
                } else {
                    $Q1 = "SELECT guid AS playerid FROM guild_member WHERE guildid=" . $guildid;
                }
                $result = $sql["char"]->query($Q1);
                unset($guildid);
                unset($Q1);
                $where_out = "guid IN (0 ";
                while ($char = $sql["char"]->fetch_row($result)) {
                    $where_out .= ", ";
                    $where_out .= $char[0];
                }
                $where_out .= ") ";
                unset($result);
                break;
            case "item":
                if (!is_numeric($search_value)) {
                    $search_value = 0;
                }
                if ($core == 1) {
                    $result = $sql["char"]->query("SELECT ownerguid\r\n          FROM playeritems\r\n          WHERE entry" . $symbol . "'" . $search_value . "'");
                } elseif ($core == 2) {
                    $result = $sql["char"]->query("SELECT owner_guid AS ownerguid\r\n          FROM character_inventory\r\n            LEFT JOIN item_instance ON character_inventory.item=item_instance.guid\r\n          WHERE item_template" . $symbol . "'" . $search_value . "'");
                } else {
                    $result = $sql["char"]->query("SELECT owner_guid AS ownerguid\r\n          FROM character_inventory\r\n            LEFT JOIN item_instance ON character_inventory.item=item_instance.guid\r\n          WHERE itemEntry" . $symbol . "'" . $search_value . "'");
                }
                $where_out = "guid IN (0 ";
                while ($char = $sql["char"]->fetch_row($result)) {
                    if ($char[0] != NULL) {
                        $where_out .= ", ";
                        $where_out .= $char[0];
                    }
                }
                $where_out .= ") ";
                unset($result);
                break;
            case "highest_rank":
                if (!is_numeric($search_value)) {
                    $search_value = 0;
                }
                if ($core == 1) {
                    $where_out = "SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ';', " . (PLAYER_FIELD_LIFETIME_HONORBALE_KILLS + 1) . "), ';', -1)" . $symbol . $search_value;
                } else {
                    $where_out = "totalKills" . $symbol . $search_value;
                }
                break;
            case "mapid":
                if (!is_numeric($search_value)) {
                    $search_value = 0;
                }
                if ($core == 1) {
                    $where_out = "mapid" . $symbol . $search_value;
                } else {
                    $where_out = "map" . $symbol . $search_value;
                }
                break;
            case "online":
                if ($search_value != 0) {
                    $search_value = 1;
                } else {
                    $search_value = 0;
                }
                $where_out = "online=" . $search_value;
                break;
            default:
                if (preg_match('/^[\\t\\v\\b\\f\\a\\n\\r\\\\"\'\\? <>[](){}_=+-|!@#$%^&*~`.,0123456789\\0]{1,30}$/', $search_value)) {
                    redirect("charlist.php?error=2");
                }
                if (!is_numeric($search_value)) {
                    $where_out = $search_by . " LIKE '%" . $search_value . "%'";
                } else {
                    $where_out = $search_by . $symbol . "'" . $search_value . "'";
                }
        }
        if ($core == 1) {
            $sql_query = "SELECT guid, name, acct, race, class, zoneid, mapid,\r\n        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ';', " . (PLAYER_FIELD_LIFETIME_HONORBALE_KILLS + 1) . "), ';', -1) AS UNSIGNED) AS highest_rank,\r\n        online, level, gender, timestamp\r\n        FROM `characters`\r\n        WHERE " . $where_out . " ORDER BY " . $order_by . " " . $order_dir . " LIMIT " . $start . ", " . $itemperpage;
        } else {
            $sql_query = "SELECT guid, name, account AS acct, race, class, zone AS zoneid, map AS mapid,\r\n        totalKills AS highest_rank,\r\n        online, level, gender, logout_time AS timestamp\r\n        FROM `characters`\r\n        WHERE " . $where_out . " ORDER BY " . $order_by . " " . $order_dir . " LIMIT " . $start . ", " . $itemperpage;
        }
        $query_1 = $sql["char"]->query("SELECT COUNT(*) FROM `characters` WHERE " . $where_out);
        $query = $sql["char"]->query($sql_query);
    } else {
        $query_1 = $sql["char"]->query("SELECT COUNT(*) FROM `characters`");
        if ($core == 1) {
            $query = $sql["char"]->query("SELECT guid, name, acct, race, class, zoneid, mapid,\r\n        online, level, gender, timestamp,\r\n        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ';', " . (PLAYER_FIELD_LIFETIME_HONORBALE_KILLS + 1) . "), ';', -1) AS UNSIGNED) AS highest_rank\r\n        FROM `characters` ORDER BY " . $order_by . " " . $order_dir . " LIMIT " . $start . ", " . $itemperpage);
        } else {
            $query = $sql["char"]->query("SELECT guid, name, account AS acct, race, class, zone AS zoneid, map AS mapid,\r\n        online, level, gender, logout_time AS timestamp,\r\n        totalKills AS highest_rank\r\n        FROM `characters` ORDER BY " . $order_by . " " . $order_dir . " LIMIT " . $start . ", " . $itemperpage);
        }
    }
    $all_record = $sql["char"]->result($query_1, 0);
    unset($query_1);
    $this_page = $sql["char"]->num_rows($query);
    //==========================top page navigaion starts here========================
    $output .= '
        <script type="text/javascript" src="libs/js/check.js"></script>
          <table class="top_hidden">
            <tr>
              <td>';
    // cleanup unknown working condition
    //if($user_lvl >= $action_permission["delete"])
    //              makebutton($lang_char_list["cleanup"], 'cleanup.php', 130);
    makebutton(lang("global", "back"), 'javascript:window.history.back()', 130);
    $search_by && $search_value ? makebutton(lang("char_list", "characters"), 'char_list.php" type="def', 130) : ($output .= '');
    $output .= '
              </td>
              <td align="right" style="width: 25%;" rowspan="2">';
    $output .= generate_pagination('char_list.php?order_by=' . $order_hold . '&amp;dir=' . ($dir ? 0 : 1) . ($search_value && $search_by ? '&amp;symbol=' . $_GET["symbol"] . '&amp;search_by=' . $search_by . '&amp;search_value=' . $search_value . '' : ''), $all_record, $itemperpage, $start);
    $output .= '
              </td>
            </tr>
            <tr align="left">
              <td>
                <table class="hidden">
                  <tr>
                    <td>
                      <form action="char_list.php" method="get" id="form">
                        <div>
                          <input type="hidden" name="error" value="3" />
                          <select name="search_by">
                            <option value="name"' . ($search_by == "name" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_name") . '</option>
                            <option value="guid"' . ($search_by == "guid" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_id") . '</option>
                            <option value="account"' . ($search_by == "account" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_account") . '</option>
                            <option value="level"' . ($search_by == "level" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_level") . '</option>
                            <option value="guild"' . ($search_by == "guild" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_guild") . '</option>
                            <option value="race"' . ($search_by == "race" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_race_id") . '</option>
                            <option value="class"' . ($search_by == "class" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_class_id") . '</option>
                            <option value="mapid"' . ($search_by == "mapid" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_map_id") . '</option>
                            <option value="highest_rank"' . ($search_by == "highest_rank" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_honor_kills") . '</option>
                            <option value="online"' . ($search_by == "online" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_online") . '</option>
                            <option value="gold"' . ($search_by == "gold" ? ' selected="selected"' : '') . '>' . lang("char_list", "chars_gold") . '</option>
                            <option value="item"' . ($search_by == "item" ? ' selected="selected"' : '') . '>' . lang("char_list", "by_item") . '</option>
                          </select>
                          <select name="symbol">
                            <option value="equal"' . ($symbol == "=" ? ' selected="selected"' : '') . '>=</option>
                            <option value="greater_equal"' . ($symbol == ">=" ? ' selected="selected"' : '') . '>&gt;=</option>
                            <option value="greater"' . ($symbol == ">" ? ' selected="selected"' : '') . '>&gt;</option>
                            <option value="less_equal"' . ($symbol == "<=" ? ' selected="selected"' : '') . '>&lt;=</option>
                            <option value="less"' . ($symbol == "<" ? ' selected="selected"' : '') . '>&lt;</option>
                            <option value="not_equal"' . ($symbol == "<>" ? ' selected="selected"' : '') . '>!=</option>
                          </select>
                          <input type="text" size="24" maxlength="50" name="search_value" value="' . $search_value . '" />
                        </div>
                      </form>
                    </td>
                    <td>';
    makebutton(lang("global", "search"), 'javascript:do_submit()', 80);
    $output .= '
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>';
    //==========================top page navigaion ENDS here ========================
    $output .= '
          <form method="get" action="char_list.php" id="form1">
            <div>
              <input type="hidden" name="action" value="del_char_form" />
              <input type="hidden" name="start" value="' . $start . '" />
            </div>
            <table class="lined" id="char_list_table">
              <tr>
                <td colspan="6" align="left" class="hidden">';
    if ($user_lvl >= $action_permission["delete"] || $owner_acc_name == $user_name) {
        makebutton(lang("char_list", "del_selected_chars"), 'javascript:do_submit(\'form1\',0)" type="wrn', 220);
    }
    $output .= '
                </td>
              </tr>
              <tr>
                <th style="width: 1%;">
                  <input name="allbox" type="checkbox" value="Check All" onclick="CheckAll(document.form1);" />
                </th>
                <th style="width: 1%;">
                  <a href="char_list.php?order_by=guid&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "guid" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "id") . '</a>
                </th>
                <th style="width: 10%;">
                  <a href="char_list.php?order_by=name&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "name" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "char_name") . '</a>
                </th>
                <th style="width: 10%;">
                  <a href="char_list.php?order_by=acct&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "acct" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "account") . '</a>
                </th>
                <th style="width: 1%;">
                  <a href="char_list.php?order_by=race&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "race" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "race_short") . '</a>
                </th>
                <th style="width: 1%;">
                  <a href="char_list.php?order_by=class&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "class" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "class_short") . '</a>
                </th>
                <th style="width: 1%;">
                  <a href="char_list.php?order_by=level&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "level" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "level_short") . '</a>
                </th>
                <th style="width: 10%;">
                  <a href="char_list.php?order_by=mapid&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "mapid, zoneid" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "map") . '</a>
                </th>
                <th style="width: 10%;">
                  <a href="char_list.php?order_by=zoneid&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "zoneid, mapid" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "zone") . '</a>
                </th>
                <th style="width: 1%;">
                  <a href="char_list.php?order_by=highest_rank&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "highest_rank" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "honor_kills") . '</a>
                </th>
                <th style="width: 10%;">
                  <!-- a href="char_list.php?order_by=guild&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '" -->' . ($order_by == "guild" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "guild") . '<!-- /a -->
                </th>
                <th style="width: 10%;">
                  <a href="char_list.php?order_by=timestamp&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "logout_time" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . lang("char_list", "lastseen") . '</a>
                </th>
                <th style="width: 1%;">
                  <a href="char_list.php?order_by=online&amp;start=' . $start . ($search_value && $search_by ? '&amp;search_by=' . $search_by . '&amp;symbol=' . $_GET["symbol"] . '&amp;search_value=' . $search_value : '') . '&amp;dir=' . $dir . '">' . ($order_by == "online" ? '<img src="img/arr_' . ($dir ? "dw" : "up") . '.gif" alt="" /> ' : '') . '
                    <img src="img/lightning.png" onmousemove="oldtoolTip(\'' . lang("char_list", "online") . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" ' . ($order_by == "online" ? '' : 'style="position: relative; top: 7px;"') . ' />
                  </a>
                </th>';
    if ($showcountryflag) {
        require_once "libs/misc_lib.php";
        $output .= '
                <th style="width: 1%;">
                  <img src="img/world.png" onmousemove="oldtoolTip(\'' . lang("global", "country") . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                </th>';
    }
    if ($user_lvl >= $action_permission["update"]) {
        $output .= '
                <th style="width: 1%;">
                  <img src="img/arrow_switch.png" onmousemove="oldtoolTip(\'' . lang("char_list", "char_tools") . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                </th>';
    }
    $output .= '
              </tr>';
    $looping = $this_page < $itemperpage ? $this_page : $itemperpage;
    for ($i = 1; $i <= $looping; $i++) {
        // switched to fetch_assoc because using record indexes is for morons
        $char = $sql["char"]->fetch_assoc($query, 0) or die(error(lang("global", "err_no_user")));
        // to disalow lower lvl gm to  view accounts of other GMs
        if ($core == 1) {
            $a_query = $sql["logon"]->query("SELECT login FROM accounts WHERE acct='" . $char["acct"] . "'");
        } else {
            $a_query = $sql["logon"]->query("SELECT username as login FROM account WHERE id='" . $char["acct"] . "'");
        }
        $owner_acc_name = $sql["logon"]->result($a_query, 0, 'login');
        $gm_query = $sql["mgr"]->query("SELECT SecurityLevel AS gm FROM config_accounts WHERE Login='******'");
        $owner_gmlvl = $sql["mgr"]->result($gm_query, 0, 'gm');
        if ($owner_gmlvl >= 1073741824) {
            $owner_gmlvl -= 1073741824;
        }
        $time_offset = $timezone_offset * 3600;
        if ($char["timestamp"] != 0) {
            // we only show hours if it was today
            if (date("M j, Y", $char["timestamp"] + $time_offset) == date("M j, Y", $time_offset)) {
                $lastseen = date(lang("char_list", "today") . " @ Hi", $char["timestamp"] + $time_offset);
            } else {
                $lastseen = date("M j, Y", $char["timestamp"] + $time_offset);
            }
        } else {
            $lastseen = "-";
        }
        if ($core == 1) {
            $guild_id = $sql["char"]->result($sql["char"]->query("SELECT guildid FROM guild_data WHERE playerid='" . $char["guid"] . "'"), 0);
            $guild_name = $sql["char"]->result($sql["char"]->query("SELECT guildName FROM guilds WHERE guildid='" . $guild_id . "'"));
        } else {
            $guild_id = $sql["char"]->result($sql["char"]->query("SELECT guildid FROM guild_member WHERE guid='" . $char["guid"] . "'"), 0);
            $guild_name = $sql["char"]->result($sql["char"]->query("SELECT name FROM guild WHERE guildid='" . $guild_id . "'"));
        }
        // we need the screen name here
        // but first, we need the user name
        if ($core == 1) {
            $un_query = "SELECT * FROM accounts WHERE acct='" . $char["acct"] . "'";
        } else {
            $un_query = "SELECT * FROM account WHERE id='" . $char["acct"] . "'";
        }
        $un_results = $sql["logon"]->query($un_query);
        $un = $sql["logon"]->fetch_assoc($un_results);
        $sn_query = "SELECT * FROM config_accounts WHERE Login='******'";
        $sn_result = $sql["mgr"]->query($sn_query);
        $sn = $sql["mgr"]->fetch_assoc($sn_result);
        if ($user_lvl >= $owner_gmlvl || $owner_acc_name == $user_name || $user_lvl == $action_permission["delete"]) {
            $output .= '
              <tr>
                <td>';
            if ($user_lvl >= $action_permission["delete"] || $owner_acc_name == $user_name) {
                $output .= '
                  <input type="checkbox" name="check[]" value="' . $char["guid"] . '" onclick="CheckCheckAll(document.form1);" />';
            }
            $output .= '
                </td>
                <td>' . $char["guid"] . '</td>
                <td>
                  <a href="char.php?id=' . $char["guid"] . '">' . htmlentities($char["name"], ENT_COMPAT, $site_encoding) . '</a>
                </td>';
            if ($sn["ScreenName"]) {
                $output .= '
                <td>
                  <a href="user.php?action=edit_user&amp;error=11&amp;acct=' . $char["acct"] . '">' . htmlentities($sn["ScreenName"], ENT_COMPAT, $site_encoding) . '</a>
                </td>';
            } else {
                $output .= '
                <td>
                  <a href="user.php?action=edit_user&amp;error=11&amp;acct=' . $char["acct"] . '">' . htmlentities($owner_acc_name, ENT_COMPAT, $site_encoding) . '</a>
                </td>';
            }
            $output .= '
                <td>
                  <img src="img/c_icons/' . $char["race"] . '-' . $char["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($char["race"]) . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                </td>
                <td>
                  <img src="img/c_icons/' . $char["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($char["class"]) . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                </td>
                <td>
                  <span>' . char_get_level_color($char["level"]) . '</span>
                </td>
                <td>
                  <span onmousemove="oldtoolTip(\'MapID:' . $char["mapid"] . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_map_name($char["mapid"]) . '</span>
                </td>
                <td>
                  <span onmousemove="oldtoolTip(\'ZoneID:' . $char["zoneid"] . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_zone_name($char["zoneid"]) . '</span>
                </td>
                <td>
                  <span>' . $char["highest_rank"] . '</span>
                </td>
                <td>
                  <a href="guild.php?action=view_guild&amp;error=3&amp;id=' . $guild_id . '">' . htmlentities($guild_name, ENT_COMPAT, $site_encoding) . '</a>
                </td>
                <td>
                  <span>' . $lastseen . '</span>
                </td>
                <td>
                  <img src="img/' . ($char["online"] ? 'up' : 'down') . '.gif" alt="" />
                </td>';
            if ($showcountryflag) {
                $country = misc_get_country_by_account($char["acct"]);
                if ($country["code"]) {
                    $output .= '
                <td>
                  <img src="img/flags/' . $country["code"] . '.png" onmousemove="oldtoolTip(\'' . $country["country"] . '\',\'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                </td>';
                } else {
                    $output .= '
                <td>
                  <span>-</span>
                </td>';
                }
            }
            if ($user_lvl >= $action_permission["update"]) {
                $output .= '
                <td>
                  <a href="char_tools.php?char=' . $char["guid"] . '">
                    <img src="img/arrow_switch.png" alt="" />
                  </a>
                </td>';
            }
            $output .= '
              </tr>';
        } else {
            $output .= '
              <tr>
                <td>*</td><td>***</td><td>***</td><td>You</td><td>Have</td><td>No</td><td class="small">Permission</td><td>to</td><td>View</td><td>this</td><td>Data</td><td>***</td><td>*</td>';
            if ($showcountryflag) {
                $output .= '<td>*</td>';
            }
            $output .= '
                <td>*</td>
              </tr>';
        }
    }
    unset($char);
    unset($result);
    $output .= '
              <tr>
                <td colspan="13" align="right" class="hidden" style="width: 25%;">';
    $output .= generate_pagination('char_list.php?order_by=' . $order_by . '&amp;dir=' . ($dir ? 0 : 1) . ($search_value && $search_by ? '&amp;symbol=' . $_GET["symbol"] . '&amp;search_by=' . $search_by . '&amp;search_value=' . $search_value . '' : ''), $all_record, $itemperpage, $start);
    $output .= '
                </td>
              </tr>
              <tr>
                <td colspan="6" align="left" class="hidden">';
    if ($user_lvl >= $action_permission["delete"] || $owner_acc_name == $user_name) {
        makebutton(lang("char_list", "del_selected_chars"), 'javascript:do_submit(\'form1\',0)" type="wrn', 220);
    }
    $output .= '
                </td>
                <td colspan="7" align="right" class="hidden">' . lang("char_list", "tot_chars") . ' : ' . $all_record . '</td>
              </tr>
            </table>
          </form>';
}
コード例 #25
0
     $query = $DB->select("SELECT c.*, a.*   FROM " . $wsdb_info['db'] . ".`characters` as c, `account` as a \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE ((c.`online`='1') AND (c.`account`=a.`id`)) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY c.`name`");
 }
 $faction_alliance = 0;
 $faction_horde = 0;
 $total = 0;
 foreach ($query as $result) {
     if ($res_color == 1) {
         $res_color = 2;
     } else {
         $res_color = 1;
     }
     $cc++;
     $my_char = new character($result, $mangos_field);
     $res_race = $site_defines['character_race'][$my_char->race];
     $res_class = $site_defines['character_class'][$my_char->class];
     $res_pos = get_zone_name($my_char->map, $my_char->position_x, $my_char->position_y);
     $char_faction = get_faction($result['race']);
     $res_info[$cc]["number"] = $cc;
     $res_info[$cc]["res_color"] = $res_color;
     $res_info[$cc]["name"] = $my_char->name;
     $res_info[$cc]["race"] = $my_char->race;
     $res_info[$cc]["class"] = $my_char->class;
     $res_info[$cc]["gender"] = $my_char->gender;
     $res_info[$cc]["level"] = $my_char->level;
     $res_info[$cc]["pos"] = $res_pos;
     $res_info[$cc]["faction"] = $char_faction;
     $res_info[$cc]["char_link"] = $charinfo_link == "" ? "#" : $charinfo_link . $my_char->guid;
     $res_info[$cc]["gmlevel"] = get_gmlevelstr($result['gmlevel']);
     $res_info[$cc]["addinfo"] = "Имя персонажа {guid}: " . $my_char->name . " {" . $my_char->guid . "} ;" . "\\n" . "Имя аккаунта: {id}: " . $result['username'] . " {" . $result['id'] . "} ;" . "\\n" . "IP компьютера: " . $result['last_ip'];
     if ($char_faction == "Alliance") {
         $faction_alliance++;
コード例 #26
0
ファイル: filedump.php プロジェクト: erico-deh/ocPortal
 /**
  * The actualiser for uploading a file.
  *
  * @return tempcode	The UI.
  */
 function module_do_upload()
 {
     if (!has_specific_permission(get_member(), 'upload_filedump')) {
         access_denied('I_ERROR');
     }
     $title = get_page_title('FILEDUMP_UPLOAD');
     if (function_exists('set_time_limit')) {
         @set_time_limit(0);
     }
     // Slowly uploading a file can trigger time limit, on some servers
     $place = filter_naughty(post_param('place'));
     require_code('uploads');
     if (!is_swf_upload(true) && (!array_key_exists('file', $_FILES) || !is_uploaded_file($_FILES['file']['tmp_name']))) {
         $attach_name = 'file';
         $max_size = get_max_file_size();
         if (isset($_FILES[$attach_name]) && ($_FILES[$attach_name]['error'] == 1 || $_FILES[$attach_name]['error'] == 2)) {
             warn_exit(do_lang_tempcode('FILE_TOO_BIG', integer_format($max_size)));
         } elseif (isset($_FILES[$attach_name]) && ($_FILES[$attach_name]['error'] == 3 || $_FILES[$attach_name]['error'] == 6 || $_FILES[$attach_name]['error'] == 7)) {
             warn_exit(do_lang_tempcode('ERROR_UPLOADING_' . strval($_FILES[$attach_name]['error'])));
         } else {
             warn_exit(do_lang_tempcode('ERROR_UPLOADING'));
         }
     }
     $file = $_FILES['file']['name'];
     if (get_magic_quotes_gpc()) {
         $file = stripslashes($file);
     }
     if (!has_specific_permission(get_member(), 'upload_anything_filedump') || get_file_base() != get_custom_file_base()) {
         check_extension($file);
     }
     $file = str_replace('.', '-', basename($file, '.' . get_file_extension($file))) . '.' . get_file_extension($file);
     if (!file_exists(get_custom_file_base() . '/uploads/filedump' . $place . $file)) {
         $max_size = get_max_file_size();
         if ($_FILES['file']['size'] > $max_size) {
             warn_exit(do_lang_tempcode('FILE_TOO_BIG', integer_format(intval($max_size))));
         }
         $full = get_custom_file_base() . '/uploads/filedump' . $place . $file;
         if (is_swf_upload(true)) {
             @rename($_FILES['file']['tmp_name'], $full) or warn_exit(do_lang_tempcode('FILE_MOVE_ERROR', escape_html($file), escape_html('uploads/filedump' . $place)));
         } else {
             @move_uploaded_file($_FILES['file']['tmp_name'], $full) or warn_exit(do_lang_tempcode('FILE_MOVE_ERROR', escape_html($file), escape_html('uploads/filedump' . $place)));
         }
         fix_permissions($full);
         sync_file($full);
         $return_url = build_url(array('page' => '_SELF', 'place' => $place), '_SELF');
         $test = $GLOBALS['SITE_DB']->query_value_null_ok('filedump', 'description', array('name' => $file, 'path' => $place));
         if (!is_null($test)) {
             delete_lang($test);
         }
         $GLOBALS['SITE_DB']->query_delete('filedump', array('name' => $file, 'path' => $place), '', 1);
         $description = post_param('description');
         $GLOBALS['SITE_DB']->query_insert('filedump', array('name' => $file, 'path' => $place, 'the_member' => get_member(), 'description' => insert_lang_comcode($description, 3)));
         require_code('notifications');
         $subject = do_lang('FILEDUMP_NOTIFICATION_MAIL_SUBJECT', get_site_name(), $file, $place);
         $mail = do_lang('FILEDUMP_NOTIFICATION_MAIL', comcode_escape(get_site_name()), comcode_escape($file), array(comcode_escape($place), comcode_escape($description)));
         dispatch_notification('filedump', $place, $subject, $mail);
         log_it('FILEDUMP_UPLOAD', $file, $place);
         if (has_actual_page_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), get_page_name(), get_zone_name())) {
             syndicate_described_activity('filedump:ACTIVITY_FILEDUMP_UPLOAD', $place . '/' . $file, '', '', '', '', '', 'filedump');
         }
         return redirect_screen($title, $return_url, do_lang_tempcode('SUCCESS'));
     } else {
         warn_exit(do_lang_tempcode('OVERWRITE_ERROR'));
     }
     return new ocp_tempcode();
 }
コード例 #27
0
ファイル: char.php プロジェクト: scamp/minimanager
function char_main(&$sqlr, &$sqlc)
{
    global $output, $lang_global, $lang_char, $lang_item, $realm_id, $realm_db, $characters_db, $world_db, $server, $mmfpm_db, $action_permission, $user_lvl, $user_name, $user_id, $item_datasite, $spell_datasite, $showcountryflag;
    // this page uses wowhead tooltops
    wowhead_tt();
    // we need at least an id or we would have nothing to show
    if (empty($_GET['id'])) {
        error($lang_global['empty_fields']);
    }
    // this is multi realm support, as of writing still under development
    //  this page is already implementing it
    if (empty($_GET['realm'])) {
        $realmid = $realm_id;
    } else {
        $realmid = $sqlr->quote_smart($_GET['realm']);
        if (is_numeric($realmid)) {
            $sqlc->connect($characters_db[$realmid]['addr'], $characters_db[$realmid]['user'], $characters_db[$realmid]['pass'], $characters_db[$realmid]['name']);
        } else {
            $realmid = $realm_id;
        }
    }
    $id = $sqlc->quote_smart($_GET['id']);
    if (is_numeric($id)) {
    } else {
        error($lang_global['empty_fields']);
    }
    $result = $sqlc->query('SELECT account, race FROM characters WHERE guid = ' . $id . ' LIMIT 1');
    if ($sqlc->num_rows($result)) {
        //resrict by owner's gmlvl
        $owner_acc_id = $sqlc->result($result, 0, 'account');
        $query = $sqlr->query('SELECT gmlevel, username FROM account WHERE id = ' . $owner_acc_id . '');
        $owner_gmlvl = $sqlr->result($query, 0, 'gmlevel');
        $owner_name = $sqlr->result($query, 0, 'username');
        if ($user_lvl || $server[$realmid]['both_factions']) {
            $side_v = 0;
            $side_p = 0;
        } else {
            $side_p = in_array($sqlc->result($result, 0, 'race'), array(2, 5, 6, 8, 10)) ? 1 : 2;
            $result_1 = $sqlc->query('SELECT race FROM characters WHERE account = ' . $user_id . ' LIMIT 1');
            if ($sqlc->num_rows($result)) {
                $side_v = in_array($sqlc->result($result_1, 0, 'race'), array(2, 5, 6, 8, 10)) ? 1 : 2;
            } else {
                $side_v = 0;
            }
            unset($result_1);
        }
        if ($user_lvl >= $owner_gmlvl && ($side_v === $side_p || !$side_v)) {
            $result = $sqlc->query('SELECT account, data, name, race, class, gender, level, zone, map, online, totaltime, 
									arenaPoints, totalHonorPoints, totalKills, 
									health, 
									power1, power2, power3, power4, power5, power6, power7
								FROM characters 
								WHERE guid = ' . $id . '');
            $char = $sqlc->fetch_assoc($result);
            $char_data = explode(' ', $char['data']);
            $online = $char['online'] ? $lang_char['online'] : $lang_char['offline'];
            if ($char_data[CHAR_DATA_OFFSET_GUILD_ID]) {
                $guild_name = $sqlc->result($sqlc->query('SELECT name FROM guild WHERE guildid =' . $char_data[CHAR_DATA_OFFSET_GUILD_ID] . ''), 0, 'name');
                $guild_name = '<a href="guild.php?action=view_guild&amp;realm=' . $realmid . '&amp;error=3&amp;id=' . $char_data[CHAR_DATA_OFFSET_GUILD_ID] . '" >' . $guild_name . '</a>';
                $mrank = $char_data[CHAR_DATA_OFFSET_GUILD_RANK] + 1;
                $guild_rank = $sqlc->result($sqlc->query('SELECT rname FROM guild_rank WHERE guildid =' . $char_data[CHAR_DATA_OFFSET_GUILD_ID] . ' AND rid=' . $mrank . ''), 0, 'rname');
            } else {
                $guild_name = $lang_global['none'];
                $guild_rank = $lang_global['none'];
            }
            $block = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_BLOCK]));
            $block = round($block[1], 2);
            $dodge = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_DODGE]));
            $dodge = round($dodge[1], 2);
            $parry = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_PARRY]));
            $parry = round($parry[1], 2);
            $crit = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_MELEE_CRIT]));
            $crit = round($crit[1], 2);
            $ranged_crit = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_RANGE_CRIT]));
            $ranged_crit = round($ranged_crit[1], 2);
            $maxdamage = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_MAXDAMAGE]));
            $maxdamage = round($maxdamage[1], 0);
            $mindamage = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_MINDAMAGE]));
            $mindamage = round($mindamage[1], 0);
            $maxrangeddamage = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_MAXRANGEDDAMAGE]));
            $maxrangeddamage = round($maxrangeddamage[1], 0);
            $minrangeddamage = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_MINRANGEDDAMAGE]));
            $minrangeddamage = round($minrangeddamage[1], 0);
            $spell_crit = 100;
            for ($i = 0; $i < 6; ++$i) {
                $temp = unpack('f', pack('L', $char_data[CHAR_DATA_OFFSET_SPELL_CRIT + 1 + $i]));
                if ($temp[1] < $spell_crit) {
                    $spell_crit = $temp[1];
                }
            }
            $spell_crit = round($spell_crit, 2);
            $spell_damage = 9999;
            for ($i = 0; $i < 6; ++$i) {
                if ($char_data[CHAR_DATA_OFFSET_SPELL_DAMAGE + 1 + $i] < $spell_damage) {
                    $spell_damage = $char_data[CHAR_DATA_OFFSET_SPELL_DAMAGE + 1 + $i];
                }
            }
            $rage = round($char['power2'] / 10);
            $expertise = '' . $char_data[CHAR_DATA_OFFSET_EXPERTISE] . ' / ' . $char_data[CHAR_DATA_OFFSET_OFFHAND_EXPERTISE] . '';
            $EQU_HEAD = $char_data[CHAR_DATA_OFFSET_EQU_HEAD];
            $EQU_NECK = $char_data[CHAR_DATA_OFFSET_EQU_NECK];
            $EQU_SHOULDER = $char_data[CHAR_DATA_OFFSET_EQU_SHOULDER];
            $EQU_SHIRT = $char_data[CHAR_DATA_OFFSET_EQU_SHIRT];
            $EQU_CHEST = $char_data[CHAR_DATA_OFFSET_EQU_CHEST];
            $EQU_BELT = $char_data[CHAR_DATA_OFFSET_EQU_BELT];
            $EQU_LEGS = $char_data[CHAR_DATA_OFFSET_EQU_LEGS];
            $EQU_FEET = $char_data[CHAR_DATA_OFFSET_EQU_FEET];
            $EQU_WRIST = $char_data[CHAR_DATA_OFFSET_EQU_WRIST];
            $EQU_GLOVES = $char_data[CHAR_DATA_OFFSET_EQU_GLOVES];
            $EQU_FINGER1 = $char_data[CHAR_DATA_OFFSET_EQU_FINGER1];
            $EQU_FINGER2 = $char_data[CHAR_DATA_OFFSET_EQU_FINGER2];
            $EQU_TRINKET1 = $char_data[CHAR_DATA_OFFSET_EQU_TRINKET1];
            $EQU_TRINKET2 = $char_data[CHAR_DATA_OFFSET_EQU_TRINKET2];
            $EQU_BACK = $char_data[CHAR_DATA_OFFSET_EQU_BACK];
            $EQU_MAIN_HAND = $char_data[CHAR_DATA_OFFSET_EQU_MAIN_HAND];
            $EQU_OFF_HAND = $char_data[CHAR_DATA_OFFSET_EQU_OFF_HAND];
            $EQU_RANGED = $char_data[CHAR_DATA_OFFSET_EQU_RANGED];
            $EQU_TABARD = $char_data[CHAR_DATA_OFFSET_EQU_TABARD];
            /*
            // reserved incase we want to use back minimanagers' built in tooltip, instead of wowheads'
            // minimanagers' item tooltip needs updating, but it can show enchantments and sockets.
            
                  $equiped_items = array
                  (
                     1 => array(($EQU_HEAD      ? get_item_tooltip($EQU_HEAD)      : 0),($EQU_HEAD      ? get_item_icon($EQU_HEAD)      : 0),($EQU_HEAD      ? get_item_border($EQU_HEAD)      : 0)),
                     2 => array(($EQU_NECK      ? get_item_tooltip($EQU_NECK)      : 0),($EQU_NECK      ? get_item_icon($EQU_NECK)      : 0),($EQU_NECK      ? get_item_border($EQU_NECK)      : 0)),
                     3 => array(($EQU_SHOULDER  ? get_item_tooltip($EQU_SHOULDER)  : 0),($EQU_SHOULDER  ? get_item_icon($EQU_SHOULDER)  : 0),($EQU_SHOULDER  ? get_item_border($EQU_SHOULDER)  : 0)),
                     4 => array(($EQU_SHIRT     ? get_item_tooltip($EQU_SHIRT)     : 0),($EQU_SHIRT     ? get_item_icon($EQU_SHIRT)     : 0),($EQU_SHIRT     ? get_item_border($EQU_SHIRT)     : 0)),
                     5 => array(($EQU_CHEST     ? get_item_tooltip($EQU_CHEST)     : 0),($EQU_CHEST     ? get_item_icon($EQU_CHEST)     : 0),($EQU_CHEST     ? get_item_border($EQU_CHEST)     : 0)),
                     6 => array(($EQU_BELT      ? get_item_tooltip($EQU_BELT)      : 0),($EQU_BELT      ? get_item_icon($EQU_BELT)      : 0),($EQU_BELT      ? get_item_border($EQU_BELT)      : 0)),
                     7 => array(($EQU_LEGS      ? get_item_tooltip($EQU_LEGS)      : 0),($EQU_LEGS      ? get_item_icon($EQU_LEGS)      : 0),($EQU_LEGS      ? get_item_border($EQU_LEGS)      : 0)),
                     8 => array(($EQU_FEET      ? get_item_tooltip($EQU_FEET)      : 0),($EQU_FEET      ? get_item_icon($EQU_FEET)      : 0),($EQU_FEET      ? get_item_border($EQU_FEET)      : 0)),
                     9 => array(($EQU_WRIST     ? get_item_tooltip($EQU_WRIST)     : 0),($EQU_WRIST     ? get_item_icon($EQU_WRIST)     : 0),($EQU_WRIST     ? get_item_border($EQU_WRIST)     : 0)),
                    10 => array(($EQU_GLOVES    ? get_item_tooltip($EQU_GLOVES)    : 0),($EQU_GLOVES    ? get_item_icon($EQU_GLOVES)    : 0),($EQU_GLOVES    ? get_item_border($EQU_GLOVES)    : 0)),
                    11 => array(($EQU_FINGER1   ? get_item_tooltip($EQU_FINGER1)   : 0),($EQU_FINGER1   ? get_item_icon($EQU_FINGER1)   : 0),($EQU_FINGER1   ? get_item_border($EQU_FINGER1)   : 0)),
                    12 => array(($EQU_FINGER2   ? get_item_tooltip($EQU_FINGER2)   : 0),($EQU_FINGER2   ? get_item_icon($EQU_FINGER2)   : 0),($EQU_FINGER2   ? get_item_border($EQU_FINGER2)   : 0)),
                    13 => array(($EQU_TRINKET1  ? get_item_tooltip($EQU_TRINKET1)  : 0),($EQU_TRINKET1  ? get_item_icon($EQU_TRINKET1)  : 0),($EQU_TRINKET1  ? get_item_border($EQU_TRINKET1)  : 0)),
                    14 => array(($EQU_TRINKET2  ? get_item_tooltip($EQU_TRINKET2)  : 0),($EQU_TRINKET2  ? get_item_icon($EQU_TRINKET2)  : 0),($EQU_TRINKET2  ? get_item_border($EQU_TRINKET2)  : 0)),
                    15 => array(($EQU_BACK      ? get_item_tooltip($EQU_BACK)      : 0),($EQU_BACK      ? get_item_icon($EQU_BACK)      : 0),($EQU_BACK      ? get_item_border($EQU_BACK)      : 0)),
                    16 => array(($EQU_MAIN_HAND ? get_item_tooltip($EQU_MAIN_HAND) : 0),($EQU_MAIN_HAND ? get_item_icon($EQU_MAIN_HAND) : 0),($EQU_MAIN_HAND ? get_item_border($EQU_MAIN_HAND) : 0)),
                    17 => array(($EQU_OFF_HAND  ? get_item_tooltip($EQU_OFF_HAND)  : 0),($EQU_OFF_HAND  ? get_item_icon($EQU_OFF_HAND)  : 0),($EQU_OFF_HAND  ? get_item_border($EQU_OFF_HAND)  : 0)),
                    18 => array(($EQU_RANGED    ? get_item_tooltip($EQU_RANGED)    : 0),($EQU_RANGED    ? get_item_icon($EQU_RANGED)    : 0),($EQU_RANGED    ? get_item_border($EQU_RANGED)    : 0)),
                    19 => array(($EQU_TABARD    ? get_item_tooltip($EQU_TABARD)    : 0),($EQU_TABARD    ? get_item_icon($EQU_TABARD)    : 0),($EQU_TABARD    ? get_item_border($EQU_TABARD)    : 0))
                  );
            */
            $sqlm = new SQL();
            $sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
            $sqlw = new SQL();
            $sqlw->connect($world_db[$realmid]['addr'], $world_db[$realmid]['user'], $world_db[$realmid]['pass'], $world_db[$realmid]['name']);
            $equiped_items = array(1 => array('', $EQU_HEAD ? get_item_icon($EQU_HEAD, $sqlm, $sqlw) : 0, $EQU_HEAD ? get_item_border($EQU_HEAD, $sqlw) : 0), 2 => array('', $EQU_NECK ? get_item_icon($EQU_NECK, $sqlm, $sqlw) : 0, $EQU_NECK ? get_item_border($EQU_NECK, $sqlw) : 0), 3 => array('', $EQU_SHOULDER ? get_item_icon($EQU_SHOULDER, $sqlm, $sqlw) : 0, $EQU_SHOULDER ? get_item_border($EQU_SHOULDER, $sqlw) : 0), 4 => array('', $EQU_SHIRT ? get_item_icon($EQU_SHIRT, $sqlm, $sqlw) : 0, $EQU_SHIRT ? get_item_border($EQU_SHIRT, $sqlw) : 0), 5 => array('', $EQU_CHEST ? get_item_icon($EQU_CHEST, $sqlm, $sqlw) : 0, $EQU_CHEST ? get_item_border($EQU_CHEST, $sqlw) : 0), 6 => array('', $EQU_BELT ? get_item_icon($EQU_BELT, $sqlm, $sqlw) : 0, $EQU_BELT ? get_item_border($EQU_BELT, $sqlw) : 0), 7 => array('', $EQU_LEGS ? get_item_icon($EQU_LEGS, $sqlm, $sqlw) : 0, $EQU_LEGS ? get_item_border($EQU_LEGS, $sqlw) : 0), 8 => array('', $EQU_FEET ? get_item_icon($EQU_FEET, $sqlm, $sqlw) : 0, $EQU_FEET ? get_item_border($EQU_FEET, $sqlw) : 0), 9 => array('', $EQU_WRIST ? get_item_icon($EQU_WRIST, $sqlm, $sqlw) : 0, $EQU_WRIST ? get_item_border($EQU_WRIST, $sqlw) : 0), 10 => array('', $EQU_GLOVES ? get_item_icon($EQU_GLOVES, $sqlm, $sqlw) : 0, $EQU_GLOVES ? get_item_border($EQU_GLOVES, $sqlw) : 0), 11 => array('', $EQU_FINGER1 ? get_item_icon($EQU_FINGER1, $sqlm, $sqlw) : 0, $EQU_FINGER1 ? get_item_border($EQU_FINGER1, $sqlw) : 0), 12 => array('', $EQU_FINGER2 ? get_item_icon($EQU_FINGER2, $sqlm, $sqlw) : 0, $EQU_FINGER2 ? get_item_border($EQU_FINGER2, $sqlw) : 0), 13 => array('', $EQU_TRINKET1 ? get_item_icon($EQU_TRINKET1, $sqlm, $sqlw) : 0, $EQU_TRINKET1 ? get_item_border($EQU_TRINKET1, $sqlw) : 0), 14 => array('', $EQU_TRINKET2 ? get_item_icon($EQU_TRINKET2, $sqlm, $sqlw) : 0, $EQU_TRINKET2 ? get_item_border($EQU_TRINKET2, $sqlw) : 0), 15 => array('', $EQU_BACK ? get_item_icon($EQU_BACK, $sqlm, $sqlw) : 0, $EQU_BACK ? get_item_border($EQU_BACK, $sqlw) : 0), 16 => array('', $EQU_MAIN_HAND ? get_item_icon($EQU_MAIN_HAND, $sqlm, $sqlw) : 0, $EQU_MAIN_HAND ? get_item_border($EQU_MAIN_HAND, $sqlw) : 0), 17 => array('', $EQU_OFF_HAND ? get_item_icon($EQU_OFF_HAND, $sqlm, $sqlw) : 0, $EQU_OFF_HAND ? get_item_border($EQU_OFF_HAND, $sqlw) : 0), 18 => array('', $EQU_RANGED ? get_item_icon($EQU_RANGED, $sqlm, $sqlw) : 0, $EQU_RANGED ? get_item_border($EQU_RANGED, $sqlw) : 0), 19 => array('', $EQU_TABARD ? get_item_icon($EQU_TABARD, $sqlm, $sqlw) : 0, $EQU_TABARD ? get_item_border($EQU_TABARD, $sqlw) : 0));
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name) {
                $output .= '
          <!-- start of char.php -->
          <center>
            <div id="tab_content">
              <div id="tab">
                <ul>
                  <li><a href="char_inv.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['inventory'] . '</a></li>
                  <li><a href="char_extra.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['extra'] . '</a></li>
                  ' . ($char['level'] < 10 ? '' : '<li><a href="char_talent.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['talents'] . '</a></li>') . '
                  <li><a href="char_achieve.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['achievements'] . '</a></li>
                  <li><a href="char_rep.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['reputation'] . '</a></li>
                  <li><a href="char_skill.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['skills'] . '</a></li>
                  <li><a href="char_quest.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['quests'] . '</a></li>';
                if (char_get_class_name($char['class']) === 'Hunter') {
                    $output .= '
                  <li><a href="char_pets.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['pets'] . '</a></li>';
                }
                $output .= '
                  <li><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['friends'] . '</a></li>
				  <li><a href="char_spell.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['spells'] . '</a></li>
				  <li><a href="char_mail.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['mail'] . '</a></li>
                </ul>
                <ul>';
                // selected char tab at last
                $output .= '
                  <li id="selected"><a href="char.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['char_sheet'] . '</a></li>';
            } else {
                $output .= '
          <center>
            <div id="tab">
              <ul>
                <li id="selected"><a href="char.php?id=' . $id . '&amp;realm=' . $realmid . '">' . $lang_char['char_sheet'] . '</a></li>
              </ul>
            </div>
            <div id="tab_content">
              <div id="tab">
                <ul>';
            }
            $output .= '
                </ul>
              </div>
              <div id="tab_content2">
                <table class="lined" style="width: 580px;">
                  <tr>
                    <td colspan="2">
                      <div>
                        <img src="' . char_get_avatar_img($char['level'], $char['gender'], $char['race'], $char['class'], 0) . '" alt="avatar" />
                      </div>
                      <div>';
            $a_results = $sqlc->query('SELECT DISTINCT spell FROM character_aura WHERE guid = ' . $id . '');
            if ($sqlc->num_rows($a_results)) {
                while ($aura = $sqlc->fetch_assoc($a_results)) {
                    $output .= '
                        <a style="padding:2px;" href="' . $spell_datasite . $aura['spell'] . '" target="_blank">
                          <img src="' . spell_get_icon($aura['spell'], $sqlm) . '" alt="' . $aura['spell'] . '" width="24" height="24" />
                        </a>';
                }
            }
            $output .= '
                      </div>
                    </td>
                    <td colspan="4">
                      <font class="bold">
                        ' . htmlentities($char['name']) . ' -
                        <img src="img/c_icons/' . $char['race'] . '-' . $char['gender'] . '.gif" onmousemove="toolTip(\'' . char_get_race_name($char['race']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" />
                        <img src="img/c_icons/' . $char['class'] . '.gif" onmousemove="toolTip(\'' . char_get_class_name($char['class']) . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" />
                        - lvl ' . char_get_level_color($char['level']) . '
                      </font>
                      <br />' . get_map_name($char['map'], $sqlm) . ' - ' . get_zone_name($char['zone'], $sqlm) . '
                      <br />' . $lang_char['honor_points'] . ': ' . $char['totalHonorPoints'] . ' / ' . $char['arenaPoints'] . ' - ' . $lang_char['honor_kills'] . ': ' . $char['totalKills'] . '
                      <br />' . $lang_char['guild'] . ': ' . $guild_name . ' | ' . $lang_char['rank'] . ': ' . htmlentities($guild_rank) . '
                      <br />' . ($char['online'] ? '<img src="img/up.gif" onmousemove="toolTip(\'Online\', \'item_tooltip\')" onmouseout="toolTip()" alt="online" />' : '<img src="img/down.gif" onmousemove="toolTip(\'Offline\', \'item_tooltip\')" onmouseout="toolTip()" alt="offline" />');
            if ($showcountryflag) {
                require_once 'libs/misc_lib.php';
                $country = misc_get_country_by_account($char['account'], $sqlr, $sqlm);
                $output .= ' - ' . ($country['code'] ? '<img src="img/flags/' . $country['code'] . '.png" onmousemove="toolTip(\'' . $country['country'] . '\', \'item_tooltip\')" onmouseout="toolTip()" alt="" />' : '-');
                unset($country);
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="6%">';
            if ($equiped_items[1][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_HEAD . '" target="_blank">
                        <img src="' . $equiped_items[1][1] . '" class="' . $equiped_items[1][2] . '" alt="Head" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_head.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" align="center" width="50%">
                      <div class="gradient_p">' . $lang_item['health'] . ':</div>
                      <div class="gradient_pp">' . $char['health'] . '</div>';
            if ($char['class'] == 11) {
                //druid
                $output .= '
                      </br>
                      <div class="gradient_p">' . $lang_item['energy'] . ':</div>
                      <div class="gradient_pp">' . $char['power4'] . '</div>';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" align="center" width="50%">';
            if ($char['class'] == 1) {
                $output .= '
                      <div class="gradient_p">' . $lang_item['rage'] . ':</div>
                      <div class="gradient_pp">' . $rage . '</div>';
            } elseif ($char['class'] == 4) {
                $output .= '
                      <div class="gradient_p">' . $lang_item['energy'] . ':</div>
                      <div class="gradient_pp">' . $char['power4'] . '</div>';
            } elseif ($char['class'] == 6) {
                // Don't know if FOCUS is the right one need to verify with Death Knight player.
                $output .= '
                      <div class="gradient_p">' . $lang_item['runic'] . ':</div>
                      <div class="gradient_pp">Unknown</div>';
            } elseif ($char['class'] == 11) {
                $output .= '
                      <div class="gradient_p">' . $lang_item['mana'] . ':</div>
                      <div class="gradient_pp">' . $char['power1'] . '</div>
                      </br>
                      <div class="gradient_p">' . $lang_item['rage'] . ':</div>
                      <div class="gradient_pp">' . $rage . '</div>';
            } elseif ($char['class'] == 2 || $char['class'] == 3 || $char['class'] == 5 || $char['class'] == 7 || $char['class'] == 8 || $char['class'] == 9) {
                $output .= '
                      <div class="gradient_p">' . $lang_item['mana'] . ':</div>
                      <div class="gradient_pp">' . $char['power1'] . '</div>';
            }
            $output .= '
                    </td>
                    <td width="6%">';
            if ($equiped_items[10][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_GLOVES . '" target="_blank">
                        <img src="' . $equiped_items[10][1] . '" class="' . $equiped_items[10][2] . '" alt="Gloves" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_gloves.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="1%">';
            if ($equiped_items[2][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_NECK . '" target="_blank">
                        <img src="' . $equiped_items[2][1] . '" class="' . $equiped_items[2][2] . '" alt="Neck" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_neck.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" rowspan="3" align="center" width="50%">
                      <div class="gradient_p">
                        ' . $lang_item['strength'] . ':<br />
                        ' . $lang_item['agility'] . ':<br />
                        ' . $lang_item['stamina'] . ':<br />
                        ' . $lang_item['intellect'] . ':<br />
                        ' . $lang_item['spirit'] . ':<br />
                        ' . $lang_item['armor'] . ':
                      </div>
                      <div class="gradient_pp">
                        ' . $char_data[CHAR_DATA_OFFSET_STR] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_AGI] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_STA] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_INT] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_SPI] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_ARMOR] . '
                      </div>
                    </td>
                    <td class="half_line" colspan="2" rowspan="3" align="center" width="50%">
                      <div class="gradient_p">
                        ' . $lang_item['res_holy'] . ':<br />
                        ' . $lang_item['res_arcane'] . ':<br />
                        ' . $lang_item['res_fire'] . ':<br />
                        ' . $lang_item['res_nature'] . ':<br />
                        ' . $lang_item['res_frost'] . ':<br />
                        ' . $lang_item['res_shadow'] . ':
                      </div>
                      <div class="gradient_pp">
                        ' . $char_data[CHAR_DATA_OFFSET_RES_HOLY] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_RES_ARCANE] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_RES_FIRE] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_RES_NATURE] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_RES_FROST] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_RES_SHADOW] . '
                      </div>
                    </td>
                    <td width="1%">';
            if ($equiped_items[6][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_BELT . '" target="_blank">
                        <img src="' . $equiped_items[6][1] . '" class="' . $equiped_items[6][2] . '" alt="Belt" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_waist.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="1%">';
            if ($equiped_items[3][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_SHOULDER . '" target="_blank">
                        <img src="' . $equiped_items[3][1] . '" class="' . $equiped_items[3][2] . '" alt="Shoulder" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_shoulder.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td width="1%">';
            if ($equiped_items[7][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_LEGS . '" target="_blank">
                        <img src="' . $equiped_items[7][1] . '" class="' . $equiped_items[7][2] . '" alt="Legs" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_legs.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="1%">';
            if ($equiped_items[15][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_BACK . '" target="_blank">
                        <img src="' . $equiped_items[15][1] . '" class="' . $equiped_items[15][2] . '" alt="Back" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_chest_back.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td width="1%">';
            if ($equiped_items[8][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_FEET . '" target="_blank">
                        <img src="' . $equiped_items[8][1] . '" class="' . $equiped_items[8][2] . '" alt="Feet" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_feet.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="1%">';
            if ($equiped_items[5][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_CHEST . '" target="_blank">
                        <img src="' . $equiped_items[5][1] . '" class="' . $equiped_items[5][2] . '" alt="Chest" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_chest_back.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                      <div class="gradient_p">
                        ' . $lang_char['melee_d'] . ':<br />
                        ' . $lang_char['melee_ap'] . ':<br />
                        ' . $lang_char['melee_hit'] . ':<br />
                        ' . $lang_char['melee_crit'] . ':<br />
                        ' . $lang_char['expertise'] . ':<br />
                      </div>
                      <div class="gradient_pp">
                        ' . $mindamage . '-' . $maxdamage . '<br />
                        ' . ($char_data[CHAR_DATA_OFFSET_AP] + $char_data[CHAR_DATA_OFFSET_AP_MOD]) . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_MELEE_HIT] . '<br />
                        ' . $crit . '%<br />
                        ' . $expertise . '<br />
                      </div>
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                      <div class="gradient_p">
                        ' . $lang_char['spell_d'] . ':<br />
                        ' . $lang_char['spell_heal'] . ':<br />
                        ' . $lang_char['spell_hit'] . ':<br />
                        ' . $lang_char['spell_crit'] . ':<br />
                        ' . $lang_char['spell_haste'] . '
                      </div>
                      <div class="gradient_pp">
                        ' . $spell_damage . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_SPELL_HEAL] . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_SPELL_HIT] . '<br />
                        ' . $spell_crit . '%<br />
                        ' . $char_data[CHAR_DATA_OFFSET_SPELL_HASTE_RATING] . '
                      </div>
                    </td>
                    <td width="1%">';
            if ($equiped_items[11][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_FINGER1 . '" target="_blank">
                        <img src="' . $equiped_items[11][1] . '" class="' . $equiped_items[11][2] . '" alt="Finger1" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_finger.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="1%">';
            if ($equiped_items[4][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_SHIRT . '" target="_blank">
                        <img src="' . $equiped_items[4][1] . '" class="' . $equiped_items[4][2] . '" alt="Shirt" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_shirt.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td width="1%">';
            if ($equiped_items[12][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_FINGER2 . '" target="_blank">
                        <img src="' . $equiped_items[12][1] . '" class="' . $equiped_items[12][2] . '" alt="Finger2" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_finger.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="1%">';
            if ($equiped_items[19][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_TABARD . '" target="_blank">
                        <img src="' . $equiped_items[19][1] . '" class="' . $equiped_items[19][2] . '" alt="Tabard" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_tabard.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                      <div class="gradient_p">
                        ' . $lang_char['dodge'] . ':<br />
                        ' . $lang_char['parry'] . ':<br />
                        ' . $lang_char['block'] . ':<br />
                        ' . $lang_char['resilience'] . ':<br />
                      </div>
                      <div class="gradient_pp">
                        ' . $dodge . '%<br />
                        ' . $parry . '%<br />
                        ' . $block . '%<br />
                        ' . $char_data[CHAR_DATA_OFFSET_RESILIENCE] . '<br />
                      </div>
                    </td>
                    <td class="half_line" colspan="2" rowspan="2" align="center" width="50%">
                      <div class="gradient_p">
                        ' . $lang_char['ranged_d'] . ':<br />
                        ' . $lang_char['ranged_ap'] . ':<br />
                        ' . $lang_char['ranged_hit'] . ':<br />
                        ' . $lang_char['ranged_crit'] . ':<br />
                      </div>
                      <div class="gradient_pp">
                        ' . $minrangeddamage . '-' . $maxrangeddamage . '<br />
                        ' . ($char_data[CHAR_DATA_OFFSET_RANGED_AP] + $char_data[CHAR_DATA_OFFSET_RANGED_AP_MOD]) . '<br />
                        ' . $char_data[CHAR_DATA_OFFSET_RANGE_HIT] . '<br />
                        ' . $ranged_crit . '%<br />
                      </div>
                    </td>
                    <td width="1%">';
            if ($equiped_items[13][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_TRINKET1 . '" target="_blank">
                        <img src="' . $equiped_items[13][1] . '" class="' . $equiped_items[13][2] . '" alt="Trinket1" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_trinket.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td width="1%">';
            if ($equiped_items[9][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_WRIST . '" target="_blank">
                        <img src="' . $equiped_items[9][1] . '" class="' . $equiped_items[9][2] . '" alt="Wrist" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_wrist.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td width="1%">';
            if ($equiped_items[14][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_TRINKET2 . '" target="_blank">
                        <img src="' . $equiped_items[14][1] . '" class="' . $equiped_items[14][2] . '" alt="Trinket2" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_trinket.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                  </tr>
                  <tr>
                    <td></td>
                    <td width="15%">';
            if ($equiped_items[16][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_MAIN_HAND . '" target="_blank">
                        <img src="' . $equiped_items[16][1] . '" class="' . $equiped_items[16][2] . '" alt="MainHand" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_main_hand.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td width="15%">';
            if ($equiped_items[17][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_OFF_HAND . '" target="_blank">
                        <img src="' . $equiped_items[17][1] . '" class="' . $equiped_items[17][2] . '" alt="OffHand" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_off_hand.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td width="15%">';
            if ($equiped_items[18][1]) {
                $output .= '
                      <a style="padding:2px;" href="' . $item_datasite . $EQU_RANGED . '" target="_blank">
                        <img src="' . $equiped_items[18][1] . '" class="' . $equiped_items[18][2] . '" alt="Ranged" />
                      </a>';
            } else {
                $output .= '
                      <img src="img/INV/INV_empty_ranged.png" class="icon_border_0" alt="empty" />';
            }
            $output .= '
                    </td>
                    <td width="15%"></td>
                    <td></td>
                  </tr>';
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name) {
                //total time played
                $tot_time = $char['totaltime'];
                $tot_days = (int) ($tot_time / 86400);
                $tot_time = $tot_time - $tot_days * 86400;
                $total_hours = (int) ($tot_time / 3600);
                $tot_time = $tot_time - $total_hours * 3600;
                $total_min = (int) ($tot_time / 60);
                $output .= '
                  <tr>
                    <td colspan="6">
                      ' . $lang_char['tot_paly_time'] . ': ' . $tot_days . ' ' . $lang_char['days'] . ' ' . $total_hours . ' ' . $lang_char['hours'] . ' ' . $total_min . ' ' . $lang_char['min'] . '
                    </td>
                  </tr>';
            }
            $output .= '
                </table>
              </div>
              <br />
            </div>
            <br />
            <table class="hidden">
              <tr>
                <td>';
            // button to user account page, user account page has own security
            makebutton($lang_char['chars_acc'], 'user.php?action=edit_user&amp;id=' . $owner_acc_id . '', 130);
            $output .= '
                </td>
                <td>';
            // only higher level GM with delete access can edit character
            //  character edit allows removal of character items, so delete permission is needed
            if ($user_lvl > $owner_gmlvl && $user_lvl >= $action_permission['delete']) {
                makebutton($lang_char['edit_button'], 'char_edit.php?id=' . $id . '&amp;realm=' . $realmid . '', 130);
                $output .= '
                </td>
                <td>';
            }
            // only higher level GM with delete access, or character owner can delete character
            if ($user_lvl > $owner_gmlvl && $user_lvl >= $action_permission['delete'] || $owner_name === $user_name) {
                makebutton($lang_char['del_char'], 'char_list.php?action=del_char_form&amp;check%5B%5D=' . $id . '" type="wrn', 130);
                $output .= '
                </td>
                <td>';
            }
            // only GM with update permission can send mail, mail can send items, so update permission is needed
            if ($user_lvl >= $action_permission['update']) {
                makebutton($lang_char['send_mail'], 'mail.php?type=ingame_mail&amp;to=' . $char['name'] . '', 130);
                $output .= '
                </td>
                <td>';
            }
            makebutton($lang_global['back'], 'javascript:window.history.back()" type="def', 130);
            $output .= '
                </td>
              </tr>
            </table>
            <br />
          </center>
          <!-- end of char.php -->';
        } else {
            error($lang_char['no_permission']);
        }
    } else {
        error($lang_char['no_char_found']);
    }
}
コード例 #28
0
function char_friends()
{
    global $output, $realm_id, $logon_db, $corem_db, $characters_db, $site_encoding, $action_permission, $user_lvl, $user_name, $sql, $core;
    if (empty($_GET["id"])) {
        error(lang("global", "empty_fields"));
    } else {
        $id = $_GET["id"];
    }
    // this is multi realm support, as of writing still under development
    //  this page is already implementing it
    if (empty($_GET["realm"])) {
        $realmid = $realm_id;
    } else {
        $realmid = $sql["logon"]->quote_smart($_GET["realm"]);
        if (is_numeric($realmid)) {
            $sql["char"]->connect($characters_db[$realmid]['addr'], $characters_db[$realmid]['user'], $characters_db[$realmid]['pass'], $characters_db[$realmid]['name'], $characters_db[$realmid]["encoding"]);
        } else {
            $realmid = $realm_id;
        }
    }
    //==========================$_GET and SECURE========================
    if (!is_numeric($id)) {
        $id = 0;
    }
    $order_by = isset($_GET["order_by"]) ? $sql["char"]->quote_smart($_GET["order_by"]) : 'name';
    if (!preg_match('/^[[:lower:]]{1,6}$/', $order_by)) {
        $order_by = 'name';
    }
    $dir = isset($_GET["dir"]) ? $sql["char"]->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========================
    if ($order_by === "map") {
        $order_by = "map " . $order_dir . ", zone";
    } elseif ($order_by === "zone") {
        $order_by = "zone " . $order_dir . ", map";
    }
    // getting character data from database
    if ($core == 1) {
        $result = $sql["char"]->query("SELECT acct, name, race, class, level, gender\r\n      FROM characters WHERE guid='" . $id . "' LIMIT 1");
    } else {
        $result = $sql["char"]->query("SELECT account AS acct, name, race, class, level, gender\r\n      FROM characters WHERE guid='" . $id . "' LIMIT 1");
    }
    if ($sql["char"]->num_rows($result)) {
        $char = $sql["char"]->fetch_assoc($result);
        // we get user permissions first
        $owner_acc_id = $sql["char"]->result($result, 0, "acct");
        if ($core == 1) {
            $result = $sql["logon"]->query("SELECT login FROM accounts WHERE acct='" . $char["acct"] . "'");
        } else {
            $result = $sql["logon"]->query("SELECT username AS login FROM account WHERE id='" . $char["acct"] . "'");
        }
        $owner_name = $sql["logon"]->result($result, 0, 'login');
        $s_query = "SELECT *, SecurityLevel AS gm FROM config_accounts WHERE Login='******'";
        $s_result = $sql["mgr"]->query($s_query);
        $s_fields = $sql["mgr"]->fetch_assoc($s_result);
        $owner_gmlvl = $s_fields["gm"];
        $view_mod = $s_fields["View_Mod_Friends"];
        if ($owner_gmlvl >= 1073741824) {
            $owner_gmlvl -= 1073741824;
        }
        // owner configured overrides
        $view_override = false;
        if ($view_mod > 0) {
            if ($view_mod == 1) {
            } elseif ($view_mod == 2) {
                // only registered users may view this page
                if ($user_lvl > -1) {
                    $view_override = true;
                }
            }
        }
        // visibility overrides for specific tabs
        $view_inv_override = false;
        if ($s_fields["View_Mod_Inv"] > 0) {
            if ($s_fields["View_Mod_Inv"] == 1) {
            } elseif ($s_fields["View_Mod_Inv"] == 2) {
                // only registered users may view this tab
                if ($user_lvl > -1) {
                    $view_inv_override = true;
                }
            }
        } else {
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                $view_inv_override = true;
            }
        }
        $view_talent_override = false;
        if ($s_fields["View_Mod_Talent"] > 0) {
            if ($s_fields["View_Mod_Talent"] == 1) {
            } elseif ($s_fields["View_Mod_Talent"] == 2) {
                // only registered users may view this tab
                if ($user_lvl > -1) {
                    $view_talent_override = true;
                }
            }
        } else {
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                $view_talent_override = true;
            }
        }
        $view_achieve_override = false;
        if ($s_fields["View_Mod_Achieve"] > 0) {
            if ($s_fields["View_Mod_Achieve"] == 1) {
            } elseif ($s_fields["View_Mod_Achieve"] == 2) {
                // only registered users may view this tab
                if ($user_lvl > -1) {
                    $view_achieve_override = true;
                }
            }
        } else {
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                $view_achieve_override = true;
            }
        }
        $view_quest_override = false;
        if ($s_fields["View_Mod_Quest"] > 0) {
            if ($s_fields["View_Mod_Quest"] == 1) {
            } elseif ($s_fields["View_Mod_Quest"] == 2) {
                // only registered users may view this tab
                if ($user_lvl > -1) {
                    $view_quest_override = true;
                }
            }
        } else {
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                $view_quest_override = true;
            }
        }
        $view_view_override = false;
        if ($s_fields["View_Mod_View"] > 0) {
            if ($s_fields["View_Mod_View"] == 1) {
            } elseif ($s_fields["View_Mod_View"] == 2) {
                // only registered users may view this tab
                if ($user_lvl > -1) {
                    $view_view_override = true;
                }
            }
        } else {
            if ($user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
                $view_view_override = true;
            }
        }
        if ($view_override || $user_lvl > $owner_gmlvl || $owner_name === $user_name || $user_lvl == $action_permission["delete"]) {
            //------------------------Character Tabs---------------------------------
            // we start with a lead of 10 spaces,
            //  because last line of header is an opening tag with 8 spaces
            //  keep html indent in sync, so debuging from browser source would be easy to read
            $output .= '
            <script type="text/javascript">
              // <![CDATA[
                function wrap()
                {
                  if (getBrowserWidth() > 1024)
                  document.write(\'</table></td><td><table class="lined" id="ch_fri_large_screen">\');
                }
              // ]]>
            </script>
            <div class="tab">
              <ul>
                <li><a href="char.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "char_sheet") . '</a></li>';
            if ($view_inv_override) {
                $output .= '
                <li><a href="char_inv.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "inventory") . '</a></li>';
            }
            if ($view_talent_override) {
                $output .= '
                ' . ($char["level"] < 10 ? '' : '<li><a href="char_talent.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "talents") . '</a></li>') . '';
            }
            if ($view_achieve_override) {
                $output .= '
                <li><a href="char_achieve.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "achievements") . '</a></li>';
            }
            if ($view_quest_override) {
                $output .= '
                <li><a href="char_quest.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "quests") . '</a></li>';
            }
            $output .= '
                <li class="selected"><a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "friends") . '</a></li>';
            if ($view_view_override) {
                $output .= '
                <li><a href="char_view.php?id=' . $id . '&amp;realm=' . $realmid . '">' . lang("char", "view") . '</a></li>';
            }
            $output .= '
              </ul>
            </div>
            <div class="tab_content center center_text">
              <span class="bold">
                ' . htmlentities($char["name"], ENT_COMPAT, $site_encoding) . ' -
                <img src="img/c_icons/' . $char["race"] . '-' . $char["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($char["race"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                <img src="img/c_icons/' . $char["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($char["class"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" /> - ' . lang("char", "level_short") . char_get_level_color($char["level"]) . '
              </span>
              <br /><br />
              <table class="hidden" id="ch_fri_unk_1">
                <tr valign="top">
                  <td>
                    <table class="lined" id="ch_fri_unk_2">';
            // pre-build columns for friends/ignores table
            $friends_columns = '
                      <tr>
                        <th style="width: 1%;">
                          <a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=name&amp;dir=' . $dir . '"' . ($order_by === "name" ? ' class="' . $order_dir . '"' : '') . '>' . lang("char", "name") . '</a>
                        </th>
                        <th style="width: 1%;">
                          <a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=race&amp;dir=' . $dir . '"' . ($order_by === "race" ? ' class="' . $order_dir . '"' : '') . '>' . lang("char", "race") . '</a>
                        </th>
                        <th style="width: 1%;">
                          <a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=class&amp;dir=' . $dir . '"' . ($order_by === "class" ? ' class="' . $order_dir . '"' : '') . '>' . lang("char", "class") . '</a>
                        </th>
                        <th style="width: 1%;">
                          <a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=level&amp;dir=' . $dir . '"' . ($order_by === "level" ? ' class="' . $order_dir . '"' : '') . '>' . lang("char", "level") . '</a>
                        </th>
                        <th style="width: 1%;">
                          <a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=mapid&amp;dir=' . $dir . '"' . ($order_by === "map " . $order_dir . ", zone" ? ' class="' . $order_dir . '"' : '') . '>' . lang("char", "map") . '</a>
                        </th>
                        <th style="width: 1%;">
                          <a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=zoneid&amp;dir=' . $dir . '"' . ($order_by === "zone " . $order_dir . ", map" ? ' class="' . $order_dir . '"' : '') . '>' . lang("char", "zone") . '</a>
                        </th>
                        <th style="width: 1%;">
                          <a href="char_friends.php?id=' . $id . '&amp;realm=' . $realmid . '&amp;order_by=online&amp;dir=' . $dir . '"' . ($order_by === "online" ? ' class="' . $order_dir . '"' : '') . '>' . lang("char", "online") . '</a>
                        </th>
                      </tr>';
            // get friends
            if ($core == 1) {
                $result = $sql["char"]->query("SELECT name, race, class, mapid, zoneid, level, gender, online, acct, guid\r\n          FROM characters WHERE guid IN (SELECT friend_guid FROM social_friends WHERE character_guid='" . $id . "') ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            } else {
                $result = $sql["char"]->query("SELECT name, race, class, map AS mapid, zone AS zoneid, level, gender, online, account AS acct, guid\r\n          FROM characters WHERE guid IN (SELECT friend FROM character_social WHERE guid='" . $id . "' AND flags=1) ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            }
            $output_temp = '<tr><td style="display: none;"></td></tr>';
            if ($sql["char"]->num_rows($result)) {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "friends") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                while ($data = $sql["char"]->fetch_assoc($result)) {
                    if ($core == 1) {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT login FROM accounts WHERE acct='" . $data["acct"] . "'"), 0, "gmlevel");
                    } else {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT username AS login FROM account WHERE id='" . $data["acct"] . "'"), 0, "login");
                    }
                    $char_gm_level = $sql["mgr"]->result($sql["mgr"]->query("SELECT SecurityLevel AS gmlevel FROM config_accounts WHERE Login='******'"), 0, "gmlevel");
                    $output_temp .= '
                      <tr>
                        <td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output_temp .= '
                          <a href="char.php?id=' . $data["guid"] . '">
                            <span>' . $data["name"] . '</span>
                          </a>';
                    } else {
                        $output_temp .= $data["name"];
                    }
                    $output_temp .= '
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["race"] . '-' . $data["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($data["race"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($data["class"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                          <span>' . char_get_level_color($data["level"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'MapID:' . $data["mapid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_map_name($data["mapid"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'ZoneID:' . $data["zoneid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_zone_name($data["zoneid"]) . '</span>
                        </td>
                        <td>
                          <img src="img/' . ($data["online"] ? 'up' : 'down') . '.gif" alt="" />
                        </td>
                      </tr>';
                }
            } else {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "friends") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                $output_temp .= '
                      <tr>
                        <td colspan="7">
                          <span>' . lang("char", "no_friends") . '</span>
                        </td>
                      </tr>';
            }
            $output_temp .= '
                      <tr>
                        <th colspan="7">&nbsp;</th>
                      </tr>';
            // get is friend of
            if ($core == 1) {
                $result = $sql["char"]->query("SELECT name, race, class, mapid, zoneid, level, gender, online, acct, guid\r\n          FROM characters WHERE guid IN (SELECT character_guid FROM social_friends WHERE friend_guid='" . $id . "') ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            } else {
                $result = $sql["char"]->query("SELECT name, race, class, map AS mapid, zone AS zoneid, level, gender, online, account AS acct, guid\r\n          FROM characters WHERE guid IN (SELECT guid FROM character_social WHERE friend='" . $id . "' AND flags=1) ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            }
            if ($sql["char"]->num_rows($result)) {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "friendof") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                while ($data = $sql["char"]->fetch_assoc($result)) {
                    if ($core == 1) {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT login FROM accounts WHERE acct='" . $data["acct"] . "'"), 0, "gmlevel");
                    } else {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT username AS login FROM account WHERE id='" . $data["acct"] . "'"), 0, "login");
                    }
                    $char_gm_level = $sql["mgr"]->result($sql["mgr"]->query("SELECT SecurityLevel AS gmlevel FROM config_accounts WHERE Login='******'"), 0, "gmlevel");
                    $output_temp .= '
                      <tr>
                        <td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output_temp .= '
                          <a href="char.php?id=' . $data["guid"] . '">
                            <span>' . $data["name"] . '</span>
                          </a>';
                    } else {
                        $output_temp .= $data["name"];
                    }
                    $output_temp .= '
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["race"] . '-' . $data["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($data["race"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($data["class"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                        <span>' . char_get_level_color($data["level"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'MapID:' . $data["mapid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_map_name($data["mapid"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'ZoneID:' . $data["zoneid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_zone_name($data["zoneid"]) . '</span>
                        </td>
                        <td>
                          <img src="img/' . ($data["online"] ? 'up' : 'down') . '.gif" alt="" />
                        </td>
                      </tr>';
                }
            } else {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "friendof") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                $output_temp .= '
                      <tr>
                        <td colspan="7">
                          <span>' . lang("char", "no_friend_of") . '</span>
                        </td>
                      </tr>';
            }
            $output_temp .= '
                      <tr>
                        <th colspan="7">&nbsp;</th>
                      </tr>';
            // get ignores
            if ($core == 1) {
                $result = $sql["char"]->query("SELECT name, race, class, mapid, zoneid, level, gender, online, acct, guid\r\n          FROM characters WHERE guid IN (SELECT ignore_guid FROM social_ignores WHERE character_guid='" . $id . "') ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            } else {
                $result = $sql["char"]->query("SELECT name, race, class, map AS mapid, zone AS zoneid, level, gender, online, account AS acct, guid\r\n          FROM characters WHERE guid IN (SELECT friend FROM character_social WHERE guid='" . $id . "' AND flags=2) ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            }
            if ($sql["char"]->num_rows($result)) {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "ignored") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                while ($data = $sql["char"]->fetch_assoc($result)) {
                    if ($core == 1) {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT login FROM accounts WHERE acct='" . $data["acct"] . "'"), 0, "gmlevel");
                    } else {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT username AS login FROM account WHERE id='" . $data["acct"] . "'"), 0, "login");
                    }
                    $char_gm_level = $sql["mgr"]->result($sql["mgr"]->query("SELECT SecurityLevel AS gmlevel FROM config_accounts WHERE Login='******'"), 0, "gmlevel");
                    $output_temp .= '
                      <tr>
                        <td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output_temp .= '
                          <a href="char.php?id=' . $data["guid"] . '">
                            <span>' . $data["name"] . '</span>
                          </a>';
                    } else {
                        $output_temp .= $data["name"];
                    }
                    $output_temp .= '
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["race"] . '-' . $data["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($data["race"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($data["class"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                          <span>' . char_get_level_color($data["level"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'MapID:' . $data["mapid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_map_name($data["mapid"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'ZoneID:' . $data["zoneid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_zone_name($data["zoneid"]) . '</span>
                        </td>
                        <td>
                          <img src="img/' . ($data["online"] ? 'up' : 'down') . '.gif" alt="" />
                        </td>
                      </tr>';
                }
            } else {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "ignored") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                $output_temp .= '
                      <tr>
                        <td colspan="7">
                          <span>' . lang("char", "no_ignores") . '</span>
                        </td>
                      </tr>';
            }
            $output_temp .= '
                      <tr>
                        <th colspan="7">&nbsp;</th>
                      </tr>';
            // get ignored by
            if ($core == 1) {
                $result = $sql["char"]->query("SELECT name, race, class, mapid, zoneid, level, gender, online, acct, guid\r\n          FROM characters WHERE guid IN (SELECT ignore_guid FROM social_ignores WHERE character_guid='" . $id . "') ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            } else {
                $result = $sql["char"]->query("SELECT name, race, class, map AS mapid, zone AS zoneid, level, gender, online, account AS acct, guid\r\n          FROM characters WHERE guid IN (SELECT guid FROM character_social WHERE friend='" . $id . "' AND flags=2) ORDER BY '" . $order_by . "' '" . $order_dir . "'");
            }
            if ($sql["char"]->num_rows($result)) {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "ignoredby") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                while ($data = $sql["char"]->fetch_assoc($result)) {
                    if ($core == 1) {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT login FROM accounts WHERE acct='" . $data["acct"] . "'"), 0, "gmlevel");
                    } else {
                        $char_owner = $sql["logon"]->result($sql["logon"]->query("SELECT username AS login FROM account WHERE id='" . $data["acct"] . "'"), 0, "login");
                    }
                    $char_gm_level = $sql["mgr"]->result($sql["mgr"]->query("SELECT SecurityLevel AS gmlevel FROM config_accounts WHERE Login='******'"), 0, "gmlevel");
                    $output_temp .= '
                      <tr>
                        <td>';
                    if ($user_lvl >= $char_gm_level) {
                        $output_temp .= '
                          <a href="char.php?id=' . $data["guid"] . '">
                            <span>' . $data["name"] . '</span>
                          </a>';
                    } else {
                        $output_temp .= $data["name"];
                    }
                    $output_temp .= '
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["race"] . '-' . $data["gender"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_race_name($data["race"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                          <img src="img/c_icons/' . $data["class"] . '.gif" onmousemove="oldtoolTip(\'' . char_get_class_name($data["class"]) . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()" alt="" />
                        </td>
                        <td>
                          <span>' . char_get_level_color($data["level"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'MapID:' . $data["mapid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_map_name($data["mapid"]) . '</span>
                        </td>
                        <td class="small">
                          <span onmousemove="oldtoolTip(\'ZoneID:' . $data["zoneid"] . '\', \'old_item_tooltip\')" onmouseout="oldtoolTip()">' . get_zone_name($data["zoneid"]) . '</span>
                        </td>
                        <td>
                          <img src="img/' . ($data["online"] ? 'up' : 'down') . '.gif" alt="" />
                        </td>
                      </tr>';
                }
            } else {
                $output_temp .= '
                      <tr>
                        <th colspan="7" class="center_text">
                          <span>' . lang("char", "ignoredby") . '</span>
                        </th>
                      </tr>';
                // append columns
                $output_temp .= $friends_columns;
                $output_temp .= '
                      <tr>
                        <td colspan="7">
                          <span>' . lang("char", "no_ignored_by") . '</span>
                        </td>
                      </tr>';
            }
            $output .= $output_temp;
            $output .= '
                    </table>
                  </td>';
            //---------------Page Specific Data Ends here----------------------------
            //---------------Character Tabs Footer-----------------------------------
            $output .= '
                </tr>
              </table>
            </div>
            <br />
            <table class="hidden center">
              <tr>
                <td>';
            // button to user account page, user account page has own security
            makebutton(lang("char", "chars_acc"), 'user.php?action=edit_user&amp;id=' . $owner_acc_id . '', 130);
            $output .= '
                </td>
                <td>';
            // only higher level GM with delete access can edit character
            //  character edit allows removal of character items, so delete permission is needed
            if ($user_lvl > $owner_gmlvl && $user_lvl >= $action_permission["delete"]) {
                //makebutton($lang_char["edit_button"], 'char_edit.php?id='.$id.'&amp;realm='.$realmid.'', 130);
                $output .= '
                </td>
                <td>';
            }
            // only higher level GM with delete access, or character owner can delete character
            if ($user_lvl > $owner_gmlvl && $user_lvl >= $action_permission["delete"] || $owner_name === $user_name) {
                makebutton(lang("char", "del_char"), 'char_list.php?action=del_char_form&amp;check%5B%5D=' . $id . '" type="wrn', 130);
                $output .= '
                </td>
                <td>';
            }
            // only GM with update permission can send mail, mail can send items, so update permission is needed
            if ($user_lvl >= $action_permission["update"]) {
                makebutton(lang("char", "send_mail"), 'mail.php?type=ingame_mail&amp;to=' . $char["name"] . '', 130);
                $output .= '
                </td>
                <td>';
            }
            makebutton(lang("global", "back"), 'javascript:window.history.back()" type="def', 130);
            $output .= '
                </td>
              </tr>
            </table>
            <br />
          <!-- end of char_friends.php -->';
        } else {
            error(lang("char", "no_permission"));
        }
    } else {
        error(lang("char", "no_char_found"));
    }
}
コード例 #29
0
ファイル: player_online.php プロジェクト: galathil/coolwow2
    $donnees2 = mysql_fetch_array($reponse2);
    $online = $donnees2['nombre'];
    mysql_close();
    echo "<b><a href=\"index.php?module=connectes&royaume=" . $donnees['id'] . "\">Il y a {$online} joueurs connectés sur :  " . $donnees['name'] . "</a></b><br>";
}
echo "<br />";
mysql_connect($characters[$royaume]['host'], $characters[$royaume]['user'], $characters[$royaume]['password']) or die(mysql_error());
mysql_select_db($characters[$royaume]['db']) or die(mysql_error());
if ($gm_visible_list == 1) {
    $reponse2 = mysql_query("SELECT c.guid,c.name,c.race,c.class,c.zone,c.map,c.gender,c.level,r.gmlevel,\n\t\tCAST( SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', " . (CHAR_DATA_OFFSET_ARENA_POINTS + 1) . "), ' ', -1) AS UNSIGNED) AS highest_rank,\n\t\tCAST( SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', " . (CHAR_DATA_OFFSET_GUILD_ID + 1) . "), ' ', -1) AS UNSIGNED) as GNAME\n\t\tFROM " . $characters[$royaume]['db'] . ".characters c LEFT OUTER JOIN " . $realmd['db'] . ".account r ON r.id=c.account\n\t\tWHERE c.online = 1");
} else {
    $reponse2 = mysql_query("SELECT c.guid,c.name,c.race,c.class,c.zone,c.map,c.gender,c.level,r.gmlevel,\n\t\tCAST( SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', " . (CHAR_DATA_OFFSET_ARENA_POINTS + 1) . "), ' ', -1) AS UNSIGNED) AS highest_rank,\n\t\tCAST( SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', " . (CHAR_DATA_OFFSET_GUILD_ID + 1) . "), ' ', -1) AS UNSIGNED) as GNAME\n\t\tFROM " . $characters[$royaume]['db'] . ".characters c LEFT OUTER JOIN " . $realmd['db'] . ".account r ON r.id=c.account\n\t\tWHERE c.online = 1 AND r.gmlevel = 0");
}
echo "\n\t<table class=\"lined\" style=\"border-collapse: collapse\"; width=\"99%\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\" class=\"sortable\">\n\t<tr>\n\t<th width=\"120\">" . $lang_player['name'] . "</th>\n\t<th width=\"30\">" . $lang_player['race'] . "</th>\n\t<th width=\"30\">" . $lang_player['class'] . "</th>\n\t<th width=\"30\">" . $lang_player['level'] . "</th>\n    <th width=\"30\">" . $lang_player['rank'] . "</th>\n\t<th width=\"30\">" . $lang_player['faction'] . "</th>\n\t<th width=\"200\">" . $lang_player['guilde'] . "</th>\n\t<th width=\"80\">" . $lang_player['map'] . "</th>\n\t<th width=\"250\">" . $lang_player['zone'] . "</th>\n\t</tr>";
$reponse5 = mysql_query("SELECT COUNT(*) AS nombre FROM characters WHERE online= 1") or die(mysql_error());
$donnees5 = mysql_fetch_array($reponse5);
$test_online = $donnees5['nombre'];
if ($test_online == 0) {
    echo "<tr><td colspan=\"9\">" . $lang_player['no_online'] . "</td></tr>";
} else {
    while ($char = mysql_fetch_array($reponse2)) {
        mysql_connect($characters[$royaume]['host'], $characters[$royaume]['user'], $characters[$royaume]['password']) or die(mysql_error());
        mysql_select_db($characters[$royaume]['db']) or die(mysql_error());
        $reponse4 = mysql_query("SELECT name FROM guild WHERE guildid=" . $char['GNAME'] . ";");
        $guild_name = mysql_fetch_row($reponse4);
        echo "\n\t\t\t<tr>\n\t\t\t\t<td align=\"center\"><a href=\"armurerie-select.php?perso=" . $char['name'] . "\">" . $char['name'] . "</a></td>\n\t\t\t\t<td align=\"center\"><img src='images/races/" . $char['race'] . "-" . $char['gender'] . ".gif' onmousemove='toolTip(\"" . get_player_race($char['race']) . "\",\"item_tooltip\")' onmouseout='toolTip()' /></td>\n\t\t\t\t<td align=\"center\"><img src='images/classes/" . $char['class'] . ".gif' onmousemove='toolTip(\"" . get_player_class($char['class']) . "\",\"item_tooltip\")' onmouseout='toolTip()' /></td>\n\t\t\t\t<td align=\"center\">" . $char['level'] . "</td>\n\t\t\t\t<td align=\"center\"><span onmouseover='toolTip(\"" . $CHAR_RANK[$CHAR_RACE[$char['race']][1]][pvp_ranks($char['highest_rank'])] . "\",\"item_tooltip\")' onmouseout='toolTip()' style='color: white;'><img src='images/ranks/rank" . pvp_ranks($char['highest_rank'], $CHAR_RACE[$char['race']][1]) . ".gif'></span></td>\n\t\t\t\t<td align=\"center\"><span onmousemove='toolTip(\"" . $CHAR_FACTION[$char['race']] . "\",\"item_tooltip\")' onmouseout='toolTip()'>";
        side($char['race']);
        echo "</span></td>\n\t\t\t\t<td align=\"center\"><a href=\"index.php?module=guildes&action=membres&id=" . $char['guid'] . "\">" . $guild_name[0] . "</a></td>\n\t\t\t\t<td align=\"center\">" . get_map_name($char['map']) . "</td>\n\t\t\t\t<td align=\"center\">" . get_zone_name($char['zone']) . "</td>\n\t\t\t</tr>";
    }
}
echo "</table><br />";
コード例 #30
0
ファイル: galleries.php プロジェクト: erico-deh/ocPortal
 /**
  * The UI to show a gallery.
  *
  * @return tempcode		The UI
  */
 function do_gallery()
 {
     require_code('images');
     $cat = get_param('id', 'root');
     $GLOBALS['FEED_URL'] = find_script('backend') . '?mode=galleries&filter=' . $cat;
     $root = get_param('root', 'root');
     if (!has_category_access(get_member(), 'galleries', $cat)) {
         access_denied('CATEGORY_ACCESS');
     }
     // Info on our gallery
     $gallery_rows = $GLOBALS['SITE_DB']->query_select('galleries', array('*'), array('name' => $cat), '', 1);
     $implied_existence = false;
     if (!array_key_exists(0, $gallery_rows)) {
         // Possibly we will 'imply' it's existence if this is a member gallery; allows normal rendering to finish, with add links
         $matches = array();
         if (preg_match('#^member\\_(\\d+)\\_(.*)$#', $cat, $matches) != 0) {
             $username = $GLOBALS['FORUM_DRIVER']->get_username(intval($matches[1]));
             if (!is_null($username)) {
                 $gallery_rows = $GLOBALS['SITE_DB']->query_select('galleries', array('*'), array('name' => $matches[2]), '', 1);
             }
         }
         if (!array_key_exists(0, $gallery_rows)) {
             return warn_screen(get_page_title('ERROR_OCCURRED'), do_lang_tempcode('MISSING_RESOURCE'));
         }
         $myrow = $gallery_rows[0];
         $myrow['is_member_synched'] = 0;
         $fullname = do_lang('PERSONAL_GALLERY_OF', $username, get_translated_text($myrow['fullname']));
         $myrow['parent_id'] = $matches[2];
         $implied_existence = true;
     } else {
         $myrow = $gallery_rows[0];
         $fullname = get_translated_text($myrow['fullname']);
     }
     if ($fullname == '') {
         $fullname = $cat;
     }
     $description = get_translated_tempcode($myrow['description']);
     if (has_actual_page_access(NULL, 'cms_galleries', NULL, NULL) && has_submit_permission('mid', get_member(), get_ip_address(), 'cms_galleries', array('galleries', $cat))) {
         $submit_cat = $myrow['is_member_synched'] == 1 ? 'member_' . strval(get_member()) . '_' . $cat : $cat;
         $submit_image_url = $myrow['accept_images'] == 0 ? new ocp_tempcode() : build_url(array('page' => 'cms_galleries', 'type' => 'ad', 'cat' => $submit_cat), get_module_zone('cms_galleries'));
         $submit_video_url = $myrow['accept_videos'] == 0 ? new ocp_tempcode() : build_url(array('page' => 'cms_galleries', 'type' => 'av', 'cat' => $submit_cat), get_module_zone('cms_galleries'));
     } else {
         $submit_image_url = new ocp_tempcode();
         $submit_video_url = new ocp_tempcode();
     }
     if (!$implied_existence && has_actual_page_access(NULL, 'cms_galleries', NULL, NULL) && has_edit_permission('cat_mid', get_member(), get_member_id_from_gallery_name($cat), 'cms_galleries', array('galleries', $cat))) {
         $edit_url = build_url(array('page' => 'cms_galleries', 'type' => '_ec', 'id' => $cat), get_module_zone('cms_galleries'));
     } else {
         $edit_url = new ocp_tempcode();
     }
     if (!$implied_existence && has_actual_page_access(NULL, 'cms_galleries', NULL, NULL) && has_submit_permission('cat_mid', get_member(), get_ip_address(), 'cms_galleries')) {
         $add_gallery_url = build_url(array('page' => 'cms_galleries', 'type' => 'ac', 'cat' => $cat), get_module_zone('cms_galleries'));
     } else {
         $add_gallery_url = new ocp_tempcode();
     }
     $may_download_gallery = has_specific_permission(get_member(), 'may_download_gallery', 'galleries', array('galleries', $cat));
     $tree = gallery_breadcrumbs($cat, $root, true, get_module_zone('galleries'));
     if (!$tree->is_empty()) {
         $tree->attach(do_template('BREADCRUMB_ESCAPED'));
     }
     if (has_specific_permission(get_member(), 'open_virtual_roots')) {
         $url = get_self_url(false, false, array('root' => $cat));
         $tree->attach(hyperlink($url, escape_html($fullname), false, false, do_lang_tempcode('VIRTUAL_ROOT')));
     } else {
         $tree->attach('<span>' . escape_html($fullname) . '</span>');
     }
     $myrow['flow_mode_interface'] = get_param_integer('flow_mode_interface', $myrow['flow_mode_interface']);
     // Allow override via URL
     // Flow mode puts emphasis on subgalleries, rather than entries; it is subgalleries that there are a lot of, rather than entries
     if ($myrow['flow_mode_interface'] == 1) {
         $max = get_param_integer('max', get_default_gallery_max());
         if ($max < 1) {
             $max = 1;
         }
         $start = get_param_integer('start', 0);
     } else {
         $max = NULL;
         $start = NULL;
     }
     // Subgalleries
     $order = 'add_date DESC';
     if (get_option('gallery_name_order') == '1') {
         $order = 'name ASC';
     }
     $rows_children = $GLOBALS['SITE_DB']->query_select('galleries', array('*'), array('parent_id' => $cat), 'ORDER BY ' . $order, 200);
     $children = new ocp_tempcode();
     $num_galleries = 0;
     if (count($rows_children) == 200) {
         $rows_children = array();
     }
     // Lots of personal galleries. Will need to be reached via member profiles
     foreach ($rows_children as $child) {
         if (substr($child['name'], 0, 9) == 'download_') {
             continue;
         }
         if (!has_category_access(get_member(), 'galleries', $child['name'])) {
             continue;
         }
         if (get_option('show_empty_galleries') == '1' || gallery_has_content($child['name'])) {
             if (is_null($max) || $num_galleries >= $start && $num_galleries < $start + $max) {
                 $content = show_gallery_box($child, $root, true, get_zone_name(), get_option('show_empty_galleries') != '1');
                 if (!$content->is_empty()) {
                     $children->attach(do_template('GALLERY_SUBGALLERY_WRAP', array('CONTENT' => $content)));
                 }
             }
             $num_galleries++;
         }
     }
     // Views
     if (get_db_type() != 'xml') {
         $myrow['gallery_views']++;
         $GLOBALS['SITE_DB']->query_update('galleries', array('gallery_views' => $myrow['gallery_views']), array('name' => $cat), '', 1, NULL, false, true);
     }
     // Page title
     if (addon_installed('awards')) {
         require_code('awards');
         $awards = find_awards_for('gallery', $cat);
     } else {
         $awards = array();
     }
     $title_to_use = do_lang_tempcode('_GALLERY', escape_html($fullname));
     $title_to_use_2 = do_lang('_GALLERY', $fullname);
     $title = get_page_title($title_to_use, false, NULL, NULL, $awards);
     seo_meta_load_for('gallery', $cat, $title_to_use_2);
     $rep_image = $myrow['rep_image'];
     if (post_param_integer('rating_' . $cat, -1) != -1) {
         decache('main_top_galleries');
     }
     list($rating_details, $comment_details, $trackback_details) = embed_feedback_systems(get_page_name(), $cat, $myrow['allow_rating'], $myrow['allow_comments'], 0, 1, NULL, build_url(array('page' => '_SELF'), '_SELF', NULL, true, false, true), $title_to_use_2, get_value('comment_forum__galleries'));
     breadcrumb_add_segment($tree);
     $GLOBALS['META_DATA'] += array('created' => date('Y-m-d', $myrow['add_date']), 'creator' => is_null($myrow['g_owner']) ? '' : $GLOBALS['FORUM_DRIVER']->get_username($myrow['g_owner']), 'publisher' => '', 'modified' => '', 'type' => 'Gallery', 'title' => $fullname, 'identifier' => '_SEARCH:galleries:misc:' . $cat, 'description' => get_translated_text($myrow['description']));
     if ($rep_image != '') {
         $GLOBALS['META_DATA'] += array('image' => (url_is_local($rep_image) ? get_custom_base_url() . '/' : '') . $rep_image);
     }
     // Sorting
     list($sort, $sort_backwards, $sql_suffix_images, $sql_suffix_videos) = $this->get_sort_order();
     if (get_option('is_on_rating') == '1') {
         $_selectors['compound_rating DESC'] = 'POPULARITY';
     }
     $_selectors = array_merge($_selectors, array('url ASC' => 'FILENAME', 'add_date ASC' => 'OLDEST_FIRST', 'add_date DESC' => 'NEWEST_FIRST', 'title ASC' => 'TITLE'));
     $selectors = new ocp_tempcode();
     foreach ($_selectors as $selector_value => $selector_name) {
         $selected = $sort == $selector_value;
         $selectors->attach(do_template('RESULTS_BROWSER_SORTER', array('SELECTED' => $selected, 'NAME' => do_lang_tempcode($selector_name), 'VALUE' => $selector_value)));
     }
     $sort_url = get_self_url(false, false, array('sort' => NULL), false, true);
     $sorting = do_template('RESULTS_BROWSER_SORT', array('SORT' => 'sort', 'RAND' => uniqid(''), 'URL' => $sort_url, 'SELECTORS' => $selectors));
     if ($myrow['flow_mode_interface'] == 1) {
         return $this->do_gallery_flow_mode($rating_details, $comment_details, $cat, $root, $description, $children, $may_download_gallery, $edit_url, $add_gallery_url, $submit_image_url, $submit_video_url, $title, $rep_image, $start, $max, $num_galleries, $fullname, $sorting);
     } else {
         return $this->do_gallery_regular_mode($rating_details, $comment_details, $cat, $root, $description, $children, $may_download_gallery, $edit_url, $add_gallery_url, $submit_image_url, $submit_video_url, $title, $fullname, $sorting);
     }
 }