source: trunk/test_server/teleport.php@ 647

Last change on this file since 647 was 647, checked in by barny, 15 years ago

Opraven test server web

File size: 6.8 KB
Line 
1<?php
2header("Cache-Control: no-cache");
3/*
4 ReggAcc
5 Teleport character
6 (c) 2008 Vladonix (reggacc.admin at gmail dot com) 19.03.2009
7*/
8
9define('roSSECURE',true); // tested in configuration file - change
10
11define('CFG_FILE', "configuration.php"); // configuration file - change name
12
13if (!is_file(CFG_FILE)) {
14 echo "<P>Create >>> <a href=\"administration.php\">ReggAcc configuration</A> <<< </P>";
15 die('Configuration file does not exist.');
16}
17
18require_once(CFG_FILE); // main configuration - included must be first, because there is defined variable $lang used in lang.php
19require_once('lang.php'); // translations + contains function to write log, do not remove!
20include_once('dblayer.php');// database manipulating class (methods)
21
22if (!isset($layout) || !$layout) {
23 $layout = 0;
24 $lpath = "tbc/";
25}
26else {
27 $lpath = "wotlk/";
28}
29
30$lfile = "style".$lang.".css";
31
32// default
33if (!isset($img_base))
34 $img_base = "img/";
35if (!isset($charset))
36 $charset = "utf-8";
37
38$ip = $_SERVER['REMOTE_ADDR'];
39
40if (isset($_REQUEST['nr']))
41 $gnr = $_REQUEST['nr'];
42else
43 $gnr = 0;
44
45// set variables
46$ridG="rid".($gnr?$gnr:"");
47$hostrG="hostr".($gnr?$gnr:"");
48$userrG="userr".($gnr?$gnr:"");
49$passwordrG="passwordr".($gnr?$gnr:"");
50$dbrG="dbr".($gnr?$gnr:"");
51$database_encodingG="database_encoding".($gnr?$gnr:"");
52$extenG="exten".($gnr?$gnr:"");
53$showTeleportG="showTeleport".($gnr?$gnr:"");
54$feeTeleportG="feeTeleport".($gnr?$gnr:"");
55
56if (!isset(${$ridG}) || !isset(${$hostrG}) || !isset(${$userrG}) || !isset(${$passwordrG}) || !isset(${$dbrG})
57 || !isset(${$database_encodingG}) || !isset(${$extenG}) || !isset(${$showTeleportG})
58 || !isset(${$feeTeleportG})) {
59
60 echo "<P>Update >>> <a href=\"administration.php\">ReggAcc configuration</A> <<< </P>";
61 die('Set all variables for choosed realm.');
62}
63
64
65//echo ${$hostcG}.${$usercG}.${$passwordcG}.${$dbcG}.${$database_encodingG}.${$show_gmG}.${$hostrG}.${$userrG}.${$passwordrG}.${$dbrG};
66
67// G - as global ;)
68$title = get_realm_name(${$hostrG}, ${$userrG}, ${$passwordrG}, ${$dbrG}, ${$database_encodingG}, ${$ridG});
69
70if (empty($title)) $title = "No Title";
71
72if (${$extenG} > 1) // wotlk
73 $locations = array("Dalaran", "Darnassus", "Ironforge", "Orgrimmar", "Shattrath", "StormWind", "ThunderBluff", "Undercity");
74else
75 $locations = array("Darnassus", "Ironforge", "Orgrimmar", "Shattrath", "StormWind", "ThunderBluff", "Undercity");
76
77?>
78<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
79<html>
80 <head>
81 <title><?php isset($sitename)?print $sitename:print ""; ?></title>
82 <meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
83 <meta http-equiv=Content-Type content="text/html; charset=<?php isset($charset)?print $charset:print 'utf-8'; ?>">
84 <link href="<?php echo $lpath.$lfile ?>" type="text/css" rel=stylesheet>
85 <link rel="Shortcut Icon" href="<?php print $img_base ?>wowlogoanim.gif" type="image/gif">
86
87 <script type="text/javascript" src="js/jquery.js"></script>
88
89 <script type="text/javascript">
90 $(document).ready(function() {
91 $("form#plr_insert_result").hide();
92 $("#location").val(0);
93// $("#locimg").text("StormWind City");
94
95 $("form#plr_insert").submit(function() {
96 $.post("ajax_teleport.php",
97 {
98 charname: $("#charname").val(),
99 username: $("#username").val(),
100 passw: $("#passw").val(),
101 loc: $("#location").val(),
102 nr: $("#tnr").val()
103 }, function(data) {
104 $("form#plr_insert").hide("slow");
105 $("#charname").val("");
106 $("#username").val("");
107 $("#passw").val("");
108 $("form#plr_insert_result div").html(data);
109 $("form#plr_insert_result").show("slow");
110 }
111 );
112 return false;
113 });
114
115 $("form#plr_insert_result").submit(function() {
116 $("form#plr_insert_result").hide("slow");
117 $("form#plr_insert").show("slow");
118
119 return false;
120 });
121
122 $("#location").change(function() {
123 var t = "url('img/teleport/"+$("#location option:selected").text()+"0.jpg')";
124 var v = "url('img/teleport/"+$("#location option:selected").text()+".jpg')";
125
126// $("#locimg").text(t);
127 $("#teleimg").css("background-image", v.toLowerCase());
128 $("#telesimg").css("background-image", t.toLowerCase());
129 });
130
131
132 });
133 </script>
134
135</head>
136
137<body>
138
139<div id="main">
140
141 <div id="stredniTele">
142
143 <div id="wlogo" title="WoW">&nbsp;</div>
144
145 <div id="teleimgpoint">
146 &nbsp;
147 </div>
148
149 <div id="teleimgpoint1">
150 &nbsp;
151 </div>
152
153 <div id="televstup">
154 <form action="" id="plr_insert_result">
155 <div class="error">&nbsp;</div>
156<?php
157 echo "
158 <input type=\"hidden\" name=\"nr\" id=\"nr1\" value=\"".$gnr."\">
159 <input type=\"submit\" class=\"bback\" tabindex=\"1\" title=\"Send\" value=\"\">";
160?>
161 </form>
162<?php
163 if(${$showTeleportG} == 1) {
164 echo "
165 <form action=\"\" id=\"plr_insert\">
166
167 <p class=\"txt1\">".$title."</p>
168
169 <p class=\"pcaps_left\">".$text["tele_labels"]['character']."</p>
170 <input class=\"old\" id=\"charname\" tabIndex=\"1\" maxLength=\"15\" size=\"18\" name=\"charname\" value=\"\">
171
172 <p class=\"pcaps_left\">".$text["tele_labels"]['account']."</p>
173 <input class=\"old\" id=\"username\" tabIndex=\"2\" maxLength=\"15\" size=\"18\" name=\"username\" value=\"\">
174
175 <p class=\"pcaps_left\">".$text["tele_labels"]['password']."</p>
176 <input class=\"old\" id=\"passw\" tabIndex=\"3\" type=\"password\" maxLength=\"15\" size=\"18\" name=\"passw\" value=\"\">
177
178 <p class=\"pcaps_left\">".$text["tele_labels"]['location']."</p>
179
180 <select size=\"1\" id=\"location\" name=\"location\" tabIndex=\"4\">";
181
182 for ($i = 0; $i < count($locations); $i++)
183 echo "<option value=\"".$i."\" ".(!$i?"selected":"").">".$locations[$i]."</option>";
184
185 echo "
186 </select>
187
188 <input type=\"submit\" class=\"btele\" tabindex=\"5\" title=\"Send\" value=\"\">
189 <input type=\"hidden\" name=\"tnr\" id=\"tnr\" value=\"".$gnr."\">
190 </form>";
191 }
192?>
193 </div>
194
195 <div id="telemenu">
196 <?php
197 echo "
198 <form action=\"world1.php\" method=post enctype=\"multipart/form-data\">
199 <input type=\"hidden\" name=\"nr\" id=\"nr\" value=\"".$gnr."\">
200 <input type=\"submit\" class=\"bback\" tabindex=\"4\" title=\"Send\" value=\"\">
201 </form>";
202 ?>
203 <div id="telenote">
204 <span class="txt1"> <?php echo $text['tele_note'].${$feeTeleportG}." g."; ?></span>
205 </div>
206 </div>
207
208 <div id="telesimg" >
209 &nbsp;
210 </div>
211
212 <div id="teleimg" >
213 &nbsp;
214 </div>
215
216
217 </div>
218</div>
219
220</body>
221</html>
Note: See TracBrowser for help on using the repository browser.