idea: playermap, fixed wizard_spawn
2
mojotrollz/idea/playermap/config/.htaccess
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
order deny,allow
|
||||||
|
deny from all
|
||||||
12
mojotrollz/idea/playermap/config/config-protected.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
$realmd = array(
|
||||||
|
'db_type' => 'mysql',
|
||||||
|
'db_host' => '127.0.0.1',
|
||||||
|
'db_port' => '3306',
|
||||||
|
'db_username' => 'root',
|
||||||
|
'db_password' => 'ascent',
|
||||||
|
'db_name' => 'realmd',
|
||||||
|
'db_encoding' => 'utf8',
|
||||||
|
);
|
||||||
|
$project = "trinity";
|
||||||
|
?>
|
||||||
3
mojotrollz/idea/playermap/config/index.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
header("../index.php");
|
||||||
|
?>
|
||||||
63
mojotrollz/idea/playermap/config/playermap_config.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Player map configuration
|
||||||
|
$db_type = 'MySQL';
|
||||||
|
|
||||||
|
$realm_db['addr'] = '127.0.0.1:3306'; // SQL server IP:port this realmd located on
|
||||||
|
$realm_db['user'] = ''; // SQL server login this realmd located on
|
||||||
|
$realm_db['pass'] = ''; // SQL server pass this realmd located on
|
||||||
|
$realm_db['name'] = ''; // realmd DB name
|
||||||
|
$realm_db['encoding'] = 'utf8'; // SQL connection encoding
|
||||||
|
|
||||||
|
//==== For each realm, you must have $world_db and $characters_db and $server filled in, label each with the realm id: ex: $world_db[REALMID]['addr'] === //
|
||||||
|
|
||||||
|
// position in array must represent realmd ID
|
||||||
|
$world_db[1]['addr'] = '127.0.0.1:3306'; // SQL server IP:port this DB located on
|
||||||
|
$world_db[1]['user'] = ''; // SQL server login this DB located on
|
||||||
|
$world_db[1]['pass'] = ''; // SQL server pass this DB located on
|
||||||
|
$world_db[1]['name'] = ''; // World Database name, by default "mangos" for MaNGOS, "world" for Trinity
|
||||||
|
$world_db[1]['encoding'] = 'utf8'; // SQL connection encoding
|
||||||
|
|
||||||
|
// position in array must represent realmd ID
|
||||||
|
$characters_db[1]['addr'] = '127.0.0.1:3306'; // SQL server IP:port this DB located on
|
||||||
|
$characters_db[1]['user'] = ''; // SQL server login this DB located on
|
||||||
|
$characters_db[1]['pass'] = ''; // SQL server pass this DB located on
|
||||||
|
$characters_db[1]['name'] = ''; // Character Database name
|
||||||
|
$characters_db[1]['encoding'] = 'utf8'; // SQL connection encoding
|
||||||
|
|
||||||
|
//---- Game Server Configuration ----
|
||||||
|
|
||||||
|
$server_type = 1; // 0=MaNGOS, 1=Trinity
|
||||||
|
|
||||||
|
// position in array must represent realmd ID, same as in $world_db
|
||||||
|
$server[1]['addr'] = ''; // Game Server IP, as seen by MiniManager, from your webhost
|
||||||
|
$server[1]['addr_wan'] = ''; // Game Server IP, as seen by clients - Must be external address
|
||||||
|
$server[1]['game_port'] = 8085; // Game Server port
|
||||||
|
$server[1]['rev'] = ''; // MaNGOS rev. used (Trinity does not need this)
|
||||||
|
$server[1]['both_factions'] = true; // Allow to see opponent faction characters. Affects only players.
|
||||||
|
|
||||||
|
|
||||||
|
// === Player Map configuration === //
|
||||||
|
|
||||||
|
// GM online options
|
||||||
|
$map_gm_show_online_only_gmoff = 1; // show GM point only if in '.gm off' [1/0]
|
||||||
|
$map_gm_show_online_only_gmvisible = 1; // show GM point only if in '.gm visible on' [1/0]
|
||||||
|
$map_gm_add_suffix = 1; // add '{GM}' to name [1/0]
|
||||||
|
$map_status_gm_include_all = 1; // include 'all GMs in game'/'who on map' [1/0]
|
||||||
|
|
||||||
|
// status window options:
|
||||||
|
$map_show_status = 1; // show server status window [1/0]
|
||||||
|
$map_show_time = 1; // Show autoupdate timer 1 - on, 0 - off
|
||||||
|
$map_time = 5; // Map autoupdate time (seconds), 0 - not update.
|
||||||
|
|
||||||
|
// all times set in msec (do not set time < 1500 for show), 0 to disable.
|
||||||
|
$map_time_to_show_uptime = 3000; // time to show uptime string
|
||||||
|
$map_time_to_show_maxonline = 3000; // time to show max online
|
||||||
|
$map_time_to_show_gmonline = 3000; // time to show GM online
|
||||||
|
|
||||||
|
$developer_test_mode = false;
|
||||||
|
|
||||||
|
$multi_realm_mode = true;
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
169
mojotrollz/idea/playermap/func.php
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
class DBLayer
|
||||||
|
{
|
||||||
|
var $link_id;
|
||||||
|
var $query_result;
|
||||||
|
var $saved_queries = array();
|
||||||
|
var $num_queries = 0;
|
||||||
|
|
||||||
|
function DBLayer($db_host, $db_username, $db_password, $db_name)
|
||||||
|
{
|
||||||
|
$this->link_id = @mysql_connect($db_host, $db_username, $db_password, true);
|
||||||
|
|
||||||
|
if ($this->link_id)
|
||||||
|
{
|
||||||
|
if (@mysql_select_db($db_name, $this->link_id))
|
||||||
|
return $this->link_id;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//error('Unable to select database. MySQL reported: '.mysql_error());
|
||||||
|
$this->close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
//error('Unable to connect to MySQL server. MySQL reported: '.mysql_error());
|
||||||
|
|
||||||
|
$this->link_id = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isValid()
|
||||||
|
{
|
||||||
|
return $this->link_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
function query($sql)
|
||||||
|
{
|
||||||
|
if(!$this->link_id)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$this->query_result = @mysql_query($sql, $this->link_id);
|
||||||
|
|
||||||
|
if ($this->query_result)
|
||||||
|
{
|
||||||
|
++$this->num_queries;
|
||||||
|
return $this->query_result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function result($query_id = 0, $row = 0)
|
||||||
|
{
|
||||||
|
return ($query_id) ? @mysql_result($query_id, $row) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function fetch_assoc($query_id = 0)
|
||||||
|
{
|
||||||
|
return ($query_id) ? @mysql_fetch_assoc($query_id) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function fetch_row($query_id = 0)
|
||||||
|
{
|
||||||
|
return ($query_id) ? @mysql_fetch_row($query_id) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function num_rows($query_id = 0)
|
||||||
|
{
|
||||||
|
return ($query_id) ? @mysql_num_rows($query_id) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function affected_rows()
|
||||||
|
{
|
||||||
|
return ($this->link_id) ? @mysql_affected_rows($this->link_id) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function insert_id()
|
||||||
|
{
|
||||||
|
return ($this->link_id) ? @mysql_insert_id($this->link_id) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_num_queries()
|
||||||
|
{
|
||||||
|
return $this->num_queries;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_saved_queries()
|
||||||
|
{
|
||||||
|
return $this->saved_queries;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function free_result($query_id = false)
|
||||||
|
{
|
||||||
|
return ($query_id) ? @mysql_free_result($query_id) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function escape($str)
|
||||||
|
{
|
||||||
|
if (function_exists('mysql_real_escape_string'))
|
||||||
|
return mysql_real_escape_string($str, $this->link_id);
|
||||||
|
else
|
||||||
|
return mysql_escape_string($str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function error()
|
||||||
|
{
|
||||||
|
$result['error_sql'] = @current(@end($this->saved_queries));
|
||||||
|
$result['error_no'] = $this->link_id ? @mysql_errno($this->link_id) : @mysql_errno();
|
||||||
|
$result['error_msg'] = $this->link_id ? @mysql_error($this->link_id) : @mysql_error();
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function close()
|
||||||
|
{
|
||||||
|
if ($this->link_id)
|
||||||
|
{
|
||||||
|
if ($this->query_result)
|
||||||
|
@mysql_free_result($this->query_result);
|
||||||
|
|
||||||
|
return @mysql_close($this->link_id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function error($message)
|
||||||
|
{
|
||||||
|
$s = 'Error: <strong>'.$message.'.</strong>';
|
||||||
|
echo $s;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sort_players($a, $b)
|
||||||
|
{
|
||||||
|
if($a['leaderGuid'] == $b['leaderGuid'])
|
||||||
|
return strcmp($a['name'],$b['name']);
|
||||||
|
return ($a['leaderGuid'] < $b['leaderGuid']) ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_zone_name($zone_id)
|
||||||
|
{
|
||||||
|
global $zones;
|
||||||
|
$zname = 'Unknown zone';
|
||||||
|
if(isset($zones[$zone_id])) {
|
||||||
|
$zname = $zones[$zone_id];
|
||||||
|
}
|
||||||
|
return $zname;
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_realm(){
|
||||||
|
//return true; //always run
|
||||||
|
global $server, $port;
|
||||||
|
$s = @fsockopen("$server", $port, $ERROR_NO, $ERROR_STR,(float)0.5);
|
||||||
|
if($s){@fclose($s);return true;} else return false;
|
||||||
|
}
|
||||||
|
?>
|
||||||
BIN
mojotrollz/idea/playermap/img/c_icons/1-0.gif
Normal file
|
After Width: | Height: | Size: 363 B |
BIN
mojotrollz/idea/playermap/img/c_icons/1-1.gif
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
mojotrollz/idea/playermap/img/c_icons/1.gif
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
mojotrollz/idea/playermap/img/c_icons/10-0.gif
Normal file
|
After Width: | Height: | Size: 740 B |
BIN
mojotrollz/idea/playermap/img/c_icons/10-1.gif
Normal file
|
After Width: | Height: | Size: 739 B |
BIN
mojotrollz/idea/playermap/img/c_icons/11-0.gif
Normal file
|
After Width: | Height: | Size: 739 B |
BIN
mojotrollz/idea/playermap/img/c_icons/11-1.gif
Normal file
|
After Width: | Height: | Size: 731 B |
BIN
mojotrollz/idea/playermap/img/c_icons/11.gif
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
mojotrollz/idea/playermap/img/c_icons/2-0.gif
Normal file
|
After Width: | Height: | Size: 347 B |
BIN
mojotrollz/idea/playermap/img/c_icons/2-1.gif
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
mojotrollz/idea/playermap/img/c_icons/2.gif
Normal file
|
After Width: | Height: | Size: 370 B |
BIN
mojotrollz/idea/playermap/img/c_icons/3-0.gif
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
mojotrollz/idea/playermap/img/c_icons/3-1.gif
Normal file
|
After Width: | Height: | Size: 330 B |
BIN
mojotrollz/idea/playermap/img/c_icons/3.gif
Normal file
|
After Width: | Height: | Size: 301 B |
BIN
mojotrollz/idea/playermap/img/c_icons/4-0.gif
Normal file
|
After Width: | Height: | Size: 352 B |
BIN
mojotrollz/idea/playermap/img/c_icons/4-1.gif
Normal file
|
After Width: | Height: | Size: 371 B |
BIN
mojotrollz/idea/playermap/img/c_icons/4.gif
Normal file
|
After Width: | Height: | Size: 344 B |
BIN
mojotrollz/idea/playermap/img/c_icons/5-0.gif
Normal file
|
After Width: | Height: | Size: 365 B |
BIN
mojotrollz/idea/playermap/img/c_icons/5-1.gif
Normal file
|
After Width: | Height: | Size: 362 B |
BIN
mojotrollz/idea/playermap/img/c_icons/5.gif
Normal file
|
After Width: | Height: | Size: 332 B |
BIN
mojotrollz/idea/playermap/img/c_icons/6-0.gif
Normal file
|
After Width: | Height: | Size: 378 B |
BIN
mojotrollz/idea/playermap/img/c_icons/6-1.gif
Normal file
|
After Width: | Height: | Size: 352 B |
BIN
mojotrollz/idea/playermap/img/c_icons/6.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mojotrollz/idea/playermap/img/c_icons/7-0.gif
Normal file
|
After Width: | Height: | Size: 373 B |
BIN
mojotrollz/idea/playermap/img/c_icons/7-1.gif
Normal file
|
After Width: | Height: | Size: 346 B |
BIN
mojotrollz/idea/playermap/img/c_icons/7.gif
Normal file
|
After Width: | Height: | Size: 355 B |
BIN
mojotrollz/idea/playermap/img/c_icons/8-0.gif
Normal file
|
After Width: | Height: | Size: 360 B |
BIN
mojotrollz/idea/playermap/img/c_icons/8-1.gif
Normal file
|
After Width: | Height: | Size: 373 B |
BIN
mojotrollz/idea/playermap/img/c_icons/8.gif
Normal file
|
After Width: | Height: | Size: 342 B |
BIN
mojotrollz/idea/playermap/img/c_icons/9.gif
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
mojotrollz/idea/playermap/img/c_icons/Thumbs.db
Normal file
9
mojotrollz/idea/playermap/img/c_icons/index.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta http-equiv="refresh" content="0; URL=../">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
ErroR <a href="../">here</a>.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
mojotrollz/idea/playermap/img/map/Thumbs.db
Normal file
BIN
mojotrollz/idea/playermap/img/map/allia.gif
Normal file
|
After Width: | Height: | Size: 60 B |
BIN
mojotrollz/idea/playermap/img/map/allianceicon.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mojotrollz/idea/playermap/img/map/azeroth.jpg
Normal file
|
After Width: | Height: | Size: 121 KiB |
BIN
mojotrollz/idea/playermap/img/map/dead.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mojotrollz/idea/playermap/img/map/group-icon.gif
Normal file
|
After Width: | Height: | Size: 60 B |
BIN
mojotrollz/idea/playermap/img/map/horde.gif
Normal file
|
After Width: | Height: | Size: 60 B |
BIN
mojotrollz/idea/playermap/img/map/hordeicon.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
9
mojotrollz/idea/playermap/img/map/index.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta http-equiv="refresh" content="0; URL=../">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
ErroR <a href="../">here</a>.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
mojotrollz/idea/playermap/img/map/inst-icon - Copy.gif
Normal file
|
After Width: | Height: | Size: 881 B |
BIN
mojotrollz/idea/playermap/img/map/inst-icon.gif
Normal file
|
After Width: | Height: | Size: 881 B |
BIN
mojotrollz/idea/playermap/img/map/northrend.jpg
Normal file
|
After Width: | Height: | Size: 112 KiB |
BIN
mojotrollz/idea/playermap/img/map/outland.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
mojotrollz/idea/playermap/img/map/realm_off.gif
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
mojotrollz/idea/playermap/img/map/realm_on.gif
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
mojotrollz/idea/playermap/img/map/status.gif
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
925
mojotrollz/idea/playermap/index.php
Normal file
@ -0,0 +1,925 @@
|
|||||||
|
<?php
|
||||||
|
require_once("pomm_conf.php");
|
||||||
|
require_once("func.php");
|
||||||
|
require_once("map_english.php");
|
||||||
|
|
||||||
|
?>
|
||||||
|
<HTML><HEAD><title>Online Playermap by Lasoto</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<style type="text/css">
|
||||||
|
<!--
|
||||||
|
body {
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
color: #EABA28;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
#world {
|
||||||
|
position: absolute;
|
||||||
|
height: 732px;
|
||||||
|
width: 966px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -483px;
|
||||||
|
background-image: url(<?php echo $img_base ?>azeroth.jpg);
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
#outland {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
height: 732px;
|
||||||
|
width: 966px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -483px;
|
||||||
|
background-image: url(<?php echo $img_base ?>outland.jpg);
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
#northrend {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
height: 732px;
|
||||||
|
width: 966px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -483px;
|
||||||
|
background-image: url(<?php echo $img_base ?>northrend.jpg);
|
||||||
|
z-index: 8;
|
||||||
|
}
|
||||||
|
#pointsOldworld {
|
||||||
|
position: absolute;
|
||||||
|
height: 732px;
|
||||||
|
width: 966px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -483px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
#pointsOutland {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
height: 732px;
|
||||||
|
width: 966px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -483px;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
#pointsNorthrend {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
height: 732px;
|
||||||
|
width: 966px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -483px;
|
||||||
|
z-index: 98;
|
||||||
|
}
|
||||||
|
#wow {
|
||||||
|
position: absolute;
|
||||||
|
height: 98px;
|
||||||
|
width: 200px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -483px;
|
||||||
|
z-index: 101;
|
||||||
|
text-align: center;
|
||||||
|
clear: none;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
#info {
|
||||||
|
position: absolute;
|
||||||
|
height: 16px;
|
||||||
|
width: 40px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -20px;
|
||||||
|
z-index: 102;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#info_bottom {
|
||||||
|
position: absolute;
|
||||||
|
height: 20px;
|
||||||
|
width: 966px;
|
||||||
|
left: 50%;
|
||||||
|
margin-top: 711px;
|
||||||
|
margin-left: -483px;
|
||||||
|
z-index: 101;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#timer {
|
||||||
|
font-family: arial;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #E7CF07;
|
||||||
|
filter: Glow(Color=#000099, Strength=3);
|
||||||
|
}
|
||||||
|
#server_info {
|
||||||
|
font-family: Georgia, "Times New Roman", Times, serif;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: italic;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #FFFF99;
|
||||||
|
filter: Glow(Color=0, Strength=3);
|
||||||
|
}
|
||||||
|
#serverstatus {
|
||||||
|
visibility: <?php echo $show_status ? 'visible' : 'hidden'?>;
|
||||||
|
position: absolute;
|
||||||
|
height: 36px;
|
||||||
|
width: 156px;
|
||||||
|
margin-left: -78px;
|
||||||
|
left: 50%;
|
||||||
|
top: 97px;
|
||||||
|
text-align: center;
|
||||||
|
z-index: 101;
|
||||||
|
}
|
||||||
|
#tip {
|
||||||
|
border: 0px solid #aaaaaa;
|
||||||
|
left: -1000px;
|
||||||
|
padding: 0px;
|
||||||
|
position: absolute;
|
||||||
|
top: -1000px;
|
||||||
|
z-index: 150;
|
||||||
|
}
|
||||||
|
.statustext {
|
||||||
|
font-weight: normal;
|
||||||
|
color: #EABA28;
|
||||||
|
font-family: verdana, arial, sans-serif, helvetica;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0px;
|
||||||
|
background-image: url(<?php echo $img_base ?>status.gif);
|
||||||
|
}
|
||||||
|
.tip_header {
|
||||||
|
background: #bb0000;
|
||||||
|
FONT-WEIGHT: bold;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: arial, helvetica, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
.tip_head_text {
|
||||||
|
background: rgb(50,50,50);
|
||||||
|
FONT-WEIGHT: bold;
|
||||||
|
color: #DDDD33;
|
||||||
|
font-family: arial, helvetica, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
.tip_text {
|
||||||
|
background: #000000;
|
||||||
|
FONT-WEIGHT: normal;
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: arial, helvetica, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
.tip_worldinfo {
|
||||||
|
FONT-WEIGHT: normal;
|
||||||
|
color: #FFFF99;
|
||||||
|
font-family: Georgia, arial, helvetica, sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: normal;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
-->
|
||||||
|
</style>
|
||||||
|
</HEAD>
|
||||||
|
<script TYPE="text/javascript" src="libs/js/JsHttpRequest/Js.js"></script>
|
||||||
|
<SCRIPT TYPE="text/javascript">
|
||||||
|
|
||||||
|
var current_map = 0;
|
||||||
|
var time = <?php echo $time ?>;
|
||||||
|
var show_time=<?php echo $show_time ?>;
|
||||||
|
var show_status=<?php echo $show_status ?>;
|
||||||
|
var maps_count = <?php echo count($lang_defs['maps_names']); ?>;
|
||||||
|
var maps_array = new Array(<?php echo $maps_for_points ?>);
|
||||||
|
var maps_name_array = new Array(<?php echo "'".implode("','", $lang_defs['maps_names'])."'" ?>);
|
||||||
|
|
||||||
|
var race_name = {<?php echo "0:''"; foreach($character_race as $id => $race) echo(", ".$id.":'".$race."'"); ?>}
|
||||||
|
|
||||||
|
var class_name = {<?php echo "0:''"; foreach($character_class as $id => $class) echo(", ".$id.":'".$class."'"); ?>}
|
||||||
|
|
||||||
|
var instances_x = new Array();
|
||||||
|
var instances_y = new Array();
|
||||||
|
|
||||||
|
instances_x[0] = {
|
||||||
|
2:0,13:0,17:0,30:762,33:712,34:732,35:732,36:712,37:0,43:245,44:0,47:238,48:172,70:833,90:738,
|
||||||
|
109:849,129:254,150:0,169:0,189:773,209:269,229:782,230:778,249:290,269:315,289:816,309:782,329:834,
|
||||||
|
349:123,369:745,389:308,409:783,429:164,449:741,450:305,451:0,469:778,489:244,509:160,529:820,531:144,532:798,534:317,560:320,568:897,572:750,580:868,585:883,595:322,618:313
|
||||||
|
}
|
||||||
|
|
||||||
|
instances_y[0] = {
|
||||||
|
2:0,13:0,17:0,30:278,33:295,34:511,35:503,36:567,37:0,43:419,44:0,47:508,48:291,70:443,90:419,
|
||||||
|
109:551,129:516,150:0,169:0,189:216,209:568,229:481,230:484,249:514,269:601,289:258,309:589,329:203,
|
||||||
|
349:432,369:497,389:352,409:484,429:496,449:508,450:352,451:0,469:480,489:364,509:607,529:321,531:603,532:569,534:596,560:606,568:172,572:245,580:26,585:16,595:601,618:348
|
||||||
|
}
|
||||||
|
|
||||||
|
instances_x[1] = { 540:593,542:586,543:593,544:588,545:393,546:399,547:388,548:399,550:683,552:680,553:672,554:669,555:495,556:506,557:495,558:483,559:408,562:443,564:740,565:485 }
|
||||||
|
instances_y[1] = { 540:399,542:398,543:405,544:402,545:355,546:350,547:353,548:357,550:226,552:215,553:210,554:239,555:569,556:557,557:545,558:557,559:489,562:239,564:567,565:204 }
|
||||||
|
instances_x[2] = { 533:568,574:749,575:751,576:161,578:159,599:553,600:605,601:395,602:575,603:559,604:740,608:470,615:491,616:155,617:457,619:400,624:363 }
|
||||||
|
instances_y[2] = { 533:456,574:577,575:583,576:443,578:451,599:195,600:406,601:462,602:180,603:169,604:292,608:360,615:461,616:447,617:352,619:462,624:369 }
|
||||||
|
|
||||||
|
var fade_colors = Array('C6B711','BDAF10','B7A910','B1A40F','AB9E0F','A4980E','9E920E','988C0D','92870D','8B800C','857B0B','7F750B','79700A','746B0A','6E6609','686009','625B08','5C5508','564F07','504A07','4A4406','443F05','3E3905','383404','312D04','2A2703','232002','1C1A02','141201','000000');
|
||||||
|
var fade_cur_color = fade_colors.length-1;
|
||||||
|
var status_text = Array('OffLine','DB connect error','uptime','max online','GM online');
|
||||||
|
var status_data = Array(1,0,0,0);
|
||||||
|
var status_process = Array();
|
||||||
|
var status_cur_time = 0;
|
||||||
|
var status_next_process = 0;
|
||||||
|
var statusUpdateInterval = 50;
|
||||||
|
var pointx;
|
||||||
|
var pointy;
|
||||||
|
|
||||||
|
function _status_action(text,status_data,text_type,action,time)
|
||||||
|
{
|
||||||
|
this.text_id = text;
|
||||||
|
this.status_data = status_data;
|
||||||
|
this.text_type = text_type;
|
||||||
|
this.action = action;
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _coord()
|
||||||
|
{
|
||||||
|
this.x = 0;
|
||||||
|
this.y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _points() {
|
||||||
|
this.map_id = 0;
|
||||||
|
this.x = 0;
|
||||||
|
this.y = 0;
|
||||||
|
this.name = "";
|
||||||
|
this.zone = "";
|
||||||
|
this.faction = 0;
|
||||||
|
this.single_text = "";
|
||||||
|
this.multi_text = "";
|
||||||
|
this.player = 0;
|
||||||
|
this.Extention = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _multi_text() {
|
||||||
|
this.current = 0;
|
||||||
|
this.next = 0;
|
||||||
|
this.first_members = Array();
|
||||||
|
this.text = Array();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _pos() {
|
||||||
|
this.x = 0;
|
||||||
|
this.y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBodyScrollTop()
|
||||||
|
{
|
||||||
|
return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBodyScrollLeft()
|
||||||
|
{
|
||||||
|
return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_tipxy(tip_width, tip_height, x1, y1)
|
||||||
|
{
|
||||||
|
tipxy = new _coord();
|
||||||
|
tipxy.x = 5;
|
||||||
|
tipxy.y = 5;
|
||||||
|
if(document.layers)
|
||||||
|
{
|
||||||
|
wd = innerWidth;
|
||||||
|
ht = innerHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wd = document.body.clientWidth;
|
||||||
|
ht = document.body.clientHeight;
|
||||||
|
}
|
||||||
|
if(x1+tip_width+15 < wd)
|
||||||
|
tipxy.x = x1+15;
|
||||||
|
else if(x1-tip_width-15 > 0)
|
||||||
|
tipxy.x = x1-tip_width-15;
|
||||||
|
else
|
||||||
|
tipxy.x = wd/2-tip_width/2;
|
||||||
|
if(y1+tip_height-5 < ht)
|
||||||
|
tipxy.y = y1-5;
|
||||||
|
else if(ht-tip_height-5 > 0)
|
||||||
|
tipxy.y = ht-tip_height-5;
|
||||||
|
else
|
||||||
|
tipxy.y = 5;
|
||||||
|
//tipxy.x += getBodyScrollLeft();
|
||||||
|
//tipxy.y += getBodyScrollTop();
|
||||||
|
return tipxy;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMultiText(multitext, onClick)
|
||||||
|
{
|
||||||
|
if(onClick)
|
||||||
|
{
|
||||||
|
multitext.current = multitext.next;
|
||||||
|
}
|
||||||
|
if(document.layers)
|
||||||
|
{
|
||||||
|
ht = innerHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ht = document.body.clientHeight;
|
||||||
|
}
|
||||||
|
var length = multitext.text.length - multitext.current;
|
||||||
|
count = length;
|
||||||
|
if((20+length*22) > ht*0.8)
|
||||||
|
{
|
||||||
|
count = Math.round((ht*0.8 - 20)/22);
|
||||||
|
multitext.next = multitext.current + count;
|
||||||
|
if(multitext.next == multitext.text.length)
|
||||||
|
multitext.next = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
multitext.next = 0;
|
||||||
|
var data = '';
|
||||||
|
var i = 0;
|
||||||
|
while(i < count)
|
||||||
|
{
|
||||||
|
if(in_array(multitext.current + i, multitext.first_members))
|
||||||
|
group_line = '<tr\><td colspan=\'7\' bgcolor=\'#11FF99\' height=\'1px\'\></td\></tr\>';
|
||||||
|
else
|
||||||
|
group_line = '';
|
||||||
|
data += group_line + '<tr class=\'tip_text\'><td align=\'left\'\> '+eval(multitext.current + i + 1)+' </td\>'+multitext.text[multitext.current + i]+'</tr\>';
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if(multitext.next > multitext.current)
|
||||||
|
data += '<tr class=\'tip_text\'><td align=\'right\' colspan=\'7\'\>>>> <?php echo $lang_defs['click_to_next'];?> >>> </td\></tr\>';
|
||||||
|
else if(multitext.current > 0)
|
||||||
|
data += '<tr class=\'tip_text\'><td align=\'left\' colspan=\'7\'\> <<< <?php echo $lang_defs['click_to_first'];?> <<<</td\></tr\>';
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function tip(object, type, onClick)
|
||||||
|
{
|
||||||
|
var t, data;
|
||||||
|
var tipxy;
|
||||||
|
t=document.getElementById("tip");
|
||||||
|
if(window.opera)
|
||||||
|
{
|
||||||
|
pointx = window.event.clientX;
|
||||||
|
pointy = window.event.clientY;
|
||||||
|
}
|
||||||
|
else if(navigator.appName != "Netscape")
|
||||||
|
{
|
||||||
|
pointx = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
|
||||||
|
pointy = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
|
||||||
|
}
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case 2:
|
||||||
|
tipxy = new _coord();
|
||||||
|
tipxy.x = pointx+15;
|
||||||
|
tipxy.y = pointy-60;
|
||||||
|
t.innerHTML='<table width="120" border="0" cellspacing="0" cellpadding="0" class=\'tip_worldinfo\'\>'+object+'</table\>';
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if(onClick || t.innerHTML == '')
|
||||||
|
{
|
||||||
|
data = getMultiText(object.multi_text, onClick);
|
||||||
|
t.innerHTML='<table border=\'0\' cellspacing=\'0\' cellpadding=\'0\'\><tr class=\'tip_header\'\><td colspan=\'7\'\>'+object.zone+'</td\></tr\><tr class=\'tip_head_text\'\><td align=\'center\'\>#</td\><td\> <?php echo $lang_defs['name'];?></td\><td width=\'25\' align=\'center\'\><?php echo $lang_defs['level'];?></td\><td colspan=\'2\'\><?php echo $lang_defs['race'];?></td\><td colspan=\'2\'\> <?php echo $lang_defs['class'];?></td\></tr\>'+data+'<\/table\>';
|
||||||
|
}
|
||||||
|
tipxy = get_tipxy(t.offsetWidth, t.offsetHeight, pointx, pointy);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
if(object.faction) {color='#D2321E';}
|
||||||
|
else {color='#0096BE';}
|
||||||
|
t.innerHTML='<table width=\'100\' border=\'0\' cellspacing=\'0\' cellpadding=\'0\'\><tr class=\'tip_text\'\><td\> '+object.name+' </td\></tr\><tr bgcolor=\''+color+'\'\><td height=\'1px\'\></td\></tr\><tr\><td\><table width=100% border=\'0\' cellspacing=\'0\' cellpadding=\'3\'\><tr class=\'tip_text\'\><td\>'+object.single_text+'</td\></tr\><\/table\></td\></tr\><\/table\>';
|
||||||
|
tipxy = get_tipxy(t.offsetWidth, t.offsetHeight, pointx, pointy);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
t.style.left=tipxy.x + "px";
|
||||||
|
t.style.top=tipxy.y + "px";
|
||||||
|
}
|
||||||
|
|
||||||
|
function h_tip() {
|
||||||
|
var t;
|
||||||
|
t=document.getElementById("tip");
|
||||||
|
t.innerHTML="";
|
||||||
|
t.style.left="-1000px";
|
||||||
|
t.style.top="-1000px";
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_player_position(x,y,m)
|
||||||
|
{
|
||||||
|
pos = new _pos();
|
||||||
|
where_530 = 0;
|
||||||
|
x = Math.round(x);
|
||||||
|
y = Math.round(y);
|
||||||
|
if(m == 530) {
|
||||||
|
if(y < -1000 && y > -10000 && x > 5000) { //BE
|
||||||
|
x=x-10349; y=y+6357; where_530 = 1;
|
||||||
|
}
|
||||||
|
else if(y < -7000 && x < 0) { //Dr
|
||||||
|
x=x+3961; y=y+13931; where_530 = 2;
|
||||||
|
}
|
||||||
|
else { //Outland
|
||||||
|
x=x-3070; y=y-1265; where_530 = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(m == 609) {
|
||||||
|
x=x-2355; y=y+5662;
|
||||||
|
}
|
||||||
|
if(where_530 == 3) { //Outland
|
||||||
|
xpos = Math.round(x * 0.051446);
|
||||||
|
ypos = Math.round(y * 0.051446);
|
||||||
|
}
|
||||||
|
else if(m == 571) { //Northrend
|
||||||
|
xpos = Math.round(x * 0.050085);
|
||||||
|
ypos = Math.round(y * 0.050085);
|
||||||
|
}
|
||||||
|
else { //Azeroth
|
||||||
|
xpos = Math.round(x * 0.025140);
|
||||||
|
ypos = Math.round(y * 0.025140);
|
||||||
|
}
|
||||||
|
switch (m) {
|
||||||
|
case '530':
|
||||||
|
if(where_530 == 1) {
|
||||||
|
pos.x = 858 - ypos; pos.y = 84 - xpos;
|
||||||
|
}
|
||||||
|
else if(where_530 == 2) {
|
||||||
|
pos.x = 103 - ypos; pos.y = 261 - xpos;
|
||||||
|
}
|
||||||
|
else if(where_530 == 3) {
|
||||||
|
pos.x = 684 - ypos; pos.y = 229 - xpos;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '571':
|
||||||
|
pos.x = 505 - ypos;
|
||||||
|
pos.y = 642 - xpos;
|
||||||
|
break;
|
||||||
|
case '609':
|
||||||
|
pos.x = 896 - ypos;
|
||||||
|
pos.y = 232 - xpos;
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
pos.x = 194 - ypos;
|
||||||
|
pos.y = 398 - xpos;
|
||||||
|
break;
|
||||||
|
case '0':
|
||||||
|
pos.x = 752 - ypos;
|
||||||
|
pos.y = 291 - xpos;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pos.x = 194 - ypos;
|
||||||
|
pos.y = 398 - xpos;
|
||||||
|
}
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
function in_array(value, arr)
|
||||||
|
{
|
||||||
|
var i = 0;
|
||||||
|
while (i < arr.length)
|
||||||
|
{
|
||||||
|
if(value == arr[i])
|
||||||
|
return true;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMapLayerByID(id)
|
||||||
|
{
|
||||||
|
switch(id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return document.getElementById("world"); break;
|
||||||
|
case 1:
|
||||||
|
return document.getElementById("outland"); break;
|
||||||
|
case 2:
|
||||||
|
return document.getElementById("northrend"); break;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPointsLayerByID(id)
|
||||||
|
{
|
||||||
|
switch(id)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return document.getElementById("pointsOldworld"); break;
|
||||||
|
case 1:
|
||||||
|
return document.getElementById("pointsOutland"); break;
|
||||||
|
case 2:
|
||||||
|
return document.getElementById("pointsNorthrend"); break;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function switchworld(n)
|
||||||
|
{
|
||||||
|
for(var i = 0; i < maps_count; i++)
|
||||||
|
{
|
||||||
|
obj_map_layer = getMapLayerByID(i);
|
||||||
|
obj_points_layer = getPointsLayerByID(i);
|
||||||
|
|
||||||
|
if(i == n)
|
||||||
|
{
|
||||||
|
obj_map_layer.style.visibility = "visible";
|
||||||
|
obj_points_layer.style.visibility = "visible";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj_map_layer.style.visibility = "hidden";
|
||||||
|
obj_points_layer.style.visibility = "hidden";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function show(data)
|
||||||
|
{
|
||||||
|
if(!data)
|
||||||
|
{
|
||||||
|
var object;
|
||||||
|
for(var i = 0; i < maps_count; i++)
|
||||||
|
{
|
||||||
|
object = getPointsLayerByID(i);
|
||||||
|
object.innerHTML = '';
|
||||||
|
}
|
||||||
|
document.getElementById("server_info").innerHTML = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mpoints = new Array();
|
||||||
|
instances = new Array();
|
||||||
|
groups = new Array();
|
||||||
|
single = new Array();
|
||||||
|
points_layer = new Array();
|
||||||
|
alliance_count = new Array();
|
||||||
|
horde_count = new Array();
|
||||||
|
|
||||||
|
for(var i = 0; i < maps_count; i++)
|
||||||
|
{
|
||||||
|
instances[i] = '';
|
||||||
|
groups[i] = '';
|
||||||
|
single[i] = '';
|
||||||
|
alliance_count[i] = eval(data[i][0]);
|
||||||
|
horde_count[i] = eval(data[i][1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
point_count=0;
|
||||||
|
var ht;
|
||||||
|
if(document.layers)
|
||||||
|
{
|
||||||
|
ht = innerHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ht = document.body.clientHeight;
|
||||||
|
}
|
||||||
|
group_line = '';
|
||||||
|
i = maps_count;
|
||||||
|
|
||||||
|
while (i < data.length)
|
||||||
|
{
|
||||||
|
if (data[i].race==2 || data[i].race==5 || data[i].race==6 || data[i].race==8 || data[i].race==10)
|
||||||
|
{
|
||||||
|
faction = 1;
|
||||||
|
text_col='#D2321E';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
faction = 0;
|
||||||
|
text_col='#0096BE';
|
||||||
|
}
|
||||||
|
if(data[i].dead == 1)
|
||||||
|
char = '<img src=\'<?php echo $img_base ?>dead.gif\' style=\'float:center\' border=0 width=18 height=18\>';
|
||||||
|
else
|
||||||
|
char = '<img src=\'<?php echo $img_base2 ?>'+data[i].race+'-'+data[i].gender+'.gif\' style=\'float:center\' border=0 width=18 height=18\>';
|
||||||
|
n=0;
|
||||||
|
if(in_array(data[i].map, maps_array))
|
||||||
|
{
|
||||||
|
pos = get_player_position(data[i].x,data[i].y,data[i].map);
|
||||||
|
while(n != point_count)
|
||||||
|
{
|
||||||
|
if(data[i].map == mpoints[n].map_id && Math.sqrt(Math.pow(pos.x-mpoints[n].x,2)+Math.pow(pos.y-mpoints[n].y,2)) < 3)
|
||||||
|
break;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while(n != point_count)
|
||||||
|
{
|
||||||
|
if(mpoints[n].map_id == data[i].map)
|
||||||
|
break;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(n == point_count)
|
||||||
|
{
|
||||||
|
mpoints[n] = new _points();
|
||||||
|
mpoints[point_count].map_id = data[i].map;
|
||||||
|
mpoints[point_count].name = data[i].name;
|
||||||
|
mpoints[point_count].zone = data[i].zone;
|
||||||
|
mpoints[point_count].player = 1;
|
||||||
|
mpoints[point_count].Extention = eval(data[i].Extention);
|
||||||
|
if(in_array(data[i].map, maps_array))
|
||||||
|
{
|
||||||
|
mpoints[n].faction = faction;
|
||||||
|
mpoints[point_count].single_text = data[i].zone+'<br\>'+data[i].level+' lvl<br\>'+char+' <img src=\'<?php echo $img_base2 ?>'+data[i].cl+'.gif\' style=\'float:center\' border=0 width=18 height=18\><br\>'+race_name[data[i].race]+'<br/>'+class_name[data[i].cl]+'<br/>';
|
||||||
|
mpoints[point_count].x = pos.x;
|
||||||
|
mpoints[point_count].y = pos.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mpoints[point_count].single_text='';
|
||||||
|
mpoints[point_count].x = 0;
|
||||||
|
mpoints[point_count].y = 0;
|
||||||
|
}
|
||||||
|
mpoints[point_count].current_leaderGuid = data[i].leaderGuid;
|
||||||
|
mpoints[point_count].multi_text = new _multi_text();
|
||||||
|
n = point_count;
|
||||||
|
point_count++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mpoints[n].player += 1;
|
||||||
|
mpoints[n].single_text = '';
|
||||||
|
}
|
||||||
|
if(!in_array(mpoints[n].map_id, maps_array) && (mpoints[n].current_leaderGuid != data[i].leaderGuid || (data[i].leaderGuid == 0 && mpoints[n].player > 1)))
|
||||||
|
{
|
||||||
|
mpoints[n].multi_text.first_members.push(mpoints[n].player-1);
|
||||||
|
mpoints[n].current_leaderGuid = data[i].leaderGuid;
|
||||||
|
}
|
||||||
|
mpoints[n].multi_text.text[mpoints[n].player-1] = '<td align=\'left\' valign=\'middle\'\> '+data[i].name+'</td\><td\>'+data[i].level+'</td\><td align=\'left\'\>'+char+'</td\><td align=\'left\'\ style=\'color: '+text_col+';\'> '+race_name[data[i].race]+'</td\><td align=\'left\'\> <img src=\'<?php echo $img_base2 ?>'+data[i].cl+'.gif\' style=\'float:center\' border=0 width=18 height=18\></td\><td align=\'left\'\> '+class_name[data[i].cl]+' </td\>';
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
n=0;
|
||||||
|
while(n!=point_count)
|
||||||
|
{
|
||||||
|
if(!in_array(mpoints[n].map_id, maps_array))
|
||||||
|
instances[mpoints[n].Extention] += '<img src="<?php echo $img_base ?>inst-icon.gif" style="position: absolute; border: 0px; left: '+instances_x[mpoints[n].Extention][mpoints[n].map_id]+'px; top: '+instances_y[mpoints[n].Extention][mpoints[n].map_id]+'px;" onMouseMove="tip(mpoints['+n+'],1,false);" onMouseDown="tip(mpoints['+n+'],1,true);" onMouseOut="h_tip();mpoints['+n+'].multi_text.current=0;"\>';
|
||||||
|
else if(mpoints[n].player > 1)
|
||||||
|
groups[mpoints[n].Extention] += '<img src="<?php echo $img_base ?>group-icon.gif" style="position: absolute; border: 0px; left: '+mpoints[n].x+'px; top: '+mpoints[n].y+'px;" onMouseMove="tip(mpoints['+n+'],1,false);" onMouseDown="tip(mpoints['+n+'],1,true);" onMouseOut="h_tip();mpoints['+n+'].multi_text.current=0;"\>';
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(mpoints[n].faction)
|
||||||
|
point = "<?php echo $img_base ?>horde.gif";
|
||||||
|
else
|
||||||
|
point = "<?php echo $img_base ?>allia.gif";
|
||||||
|
single[mpoints[n].Extention] += '<img src="'+point+'" style="position: absolute; border: 0px; left: '+mpoints[n].x+'px; top: '+mpoints[n].y+'px;" onMouseMove="tip(mpoints['+n+'],0,false);" onMouseOut="h_tip();"\>';
|
||||||
|
}
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
|
||||||
|
players_count = Array(0);
|
||||||
|
total_players_count = new Array(0,0);
|
||||||
|
|
||||||
|
for(i = 0; i < maps_count; i++)
|
||||||
|
{
|
||||||
|
obj = getPointsLayerByID(i);
|
||||||
|
obj.innerHTML = instances[i] + single[i] + groups[i];
|
||||||
|
players_count[i] = alliance_count[i] + horde_count[i];
|
||||||
|
total_players_count[0] += alliance_count[i];
|
||||||
|
total_players_count[1] += horde_count[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("server_info").innerHTML='online: <b style="color: rgb(100,100,100);" onMouseMove="tip(\'<tr\><td\><img src=\\\'<?php echo $img_base ?>hordeicon.gif\\\'\></td\><td\><b style=\\\'color: rgb(210,50,30);\\\'\><?php echo $lang_defs['faction'][1]; ?>:</b\> <b\>'+total_players_count[1]+'</b\></td\></tr\><tr\><td\><img src=\\\'<?php echo $img_base ?>allianceicon.gif\\\'\></td\><td\><b style=\\\'color: rgb(0,150,190);\\\'\><?php echo $lang_defs['faction'][0]; ?>:</b\> <b\>'+total_players_count[0]+'</b\></td\></tr\>\',2,false);" onMouseOut="h_tip();"><?php echo $lang_defs['total']; ?></b> '+eval(total_players_count[0]+total_players_count[1])+'';
|
||||||
|
for(i = 0; i < maps_count; i++)
|
||||||
|
{
|
||||||
|
document.getElementById("server_info").innerHTML += ' <b style="color: rgb(160,160,20); cursor:pointer;" onClick="switchworld('+i+');" onMouseMove="tip(\'<tr\><td\><img src=\\\'<?php echo $img_base ?>hordeicon.gif\\\'\></td\><td\><b style=\\\'color: rgb(210,50,30);\\\'\><?php echo $lang_defs['faction'][1]; ?>:</b\> <b\>'+horde_count[i]+'</b\></td\></tr\><tr\><td\><img src=\\\'<?php echo $img_base ?>allianceicon.gif\\\'\></td\><td\><b style=\\\'color: rgb(0,150,190);\\\'\><?php echo $lang_defs['faction'][0]; ?>:</b\> <b\>'+alliance_count[i]+'</b\></td\></tr\>\',2,false);" onMouseOut="h_tip();">'+maps_name_array[i]+'</b\> '+players_count[i]+'';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function statusController(status_process_id,diff)
|
||||||
|
{
|
||||||
|
var action = status_process[status_process_id].action;
|
||||||
|
if(action)
|
||||||
|
{
|
||||||
|
var obj = document.getElementById("status");
|
||||||
|
var text_type = status_process[status_process_id].text_type;
|
||||||
|
if(text_type == 0)
|
||||||
|
{
|
||||||
|
var status_process_now = new Date();
|
||||||
|
var status_process_diff = status_process_now.getTime() - status_process_started.getTime();
|
||||||
|
var objDate = new Date(status_data[status_process[status_process_id].status_data]*1000 + status_process_diff);
|
||||||
|
var days = parseInt(status_data[status_process[status_process_id].status_data]/86400);
|
||||||
|
var hours = objDate.getUTCHours();
|
||||||
|
var min = objDate.getUTCMinutes();
|
||||||
|
var sec = objDate.getUTCSeconds();
|
||||||
|
if(hours < 10) hours = '0'+hours;
|
||||||
|
if(min < 10) min = '0'+min;
|
||||||
|
if(sec < 10) sec = '0'+sec;
|
||||||
|
if(days) days = days+' '; else days = '';
|
||||||
|
obj.innerHTML = status_text[status_process[status_process_id].text_id]+' - '+days+''+hours+':'+min+':'+sec;
|
||||||
|
}
|
||||||
|
else if(text_type == 1)
|
||||||
|
{
|
||||||
|
obj.innerHTML = status_text[status_process[status_process_id].text_id]+' - '+status_data[status_process[status_process_id].status_data];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
obj.innerHTML = status_text[status_process[status_process_id].text_id];
|
||||||
|
switch(action)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
if(fade_cur_color > 0)
|
||||||
|
{
|
||||||
|
fade_cur_color--;
|
||||||
|
obj.style.color = '#'+fade_colors[fade_cur_color];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if(fade_cur_color < (fade_colors.length-1))
|
||||||
|
{
|
||||||
|
fade_cur_color++;
|
||||||
|
obj.style.color = '#'+fade_colors[fade_cur_color];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
status_cur_time += diff;
|
||||||
|
if(status_next_process || status_cur_time >= status_process[status_process_id].time)
|
||||||
|
{
|
||||||
|
if(status_next_process)
|
||||||
|
status_cur_time = statusUpdateInterval*fade_colors.length;
|
||||||
|
else
|
||||||
|
status_cur_time = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
status_process_id++;
|
||||||
|
if(status_process_id >= (status_process.length))
|
||||||
|
status_process_id = 0;
|
||||||
|
} while(status_next_process && status_process[status_process_id].action == 2);
|
||||||
|
status_next_process = 0;
|
||||||
|
}
|
||||||
|
setTimeout('statusController('+status_process_id+','+statusUpdateInterval+')', statusUpdateInterval);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showNextStatusText()
|
||||||
|
{
|
||||||
|
if(status_process.length > 2)
|
||||||
|
status_next_process = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function statusInit()
|
||||||
|
{
|
||||||
|
var blinkTime = statusUpdateInterval*fade_colors.length;
|
||||||
|
var time_to_show_uptime = <?php echo $time_to_show_uptime ?>;
|
||||||
|
var time_to_show_maxonline = <?php echo $time_to_show_maxonline ?>;
|
||||||
|
var time_to_show_gmonline = <?php echo $time_to_show_gmonline ?>;
|
||||||
|
|
||||||
|
// for first time
|
||||||
|
if(status_process.length == 0)
|
||||||
|
setTimeout('statusController(0,'+statusUpdateInterval+')', statusUpdateInterval);
|
||||||
|
|
||||||
|
status_process = new Array();
|
||||||
|
if(status_data[0] == 1) // online
|
||||||
|
{
|
||||||
|
if(time_to_show_uptime)
|
||||||
|
{
|
||||||
|
status_process.push(new _status_action(2,1,0,1,time_to_show_uptime));
|
||||||
|
status_process.push(new _status_action(2,1,0,2,blinkTime));
|
||||||
|
}
|
||||||
|
if(time_to_show_maxonline)
|
||||||
|
{
|
||||||
|
status_process.push(new _status_action(3,2,1,1,time_to_show_maxonline));
|
||||||
|
status_process.push(new _status_action(3,2,1,2,blinkTime));
|
||||||
|
}
|
||||||
|
if(time_to_show_gmonline)
|
||||||
|
{
|
||||||
|
status_process.push(new _status_action(4,3,1,1,time_to_show_gmonline));
|
||||||
|
status_process.push(new _status_action(4,3,1,2,blinkTime));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(status_data[0] == 0) // offline
|
||||||
|
{
|
||||||
|
status_process.push(new _status_action(0,0,2,1,blinkTime));
|
||||||
|
status_process.push(new _status_action(0,0,2,2,blinkTime));
|
||||||
|
}
|
||||||
|
else //DB connect error
|
||||||
|
{
|
||||||
|
status_process.push(new _status_action(1,0,2,1,blinkTime));
|
||||||
|
status_process.push(new _status_action(1,0,2,2,blinkTime));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function load_data()
|
||||||
|
{
|
||||||
|
var req = new Subsys_JsHttpRequest_Js();
|
||||||
|
req.onreadystatechange = function()
|
||||||
|
{
|
||||||
|
if (req.readyState == 4)
|
||||||
|
{
|
||||||
|
if(show_status)
|
||||||
|
{
|
||||||
|
if(req.responseJS.status)
|
||||||
|
{
|
||||||
|
if(status_data[0] != req.responseJS.status.online)
|
||||||
|
{
|
||||||
|
status_data[0] = req.responseJS.status.online;
|
||||||
|
var obj = document.getElementById("statusIMG");
|
||||||
|
if(status_data[0] != 1)
|
||||||
|
{
|
||||||
|
obj.src = "<?php echo $img_base ?>realm_off.gif"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
obj.src = "<?php echo $img_base ?>realm_on.gif"
|
||||||
|
}
|
||||||
|
if(req.responseJS.status.uptime < status_data[1] || status_data[1] == 0)
|
||||||
|
{
|
||||||
|
status_process_started = new Date();
|
||||||
|
status_data[1] = req.responseJS.status.uptime;
|
||||||
|
}
|
||||||
|
status_data[2] = req.responseJS.status.maxplayers;
|
||||||
|
status_data[3] = req.responseJS.status.gmonline;
|
||||||
|
statusInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
show(req.responseJS.online);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
req.open('GET', 'pomm_play.php', true);
|
||||||
|
req.send({ });
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset()
|
||||||
|
{
|
||||||
|
var ms = 0;
|
||||||
|
then = new Date();
|
||||||
|
then.setTime(then.getTime()-ms);
|
||||||
|
load_data();
|
||||||
|
}
|
||||||
|
|
||||||
|
function display()
|
||||||
|
{
|
||||||
|
now = new Date();
|
||||||
|
ms = now.getTime() - then.getTime();
|
||||||
|
ms = time*1000-ms;
|
||||||
|
if ((show_time==1) && (time!=0))
|
||||||
|
{
|
||||||
|
document.getElementById("timer").innerHTML=(Math.round(ms/1000));
|
||||||
|
}
|
||||||
|
if (ms<=0)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
if (time!=0)
|
||||||
|
{
|
||||||
|
setTimeout("display();", 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function start()
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
display();
|
||||||
|
|
||||||
|
if(navigator.appName=="Netscape")
|
||||||
|
{
|
||||||
|
document.onmousemove=function(e)
|
||||||
|
{
|
||||||
|
pointx = e.pageX;
|
||||||
|
pointy = e.pageY;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</SCRIPT>
|
||||||
|
<BODY onload=start()>
|
||||||
|
|
||||||
|
<div onMouseDown="showNextStatusText();" id="serverstatus">
|
||||||
|
<table align="center" border="0" cellspacing="0" cellpadding="0" width="156px" height="36px">
|
||||||
|
<tr><td id="status" class="statustext"></td></tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="tip"></div>
|
||||||
|
<div ID="pointsOldworld"></div>
|
||||||
|
<div ID="pointsOutland"></div>
|
||||||
|
<div ID="pointsNorthrend"></div>
|
||||||
|
<div ID="world"></div>
|
||||||
|
<div ID="outland"></div>
|
||||||
|
<div ID="northrend"></div>
|
||||||
|
<div ID="wow"><img src="<?php echo $img_base ?>realm_on.gif" id="statusIMG" style="position: absolute; border: 0px; left: 382; top: 0;" onClick="window.location='<?php echo $_SERVER['PHP_SELF'] ?>'"></a>
|
||||||
|
</div>
|
||||||
|
<div ID="info">
|
||||||
|
<center>
|
||||||
|
<table valign="top" border="0" cellspacing="0" cellpadding="0" height="16">
|
||||||
|
<tr><td id="timer"></td></tr>
|
||||||
|
</table>
|
||||||
|
</center>
|
||||||
|
</div>
|
||||||
|
<div ID="info_bottom">
|
||||||
|
<center>
|
||||||
|
<table border="0" cellspacing="0" cellpadding="0" height="20" width="100%">
|
||||||
|
<tr><td align="center" valign="top" id="server_info"></td></tr>
|
||||||
|
</table>
|
||||||
|
</center>
|
||||||
|
</div>
|
||||||
|
</BODY></HTML>
|
||||||
85
mojotrollz/idea/playermap/libs/data_lib.php
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
define('CHAR_DATA_OFFSET_GENDER',22);
|
||||||
|
define('CHAR_DATA_OFFSET_HEALTH',23);
|
||||||
|
define('CHAR_DATA_OFFSET_MANA',24);
|
||||||
|
define('CHAR_DATA_OFFSET_RAGE',25);
|
||||||
|
define('CHAR_DATA_OFFSET_FOCUS',26);
|
||||||
|
define('CHAR_DATA_OFFSET_ENERGY',27);
|
||||||
|
define('CHAR_DATA_OFFSET_HAPPINESS',28);
|
||||||
|
define('CHAR_DATA_OFFSET_MAX_HEALTH',31);
|
||||||
|
define('CHAR_DATA_OFFSET_MAX_MANA',32);
|
||||||
|
define('CHAR_DATA_OFFSET_MAX_RAGE',33);
|
||||||
|
define('CHAR_DATA_OFFSET_MAX_FOCUS',34);
|
||||||
|
define('CHAR_DATA_OFFSET_MAX_ENERGY',35);
|
||||||
|
define('CHAR_DATA_OFFSET_MAX_HAPPINESS',36);
|
||||||
|
define('CHAR_DATA_OFFSET_LEVEL',53);
|
||||||
|
define('CHAR_DATA_OFFSET_MINDAMAGE',69);
|
||||||
|
define('CHAR_DATA_OFFSET_MAXDAMAGE',70);
|
||||||
|
define('CHAR_DATA_OFFSET_STR',84);
|
||||||
|
define('CHAR_DATA_OFFSET_AGI',85);
|
||||||
|
define('CHAR_DATA_OFFSET_STA',86);
|
||||||
|
define('CHAR_DATA_OFFSET_INT',87);
|
||||||
|
define('CHAR_DATA_OFFSET_SPI',88);
|
||||||
|
define('CHAR_DATA_OFFSET_ARMOR',99);
|
||||||
|
define('CHAR_DATA_OFFSET_RES_HOLY',100);
|
||||||
|
define('CHAR_DATA_OFFSET_RES_FIRE',101);
|
||||||
|
define('CHAR_DATA_OFFSET_RES_NATURE',102);
|
||||||
|
define('CHAR_DATA_OFFSET_RES_FROST',103);
|
||||||
|
define('CHAR_DATA_OFFSET_RES_SHADOW',104);
|
||||||
|
define('CHAR_DATA_OFFSET_RES_ARCANE',105);
|
||||||
|
define('CHAR_DATA_OFFSET_AP',123);
|
||||||
|
define('CHAR_DATA_OFFSET_AP_MOD',124);
|
||||||
|
define('CHAR_DATA_OFFSET_RANGED_AP',126);
|
||||||
|
define('CHAR_DATA_OFFSET_RANGED_AP_MOD',127);
|
||||||
|
define('CHAR_DATA_OFFSET_MINRANGEDDAMAGE',129);
|
||||||
|
define('CHAR_DATA_OFFSET_MAXRANGEDDAMAGE',130);
|
||||||
|
define('CHAR_DATA_OFFSET_FLAGS',150);
|
||||||
|
define('CHAR_DATA_OFFSET_GUILD_ID',151);
|
||||||
|
define('CHAR_DATA_OFFSET_GUILD_RANK',152);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_HEAD',258);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_NECK',260);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_SHOULDER',262);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_SHIRT',264);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_CHEST',266);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_BELT',268);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_LEGS',270);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_FEET',272);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_WRIST',274);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_GLOVES',276);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_FINGER1',278);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_FINGER2',280);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_TRINKET1',282);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_TRINKET2',284);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_BACK',286);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_MAIN_HAND',288);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_OFF_HAND',290);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_RANGED',292);
|
||||||
|
define('CHAR_DATA_OFFSET_EQU_TABARD',294);
|
||||||
|
define('CHAR_DATA_OFFSET_EXP',608);
|
||||||
|
define('CHAR_DATA_OFFSET_SKILL_DATA',610);
|
||||||
|
define('CHAR_DATA_OFFSET_POINTS1',994);
|
||||||
|
define('CHAR_DATA_OFFSET_BLOCK',998);
|
||||||
|
define('CHAR_DATA_OFFSET_DODGE',999);
|
||||||
|
define('CHAR_DATA_OFFSET_PARRY',1000);
|
||||||
|
define('CHAR_DATA_OFFSET_EXPERTISE',1001);
|
||||||
|
define('CHAR_DATA_OFFSET_OFFHAND_EXPERTISE',1002);
|
||||||
|
define('CHAR_DATA_OFFSET_MELEE_CRIT',1003);
|
||||||
|
define('CHAR_DATA_OFFSET_RANGE_CRIT',1004);
|
||||||
|
define('CHAR_DATA_OFFSET_SPELL_CRIT',1006);
|
||||||
|
define('CHAR_DATA_OFFSET_GOLD',1144);
|
||||||
|
define('CHAR_DATA_OFFSET_SPELL_DAMAGE',1145);
|
||||||
|
define('CHAR_DATA_OFFSET_SPELL_HEAL',1166);
|
||||||
|
define('CHAR_DATA_OFFSET_HONOR_KILL',1202);
|
||||||
|
define('CHAR_DATA_OFFSET_DEFENCE',1206);
|
||||||
|
define('CHAR_DATA_OFFSET_MELEE_HIT',1210);
|
||||||
|
define('CHAR_DATA_OFFSET_RANGE_HIT',1211);
|
||||||
|
define('CHAR_DATA_OFFSET_SPELL_HIT',1212);
|
||||||
|
define('CHAR_DATA_OFFSET_SPELL_HASTE_RATING',1224);
|
||||||
|
define('CHAR_DATA_OFFSET_HONOR_POINTS',1251);
|
||||||
|
define('CHAR_DATA_OFFSET_ARENA_POINTS',1252);
|
||||||
|
define('CHAR_DATA_OFFSET_GLYPHS',1292);
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
407
mojotrollz/idea/playermap/libs/js/JsHttpRequest/Js.js
Normal file
@ -0,0 +1,407 @@
|
|||||||
|
/**
|
||||||
|
* Subsys_JsHttpRequest_Js: JavaScript DHTML data loader.
|
||||||
|
* (C) 2005 Dmitry Koterov, http://forum.dklab.ru/users/DmitryKoterov/
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
* See http://www.gnu.org/copyleft/lesser.html
|
||||||
|
*
|
||||||
|
* Do not remove this comment if you want to use script!
|
||||||
|
* Íå óäàëÿéòå äàííûé êîììåíòàðèé, åñëè âû õîòèòå èñïîëüçîâàòü ñêðèïò!
|
||||||
|
*
|
||||||
|
* This library tries to use XMLHttpRequest (if available), and on
|
||||||
|
* failure - use dynamically created <script> elements. Backend code
|
||||||
|
* is the same for both cases.
|
||||||
|
*
|
||||||
|
* @author Dmitry Koterov
|
||||||
|
* @version 3.34
|
||||||
|
*/
|
||||||
|
|
||||||
|
function Subsys_JsHttpRequest_Js()
|
||||||
|
{
|
||||||
|
this._construct()
|
||||||
|
}
|
||||||
|
|
||||||
|
(
|
||||||
|
function()
|
||||||
|
{ // to create local-scope variables
|
||||||
|
var COUNT = 0;
|
||||||
|
var PENDING = {};
|
||||||
|
var CACHE = {};
|
||||||
|
|
||||||
|
// Called by server script on data load.
|
||||||
|
Subsys_JsHttpRequest_Js.dataReady = function(id, text, js)
|
||||||
|
{
|
||||||
|
var undef;
|
||||||
|
var th = PENDING[id];
|
||||||
|
delete PENDING[id];
|
||||||
|
if (th)
|
||||||
|
{
|
||||||
|
delete th._xmlReq;
|
||||||
|
if (th.caching)
|
||||||
|
CACHE[th.hash] = [text, js];
|
||||||
|
th._dataReady(text, js);
|
||||||
|
}
|
||||||
|
else if (typeof(th) != typeof(undef))
|
||||||
|
{
|
||||||
|
alert("ScriptLoader: unknown pending id: "+id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Subsys_JsHttpRequest_Js.prototype =
|
||||||
|
{
|
||||||
|
// Standard properties.
|
||||||
|
onreadystatechange: null,
|
||||||
|
readyState: 0,
|
||||||
|
responseText: null,
|
||||||
|
responseXML: null,
|
||||||
|
status: 200,
|
||||||
|
statusText: "OK",
|
||||||
|
|
||||||
|
// Additional properties.
|
||||||
|
session_name: "PHPSESSID", // set to SID cookie or GET parameter name
|
||||||
|
responseJS: null, // JavaScript response array/hash
|
||||||
|
caching: false, // need to use caching?
|
||||||
|
fallbackToScript: false,
|
||||||
|
|
||||||
|
// Internals.
|
||||||
|
_span: null,
|
||||||
|
_id: null,
|
||||||
|
_xmlReq: null,
|
||||||
|
_openArg: null,
|
||||||
|
_reqHeaders: null,
|
||||||
|
|
||||||
|
dummy: function() {}, // empty function
|
||||||
|
|
||||||
|
abort: function()
|
||||||
|
{
|
||||||
|
if (this._xmlReq)
|
||||||
|
return this._xmlReq.abort();
|
||||||
|
if (this._span)
|
||||||
|
{
|
||||||
|
this.readyState = 0;
|
||||||
|
if (this.onreadystatechange)
|
||||||
|
this.onreadystatechange();
|
||||||
|
this._cleanupScript();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
open: function(method, url, asyncFlag, username, password)
|
||||||
|
{
|
||||||
|
this._openArg =
|
||||||
|
{
|
||||||
|
'method': method,
|
||||||
|
'url': url,
|
||||||
|
'asyncFlag': asyncFlag,
|
||||||
|
'username': username != null? username : '',
|
||||||
|
'password': password != null? password : ''
|
||||||
|
};
|
||||||
|
this._id = null;
|
||||||
|
this._xmlReq = null;
|
||||||
|
this._reqHeaders = [];
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
send: function(content)
|
||||||
|
{
|
||||||
|
var id = (new Date().getTime()) + "" + COUNT++;
|
||||||
|
|
||||||
|
// Build QUERY_STRING from query hash.
|
||||||
|
var query = this._hash2query(content);
|
||||||
|
|
||||||
|
// Append SID to original URL now.
|
||||||
|
var url = this._openArg.url;
|
||||||
|
var sid = this._getSid();
|
||||||
|
if (sid)
|
||||||
|
url += (url.indexOf('?')>=0? '&' : '?') + this.session_name + "=" + this.escape(sid);
|
||||||
|
|
||||||
|
// Solve hash BEFORE appending ID.
|
||||||
|
var hash = this.hash = url + '?' + query;
|
||||||
|
if (this.caching && CACHE[hash])
|
||||||
|
{
|
||||||
|
var c = CACHE[hash];
|
||||||
|
this._dataReady(c[0], c[1]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to use XMLHttpRequest.
|
||||||
|
this._xmlReq = this._obtainXmlReq(id, url);
|
||||||
|
|
||||||
|
// Pass data in URL (GET, HEAD etc.) or in request body (POST)?
|
||||||
|
var hasSetHeader = this._xmlReq && (window.ActiveXObject || this._xmlReq.setRequestHeader);
|
||||||
|
var href, body;
|
||||||
|
var method = (""+this._openArg.method).toUpperCase();
|
||||||
|
if (this._xmlReq && hasSetHeader && method == "POST")
|
||||||
|
{
|
||||||
|
// Use POST method. Pass query in request body.
|
||||||
|
// Opera 8.01 does not support setRequestHeader, so no POST method.
|
||||||
|
this._openArg.method = "POST";
|
||||||
|
href = url;
|
||||||
|
body = query;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (method != 'GET' && !this.fallbackToScript && query.length > 2000)
|
||||||
|
{
|
||||||
|
throw 'Cannot use XMLHttpRequest nor Microsoft.XMLHTTP for long POST query: object not implemented or disabled in browser.';
|
||||||
|
}
|
||||||
|
this._openArg.method = "GET";
|
||||||
|
href = url + (url.indexOf('?')>=0? '&' : '?') + query;
|
||||||
|
body = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append ID: a=aaa&b=bbb&<id>
|
||||||
|
href = href + (href.indexOf('?')>=0? '&' : '?') + id;
|
||||||
|
|
||||||
|
// Save loading script.
|
||||||
|
PENDING[id] = this;
|
||||||
|
|
||||||
|
if (this._xmlReq)
|
||||||
|
{
|
||||||
|
// Open request now & send it.
|
||||||
|
// In XMLHttpRequest mode request URL MUST be ended with "<id>-xml".
|
||||||
|
var a = this._openArg;
|
||||||
|
this._xmlReq.open(a.method, href+"-xml", a.asyncFlag, a.username, a.password);
|
||||||
|
if (hasSetHeader)
|
||||||
|
{
|
||||||
|
// Pass pending headers.
|
||||||
|
for (var i=0; i<this._reqHeaders.length; i++)
|
||||||
|
this._xmlReq.setRequestHeader(this._reqHeaders[i][0], this._reqHeaders[i][1]);
|
||||||
|
// Set non-default Content-type. We cannot use
|
||||||
|
// "application/x-www-form-urlencoded" here, because
|
||||||
|
// in PHP variable HTTP_RAW_POST_DATA is accessible only when
|
||||||
|
// enctype is not default (e.g., "application/octet-stream"
|
||||||
|
// is a good start). We parse POST data manually in backend
|
||||||
|
// library code.
|
||||||
|
this._xmlReq.setRequestHeader('Content-Type', 'application/octet-stream');
|
||||||
|
}
|
||||||
|
// Send the request.
|
||||||
|
return this._xmlReq.send(body);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Create <script> element and run it.
|
||||||
|
this._obtainScript(id, href);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getAllResponseHeaders: function()
|
||||||
|
{
|
||||||
|
if (this._xmlReq)
|
||||||
|
return this._xmlReq.getAllResponseHeaders();
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
|
||||||
|
getResponseHeader: function(label)
|
||||||
|
{
|
||||||
|
if (this._xmlReq)
|
||||||
|
return this._xmlReq.getResponseHeader(label);
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
|
||||||
|
setRequestHeader: function(label, value)
|
||||||
|
{
|
||||||
|
// Collect headers.
|
||||||
|
this._reqHeaders[this._reqHeaders.length] = [label, value];
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Internal functions.
|
||||||
|
//
|
||||||
|
|
||||||
|
// Constructor.
|
||||||
|
_construct: function() {},
|
||||||
|
|
||||||
|
// Do all work when data is ready.
|
||||||
|
_dataReady: function(text, js)
|
||||||
|
{
|
||||||
|
with (this)
|
||||||
|
{
|
||||||
|
if (text !== null || js !== null)
|
||||||
|
{
|
||||||
|
readyState = 4;
|
||||||
|
responseText = responseXML = text;
|
||||||
|
responseJS = js;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
readyState = 0;
|
||||||
|
responseText = responseXML = responseJS = null;
|
||||||
|
}
|
||||||
|
if (onreadystatechange)
|
||||||
|
onreadystatechange();
|
||||||
|
_cleanupScript();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Create new XMLHttpRequest object.
|
||||||
|
_obtainXmlReq: function(id, url)
|
||||||
|
{
|
||||||
|
// If url.domain specified and differ from current, cannot use XMLHttpRequest!
|
||||||
|
// XMLHttpRequest (and MS ActiveX'es) cannot work with different domains.
|
||||||
|
var p = url.match(new RegExp('^[a-z]+://(.*)', 'i'));
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
var curHost = document.location.host.toLowerCase();
|
||||||
|
if (p[1].substring(0, curHost.length).toLowerCase() == curHost)
|
||||||
|
{
|
||||||
|
url = p[1].substring(curHost.length, p[1].length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to use built-in loaders.
|
||||||
|
var req = null;
|
||||||
|
if (window.XMLHttpRequest)
|
||||||
|
{
|
||||||
|
try { req = new XMLHttpRequest() } catch(e) {}
|
||||||
|
}
|
||||||
|
else if (window.ActiveXObject)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
req = new ActiveXObject("Microsoft.XMLHTTP")
|
||||||
|
}
|
||||||
|
catch(e)
|
||||||
|
{}
|
||||||
|
if (!req)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
req = new ActiveXObject("Msxml2.XMLHTTP")
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
if (req)
|
||||||
|
{
|
||||||
|
var th = this;
|
||||||
|
req.onreadystatechange = function()
|
||||||
|
{
|
||||||
|
var s = req.readyState;
|
||||||
|
if (s == 4)
|
||||||
|
{
|
||||||
|
// Avoid memory leak by removing closure.
|
||||||
|
req.onreadystatechange = th.dummy;
|
||||||
|
// Remove possible junk from response.
|
||||||
|
var responseText = req.responseText;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Call associated dataReady().
|
||||||
|
eval(responseText);
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
Subsys_JsHttpRequest_Js.dataReady(id, "JavaScript code generated by backend is invalid!\n"+responseText, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
th.readyState = s;
|
||||||
|
if (th.onreadystatechange) th.onreadystatechange()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this._id = id;
|
||||||
|
}
|
||||||
|
return req;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Create new script element and start loading.
|
||||||
|
_obtainScript: function(id, href) { with (document)
|
||||||
|
{
|
||||||
|
var span = null;
|
||||||
|
// Oh shit! Damned stupid fucked Opera 7.23 does not allow to create SCRIPT
|
||||||
|
// element over createElement (in HEAD or BODY section or in nested SPAN -
|
||||||
|
// no matter): it is created deadly, and does not respons on href assignment.
|
||||||
|
// So - always create SPAN.
|
||||||
|
var span = createElement("SPAN");
|
||||||
|
span.style.display = 'none';
|
||||||
|
body.appendChild(span);
|
||||||
|
span.innerHTML = 'Text for stupid IE.<s'+'cript></' + 'script>';
|
||||||
|
setTimeout(function()
|
||||||
|
{
|
||||||
|
var s = span.getElementsByTagName("script")[0];
|
||||||
|
s.language = "JavaScript";
|
||||||
|
if (s.setAttribute)
|
||||||
|
s.setAttribute('src', href); else s.src = href;
|
||||||
|
}, 10);
|
||||||
|
this._id = id;
|
||||||
|
this._span = span;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Remove last used script element (clean memory).
|
||||||
|
_cleanupScript: function()
|
||||||
|
{
|
||||||
|
var span = this._span;
|
||||||
|
if (span)
|
||||||
|
{
|
||||||
|
this._span = null;
|
||||||
|
setTimeout(function()
|
||||||
|
{
|
||||||
|
// without setTimeout - crash in IE 5.0!
|
||||||
|
span.parentNode.removeChild(span);
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Convert hash to QUERY_STRING.
|
||||||
|
_hash2query: function(content, prefix)
|
||||||
|
{
|
||||||
|
if (prefix == null) prefix = "";
|
||||||
|
var query = [];
|
||||||
|
if (content instanceof Object)
|
||||||
|
{
|
||||||
|
for (var k in content)
|
||||||
|
{
|
||||||
|
var v = content[k];
|
||||||
|
if (v == null || ((v.constructor||{}).prototype||{})[k])
|
||||||
|
continue;
|
||||||
|
var curPrefix = prefix? prefix+'['+this.escape(k)+']' : this.escape(k);
|
||||||
|
if (v instanceof Object)
|
||||||
|
query[query.length] = this._hash2query(v, curPrefix);
|
||||||
|
else
|
||||||
|
query[query.length] = curPrefix + "=" + this.escape(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
query = [content];
|
||||||
|
}
|
||||||
|
return query.join('&');
|
||||||
|
},
|
||||||
|
|
||||||
|
// Return value of SID based on QUERY_STRING or cookie
|
||||||
|
// (PHP compatible sessions).
|
||||||
|
_getSid: function()
|
||||||
|
{
|
||||||
|
var m = document.location.search.match(new RegExp('[&?]'+this.session_name+'=([^&?]*)'));
|
||||||
|
var sid = null;
|
||||||
|
if (m)
|
||||||
|
{
|
||||||
|
sid = m[1];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var m = document.cookie.match(new RegExp('(;|^)\\s*'+this.session_name+'=([^;]*)'));
|
||||||
|
if (m)
|
||||||
|
sid = m[2];
|
||||||
|
}
|
||||||
|
return sid;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Stupid JS escape() does not quote '+'.
|
||||||
|
escape: function(s)
|
||||||
|
{
|
||||||
|
return escape(s).replace(new RegExp('\\+','g'), '%2B');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)();
|
||||||
373
mojotrollz/idea/playermap/libs/js/JsHttpRequest/Php.php
Normal file
@ -0,0 +1,373 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Subsys_JsHttpRequest_Php: PHP backend for JavaScript DHTML loader.
|
||||||
|
* (C) 2005 Dmitry Koterov, http://forum.dklab.ru/users/DmitryKoterov/
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
* See http://www.gnu.org/copyleft/lesser.html
|
||||||
|
*
|
||||||
|
* Do not remove this comment if you want to use the script!
|
||||||
|
* Íå óäàëÿéòå äàííûé êîììåíòàðèé, åñëè âû õîòèòå èñïîëüçîâàòü ñêðèïò!
|
||||||
|
*
|
||||||
|
* This backend library also supports POST requests additionally to GET.
|
||||||
|
*
|
||||||
|
* @author Dmitry Koterov
|
||||||
|
* @version 3.35
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Subsys_JsHttpRequest_Php
|
||||||
|
{
|
||||||
|
var $SCRIPT_ENCODING = "windows-1251";
|
||||||
|
var $SCRIPT_DECODE_MODE = '';
|
||||||
|
var $UNIQ_HASH;
|
||||||
|
var $SCRIPT_ID;
|
||||||
|
var $LOADER = null;
|
||||||
|
var $QUOTING = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* Create new Subsys_JsHttpRequest_Php backend object and attach it
|
||||||
|
* to script output buffer. As a result - script will always return
|
||||||
|
* correct JavaScript code, even in case of fatal errors.
|
||||||
|
*/
|
||||||
|
function Subsys_JsHttpRequest_Php($enc)
|
||||||
|
{
|
||||||
|
// QUERY_STRING is in form: PHPSESSID=<sid>&a=aaa&b=bbb&<id>
|
||||||
|
// where <id> is request ID, <sid> - session ID (if present),
|
||||||
|
// PHPSESSID - session parameter name (by default = "PHPSESSID").
|
||||||
|
|
||||||
|
// Parse QUERY_STRING wrapper format.
|
||||||
|
$this->LOADER = "SCRIPT";
|
||||||
|
if (preg_match('/(\d+)((?:-\w+)?)$/s', $_SERVER['QUERY_STRING'], $m))
|
||||||
|
{
|
||||||
|
$this->SCRIPT_ID = $m[1];
|
||||||
|
// XMLHttpRequest is used if URI ends with "&".
|
||||||
|
if ($m[2] == '-xml')
|
||||||
|
$this->LOADER = "XMLHttpRequest";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->SCRIPT_ID = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start OB handling early.
|
||||||
|
$this->UNIQ_HASH = md5(microtime().getmypid());
|
||||||
|
ini_set('error_prepend_string', ini_get('error_prepend_string').$this->UNIQ_HASH);
|
||||||
|
ini_set('error_append_string', ini_get('error_append_string') .$this->UNIQ_HASH);
|
||||||
|
ob_start(array(&$this, "_obHandler"));
|
||||||
|
|
||||||
|
// Set up encoding.
|
||||||
|
$this->setEncoding($enc);
|
||||||
|
|
||||||
|
// Check if headers are already sent (see Content-Type library usage).
|
||||||
|
// If true - generate debug message and exit.
|
||||||
|
$file = $line = null;
|
||||||
|
if (headers_sent($file, $line))
|
||||||
|
{
|
||||||
|
trigger_error(
|
||||||
|
"HTTP headers are already sent" . ($line !== null? " in $file on line $line" : "") . ". "
|
||||||
|
. "Possibly you have extra spaces (or newlines) before first line of the script or any library. "
|
||||||
|
. "Please note that Subsys_JsHttpRequest uses its own Content-Type header and fails if "
|
||||||
|
. "this header cannot be set. See header() function documentation for details",
|
||||||
|
E_USER_ERROR
|
||||||
|
);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* string getJsCode()
|
||||||
|
*
|
||||||
|
* Return JavaScript part of library.
|
||||||
|
*/
|
||||||
|
function getJsCode()
|
||||||
|
{
|
||||||
|
return file_get_contents(dirname(__FILE__).'/Js.js');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* void setEncoding(string $encoding)
|
||||||
|
*
|
||||||
|
* Set active script encoding & correct QUERY_STRING according to it.
|
||||||
|
* Examples:
|
||||||
|
* "windows-1251" - set plain encoding (non-windows characters,
|
||||||
|
* e.g. hieroglyphs, are totally ignored)
|
||||||
|
* "windows-1251 entities" - set windows encoding, BUT additionally replace:
|
||||||
|
* "&" -> "&"
|
||||||
|
* hieroglyph -> &#XXXX; entity
|
||||||
|
*/
|
||||||
|
function setEncoding($enc)
|
||||||
|
{
|
||||||
|
// Parse encoding.
|
||||||
|
preg_match('/^(\S*)(?:\s+(\S*))$/', $enc, $p);
|
||||||
|
$this->SCRIPT_ENCODING = strtolower(@$p[1]? $p[1] : $enc);
|
||||||
|
$this->SCRIPT_DECODE_MODE = @$p[2]? $p[2] : '';
|
||||||
|
// Manually parse QUERY_STRING because of damned Unicode's %uXXXX.
|
||||||
|
$this->_correctQueryString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* string quoteInput(string $input)
|
||||||
|
*
|
||||||
|
* Quote string according to input decoding mode.
|
||||||
|
* If entities is used (see setEncoding()), no '&' character is quoted,
|
||||||
|
* only '"', '>' and '<' (we presume than '&' is already quoted by
|
||||||
|
* input reader function).
|
||||||
|
*
|
||||||
|
* Use this function INSTEAD of htmlspecialchars() for $_GET data
|
||||||
|
* in your scripts.
|
||||||
|
*/
|
||||||
|
function quoteInput($s)
|
||||||
|
{
|
||||||
|
if ($this->SCRIPT_DECODE_MODE == 'entities')
|
||||||
|
return str_replace(array('"', '<', '>'), array('"', '<', '>'), $s);
|
||||||
|
else
|
||||||
|
return htmlspecialchars($s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert PHP scalar, array or hash to JS scalar/array/hash.
|
||||||
|
*/
|
||||||
|
function php2js($a)
|
||||||
|
{
|
||||||
|
if (is_null($a)) return 'null';
|
||||||
|
if ($a === false) return 'false';
|
||||||
|
if ($a === true) return 'true';
|
||||||
|
if (is_scalar($a))
|
||||||
|
{
|
||||||
|
$a = addslashes($a);
|
||||||
|
$a = str_replace("\n", '\n', $a);
|
||||||
|
$a = str_replace("\r", '\r', $a);
|
||||||
|
$a = preg_replace('{(</)(script)}i', "$1'+'$2", $a); // for FORM loader
|
||||||
|
return "'$a'";
|
||||||
|
}
|
||||||
|
$isList = true;
|
||||||
|
for ($i=0, reset($a); $i<count($a); $i++, next($a))
|
||||||
|
if (key($a) !== $i)
|
||||||
|
{
|
||||||
|
$isList = false; break;
|
||||||
|
}
|
||||||
|
$result = array();
|
||||||
|
if ($isList)
|
||||||
|
{
|
||||||
|
foreach ($a as $v)
|
||||||
|
$result[] = Subsys_JsHttpRequest_Php::php2js($v);
|
||||||
|
return '[ ' . join(',', $result) . ' ]';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach ($a as $k=>$v)
|
||||||
|
$result[] = Subsys_JsHttpRequest_Php::php2js($k) . ': ' . Subsys_JsHttpRequest_Php::php2js($v);
|
||||||
|
return '{ ' . join(',', $result) . ' }';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal methods.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse & decode QUERY_STRING.
|
||||||
|
*/
|
||||||
|
function _correctQueryString()
|
||||||
|
{
|
||||||
|
// ATTENTION!!!
|
||||||
|
// HTTP_RAW_POST_DATA is only accessible when Content-Type of POST request
|
||||||
|
// is NOT default "application/x-www-form-urlencoded"!!!
|
||||||
|
// Library frontend sets "application/octet-stream" for that purpose,
|
||||||
|
// see JavaScript code.
|
||||||
|
foreach (array('_GET'=>$_SERVER['QUERY_STRING'], '_POST'=>@$GLOBALS['HTTP_RAW_POST_DATA']) as $dst=>$src)
|
||||||
|
{
|
||||||
|
if (isset($GLOBALS[$dst]))
|
||||||
|
{
|
||||||
|
// First correct all 2-byte entities.
|
||||||
|
$s = preg_replace('/%(?!5B)(?!5D)([0-9a-f]{2})/si', '%u00\\1', $src);
|
||||||
|
// Now we can use standard parse_str() with no worry!
|
||||||
|
$data = null;
|
||||||
|
parse_str($s, $data);
|
||||||
|
$GLOBALS[$dst] = $this->_ucs2EntitiesDecode($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$_REQUEST =
|
||||||
|
(isset($_COOKIE)? $_COOKIE : array()) +
|
||||||
|
(isset($_POST)? $_POST : array()) +
|
||||||
|
(isset($_GET)? $_GET : array());
|
||||||
|
if (ini_get('register_globals'))
|
||||||
|
{
|
||||||
|
// TODO?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called in case of error too!
|
||||||
|
*/
|
||||||
|
function _obHandler($text)
|
||||||
|
{
|
||||||
|
// Check for error.
|
||||||
|
if (preg_match('{'.$this->UNIQ_HASH.'(.*?)'.$this->UNIQ_HASH.'}sx', $text))
|
||||||
|
{
|
||||||
|
$text = str_replace($this->UNIQ_HASH, '', $text);
|
||||||
|
$this->WAS_ERROR = 1;
|
||||||
|
}
|
||||||
|
// Content-type header.
|
||||||
|
// In XMLHttpRRequest mode we must return text/plain - damned stupid Opera 8.0. :(
|
||||||
|
header("Content-type: " . ($this->LOADER=="SCRIPT"? "text/javascript" : "text/plain") . "; charset=" . $this->SCRIPT_ENCODING);
|
||||||
|
// Make resulting hash.
|
||||||
|
if (!isset($this->RESULT)) $this->RESULT = @$GLOBALS['_RESULT'];
|
||||||
|
$result = $this->php2js($this->RESULT);
|
||||||
|
$text =
|
||||||
|
"// BEGIN Subsys_JsHttpRequest_Js\n" .
|
||||||
|
"Subsys_JsHttpRequest_Js.dataReady(\n" .
|
||||||
|
" " . $this->php2js($this->SCRIPT_ID) . ", // this ID is passed from JavaScript frontend\n" .
|
||||||
|
" " . $this->php2js(trim($text)) . ",\n" .
|
||||||
|
" " . $result . "\n" .
|
||||||
|
")\n" .
|
||||||
|
"// END Subsys_JsHttpRequest_Js\n" .
|
||||||
|
"";
|
||||||
|
// $f = fopen("debug", "w"); fwrite($f, $text); fclose($f);
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decode all %uXXXX entities in string or array (recurrent).
|
||||||
|
* String must not contain %XX entities - they are ignored!
|
||||||
|
*/
|
||||||
|
function _ucs2EntitiesDecode($data)
|
||||||
|
{
|
||||||
|
if (is_array($data))
|
||||||
|
{
|
||||||
|
$d = array();
|
||||||
|
foreach ($data as $k=>$v)
|
||||||
|
{
|
||||||
|
$d[$this->_ucs2EntitiesDecode($k)] = $this->_ucs2EntitiesDecode($v);
|
||||||
|
}
|
||||||
|
return $d;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (strpos($data, '%u') !== false)
|
||||||
|
{ // improve speed
|
||||||
|
$data = preg_replace_callback('/%u([0-9A-F]{1,4})/si', array(&$this, '_ucs2EntitiesDecodeCallback'), $data);
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decode one %uXXXX entity (RE callback).
|
||||||
|
*/
|
||||||
|
function _ucs2EntitiesDecodeCallback($p)
|
||||||
|
{
|
||||||
|
$hex = $p[1];
|
||||||
|
$dec = hexdec($hex);
|
||||||
|
if ($dec === "38" && $this->SCRIPT_DECODE_MODE == 'entities')
|
||||||
|
{
|
||||||
|
// Process "&" separately in "entities" decode mode.
|
||||||
|
$c = "&";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (is_callable('iconv'))
|
||||||
|
{
|
||||||
|
$c = @iconv('UCS-2BE', $this->SCRIPT_ENCODING, pack('n', $dec));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$c = $this->_decUcs2Decode($dec, $this->SCRIPT_ENCODING);
|
||||||
|
}
|
||||||
|
if (!strlen($c))
|
||||||
|
{
|
||||||
|
if ($this->SCRIPT_DECODE_MODE == 'entities')
|
||||||
|
{
|
||||||
|
$c = '&#'.$dec.';';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$c = '?';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $c;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If there is no ICONV, try to decode 1-byte characters manually
|
||||||
|
* (for most popular charsets only).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert from UCS-2BE decimal to $toEnc.
|
||||||
|
*/
|
||||||
|
function _decUcs2Decode($code, $toEnc)
|
||||||
|
{
|
||||||
|
if ($code < 128) return chr($code);
|
||||||
|
if (isset($this->_encTables[$toEnc]))
|
||||||
|
{
|
||||||
|
$p = array_search($code, $this->_encTables[$toEnc]);
|
||||||
|
if ($p !== false)
|
||||||
|
return chr(128 + $p);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UCS-2BE -> 1-byte encodings (from #128).
|
||||||
|
*/
|
||||||
|
var $_encTables = array
|
||||||
|
(
|
||||||
|
'windows-1251' => array
|
||||||
|
(
|
||||||
|
0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
|
||||||
|
0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
|
||||||
|
0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
|
||||||
|
0x0098, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
|
||||||
|
0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
|
||||||
|
0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
|
||||||
|
0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
|
||||||
|
0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
|
||||||
|
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
|
||||||
|
0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
|
||||||
|
0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
|
||||||
|
0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
|
||||||
|
0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
|
||||||
|
0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
|
||||||
|
0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
|
||||||
|
0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
|
||||||
|
),
|
||||||
|
'koi8-r' => array
|
||||||
|
(
|
||||||
|
0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524,
|
||||||
|
0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590,
|
||||||
|
0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248,
|
||||||
|
0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7,
|
||||||
|
0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556,
|
||||||
|
0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x255C, 0x255d, 0x255E,
|
||||||
|
0x255F, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565,
|
||||||
|
0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x256B, 0x256C, 0x00A9,
|
||||||
|
0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
|
||||||
|
0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043d, 0x043E,
|
||||||
|
0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,
|
||||||
|
0x044C, 0x044B, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044A,
|
||||||
|
0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,
|
||||||
|
0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041d, 0x041E,
|
||||||
|
0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,
|
||||||
|
0x042C, 0x042B, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042A
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta http-equiv="refresh" content="0; URL=../">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
you are not suppose to be here, redirecting to <a href="../">here</a>.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
172
mojotrollz/idea/playermap/libs/js/bbcode.js
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
function addbbcode(textarea_id, bbcode, param, contain)
|
||||||
|
{
|
||||||
|
var target = (document.getElementById) ? document.getElementById(textarea_id) : document.all[textarea_id];
|
||||||
|
var scroll = target.scrollTop;
|
||||||
|
|
||||||
|
param = (param && param != '') ? '=' + param : '';
|
||||||
|
if (!contain)
|
||||||
|
contain = '';
|
||||||
|
|
||||||
|
if (document.selection)
|
||||||
|
{
|
||||||
|
target.focus();
|
||||||
|
var text_sel = document.selection.createRange();
|
||||||
|
text_sel.text = '[' + bbcode + param + ']' + text_sel.text + contain + '[/' + bbcode + ']';
|
||||||
|
}
|
||||||
|
else if (target.selectionStart >= 0 && target.selectionEnd >= 0)
|
||||||
|
{
|
||||||
|
var text_ini = target.value.substring(0, target.selectionStart);
|
||||||
|
var text_sel = target.value.substring(target.selectionStart, target.selectionEnd);
|
||||||
|
var text_end = target.value.substring(target.selectionEnd);
|
||||||
|
|
||||||
|
target.value = text_ini + '[' + bbcode + param + ']' + text_sel + contain + '[/' + bbcode + ']' + text_end;
|
||||||
|
target.focus();
|
||||||
|
target.setSelectionRange(text_ini.length + bbcode.length + param.length + 2, target.value.length - text_end.length - bbcode.length - 3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
target.value += '[' + bbcode + param + ']' + '[/' + bbcode + ']';
|
||||||
|
target.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
target.scrollTop = scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function addText(textarea_id, text)
|
||||||
|
{
|
||||||
|
var target = (document.getElementById) ? document.getElementById(textarea_id) : document.all[textarea_id];
|
||||||
|
if (document.selection)
|
||||||
|
{
|
||||||
|
target.focus();
|
||||||
|
var text_sel = document.selection.createRange();
|
||||||
|
text_sel.text = text;
|
||||||
|
}
|
||||||
|
else if (target.selectionStart >= 0 && target.selectionEnd >= 0)
|
||||||
|
{
|
||||||
|
var text_ini = target.value.substring(0, target.selectionStart);
|
||||||
|
var text_end = target.value.substring(target.selectionStart);
|
||||||
|
target.value = text_ini + text + text_end;
|
||||||
|
target.focus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
target.value += text;
|
||||||
|
target.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function add_url(textarea_id)
|
||||||
|
{
|
||||||
|
var target = (document.getElementById) ? document.getElementById(textarea_id) : document.all[textarea_id];
|
||||||
|
var url = prompt('URL:', 'http://');
|
||||||
|
var text = '';
|
||||||
|
|
||||||
|
if (document.selection)
|
||||||
|
{
|
||||||
|
target.focus();
|
||||||
|
var text_sel = document.selection.createRange();
|
||||||
|
text = text_sel.text
|
||||||
|
if (!text) prompt('Text:');
|
||||||
|
if(text != '')
|
||||||
|
addText(textarea_id, '[url='+ url + ']' + text + '[/url]');
|
||||||
|
else
|
||||||
|
addText(textarea_id, '[url]' + url + '[/url]');
|
||||||
|
}
|
||||||
|
else if ((target.selectionStart == target.selectionEnd) || (!target.selectionStart && !target.selectionEnd))
|
||||||
|
{
|
||||||
|
text = prompt('Text:');
|
||||||
|
if(text != '')
|
||||||
|
addbbcode(textarea_id, 'url', url, text);
|
||||||
|
else
|
||||||
|
addbbcode(textarea_id, 'url', '', url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function add_mail(textarea_id)
|
||||||
|
{
|
||||||
|
var target = (document.getElementById) ? document.getElementById(textarea_id) : document.all[textarea_id];
|
||||||
|
var email;
|
||||||
|
|
||||||
|
if (document.selection)
|
||||||
|
{
|
||||||
|
target.focus();
|
||||||
|
var text_sel = document.selection.createRange();
|
||||||
|
var text = text_sel.text
|
||||||
|
if(text.match('@'))
|
||||||
|
{
|
||||||
|
email = text;
|
||||||
|
text = prompt('Name:');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
email = prompt('E-Mail:','name@domain.com');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(text)
|
||||||
|
addText(textarea_id, '[mail='+ email + ']' + text + '[/mail]');
|
||||||
|
else
|
||||||
|
addText(textarea_id, '[mail]' + email + '[/mail]');
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (target.selectionStart >= 0 && target.selectionEnd >= 0)
|
||||||
|
{
|
||||||
|
var text_sel = target.value.substring(target.selectionStart, target.selectionEnd);
|
||||||
|
if(text_sel.indexof('@'))
|
||||||
|
{
|
||||||
|
email = text_sel;
|
||||||
|
var text = prompt('Name:');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var text = text_sel;
|
||||||
|
email = prompt('E-Mail:','name@domain.com');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
email = prompt('E-Mail:','name@domain.com');
|
||||||
|
var text = prompt('Name:');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(text)
|
||||||
|
addbbcode(textarea_id, 'mail', email, text);
|
||||||
|
else
|
||||||
|
addbbcode(textarea_id, 'mail', '', email);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function add_img(textarea_id)
|
||||||
|
{
|
||||||
|
var target = (document.getElementById) ? document.getElementById(textarea_id) : document.all[textarea_id];
|
||||||
|
|
||||||
|
if (document.selection)
|
||||||
|
{
|
||||||
|
target.focus();
|
||||||
|
var text_sel = document.selection.createRange();
|
||||||
|
text_sel = text_sel.text;
|
||||||
|
var url = prompt('URL image:', ((text_sel) ? text_sel : 'http://'));
|
||||||
|
if (url) addText(textarea_id, '[img]' + url + '[/img]');
|
||||||
|
}
|
||||||
|
else if (target.selectionStart >= 0 && target.selectionEnd >= 0)
|
||||||
|
{
|
||||||
|
var text_sel = target.value.substring(target.selectionStart, target.selectionEnd);
|
||||||
|
var url = prompt('URL image:', ((text_sel) ? text_sel : 'http://'));
|
||||||
|
if (url) addbbcode(textarea_id, 'img', '', url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function add_quote(textarea_id)
|
||||||
|
{
|
||||||
|
var text = prompt('Quote Name:', '');
|
||||||
|
if (text)
|
||||||
|
addbbcode(textarea_id, 'quote', text);
|
||||||
|
else
|
||||||
|
addbbcode(textarea_id, 'quote');
|
||||||
|
}
|
||||||
38
mojotrollz/idea/playermap/libs/js/check.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
function CheckAll(obj)
|
||||||
|
{
|
||||||
|
for (var i=0;i<obj.elements.length;i++)
|
||||||
|
{
|
||||||
|
var e = obj.elements[i];
|
||||||
|
if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled))
|
||||||
|
{
|
||||||
|
e.checked = obj.allbox.checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function CheckCheckAll(obj)
|
||||||
|
{
|
||||||
|
var TotalBoxes = 0;
|
||||||
|
var TotalOn = 0;
|
||||||
|
for (var i=0;i<obj.elements.length;i++)
|
||||||
|
{
|
||||||
|
var e = obj.elements[i];
|
||||||
|
if ((e.name != 'allbox') && (e.type=='checkbox'))
|
||||||
|
{
|
||||||
|
TotalBoxes++;
|
||||||
|
if (e.checked)
|
||||||
|
{
|
||||||
|
TotalOn++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TotalBoxes==TotalOn)
|
||||||
|
{
|
||||||
|
obj.allbox.checked=true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
obj.allbox.checked=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
346
mojotrollz/idea/playermap/libs/js/general.js
Normal file
@ -0,0 +1,346 @@
|
|||||||
|
function do_submit (form_name,backup)
|
||||||
|
{
|
||||||
|
if (form_name == 'form1')
|
||||||
|
{
|
||||||
|
if (backup == '1')
|
||||||
|
document.form1.backup_op.value = "1";
|
||||||
|
else if(document.form1.backup_op)
|
||||||
|
document.form1.backup_op.value = "0";
|
||||||
|
document.form1.submit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (form_name == 'form2')
|
||||||
|
document.form2.submit();
|
||||||
|
else
|
||||||
|
document.form.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function expand(thistag, tag, name)
|
||||||
|
{
|
||||||
|
styleObj = document.getElementById(thistag).style;
|
||||||
|
|
||||||
|
if(name == undefined)
|
||||||
|
name = '';
|
||||||
|
|
||||||
|
if (styleObj.display == "table")
|
||||||
|
{
|
||||||
|
styleObj.display="none";
|
||||||
|
tag.innerHTML = '[+] ' + name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
styleObj.display="table";
|
||||||
|
tag.innerHTML = '[-] ' + name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function showHide(id,force)
|
||||||
|
{
|
||||||
|
var o, st;
|
||||||
|
if( document.getElementById ) // Standart way
|
||||||
|
o = document.getElementById(id);
|
||||||
|
else
|
||||||
|
if(document.all) // for old MSIE
|
||||||
|
o = document.all[id];
|
||||||
|
else
|
||||||
|
if(document.layers) // for NN4
|
||||||
|
o = document.layers[id];
|
||||||
|
st = o.style;
|
||||||
|
|
||||||
|
if(force != undefined)
|
||||||
|
{
|
||||||
|
st.display = (force) ? 'table' : 'none';
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// if the style.display value is blank we try to figure it out here
|
||||||
|
if(st.display == '' && o.offsetWidth != undefined && o.offsetHeight != undefined)
|
||||||
|
st.display = (o.offsetWidth != 0 && o.offsetHeight != 0) ? 'table' : 'none';
|
||||||
|
st.display = (st.display == '' || st.display == 'table') ? 'none' : 'table';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
+-------------------------------------------------------------------+
|
||||||
|
| J S - T O O L T I P (v2.1) |
|
||||||
|
| |
|
||||||
|
| Copyright Gerd Tentler www.gerd-tentler.de/tools |
|
||||||
|
| Created: Feb. 15, 2005 Last modified: Apr. 9, 2007 |
|
||||||
|
+-------------------------------------------------------------------+
|
||||||
|
*/
|
||||||
|
var OP = (navigator.userAgent.indexOf('Opera') != -1);
|
||||||
|
var IE = (navigator.userAgent.indexOf('MSIE') != -1 && !OP);
|
||||||
|
var GK = (navigator.userAgent.indexOf('Gecko') != -1);
|
||||||
|
var SA = (navigator.userAgent.indexOf('Safari') != -1);
|
||||||
|
var DOM = document.getElementById;
|
||||||
|
var tooltip = null;
|
||||||
|
|
||||||
|
function TOOLTIP()
|
||||||
|
{
|
||||||
|
this.text = '';
|
||||||
|
this.height = 0;
|
||||||
|
this.obj = null;
|
||||||
|
this.active = false;
|
||||||
|
|
||||||
|
this.create = function(tip_class)
|
||||||
|
{
|
||||||
|
if(!this.obj)
|
||||||
|
this.init();
|
||||||
|
|
||||||
|
var t = '<table class ="'+ tip_class +'"><tr><td>'+ this.text +'</td></tr></table>';
|
||||||
|
|
||||||
|
if(DOM || IE)
|
||||||
|
this.obj.innerHTML = t;
|
||||||
|
if(DOM)
|
||||||
|
{
|
||||||
|
this.width = this.obj.offsetWidth;
|
||||||
|
this.height = this.obj.offsetHeight;
|
||||||
|
}
|
||||||
|
else if(IE)
|
||||||
|
{
|
||||||
|
this.width = this.obj.style.pixelWidth;
|
||||||
|
this.height = this.obj.style.pixelHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.move();
|
||||||
|
this.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.init = function()
|
||||||
|
{
|
||||||
|
if(DOM)
|
||||||
|
this.obj = document.getElementById('ToolTip');
|
||||||
|
else if(IE)
|
||||||
|
this.obj = document.all.ToolTip;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.move = function()
|
||||||
|
{
|
||||||
|
var winX = getWinX() - (((GK && !SA) || OP) ? 17 : 0);
|
||||||
|
var winY = getWinY() - (((GK && !SA) || OP) ? 17 : 0);
|
||||||
|
var x = mouseX;
|
||||||
|
var y = mouseY;
|
||||||
|
|
||||||
|
if(x + this.width + 10 > winX + getScrX())
|
||||||
|
x -= this.width + 10;
|
||||||
|
else
|
||||||
|
x += 10;
|
||||||
|
|
||||||
|
if(y + this.height + 10 > winY + getScrY())
|
||||||
|
y -= this.height;
|
||||||
|
else
|
||||||
|
y += 10;
|
||||||
|
|
||||||
|
this.obj.style.left = x + 'px';
|
||||||
|
this.obj.style.top = y + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.show = function()
|
||||||
|
{
|
||||||
|
this.obj.style.zIndex = 69;
|
||||||
|
this.active = true;
|
||||||
|
this.obj.style.visibility = 'visible';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hide = function()
|
||||||
|
{
|
||||||
|
this.obj.style.zIndex = -1;
|
||||||
|
this.active = false;
|
||||||
|
this.obj.style.visibility = 'hidden';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getScrX()
|
||||||
|
{
|
||||||
|
var offset = 0;
|
||||||
|
if(window.pageXOffset)
|
||||||
|
offset = window.pageXOffset;
|
||||||
|
else if(document.documentElement && document.documentElement.scrollLeft)
|
||||||
|
offset = document.documentElement.scrollLeft;
|
||||||
|
else if(document.body && document.body.scrollLeft)
|
||||||
|
offset = document.body.scrollLeft;
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getScrY()
|
||||||
|
{
|
||||||
|
var offset = 0;
|
||||||
|
if(window.pageYOffset)
|
||||||
|
offset = window.pageYOffset;
|
||||||
|
else if(document.documentElement && document.documentElement.scrollTop)
|
||||||
|
offset = document.documentElement.scrollTop;
|
||||||
|
else if(document.body && document.body.scrollTop)
|
||||||
|
offset = document.body.scrollTop;
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getWinX()
|
||||||
|
{
|
||||||
|
var size = 0;
|
||||||
|
if(window.innerWidth)
|
||||||
|
size = window.innerWidth;
|
||||||
|
else if(document.documentElement && document.documentElement.clientWidth)
|
||||||
|
size = document.documentElement.clientWidth;
|
||||||
|
else if(document.body && document.body.clientWidth)
|
||||||
|
size = document.body.clientWidth;
|
||||||
|
else
|
||||||
|
size = screen.width;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getWinY()
|
||||||
|
{
|
||||||
|
var size = 0;
|
||||||
|
if(window.innerHeight)
|
||||||
|
size = window.innerHeight;
|
||||||
|
else if(document.documentElement && document.documentElement.clientHeight)
|
||||||
|
size = document.documentElement.clientHeight;
|
||||||
|
else if(document.body && document.body.clientHeight)
|
||||||
|
size = document.body.clientHeight;
|
||||||
|
else
|
||||||
|
size = screen.height;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getMouseXY(e)
|
||||||
|
{
|
||||||
|
if(e && e.pageX != null)
|
||||||
|
{
|
||||||
|
mouseX = e.pageX;
|
||||||
|
mouseY = e.pageY;
|
||||||
|
}
|
||||||
|
else if(event && event.clientX != null)
|
||||||
|
{
|
||||||
|
mouseX = event.clientX + getScrX();
|
||||||
|
mouseY = event.clientY + getScrY();
|
||||||
|
}
|
||||||
|
if(mouseX < 0)
|
||||||
|
mouseX = 0;
|
||||||
|
if(mouseY < 0)
|
||||||
|
mouseY = 0;
|
||||||
|
if(tooltip && tooltip.active)
|
||||||
|
tooltip.move();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function toolTip(text,tip_class)
|
||||||
|
{
|
||||||
|
if(text)
|
||||||
|
{
|
||||||
|
tooltip = new TOOLTIP();
|
||||||
|
tooltip.text = text;
|
||||||
|
tooltip.create(tip_class);
|
||||||
|
}
|
||||||
|
else if(tooltip)
|
||||||
|
tooltip.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.write('<div id="ToolTip" style="position:absolute; visibility:hidden"></div>');
|
||||||
|
|
||||||
|
var mouseX = mouseY = 0;
|
||||||
|
document.onmousemove = getMouseXY;
|
||||||
|
|
||||||
|
function ANSWERBOX()
|
||||||
|
{
|
||||||
|
this.text = '';
|
||||||
|
this.btn_ok = 'OK';
|
||||||
|
this.btn_cancel = 'Cancel';
|
||||||
|
this.classname = 'answerbox';
|
||||||
|
this.btn_icon = 'img/warn_red.gif';
|
||||||
|
this.height = 0;
|
||||||
|
this.obj = null;
|
||||||
|
this.active = false;
|
||||||
|
|
||||||
|
this.create = function(action)
|
||||||
|
{
|
||||||
|
if(!this.obj)
|
||||||
|
this.init();
|
||||||
|
|
||||||
|
var t = ''
|
||||||
|
+'<table class="' + this.classname + '">'
|
||||||
|
+'<tr>'
|
||||||
|
+'<th colspan=2>'
|
||||||
|
+((this.btn_icon)?'<img src="'+ this.btn_icon +'" width="48" height="48" alt="" align="absmiddle" />':'')+ this.text +''
|
||||||
|
+'</th>'
|
||||||
|
+'</tr>'
|
||||||
|
+'<tr align="center">'
|
||||||
|
+' <td>'
|
||||||
|
+' <a class="button" style="width:120px;" href="' + action + '" type="wrn">' + this.btn_ok + '</a>'
|
||||||
|
+' </td>'
|
||||||
|
+' <td>'
|
||||||
|
+' <a class="button" style="width:120px;" href="#" onclick="answerbox.hide()" type="def">' + this.btn_cancel + '</a>'
|
||||||
|
+' </td>'
|
||||||
|
+'</tr>'
|
||||||
|
+'</table>';
|
||||||
|
|
||||||
|
if(DOM || IE)
|
||||||
|
this.obj.innerHTML = t;
|
||||||
|
if(DOM)
|
||||||
|
{
|
||||||
|
this.width = this.obj.offsetWidth;
|
||||||
|
this.height = this.obj.offsetHeight;
|
||||||
|
}
|
||||||
|
else if(IE)
|
||||||
|
{
|
||||||
|
this.width = this.obj.style.pixelWidth;
|
||||||
|
this.height = this.obj.style.pixelHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.move();
|
||||||
|
this.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.init = function()
|
||||||
|
{
|
||||||
|
if(DOM)
|
||||||
|
this.obj = document.getElementById('AnswerBox');
|
||||||
|
else if(IE)
|
||||||
|
this.obj = document.all.AnswerBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.move = function()
|
||||||
|
{
|
||||||
|
var winX = getWinX() - (((GK && !SA) || OP) ? 17 : 0);
|
||||||
|
var winY = getWinY() - (((GK && !SA) || OP) ? 17 : 0);
|
||||||
|
|
||||||
|
this.obj.style.left = (winX/2 + getScrX() - this.width/2 - 5) + 'px';
|
||||||
|
this.obj.style.top = (winY/2 + getScrY() - this.height/2 - 5) + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.show = function()
|
||||||
|
{
|
||||||
|
this.obj.style.zIndex = 60;
|
||||||
|
this.active = true;
|
||||||
|
this.obj.style.visibility = 'visible';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hide = function()
|
||||||
|
{
|
||||||
|
this.obj.style.zIndex = -1;
|
||||||
|
this.active = false;
|
||||||
|
this.obj.style.visibility = 'hidden';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function answerBox(text, action)
|
||||||
|
{
|
||||||
|
if(text)
|
||||||
|
{
|
||||||
|
answerbox.text = text;
|
||||||
|
answerbox.create(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
document.write('<div id="AnswerBox" style="position:absolute; visibility:hidden"></div>');
|
||||||
|
answerbox = new ANSWERBOX();
|
||||||
|
answerbox.init();
|
||||||
9
mojotrollz/idea/playermap/libs/js/index.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta http-equiv="refresh" content="0; URL=../">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
you are not suppose to be here, redirecting to <a href="../">here</a>.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
9
mojotrollz/idea/playermap/libs/js/irc/index.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta http-equiv="refresh" content="0; URL=../">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
you are not suppose to be here, redirecting to <a href="../">here</a>.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
mojotrollz/idea/playermap/libs/js/irc/irc.jar
Normal file
BIN
mojotrollz/idea/playermap/libs/js/irc/pixx.jar
Normal file
51
mojotrollz/idea/playermap/libs/js/layout.js
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// getBrowserWidth is taken from The Man in Blue Resolution Dependent Layout Script
|
||||||
|
function getBrowserWidth()
|
||||||
|
{
|
||||||
|
if (window.innerWidth)
|
||||||
|
{
|
||||||
|
return window.innerWidth;
|
||||||
|
}
|
||||||
|
else if (document.documentElement && document.documentElement.clientWidth != 0)
|
||||||
|
{
|
||||||
|
return document.documentElement.clientWidth;
|
||||||
|
}
|
||||||
|
else if (document.body)
|
||||||
|
{
|
||||||
|
return document.body.clientWidth;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// changeLayout is based on setActiveStyleSheet function by Paul Sowdon
|
||||||
|
// http://www.alistapart.com/articles/alternate/
|
||||||
|
function dynamicLayout()
|
||||||
|
{
|
||||||
|
var i, a;
|
||||||
|
for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
|
||||||
|
{
|
||||||
|
if (a.getAttribute("title") == 1280)
|
||||||
|
{
|
||||||
|
( getBrowserWidth() > 1024) ? a.disabled = false : a.disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addEvent( obj, type, fn )
|
||||||
|
{
|
||||||
|
if (obj.addEventListener)
|
||||||
|
{
|
||||||
|
obj.addEventListener( type, fn, false );
|
||||||
|
}
|
||||||
|
else if (obj.attachEvent)
|
||||||
|
{
|
||||||
|
obj["e"+type+fn] = fn;
|
||||||
|
obj[type+fn] = function()
|
||||||
|
{
|
||||||
|
obj["e"+type+fn]( window.event );
|
||||||
|
}
|
||||||
|
obj.attachEvent( "on"+type, obj[type+fn] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addEvent(window, 'load', dynamicLayout);
|
||||||
|
addEvent(window, 'resize', dynamicLayout);
|
||||||
194
mojotrollz/idea/playermap/libs/js/sha1.js
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
/*
|
||||||
|
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
|
||||||
|
* in FIPS PUB 180-1
|
||||||
|
* Version 2.1a Copyright Paul Johnston 2000 - 2002.
|
||||||
|
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||||
|
* Distributed under the BSD License
|
||||||
|
* See http://pajhome.org.uk/crypt/md5 for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configurable variables. You may need to tweak these to be compatible with
|
||||||
|
* the server-side, but the defaults work in most cases.
|
||||||
|
*/
|
||||||
|
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
|
||||||
|
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
|
||||||
|
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are the functions you'll usually want to call
|
||||||
|
* They take string arguments and return either hex or base-64 encoded strings
|
||||||
|
*/
|
||||||
|
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
|
||||||
|
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
|
||||||
|
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
|
||||||
|
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
|
||||||
|
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
|
||||||
|
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Calculate the SHA-1 of an array of big-endian words, and a bit length
|
||||||
|
*/
|
||||||
|
function core_sha1(x, len)
|
||||||
|
{
|
||||||
|
/* append padding */
|
||||||
|
x[len >> 5] |= 0x80 << (24 - len % 32);
|
||||||
|
x[((len + 64 >> 9) << 4) + 15] = len;
|
||||||
|
|
||||||
|
var w = Array(80);
|
||||||
|
var a = 1732584193;
|
||||||
|
var b = -271733879;
|
||||||
|
var c = -1732584194;
|
||||||
|
var d = 271733878;
|
||||||
|
var e = -1009589776;
|
||||||
|
|
||||||
|
for(var i = 0; i < x.length; i += 16)
|
||||||
|
{
|
||||||
|
var olda = a;
|
||||||
|
var oldb = b;
|
||||||
|
var oldc = c;
|
||||||
|
var oldd = d;
|
||||||
|
var olde = e;
|
||||||
|
|
||||||
|
for(var j = 0; j < 80; j++)
|
||||||
|
{
|
||||||
|
if(j < 16) w[j] = x[i + j];
|
||||||
|
else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
|
||||||
|
var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
|
||||||
|
safe_add(safe_add(e, w[j]), sha1_kt(j)));
|
||||||
|
e = d;
|
||||||
|
d = c;
|
||||||
|
c = rol(b, 30);
|
||||||
|
b = a;
|
||||||
|
a = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
a = safe_add(a, olda);
|
||||||
|
b = safe_add(b, oldb);
|
||||||
|
c = safe_add(c, oldc);
|
||||||
|
d = safe_add(d, oldd);
|
||||||
|
e = safe_add(e, olde);
|
||||||
|
}
|
||||||
|
return Array(a, b, c, d, e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Perform the appropriate triplet combination function for the current
|
||||||
|
* iteration
|
||||||
|
*/
|
||||||
|
function sha1_ft(t, b, c, d)
|
||||||
|
{
|
||||||
|
if(t < 20) return (b & c) | ((~b) & d);
|
||||||
|
if(t < 40) return b ^ c ^ d;
|
||||||
|
if(t < 60) return (b & c) | (b & d) | (c & d);
|
||||||
|
return b ^ c ^ d;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Determine the appropriate additive constant for the current iteration
|
||||||
|
*/
|
||||||
|
function sha1_kt(t)
|
||||||
|
{
|
||||||
|
return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
|
||||||
|
(t < 60) ? -1894007588 : -899497514;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Calculate the HMAC-SHA1 of a key and some data
|
||||||
|
*/
|
||||||
|
function core_hmac_sha1(key, data)
|
||||||
|
{
|
||||||
|
var bkey = str2binb(key);
|
||||||
|
if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
|
||||||
|
|
||||||
|
var ipad = Array(16), opad = Array(16);
|
||||||
|
for(var i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
ipad[i] = bkey[i] ^ 0x36363636;
|
||||||
|
opad[i] = bkey[i] ^ 0x5C5C5C5C;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
|
||||||
|
return core_sha1(opad.concat(hash), 512 + 160);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||||
|
* to work around bugs in some JS interpreters.
|
||||||
|
*/
|
||||||
|
function safe_add(x, y)
|
||||||
|
{
|
||||||
|
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
||||||
|
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||||
|
return (msw << 16) | (lsw & 0xFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bitwise rotate a 32-bit number to the left.
|
||||||
|
*/
|
||||||
|
function rol(num, cnt)
|
||||||
|
{
|
||||||
|
return (num << cnt) | (num >>> (32 - cnt));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert an 8-bit or 16-bit string to an array of big-endian words
|
||||||
|
* In 8-bit function, characters >255 have their hi-byte silently ignored.
|
||||||
|
*/
|
||||||
|
function str2binb(str)
|
||||||
|
{
|
||||||
|
var bin = Array();
|
||||||
|
var mask = (1 << chrsz) - 1;
|
||||||
|
for(var i = 0; i < str.length * chrsz; i += chrsz)
|
||||||
|
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
|
||||||
|
return bin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert an array of big-endian words to a string
|
||||||
|
*/
|
||||||
|
function binb2str(bin)
|
||||||
|
{
|
||||||
|
var str = "";
|
||||||
|
var mask = (1 << chrsz) - 1;
|
||||||
|
for(var i = 0; i < bin.length * 32; i += chrsz)
|
||||||
|
str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert an array of big-endian words to a hex string.
|
||||||
|
*/
|
||||||
|
function binb2hex(binarray)
|
||||||
|
{
|
||||||
|
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||||
|
var str = "";
|
||||||
|
for(var i = 0; i < binarray.length * 4; i++)
|
||||||
|
{
|
||||||
|
str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
|
||||||
|
hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert an array of big-endian words to a base-64 string
|
||||||
|
*/
|
||||||
|
function binb2b64(binarray)
|
||||||
|
{
|
||||||
|
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
var str = "";
|
||||||
|
for(var i = 0; i < binarray.length * 4; i += 3)
|
||||||
|
{
|
||||||
|
var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
|
||||||
|
| (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
|
||||||
|
| ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
|
||||||
|
for(var j = 0; j < 4; j++)
|
||||||
|
{
|
||||||
|
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
|
||||||
|
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
BIN
mojotrollz/idea/playermap/libs/js/ssh.jar
Normal file
59
mojotrollz/idea/playermap/libs/js/tab.js
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
//thanks to Jonathan Hedley
|
||||||
|
var panes = new Array();
|
||||||
|
|
||||||
|
function setupPanes(containerId, defaultTabId)
|
||||||
|
{
|
||||||
|
panes[containerId] = new Array();
|
||||||
|
var maxHeight = 0; var maxWidth = 0;
|
||||||
|
var container = document.getElementById(containerId);
|
||||||
|
var paneContainer = container.getElementsByTagName("div")[0];
|
||||||
|
var paneList = paneContainer.childNodes;
|
||||||
|
for (var i=0; i < paneList.length; i++ )
|
||||||
|
{
|
||||||
|
var pane = paneList[i];
|
||||||
|
if (pane.nodeType != 1)
|
||||||
|
continue;
|
||||||
|
if (pane.offsetHeight > maxHeight)
|
||||||
|
maxHeight = pane.offsetHeight;
|
||||||
|
if (pane.offsetWidth > maxWidth )
|
||||||
|
maxWidth = pane.offsetWidth;
|
||||||
|
panes[containerId][pane.id] = pane;
|
||||||
|
pane.style.display = "none";
|
||||||
|
}
|
||||||
|
paneContainer.style.height = maxHeight + "px";
|
||||||
|
paneContainer.style.width = maxWidth + "px";
|
||||||
|
document.getElementById(defaultTabId).onclick();
|
||||||
|
}
|
||||||
|
|
||||||
|
function showPane(paneId, activeTab)
|
||||||
|
{
|
||||||
|
for (var con in panes)
|
||||||
|
{
|
||||||
|
activeTab.blur();
|
||||||
|
activeTab.className = "jtab-active";
|
||||||
|
if (panes[con][paneId] != null)
|
||||||
|
{
|
||||||
|
var pane = document.getElementById(paneId);
|
||||||
|
pane.style.display = "block";
|
||||||
|
var container = document.getElementById(con);
|
||||||
|
var tabs = container.getElementsByTagName("ul")[0];
|
||||||
|
var tabList = tabs.getElementsByTagName("a")
|
||||||
|
for (var i=0; i<tabList.length; i++ )
|
||||||
|
{
|
||||||
|
var tab = tabList[i];
|
||||||
|
if (tab != activeTab)
|
||||||
|
tab.className = "jtab-disabled";
|
||||||
|
}
|
||||||
|
for (var i in panes[con])
|
||||||
|
{
|
||||||
|
var pane = panes[con][i];
|
||||||
|
if (pane == undefined)
|
||||||
|
continue;
|
||||||
|
if (pane.id == paneId)
|
||||||
|
continue;
|
||||||
|
pane.style.display = "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
41
mojotrollz/idea/playermap/map_english.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$character_race = Array(
|
||||||
|
1 => 'Human',
|
||||||
|
2 => 'Orc',
|
||||||
|
3 => 'Dwarf',
|
||||||
|
4 => 'Night Elf',
|
||||||
|
5 => 'Undead',
|
||||||
|
6 => 'Tauren',
|
||||||
|
7 => 'Gnome',
|
||||||
|
8 => 'Troll',
|
||||||
|
9 => 'Goblin',
|
||||||
|
10 => 'Blood Elf',
|
||||||
|
11 => 'Drenai');
|
||||||
|
|
||||||
|
$character_class = Array(
|
||||||
|
1 => 'Warrior',
|
||||||
|
2 => 'Paladin',
|
||||||
|
3 => 'Hunter',
|
||||||
|
4 => 'Rogue',
|
||||||
|
5 => 'Priest',
|
||||||
|
6 => 'Death Knight',
|
||||||
|
7 => 'Shaman',
|
||||||
|
8 => 'Mage',
|
||||||
|
9 => 'Warlock',
|
||||||
|
11 => 'Druid');
|
||||||
|
|
||||||
|
$lang_defs = Array(
|
||||||
|
'maps_names' => Array('Azeroth','Outland','Northrend'),
|
||||||
|
'total' => 'Total',
|
||||||
|
'faction' => Array('Alliance', 'Horde'),
|
||||||
|
'name' => 'Name',
|
||||||
|
'race' => 'Race',
|
||||||
|
'class' => 'Class',
|
||||||
|
'level' => 'lvl',
|
||||||
|
'click_to_next' => 'Click: go to next',
|
||||||
|
'click_to_first' => 'Click: go to first'
|
||||||
|
);
|
||||||
|
|
||||||
|
include "/zone_names_english.php";
|
||||||
|
?>
|
||||||
64
mojotrollz/idea/playermap/pomm_conf.php
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
require_once("/func.php");
|
||||||
|
|
||||||
|
|
||||||
|
require_once("/config/playermap_config.php");
|
||||||
|
require_once '/libs/data_lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
$realm_id = intval( $_COOKIE['cur_selected_realmd'] );
|
||||||
|
$server_arr = $server;
|
||||||
|
|
||||||
|
if (isset($_COOKIE["lang"]))
|
||||||
|
{
|
||||||
|
$lang = $_COOKIE["lang"];
|
||||||
|
if (!file_exists("map_".$lang.".php") && !file_exists("zone_names_".$lang.".php"))
|
||||||
|
$lang = $language;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$lang = $language;
|
||||||
|
|
||||||
|
$database_encoding = $site_encoding;
|
||||||
|
|
||||||
|
$server = $server_arr[$realm_id]["addr"];
|
||||||
|
$port = $server_arr[$realm_id]["game_port"];
|
||||||
|
|
||||||
|
$host = $characters_db[$realm_id]["addr"];
|
||||||
|
$user = $characters_db[$realm_id]["user"];
|
||||||
|
$password = $characters_db[$realm_id]["pass"];
|
||||||
|
$db = $characters_db[$realm_id]["name"];
|
||||||
|
|
||||||
|
$hostr = $realm_db["addr"];
|
||||||
|
$userr = $realm_db["user"];
|
||||||
|
$passwordr = $realm_db["pass"];
|
||||||
|
$dbr = $realm_db["name"];
|
||||||
|
|
||||||
|
$sql = new DBLayer($hostr, $userr, $passwordr, $dbr);
|
||||||
|
$query = $sql->query("SELECT name FROM realmlist WHERE id = ".$realm_id);
|
||||||
|
$realm_name = $sql->fetch_assoc($query);
|
||||||
|
$realm_name = htmlentities($realm_name["name"]);
|
||||||
|
|
||||||
|
$gm_show_online = $gm_online;
|
||||||
|
$gm_show_online_only_gmoff = $map_gm_show_online_only_gmoff;
|
||||||
|
$gm_show_online_only_gmvisible = $map_gm_show_online_only_gmvisible;
|
||||||
|
$gm_add_suffix = $map_gm_add_suffix;
|
||||||
|
$gm_include_online = $gm_online_count;
|
||||||
|
$show_status = $map_show_status;
|
||||||
|
$time_to_show_uptime = $map_time_to_show_uptime;
|
||||||
|
$time_to_show_maxonline = $map_time_to_show_maxonline;
|
||||||
|
$time_to_show_gmonline = $map_time_to_show_gmonline;
|
||||||
|
$status_gm_include_all = $map_status_gm_include_all;
|
||||||
|
$time = $map_time;
|
||||||
|
$show_time = $map_show_time;
|
||||||
|
|
||||||
|
// points located on these maps(do not modify it)
|
||||||
|
$maps_for_points = "0,1,530,571,609";
|
||||||
|
|
||||||
|
$img_base = "img/map/";
|
||||||
|
$img_base2 = "img/c_icons/";
|
||||||
|
|
||||||
|
$PLAYER_FLAGS = CHAR_DATA_OFFSET_FLAGS;
|
||||||
|
|
||||||
|
?>
|
||||||
143
mojotrollz/idea/playermap/pomm_play.php
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
require_once("pomm_conf.php");
|
||||||
|
require_once("func.php");
|
||||||
|
require_once("map_english.php");
|
||||||
|
|
||||||
|
$_RESULT = NULL;
|
||||||
|
|
||||||
|
$maps_count = count($lang_defs['maps_names']);
|
||||||
|
|
||||||
|
$Horde_races = 0x2B2;
|
||||||
|
$Alliance_races = 0x44D;
|
||||||
|
$outland_inst = array(540,542,543,544,545,546,547,548,550,552,553,554,555,556,557,558,559,562,564,565);
|
||||||
|
$northrend_inst = array(533,574,575,576,578,599,600,601,602,603,604,608,615,616,617,619,624);
|
||||||
|
|
||||||
|
require_once "libs/js/JsHttpRequest/Php.php";
|
||||||
|
$JsHttpRequest = new Subsys_JsHttpRequest_Php("utf-8");
|
||||||
|
|
||||||
|
$realm_db = new DBLayer($hostr, $userr, $passwordr, $dbr);
|
||||||
|
if(!$realm_db->isValid())
|
||||||
|
{
|
||||||
|
$_RESULT['status']['online'] = 2;
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
$realm_db->query("SET NAMES $database_encoding");
|
||||||
|
|
||||||
|
$gm_online = 0;
|
||||||
|
$gm_accounts = array();
|
||||||
|
$query = $realm_db->query("SELECT GROUP_CONCAT(`id` SEPARATOR ' ') FROM `account` WHERE `gmlevel`>'0'");
|
||||||
|
if($query)
|
||||||
|
if($result = $realm_db->fetch_row($query))
|
||||||
|
$gm_accounts = explode(' ', $result[0]);
|
||||||
|
$groups = array();
|
||||||
|
$characters_db = new DBLayer($host, $user, $password, $db);
|
||||||
|
if(!$characters_db->isValid())
|
||||||
|
{
|
||||||
|
$_RESULT['status']['online'] = 2;
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
$characters_db->query("SET NAMES $database_encoding");
|
||||||
|
$query = $characters_db->query("SELECT `leaderGuid`,`memberGuid` FROM `group_member` WHERE `memberGuid` IN(SELECT `guid` FROM `characters` WHERE `online`='1')");
|
||||||
|
if($query)
|
||||||
|
while($result = $characters_db->fetch_assoc($query))
|
||||||
|
$groups[$result['memberGuid']] = $result['leaderGuid'];
|
||||||
|
|
||||||
|
$Count = array();
|
||||||
|
for($i = 0; $i < $maps_count; $i++) {
|
||||||
|
$Count[$i] = array(0,0);
|
||||||
|
}
|
||||||
|
$arr = array();
|
||||||
|
$i=$maps_count;
|
||||||
|
$query = $characters_db->query("SELECT `account`,`name`,`class`,`race`, `level`, `gender`, `position_x`,`position_y`,`map`,`zone`,`extra_flags` FROM `characters` WHERE `online`='1' ORDER BY `name`");
|
||||||
|
while($result = $characters_db->fetch_assoc($query))
|
||||||
|
{
|
||||||
|
if($result['map'] == 530 && $result['position_y'] > -1000 || in_array($result['map'], $outland_inst))
|
||||||
|
$Extention = 1;
|
||||||
|
else if($result['map'] == 571 || in_array($result['map'], $northrend_inst))
|
||||||
|
$Extention = 2;
|
||||||
|
else
|
||||||
|
$Extention = 0;
|
||||||
|
|
||||||
|
$gm_player = false;
|
||||||
|
$show_player = true;
|
||||||
|
if(in_array($result['account'], $gm_accounts))
|
||||||
|
{
|
||||||
|
$gm_player = true;
|
||||||
|
$show_player = false;
|
||||||
|
if($gm_show_online == 1)
|
||||||
|
{
|
||||||
|
$show_player = true;
|
||||||
|
if(($result['extra_flags'] & 0x1) != 0 && $gm_show_online_only_gmoff == 1)
|
||||||
|
$show_player = false;
|
||||||
|
if(($result['extra_flags'] & 0x10) != 0 && $gm_show_online_only_gmvisible == 1)
|
||||||
|
$show_player = false;
|
||||||
|
if($gm_add_suffix && $show_player)
|
||||||
|
$result['name'] = $result['name'].' <small style="color: #EABA28;">{GM}</small>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($gm_player == false || ($gm_player == true && $gm_include_online == 1))
|
||||||
|
{
|
||||||
|
if($Horde_races & (0x1 << ($result['race']-1)))
|
||||||
|
$Count[$Extention][1]++;
|
||||||
|
else if($Alliance_races & (0x1 << ($result['race']-1)))
|
||||||
|
$Count[$Extention][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 = 0;
|
||||||
|
$char_flags = $char_data;
|
||||||
|
$char_dead = ($char_flags & 0x11)?1:0;
|
||||||
|
$arr[$i]['x'] = $result['position_x'];
|
||||||
|
$arr[$i]['y'] = $result['position_y'];
|
||||||
|
$arr[$i]['dead'] = $char_dead;
|
||||||
|
$arr[$i]['name']=$result['name'];
|
||||||
|
$arr[$i]['map']=$result['map'];
|
||||||
|
$arr[$i]['zone']=get_zone_name($result['zone']);
|
||||||
|
$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]) ? $groups[$char_data] : 0;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$characters_db->close();
|
||||||
|
unset($characters_db);
|
||||||
|
|
||||||
|
if(!count($arr) && !test_realm())
|
||||||
|
$res['online'] = NULL;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usort($arr, "sort_players");
|
||||||
|
$arr = array_merge($Count, $arr);
|
||||||
|
$res['online'] = $arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($show_status) {
|
||||||
|
$query = $realm_db->query("SELECT UNIX_TIMESTAMP(),`starttime`,`maxplayers` FROM `uptime` WHERE `starttime`=(SELECT MAX(`starttime`) FROM `uptime`)");
|
||||||
|
if($result = $realm_db->fetch_row($query)) {
|
||||||
|
$status['online'] = test_realm() ? 1 : 0;
|
||||||
|
$status['uptime'] = $result[0] - $result[1];
|
||||||
|
$status['maxplayers'] = $result[2];
|
||||||
|
$status['gmonline'] = $gm_online;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$status = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$status = NULL;
|
||||||
|
|
||||||
|
$realm_db->close();
|
||||||
|
unset($realm_db);
|
||||||
|
|
||||||
|
$res['status'] = $status;
|
||||||
|
|
||||||
|
$_RESULT = $res;
|
||||||
|
?>
|
||||||