Changeset 118
- Timestamp:
- Nov 4, 2007, 5:38:25 PM (17 years ago)
- Location:
- db
- Files:
-
- 16 added
- 2 deleted
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
db
- Property svn:ignore
-
old new 1 1 config.php 2 navrh
-
- Property svn:ignore
-
db/admin/bugreporter.php
r109 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 4 4 … … 93 93 <?php echo $sql_select['result']; ?> 94 94 <?php }; ?> 95 96 97 <?php98 };99 ?> -
db/admin/commands.php
r112 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 … … 17 17 ?> 18 18 </table> 19 20 <?php21 };22 ?> -
db/admin/komentare.php
r109 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK" }{2 if (!defined('IN_CODE')){ exit; }; 3 3 4 4 … … 48 48 </table> 49 49 <p><?php echo $sql_komentare_dotaz['strankovani']; ?></p> 50 51 <?php52 };53 ?> -
db/admin/obsah.php
r112 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK" AND $user['hodnost'] > 0 ){2 if (!defined('IN_CODE') OR $user['hodnost'] < 1 ){ exit; }; 3 3 4 4 if( !empty($str) ){ … … 68 68 echo "\n</div>\n"; 69 69 require_once $admin_file; 70 71 } else{ echo "<p>Pro vstup nemáte oprávnění !</p>"; }; 70 72 71 ?> -
db/admin/uvod.php
r109 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Administrační rozhraní pro Online Prohlížeč databáze.</p> 6 7 <?php8 };9 ?> -
db/character.php
r109 r118 1 1 <?php 2 if (!defined('IN_CODE')){ exit; }; 2 3 /* ##################################################################### 3 4 ##################################################################### */ … … 14 15 \* ================================= */ 15 16 16 require_once "./config.php";17 18 @mysql_connect( $Config['DB_read']['Database']['Host'], $Config['DB_read']['Database']['User'], $Config['DB_read']['Database']['Password'] )19 OR DIE("<p>Vyskytla se chyba a nelze se připojit k databázi.<br> Zkuste to později.</p>");20 21 17 /* Podle předlohy nastavte v následujícím poli tabulky které se mají přečíst 22 18 Jsou přednastavené, ale pokud by některá chyběla nebo přebývala, opravte je 23 19 Klíč => array("tabulka","podmínka na select", "podmínka na nalezeni"), */ 20 24 21 $table = array( 25 22 0 => array("character", "guid", "name"), … … 39 36 14 => array("character_ticket", "guid"), 40 37 15 => array("character_tutorial", "guid"), 41 16 => array("item_instance", "owner_guid") 38 16 => array("item_instance", "owner_guid") 42 39 ); 43 40 44 41 /* ############### Konec Nastavení scriptu ############### */ 45 42 46 if( !isset($_POST['char']) ){47 @mysql_select_db($Config['DB_read']['DB_read']['Database_mangos'])48 OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_mangos']."!</p>");49 @mysql_query("SET CHARACTER SET utf8");50 43 51 $character_sql = mysql_query("SELECT * FROM `character` WHERE `guid`='".$_GET['char']."' LIMIT 1"); 52 if( mysql_num_rows($character_sql) == 1 ){ $character_sql = mysql_fetch_array($character_sql); } 53 else{ echo "Chyba postava nenalezena ! "; exit; }; 54 55 ?> 56 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 57 <html> 58 <head> 59 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" > 60 <meta name="author" content="http://HBstudio.ic.cz; e-mail: HosipLan@seznam.cz" > 61 <meta name="Description" content="Vytažení postavy z databáze" > 62 <meta name="Keywords" content="character,postava,database,vytazeni,obnoveni" > 63 <meta name="robots" content="all, follow" > 64 <title>::] Vytažení postavy z databáze [::</title> 65 </head> 66 <body> 67 <p>Pro ověření zadejte heslo a jméno accoutu, na kterém se postava nachází.</p> 68 <form action="<?php echo("./".basename(__FILE__)); ?>" method="post"> 69 <table border="0" id="login" cellspacing="0" cellpadding="3"> 70 <tr><td colspan='2'><h3>Character: <?php echo $character_sql['name']; ?></h3></td></tr> 71 <tr><td><label for="username">Acount:</label></td><td><input type="text" name="username" id="username" value="<?php echo $_POST['username']; ?>" maxlength="32" style="width: 250px;"></td></tr> 72 <tr><td><label for="pass">Heslo:</label></td><td><input type="password" name="pass" id="pass" maxlength="32" style="width: 250px;"></td></tr> 73 <tr><td align='right' colspan='2'><input type="submit" value="Download !" name="down"> 74 <input type="hidden" name="char" value="<?php echo $_GET['char']; ?>" style="display:none;"></td></tr> 75 </table></form> 76 <?php 77 } else{ 78 44 79 45 $nick = $_POST['username']; $heslo = $_POST['pass']; 80 46 $zakodovane_heslo = sha1(STRTOUPPER($nick).":".STRTOUPPER($heslo)); 81 @mysql_select_db($Config['DB_read']['DB_read']['Database_realmd'])82 OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_realmd']."!</p>");83 @mysql_query("SET CHARACTER SET utf8");84 47 48 SwitchDB(2); // nastavení databáze na realmd 85 49 $sql_acc = @mysql_query("SELECT * FROM `account` WHERE (`username`='$nick' AND `I`='$zakodovane_heslo') LIMIT 1 "); 86 50 if( mysql_num_rows($sql_acc) == 1 ) { 87 51 $sql_acc = mysql_fetch_array($sql_acc); 88 52 89 @mysql_select_db($Config['DB_read']['DB_read']['Database_mangos']) 90 OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_mangos']."!</p>"); 91 @mysql_query("SET CHARACTER SET utf8"); 92 53 SwitchDB(1); // nastavení databáze na mangos 93 54 $sql_user = @mysql_query("SELECT * FROM `character` WHERE `guid`='".addslashes($_POST['char'])."' AND `account`='".$sql_acc['id']."' LIMIT 1 "); 94 55 if( mysql_num_rows($sql_user) == 1 ) { 95 56 $sql_user = mysql_fetch_array($sql_user); 96 97 57 98 @mysql_select_db($Config['DB_read']['DB_read']['Database_web']) 99 OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>"); 100 @mysql_query("SET CHARACTER SET utf8"); 58 SwitchDB(3); // nastavení databáze na web 101 59 $limit_sql = mysql_query("SELECT * FROM `acc_down_char` WHERE (`acc`='".$sql_user['account']."' AND `char`='".$sql_user['guid']."') ORDER BY `date` DESC"); 102 60 if( mysql_num_rows($limit_sql) > 0 ){ … … 106 64 }; 107 65 }; 108 109 66 110 @mysql_select_db($Config['DB_read']['DB_read']['Database_mangos']) 111 OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_mangos']."!</p>"); 112 @mysql_query("SET CHARACTER SET utf8"); 113 67 SwitchDB(1); // nastavení databáze na mangos 114 68 /* =========== Zacatek Hlavniho Scriptu =========== */ 115 69 $character = mysql_query("SELECT * FROM `".$table[0][0]."` WHERE `".$table[0][2]."`='".$sql_user['name']."' LIMIT 1"); … … 178 132 @header('Content-disposition: attachment; filename='.$Config['DB_read']['DB_read']['Abbr'].'_'.$sql_user['name'].".sql"); 179 133 print($file); 180 181 134 182 @mysql_select_db($Config['DB_read']['DB_read']['Database_web']) 183 OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>"); 184 @mysql_query("SET CHARACTER SET utf8"); 135 SwitchDB(3); // nastavení databáze na web 185 136 mysql_query("INSERT INTO `acc_down_char` (`acc`,`char`,`date`,`ip`) VALUES ('".$sql_acc['id']."','".$sql_user['guid']."','".time()."','".$_SERVER["REMOTE_ADDR"]."') "); 186 137 … … 191 142 } else { echo "Špatný account nebo heslo ! "; exit; }; 192 143 193 };194 195 196 mysql_close(); // odpojíme se od databáze197 /* =========== END_scritps =========== */198 if( !isset($_POST['down']) ){199 ?>200 201 </body>202 </html>203 204 <?php205 };206 144 207 145 /* ##################################################################### -
db/check_database.php
r113 r118 1 1 <?php 2 if (!defined('IN_CODE')){ exit; }; 2 3 3 4 $Database = array( -
db/config.sample.php
r113 r118 1 1 <?php 2 if (!defined('IN_CODE')){ exit; }; 2 3 3 4 $Config['DB_read'] = array( -
db/css/zakladni_css.css
r110 r118 42 42 input { 43 43 display: inline; 44 border: 1px solid black;44 border: 1px solid #d3d3d3; 45 45 background: white; 46 46 color: black; } … … 81 81 color: #000000; 82 82 text-decoration: none; background-color: #ffffff; } 83 a.graylink { font-weight: bold; padding: 1px; color: gray; text-decoration: none; } 84 a.whitelink { font-weight: bold; padding: 1px; color: white; text-decoration: none; } 85 a.whitelink:hover { color: black; } 86 a.greenlink { font-weight: bold; padding: 1px; color: #23e64c; text-decoration: none; } 87 a.bluelink { font-weight: bold; padding: 1px; color: #239fe6; text-decoration: none; } 88 a.purplelink { font-weight: bold; padding: 1px; color: #ba55d3; text-decoration: none; } 89 a.orangelink { font-weight: bold; padding: 1px; color: #e6b623; text-decoration: none; } 90 a.redlink { font-weight: bold; padding: 1px; color: #e62323; text-decoration: none; } 83 a.graylink { font-weight: bold; padding: 1px; color: #9d9d9d; text-decoration: none; } 84 a.whitelink { font-weight: bold; padding: 1px; color: white; text-decoration: none; } a.whitelink:hover { color: black; } 85 a.greenlink { font-weight: bold; padding: 1px; color: #1eff00; text-decoration: none; } 86 a.bluelink { font-weight: bold; padding: 1px; color: #0070dd; text-decoration: none; } 87 a.purplelink { font-weight: bold; padding: 1px; color: #a335ee; text-decoration: none; } 88 a.orangelink { font-weight: bold; padding: 1px; color: #ffff98; text-decoration: none; } 89 a.redlink { font-weight: bold; padding: 1px; color: #ffff98; text-decoration: none; } /* #e62323 */ 90 91 .gray { color: #9d9d9d; } 92 .white { color: white; } 93 .green { color: #1eff00; } 94 .blue { color: #0070dd; } 95 .purple { color: #a335ee; } 96 .orange { color: #ffff98; } 97 .red { color: #ffff98; } /* #e62323 */ 91 98 92 99 #center { … … 110 117 display: block; 111 118 float: left; 112 width: 120px; }119 width: 120px; } 113 120 #left ul#hlavni_menu { 114 121 display: block; … … 188 195 float: left; } 189 196 #right form.search_form input { 190 border: 1px solid black;}197 border: 1px solid #d3d3d3; } 191 198 #right form.search_form input.noborder { 192 199 border: 0px; } 193 200 #right form.search_form input { 194 border: 1px solid black;}201 border: 1px solid #d3d3d3; } 195 202 #right table.search_result { 196 203 empty-cells: show; … … 258 265 #right table#login input { 259 266 display: inline; 260 border: 1px solid white;267 border: 1px solid #d3d3d3; 261 268 background: black; 262 269 color: white; } … … 273 280 margin: 0px; 274 281 padding-left: 10px; } 275 282 #right #item_thumb { 283 display: block; 284 width: 64px; 285 height: 64px; } 286 #right table#item { 287 empty-cells: show; 288 border: 0px; } 289 #right table#item td { 290 border: 0px; 291 padding: 0px; } 292 #right table#item .lefttop { 293 width: 6px; height: 6px; 294 background-image: url(../img/lefttop.gif); 295 background-position: center center; 296 background-repeat: no-repeat; } 297 #right table#item .righttop { 298 width: 6px; height: 6px; 299 background-image: url(../img/righttop.gif); 300 background-position: center center; 301 background-repeat: no-repeat; } 302 #right table#item .rightbottom { 303 width: 6px; height: 6px; 304 background-image: url(../img/rightbottom.gif); 305 background-position: center center; 306 background-repeat: no-repeat; } 307 #right table#item .leftbottom { 308 width: 6px; height: 6px; 309 background-image: url(../img/leftbottom.gif); 310 background-position: center center; 311 background-repeat: no-repeat; } 312 #right table#item .left { 313 width: 6px; 314 background-image: url(../img/left.gif); 315 background-position: center center; 316 background-repeat: repeat-y; } 317 #right table#item .top { 318 height: 6px; 319 background-image: url(../img/top.gif); 320 background-position: center center; 321 background-repeat: repeat-x; } 322 #right table#item .right { 323 width: 6px; 324 background-image: url(../img/right.gif); 325 background-position: center center; 326 background-repeat: repeat-y; } 327 #right table#item .bottom { 328 height: 6px; 329 background-image: url(../img/bottom.gif); 330 background-position: center center; 331 background-repeat: repeat-x; } 332 #right table#item .item_content { 333 padding: 2px; 334 padding-top: 1px; 335 padding-bottom: 1px; 336 background-color: #080c20; } 337 #right #item h2 { 338 margin: 0px; padding: 0px; 339 padding-bottom: 2px; 340 font-size: 15px; 341 font-weight: normal; } 342 #right #item p { 343 margin: 0px; padding: 0px; 344 padding-bottom: 1px; 345 font-size: 13px; } 346 #right #item p .float { 347 display:block; 348 float: right; 349 padding-left: 20px; } 350 #right table#guids style { } 351 #right table#guids { 352 empty-cells: show; 353 width: 100%; 354 margin-top: 15px; 355 border: 0px; } 356 #right table#guids td { 357 vertical-align: top; 358 padding: 2px; 359 border-top: 1px solid white; 360 border-bottom: 1px solid white; } 361 #right table#guids td.navigace { 362 text-align: center; } 363 #right table#guids td ul { 364 display: block; 365 padding: 0px; 366 margin: 0px; 367 margin-top: 1px; 368 margin-bottom: 1px; } 369 #right table#guids td ul li { 370 display: inline; 371 padding: 0px; 372 margin: 0px; 373 list-style-type: none; } 374 #right table#guids td ul li a { 375 padding-left: 2px; 376 padding-right: 2px; 377 text-decoration: none; } 378 #right table#guids table td { 379 vertical-align: top; 380 border: 0px; 381 border-bottom: 1px solid white; 382 border-right: 1px solid white; } 383 #right table#guids table thead td { 384 vertical-align: top; 385 padding: 2px; 386 border-top: 1px solid white; 387 border-bottom: 2px solid white; } 388 #right span.infoclanku { 389 display: block; 390 width: 100%; 391 border-top: 1px solid white; 392 border-bottom: 1px solid white; 393 padding: 1px; 394 margin-top: 10px; } 395 396 div.object { 397 display: block; 398 margin-top: 8px; 399 margin-bottom: 8px; 400 padding: 1px; } 401 div.object img { 402 display: inline; 403 width: 40px; 404 height: 40px; } 405 div.object a span { 406 display: inline; 407 margin: 0px; 408 padding: 14px; 409 padding-top: 19px; 410 padding-bottom: 19px; 411 font-size: 12px; } 276 412 277 413 #pata { -
db/databaze_tabulky/sql.sql
r110 r118 4 4 -- 5 5 -- Počítač: localhost 6 -- Vygenerováno: Neděle 30. září 2007, 11:577 6 -- Verze MySQL: 5.0.27 8 7 -- Verze PHP: 5.2.0 … … 75 74 `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , 76 75 `nick` VARCHAR( 50 ) NOT NULL , 76 `acc` BIGINT( 20 ) UNSIGNED NOT NULL , 77 77 `phpsession` VARCHAR( 32 ) NOT NULL , 78 78 `hodnost` SMALLINT( 3 ) UNSIGNED NOT NULL , … … 94 94 `ip` VARCHAR( 15 ) NOT NULL 95 95 ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci; 96 97 -- 98 -- Struktura tabulky `data_itemsets` 99 -- 100 -- Vytvoření: Neděle 28. října 2007, 12:47 101 -- Poslední změna: Neděle 28. října 2007, 12:47 102 -- 103 104 CREATE TABLE `data_itemsets` ( 105 `id` int( 11 ) unsigned NOT NULL AUTO_INCREMENT , 106 `name` varchar( 20 ) NOT NULL , 107 `Column3` varchar( 20 ) NOT NULL , 108 `Column4` varchar( 20 ) NOT NULL , 109 `Column5` varchar( 20 ) NOT NULL , 110 `Column6` varchar( 20 ) NOT NULL , 111 `Column7` varchar( 20 ) NOT NULL , 112 `Column8` varchar( 20 ) NOT NULL , 113 `Column9` varchar( 20 ) NOT NULL , 114 `Column10` varchar( 20 ) NOT NULL , 115 `item1` varchar( 20 ) NOT NULL , 116 `item2` varchar( 20 ) NOT NULL , 117 `item3` varchar( 20 ) NOT NULL , 118 `item4` varchar( 20 ) NOT NULL , 119 `item5` varchar( 20 ) NOT NULL , 120 `item6` varchar( 20 ) NOT NULL , 121 `item7` varchar( 20 ) NOT NULL , 122 `item8` varchar( 20 ) NOT NULL , 123 `Column19` varchar( 20 ) NOT NULL , 124 `Column20` varchar( 20 ) NOT NULL , 125 `Column21` varchar( 20 ) NOT NULL , 126 `Column22` varchar( 20 ) NOT NULL , 127 `Column23` varchar( 20 ) NOT NULL , 128 `Column24` varchar( 20 ) NOT NULL , 129 `Column25` varchar( 20 ) NOT NULL , 130 `Column26` varchar( 20 ) NOT NULL , 131 `Column27` varchar( 20 ) NOT NULL , 132 `Column28` varchar( 20 ) NOT NULL , 133 `Column29` varchar( 20 ) NOT NULL , 134 `Column30` varchar( 20 ) NOT NULL , 135 `Column31` varchar( 20 ) NOT NULL , 136 `Column32` varchar( 20 ) NOT NULL , 137 `Column33` varchar( 20 ) NOT NULL , 138 `Column34` varchar( 20 ) NOT NULL , 139 `Column35` varchar( 20 ) NOT NULL , 140 `Column36` varchar( 20 ) NOT NULL , 141 `Column37` varchar( 20 ) NOT NULL , 142 `Column38` varchar( 20 ) NOT NULL , 143 `Column39` varchar( 20 ) NOT NULL , 144 `Column40` varchar( 20 ) NOT NULL , 145 `Column41` varchar( 20 ) NOT NULL , 146 `Column42` varchar( 20 ) NOT NULL , 147 `Column43` varchar( 20 ) NOT NULL , 148 `Column44` varchar( 20 ) NOT NULL , 149 `Column45` varchar( 20 ) NOT NULL , 150 PRIMARY KEY ( `id` ) 151 ) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =1 152 153 -- 154 -- Struktura tabulky `data_navody` 155 -- 156 -- Vytvoření: Sobota 03. listopadu 2007, 13:30 157 -- Poslední změna: Sobota 03. listopadu 2007, 13:30 158 -- 159 160 CREATE TABLE `data_navody` ( 161 `id` int(11) unsigned NOT NULL auto_increment, 162 `schvaleno` smallint(1) unsigned NOT NULL default '0', 163 `nazev` varchar(50) NOT NULL, 164 `keywords` varchar(255) NOT NULL default 'wow, world, wacraft, blizzard', 165 `obsah` longtext NOT NULL, 166 `vlozil` varchar(255) NOT NULL, 167 `vlozil_acc` bigint(20) unsigned NOT NULL, 168 `vlozil_date` bigint(20) unsigned NOT NULL, 169 `precteni` bigint(20) unsigned NOT NULL default '0', 170 `kategorie` int(11) unsigned NOT NULL, 171 PRIMARY KEY (`id`) 172 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 173 174 -- 175 -- Struktura tabulky `data_navody_kategorie` 176 -- 177 -- Vytvoření: Sobota 03. listopadu 2007, 13:39 178 -- Poslední změna: Sobota 03. listopadu 2007, 13:40 179 -- 180 181 CREATE TABLE `data_navody_kategorie` ( 182 `id` int(11) unsigned NOT NULL auto_increment, 183 `zobrazit` smallint(1) unsigned NOT NULL default '0', 184 `poradi` bigint(20) unsigned NOT NULL, 185 `nazev` varchar(50) NOT NULL, 186 `pocet_navodu` bigint(20) unsigned NOT NULL default '0', 187 PRIMARY KEY (`id`) 188 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -
db/functions.php
r113 r118 1 1 <?php 2 3 /* ================================================== 2 if (!defined('IN_CODE')){ exit; }; 3 4 /* ================================================== 5 * AbsCheck($int) 6 * 7 * Zjistí zda je hodnota kladná a vrací TRUE 8 * pokud není kladná vrací FALSE 9 * 10 ================================================== */ 11 12 function AbsCheck($int){ return (abs($int)==$int)? true : false; }; 13 14 /* ================================================== 15 * RelocateDate($date) 16 * 17 * Přeskládá Datum do "hezčí" podoby 18 * 19 ================================================== */ 20 21 function ReorderDate($date){ 22 $data = explode(" ", $date); 23 $data_date = explode("-", $data[0]); 24 $data_time = explode(":", $data[1]); 25 // 2007-12-31 23:00:00 26 27 $date = $data_time[0].":".$data_time[1]." " 28 .$data_date[2].".".$data_date[1].".".$data_date[0]; 29 30 return $date; 31 }; 32 33 function DatabaseTime2Sec($date){ 34 // January 1 1970 00:00:00 GMT 35 36 $data = explode(" ", $date); // rozděláme si datum 37 $date = explode("-", $data[0]); 38 $time = explode(":", $data[1]); 39 // 2007-12-31 23:00:00 40 /* 41 $moths = array( // počet dní v měsících 42 1 => "31", // leden 43 2 => "28", // únor 44 3 => "31", // březen 45 4 => "30", // duben 46 5 => "31", // květen 47 6 => "30", // červen 48 7 => "31", // červenec 49 8 => "31", // srpen 50 9 => "30", // září 51 10 => "31", // říjen 52 11 => "30", // listopad 53 12 => "31", // prosinec 54 ); 55 56 $sec = $data_date[2]+($data_date[1]*60)+($data_date[0]*60*60); 57 $sec += $data_time[2]*24*60*60; 58 59 $years = $data_date[0]-1970; // počet let od Unixu 60 for($i=2; $years > 0 ;$i++){ 61 if( $i%4 == 0 ){ $moths[2] = 29; } else{ $moths[2] = 28; }; // kontrola přestupného roku 62 for($l=1; $l <= count($moths) ;$l++){ // cyklus na připočítání dní 63 $days += $moths[$l]; 64 }; 65 $years--; // odečteme rok 66 }; 67 68 $sec += $days*24*60*60; // dny na vteřiny 69 */ 70 71 $sec = gmmktime( $time[0], $time[1], $time[2], $date[1], $date[2], $date[0] ); 72 73 return $sec; 74 }; 75 76 /* ================================================== 77 * FirstLetter($string) 78 * 79 * Předělá první písmeno na velké 80 * 81 * 4 82 * DelNl($str) 5 83 * 6 * Odstraná řádkování z řetězce 7 * 8 ================================================== */ 84 * dstraná řádkování z řetězce 85 * 86 ================================================== */ 87 88 function FirstLetter($string){ 89 $first = strtoupper(substr($string,0,1)); 90 $other = substr($string,1,strlen($string)); 91 return $first.$other; 92 }; 9 93 10 94 function DelNl($str){ … … 13 97 return $str; 14 98 }; 15 16 /* ==================================================17 * AbsCheck($int)18 *19 * Zjistí zda je hodnota kladná a vrací TRUE20 * pokud není kladná vrací FALSE21 *22 ================================================== */23 24 function AbsCheck($int){ return (abs($int)==$int)? true : false; };25 99 26 100 /* ================================================== … … 327 401 }; 328 402 403 /* ================================================== 404 * ZpracovatClanek($str) 405 * 406 * Zpracuje článek do přijatelné formy pro vypsání 407 * 408 ================================================== */ 409 410 function ZpracovatClanek($str){ 411 412 $str = str_replace("<br />","<br>",nl2br(strip_tags($str))); 413 414 $pattern = array("\[b\]","\[\/b\]", 415 "\[i\]","\[\/i\]", 416 "\[u\]","\[\/u\]", 417 "\[h4\]","\[\/h4\]", 418 "\[url\]((([a-zA-Z]+:/+)|(www))[a-zA-Z0-9\.\?%;=_\/-]+)\[\/url\]", 419 //"\[url=((([a-zA-Z]+:/+)|(www))[a-zA-Z0-9\.\?%;=_\/-]+)\]([^\[\]]+)\[\/url\]" 420 ); 421 $replacement = array("<b>","</b>", 422 "<i>","</i>", 423 "<u>","</u>", 424 "<h4>","</h4>", 425 "<a href=\"\\1\" target=\"_blank\">\\1</a>", 426 //"<a href=\"\\4\" target=\"_blank\">\\5</a>" 427 ); 428 $c_pattern = @count($pattern); $c_replacement = @count($replacement); 429 if($c_pattern==$c_replacement){ 430 for($i=0; $i < $c_pattern ;$i++){ $str = @Ereg_replace($pattern[$i], $replacement[$i], $str); }; 431 }; 432 433 // Item: [item:GUID] 434 // Creep: [creep:GUID] 435 // Quest: [quest:GUID] 436 // GO: [go:GUID] 437 // Spell: [spell:GUID] 438 439 /* 440 $nahradit_conf = array( 441 // 1 => array("tag", "tabulka", "databáze", "obrázek", "odkaz", "jmeno" ), 442 1 => array('item', 'item_template', '1', '1', 'item', "*"), //`name`,`Quality` 443 2 => array('creep', 'creature_template', '1', '0', 'creature', "`name`"), 444 3 => array('quest', 'quest_template', '1', '0', 'quest', "`Title`"), 445 4 => array('go', 'gameobject_template', '1', '0', 'gameobject', "`name`"), 446 5 => array('spell', 'data_spell_template', '3', '1', 'spell', "`name`") 447 ); 448 449 for($l=1; $l <= count($nahradit_conf) ;$l++){ 450 global $BasicWiewer; 451 SwitchDB($nahradit_conf[$l][2]); // nastavení databáze 452 453 $str_replace['base'][$l] = split("\[".$nahradit_conf[$l][0].":", $str); 454 for($i=0; $i < count($str_replace['base']) ;$i++){ 455 if( ereg("^[0-9]+\].*$", $str_replace['base'][$i]) ){ 456 $str_replace['num'][$l][$i] = ereg_replace("^([0-9]+)\].*$", "\\1", $str_replace['base'][$i]); 457 $sql_select['sql'][$l][$i] = @mysql_query("SELECT ".$nahradit_conf[$l][5]." FROM ".$nahradit_conf[$l][1]." WHERE `entry`=".$str_replace['num'][$l][$i]." LIMIT 1 "); 458 if( @mysql_num_rows($sql_select['sql'][$l][$i]) > 0 ){ 459 $result = mysql_fetch_array($sql_select['sql'][$l][$i]); 460 461 unset($item_color); 462 if( $nahradit_conf[$l][0] == "item" ){ 463 $item_color = $BasicWiewer->itemQuality($result['Quality'],1); }; 464 465 $str_replace['result'][$l][$i] .= "<div class='object'><a href=\"./index.php?".$nahradit_conf[$l][4]."=".$str_replace['num'][$i].$SID."\" $item_color>"; 466 if( $nahradit_conf[$l][3] == 1 ){ $str_replace['result'][$l][$i] .= "<img src=\"./thumbs.php?".$nahradit_conf[$l][4]."=".$str_replace['num'][$i].$SID."\" border='0'>"; }; 467 $str_replace['result'][$l][$i] .= "<span>".$result['name']."</span>"; 468 $str_replace['result'][$l][$i] .= "</a></div>\n"; 469 } else{ 470 $str_replace['result'][$l][$i] .= "<p>Položka #".$str_replace['num'][$l][$i]." nenalezena (".FirstLetter($nahradit_conf[$l][0]).")</p>\n"; 471 }; 472 }; 473 }; 474 475 }; // konec cyklu 476 477 for($l=1; $l <= count($str_replace['num']) ;$l++){ 478 for($i=1; $i <= count($str_replace['num'][$l]) ;$i++){ 479 $str = preg_replace($str_replace['num'][$l][$i], $str_replace['result'][$l][$i], $str); 480 }; 481 }; 482 */ 483 return $str; 484 }; 485 486 487 329 488 ?> -
db/hlavni.php
r109 r118 1 1 <?php 2 if($vlozeni_souboru == "OK"){ 2 if (!defined('IN_CODE')){ exit; }; 3 4 if( !empty($id) ){ 5 if( $id == "uvod" ){ $file = "uvod"; $nadpis = "Úvod"; } 6 elseif( $id == "login" ){ $file = "login"; $nadpis = "Přihlášení"; } 7 elseif( $id == "admin" ){ $file = "../admin/obsah"; $nadpis = "Administrace"; } 8 elseif( $id == "getchar" ){ $file = "getchar"; $nadpis = "Export postavy z databáze"; } 9 elseif( $id == "stats" ){ $file = "stats"; $nadpis = "Statistiky"; } 10 elseif( $id == "bugreport" ){ $file = "bug_report"; $nadpis = "Systém na opravu chyb"; } 11 elseif( $id == "sendbug" ){ $file = "bug_report"; $nadpis = "Systém na opravu chyb - nahlášení chyby"; } 12 elseif( $id == "races" ){ $file = "races"; $nadpis = "Rasy"; } 13 elseif( $id == "classes" ){ $file = "classes"; $nadpis = "Povolání"; } 14 elseif( $id == "chars" ){ $file = "chars"; $nadpis = "Postavy"; } 15 elseif( $id == "myacc" ){ $file = "myacc"; $nadpis = "Muj účet"; } 16 elseif( $id == "guild" ){ $file = "guild"; $nadpis = "Guildy"; } 17 elseif( $id == "items" ){ $file = "items"; $nadpis = "Hledání předmětů"; } 18 elseif( $id == "itemsets" ){ $file = "itemsets"; $nadpis = "Sady předmětů"; } 19 elseif( $id == "questy" ){ $file = "questy"; $nadpis = "Hledání úkolů"; } 20 elseif( $id == "qzone" ){ $file = "qzone"; $nadpis = "Úkoly podle oblastí"; } 21 elseif( $id == "qtrskill" ){ $file = "qtrskill"; $nadpis = "Úkoly na profese"; } 22 elseif( $id == "qspecial" ){ $file = "qspecial"; $nadpis = "Speciální úkoly"; } 23 elseif( $id == "creeps" ){ $file = "creeps"; $nadpis = "Hledání creepů"; } 24 elseif( $id == "czone" ){ $file = "czone"; $nadpis = "Creepové podle oblastí"; } 25 elseif( $id == "ctype" ){ $file = "ctype"; $nadpis = "Typy creepů"; } 26 elseif( $id == "crare" ){ $file = "crare"; $nadpis = "Jedineční creepové"; } 27 elseif( $id == "glevel" ){ $file = "glevel"; $nadpis = "Oblasti podle levelu"; } 28 elseif( $id == "gzone" ){ $file = "gzone"; $nadpis = "Plán světa"; } 29 elseif( $id == "spells" ){ $file = "spells"; $nadpis = "Hledání kouzel"; } 30 elseif( $id == "sclass" ){ $file = "sclass"; $nadpis = "Kouzla podle povolání"; } 31 elseif( $id == "talents" ){ $file = "talents"; $nadpis = "Prohlížení Talentů"; } 32 elseif( $id == "profes" ){ $file = "profes"; $nadpis = "Profese"; } 33 elseif( $id == "pteach" ){ $file = "pteach"; $nadpis = "Prohledávat učitele profesí"; } 34 elseif( $id == "navody" ){ $file = "guids"; $nadpis = "Návody ke hře"; } 35 elseif( $id == "eventy" ){ $file = "events"; $nadpis = "Dynamické evety ve hře"; } 36 else{ $file = "uvod"; $nadpis = "Úvod"; }; 37 38 $file = "./include/".$file.".php"; 39 } 40 elseif( !empty($quest) ){ 41 $quest_dotaz_nadpis = mysql_query("SELECT `Title` FROM `quest_template` WHERE `entry`='".$quest."' LIMIT 1"); 42 if( mysql_num_rows($quest_dotaz_nadpis) == "1" ) { $i = "0"; 43 $result = MySQL_Fetch_Array($quest_dotaz_nadpis); 44 $nadpis_quest = $result["Title"]; 45 } else{ $nadpis_quest = "Chyba !"; }; 46 $file = "./include/quest.php"; $nadpis = "Quest: ".$nadpis_quest; 47 if( !File_Exists($file) ){ $file = "./include/uvod.php"; }; 48 } 49 elseif( !empty($creature) ){ 50 $creature_dotaz_nadpis = mysql_query("SELECT `name`,`subname` FROM `creature_template` WHERE `entry`='".$creature."' LIMIT 1"); 51 if( mysql_num_rows($creature_dotaz_nadpis) == "1" ) { 52 $result = @MySQL_Fetch_Array($creature_dotaz_nadpis); 53 $nadpis_creature = $result["name"]; 54 $nadpis_creature .= (!empty($result['subname']))?" <".$result['subname'].">":""; 55 } else{ $nadpis_creature = "Chyba !"; }; 56 $file = "./include/creep.php"; $nadpis = "Creep: ".$nadpis_creature; 57 if( !File_Exists($file) ){ $file = "./include/uvod.php"; }; 58 } 59 elseif( !empty($item) ){ 60 $item_dotaz_nadpis = mysql_query("SELECT `name` FROM `item_template` WHERE `entry`='".$item."' LIMIT 1"); 61 if( mysql_num_rows($item_dotaz_nadpis) == 1 ) { 62 $result = @MySQL_Fetch_Array($item_dotaz_nadpis); 63 $nadpis_item = $result["name"]; 64 } else{ $nadpis_item = "Chyba !"; }; 65 $file = "./include/item.php"; $nadpis = "Item: ".$nadpis_item; 66 if( !File_Exists($file) ){ $file = "./include/uvod.php"; }; 67 } 68 elseif( !empty($guid) ){ 69 SwitchDB(3); // nastavení databáze na web 70 $guid_dotaz_nadpis = mysql_query("SELECT `nazev` FROM `data_navody` WHERE `id`='".$guid."' LIMIT 1"); 71 if( mysql_num_rows($guid_dotaz_nadpis) == 1 ) { 72 $result = @MySQL_Fetch_Array($guid_dotaz_nadpis); 73 $nadpis_guid = $result["nazev"]; 74 } else{ $nadpis_guid = "Chyba !"; }; 75 $file = "./include/guids.php"; $nadpis = "Návod: ".$nadpis_guid; 76 if( !File_Exists($file) ){ $file = "./include/uvod.php"; }; 77 } 78 else{ $file = "./include/uvod.php"; $nadpis = "Úvod"; }; 79 3 80 ?> 4 81 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> … … 12 89 <meta name="robots" content="all, follow"> 13 90 <link rel="stylesheet" type="text/css" href="css/css.php"> 14 <link rel="shortcut icon" href=" img/favicon.ico">91 <link rel="shortcut icon" href="./../favicon.ico"> 15 92 <script src="js/scripty.js" type="text/javascript"></script> 16 93 <title><?php echo $Config['DB_read']['DB_read']['Title']; ?></title> … … 19 96 <div id="center"><div id="hlavni"> 20 97 <div id="top"></div> 21 <div id="left">22 <ul id="hlavni_menu">98 <div id="left"> 99 <ul id="hlavni_menu"> 23 100 <?php echo GenerateMenu(); ?> 24 </ul><!-- hlavni_menu --> 25 </div><!-- left --> 101 </ul><!-- hlavni_menu --> 102 </div><!-- left --> 103 104 <div id="right"> 105 <h1><?php echo $nadpis; ?></h1> 106 <div id="text"> 26 107 27 <div id="right">28 108 <?php 29 require_once "obsah.php"; 109 if( !File_exists($file) ){ echo "<p>Chyba! Nebyl nalezen kořenový soubor.</p>"; }; 110 @require_once $file; 30 111 ?> 31 112 32 <div class="back">33 <div class="float"><?php echo $sql_select['strankovani']; ?></div>34 <a href="#top"><?php echo $text['navigation']['top']; ?></a> 35 <?php if( empty($_POST) ){ ?>36 <a href="<?php echo $_SERVER["HTTP_REFERER"]; ?>" id="back"><?php echo $text['navigation']['back']; ?></a>37 <?php }; ?>38 <script type="text/javascript">39 onload=document.getElementById('back').href="javascript:history.back();";40 </script>41 113 </div> 42 </div><!-- right --> 114 115 <div class="back"> 116 <div class="float"><?php echo $sql_select['strankovani']; ?></div> 117 <a href="#top"><?php echo $text['navigation']['top']; ?></a> 118 <?php if( empty($_POST) ){ ?> 119 <a href="<?php echo $_SERVER["HTTP_REFERER"]; ?>" id="back"><?php echo $text['navigation']['back']; ?></a> 120 <?php }; ?> 121 <script type="text/javascript"> 122 onload=document.getElementById('back').href="javascript:history.back();"; 123 </script> 124 </div> 125 </div><!-- right --> 43 126 44 127 <div style="clear:both;"></div><div id="pata"> … … 52 135 </body> 53 136 </html> 54 <?php55 };56 ?> -
db/include/bug_report.php
r113 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 4 4 … … 82 82 83 83 84 };85 84 ?> -
db/include/chars.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/classes.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/crare.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/creep.php
r113 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 … … 74 74 document.getElementById('item_skin').style.display='none'; 75 75 </script> 76 77 <?php78 };79 ?> -
db/include/creeps.php
r113 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 … … 10 10 <input type="hidden" name="id" value="creeps" class="hidden"> 11 11 <table class="search_form" border="0" cellspacing="0" cellpadding="2"> 12 <tr><td><label for="q">Hledat:</label></td><td colspan='3'><input type="text" name="q" id="q" value="<?php echo $q; ?>"></td><td><input type="submit" value="Hledat" name=" quest_find"></td></tr>12 <tr><td><label for="q">Hledat:</label></td><td colspan='3'><input type="text" name="q" id="q" value="<?php echo $q; ?>"></td><td><input type="submit" value="Hledat" name="find"></td></tr> 13 13 </table><?php if(!empty($session_id)){ ?><input type="hidden" name="PHPSESSID" value="<?php echo $session; ?>" class="hidden"><?php }; ?></form> 14 14 <?php if( !empty($sql_select['result']) ){ ?> … … 17 17 <?php echo $sql_select['error']; ?> 18 18 <?php }; ?> 19 20 21 <?php22 };23 ?> -
db/include/ctype.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/czone.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/glevel.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/guild.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/gzone.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/itemsets.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/login.php
r109 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 … … 10 10 </table></form> 11 11 <?php }; echo "<p>".$login_err."</p>\n"; ?> 12 13 <?php14 };15 ?> -
db/include/myacc.php
r109 r118 1 1 <?php 2 if($vlozeni_souboru == "OK" AND $user['loged'] == 1 ){ 2 if (!defined('IN_CODE') OR $user['loged'] != 1 ){ exit; }; 3 4 $sql_select = $BasicWiewer->myAcc(); 3 5 ?> 4 6 … … 14 16 15 17 <p>Pokud chcete údaje měnit musíte navštívit <a href="./../minimanager/">Minimanager</a></p> 16 17 <?php18 };19 ?> -
db/include/profes.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/pteach.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/qspecial.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/qtrskill.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/quest.php
r114 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 4 4 $nevyresene=0; … … 547 547 </p> */ 548 548 ?> 549 550 <?php551 };552 ?> -
db/include/questy.php
r113 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 4 4 … … 10 10 <table class="search_form" border="0" cellspacing="0" cellpadding="2"> 11 11 <tr><td><label for="q">Hledat:</label></td><td colspan='3'><input type="text" name="q" id="q" value="<?php echo $q; ?>"></td></tr> 12 <tr><td>Level <label for="lvl_d">od:</label></td><td><input type="text" name="lvl_d" id="lvl_d" maxlength="3" style="width: 45px;" value="<?php echo $lvl_d; ?>"></td><td><label for="lvl_h">do:</label></td><td><input type="text" name="lvl_h" id="lvl_h" maxlength="3" style="width: 45px;" value="<?php echo $lvl_h; ?>"></td><td><input type="submit" value="Hledat" name=" quest_find"></td></tr>12 <tr><td>Level <label for="lvl_d">od:</label></td><td><input type="text" name="lvl_d" id="lvl_d" maxlength="3" style="width: 45px;" value="<?php echo $lvl_d; ?>"></td><td><label for="lvl_h">do:</label></td><td><input type="text" name="lvl_h" id="lvl_h" maxlength="3" style="width: 45px;" value="<?php echo $lvl_h; ?>"></td><td><input type="submit" value="Hledat" name="find"></td></tr> 13 13 </table><?php if(!empty($session_id)){ ?><input type="hidden" name="PHPSESSID" value="<?php echo $session; ?>" class="hidden"><?php }; ?></form> 14 14 <?php if( !empty($sql_select['result']) ){ ?> … … 17 17 <?php echo $sql_select['error']; ?> 18 18 <?php }; ?> 19 20 21 <?php22 };23 ?> -
db/include/qzone.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/races.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/sclass.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/spells.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/stats.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/talents.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 5 5 <p>Nezprovozněno.</p> 6 7 <?php8 };9 ?> -
db/include/uvod.php
r113 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 … … 20 20 //print($databaseR->returnResult()."<br>\n"); 21 21 22 23 22 24 ?> 23 24 <?php25 };26 ?> -
db/index.php
r113 r118 1 1 <?php 2 session_start(); $session = session_id('PHPSESSID'); 2 /* =========== CODE Security =========== */ 3 define('IN_CODE', TRUE); 4 5 /* =========== Sessions =========== */ 6 session_start(); 7 $session = session_id('PHPSESSID'); 3 8 $session_id = $_GET['PHPSESSID']; 4 9 if( !empty($session_id) ){ $session = $session_id; }; 5 10 6 /* =========== Security =========== */ 7 if( isset($_GET['Database']) OR isset($_POST['Database']) ){ unset($_GET['Database']); unset($_POST['Database']); }; 8 if( isset($_GET['DB_read']) OR isset($_POST['DB_read']) ){ unset($_GET['DB_read']); unset($_POST['DB_read']); }; 9 if( isset($_GET['Menu']) OR isset($_POST['Menu']) ){ unset($_GET['Menu']); unset($_POST['Menu']); }; 10 if( isset($_GET['text']) OR isset($_POST['text']) ){ unset($_GET['text']); unset($_POST['text']); }; 11 /* =========== Input/Output Security =========== */ 11 12 $klic=array_keys($_POST); 12 13 for ($i=0;$i<=count($klic)-1;$i++) { … … 20 21 /* =========== Config aj. =========== */ 21 22 require_once "./config.php"; 23 require_once "./language/".$Config['DB_read']['language'].".php"; 22 24 require_once "./check_database.php"; 23 25 require_once "./functions.php"; … … 41 43 $login_info = @MySQL_Fetch_Array($sql_user); 42 44 43 SwitchDB(3); // nastavení databáze na web44 45 SwitchDB(3); // nastavení databáze na web 46 45 47 $sql_active_id_dotaz = @mysql_query("SELECT * FROM `acc_online` WHERE `nick`='".$login_info['username']."' LIMIT 1"); 46 48 if( @mysql_num_rows($sql_active_id_dotaz) == 1 ) { … … 49 51 50 52 if( empty($active['id']) ){ 51 @mysql_query("INSERT INTO `acc_online` ( `nick`, ` phpsession`, `hodnost`, `dateoflogin` ) VALUES ( '".$login_info['username']."', '".$session."', '".$login_info['gmlevel']."', '".time()."' )");53 @mysql_query("INSERT INTO `acc_online` ( `nick`, `acc`, `phpsession`, `hodnost`, `dateoflogin` ) VALUES ( '".$login_info['username']."', '".$login_info['id']."', '".$session."', '".$login_info['gmlevel']."', '".time()."' )"); 52 54 $login_err = "Přihlášení proběhlo úspěšně."; 53 55 } 54 56 elseif( !empty($active['id']) ){ 55 57 @mysql_query("DELETE FROM `acc_online` WHERE id='".$active['id']."' LIMIT 1 "); 56 @mysql_query("INSERT INTO `acc_online` ( `nick`, ` phpsession`, `hodnost`, `dateoflogin` ) VALUES ( '".$login_info['username']."', '".$session."', '".$login_info['gmlevel']."', '".time()."' )");58 @mysql_query("INSERT INTO `acc_online` ( `nick`, `acc`, `phpsession`, `hodnost`, `dateoflogin` ) VALUES ( '".$login_info['username']."', '".$login_info['id']."', '".$session."', '".$login_info['gmlevel']."', '".time()."' )"); 57 59 $login_err = "Přihlášení proběhlo úspěšně."; 58 60 } … … 67 69 68 70 SwitchDB(3); // nastavení databáze na web 69 70 if( $_GET['id'] == "logout" ){ 71 session_destroy(); session_regenerate_id(); 71 72 if( $_GET['id'] == "logout" ){ 73 session_destroy(); session_regenerate_id(); unset($user,$SID); 72 74 @mysql_query("DELETE FROM `acc_online` WHERE `phpsession`='$session' LIMIT 1"); 73 unset($user); unset($SID);75 header("Location: ".ereg_replace("(&PHPSESSID=)([a-z0-9]*)", "", $_SERVER["HTTP_REFERER"])); exit; 74 76 }; 75 77 … … 95 97 // 2- položka 96 98 // 3- jiné */ 97 99 98 100 1 => array(1,"index.php?id=uvod$SID","Hlavni"), 99 101 2 => array(2,"./../","Zpět na web"), … … 154 156 // 40 => array(2,"./index.php?id=profes$SID","Prohlížet"), 155 157 // 41 => array(2,"./index.php?id=pteach$SID","Učitelé"), 158 42 => array(1,"#","Jiné"), 159 43 => array(2,"./index.php?id=navody$SID","Návody"), 160 44 => array(2,"./index.php?id=eventy$SID","Eventy"), 156 161 ); 157 162 $Menu = array_merge($Menu, $Menu_add); 158 163 159 164 /* =========== END_TOP =========== */ 160 $vlozeni_souboru = "OK";165 //$vlozeni_souboru = "OK"; 161 166 162 167 … … 165 170 $str = $_GET['str']; // tady získá str z adresy 166 171 $char = $_GET['char']; // tady získá str z adresy 167 $q = addslashes($_GET['q']);172 $q = $_GET['q']; 168 173 $limit = $_GET['list']; // tady získá list z adresy 169 174 if( is_numeric($limit) == FALSE ){ unset($limit); }; 170 175 if( $limit < 1 OR empty($limit) ){ $limit = 1; }; 171 $bug = addslashes($_GET['bug']); 176 $kategory = $_GET['kat']; // tady získá kategorii z adresy 177 if( is_numeric($kategory) == FALSE ){ unset($kategory); }; 178 $bug = $_GET['bug']; 172 179 if( is_numeric($bug) == FALSE ){ unset($bug); }; 173 $quest = addslashes($_GET['quest']);180 $quest = $_GET['quest']; 174 181 if( is_numeric($quest) == FALSE ){ unset($quest); }; 175 $creature = addslashes($_GET['creature']);182 $creature = $_GET['creature']; 176 183 if( is_numeric($creature) == FALSE ){ unset($creature); }; 177 $item = addslashes($_GET['item']);184 $item = $_GET['item']; 178 185 if( is_numeric($item) == FALSE ){ unset($item); }; 179 $lvl_d = addslashes($_GET['lvl_d']);186 $lvl_d = $_GET['lvl_d']; 180 187 if( is_numeric($lvl_d) == FALSE ){ unset($lvl_d); }; 181 $lvl_h = addslashes($_GET['lvl_h']);188 $lvl_h = $_GET['lvl_h']; 182 189 if( is_numeric($lvl_h) == FALSE ){ unset($lvl_h); }; 190 $guid = $_GET['navod']; 191 if( is_numeric($guid) == FALSE ){ unset($guid); }; 183 192 184 193 /* =========== Výchozí databáze =========== */ 185 194 SwitchDB(1); // nastavení databáze na mangos 186 195 187 196 switch($id){ 188 197 case 'character': $general_include = "./character.php"; break; 189 198 default: $general_include = "./hlavni.php"; break; 190 199 }; 191 200 192 201 /* =========== Vložení základního souboru =========== */ 193 require_once "./language/".$Config['DB_read']['language'].".php";194 195 202 require_once "./post_read.php"; 196 203 $BasicWiewer = new BasicWiewer(); … … 200 207 201 208 mysql_close(); // odpojíme se od databáze 202 unset($vlozeni_souboru);203 209 /* =========== END_scritps =========== */ 204 210 ?> -
db/js/scripty.js
r76 r118 11 11 12 12 function smile(text){ 13 if ( p = document.getElementById(' text') ) {13 if ( p = document.getElementById('navod') ) { 14 14 p.focus(); 15 15 p.value+=" "+text; … … 25 25 26 26 function barvy(gbcolor){ 27 if ( p = document.getElementById(' gbcolor') ) {27 if ( p = document.getElementById('clanek') ) { 28 28 /* onmouseover = p.style = "cursor: pointer;"; */ 29 29 /* onmouseout = p.style = "cursor: auto;"; */ -
db/komentare.php
r76 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK" ){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 … … 91 91 </form> 92 92 </div><?php }; ?> 93 94 95 <?php96 };97 ?> -
db/komentare/odeslat_komentare.php
r76 r118 1 1 <?php 2 if ($promenna_obsahuji_overeni_pro_vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 ?> 4 4 … … 175 175 }; 176 176 ?> 177 178 <?php179 };180 ?> -
db/language/cz.php
r92 r118 1 1 <?php 2 if (!defined('IN_CODE')){ exit; }; 2 3 3 4 /* ================================ *\ -
db/novinka.php
r76 r118 1 1 <?php 2 if($promenna_obsahuji_overeni_pro_vlozeni_souboru == "OK"){ 3 ?> 4 5 <?php 2 if (!defined('IN_CODE')){ exit; }; 3 4 6 5 7 6 $chybka = "<p>Je mi líto ale došlo k nějaké chybě,<br>\nnebo novinka s tímhle ID neexistuje.</p>"; $i = "0"; … … 58 57 59 58 </div> 60 61 62 63 <?php64 };65 ?> -
db/novinky.php
r76 r118 1 1 <?php 2 if($promenna_obsahuji_overeni_pro_vlozeni_souboru == "OK"){ 3 ?> 2 if (!defined('IN_CODE')){ exit; }; 4 3 5 <?php6 4 7 5 if( $id != "8" ){ $sql_limit = "LIMIT 10 "; }; … … 49 47 } else { echo $chybka; }; 50 48 ?> 51 52 <?php53 };54 ?> -
db/post_read.php
r114 r118 1 1 <?php 2 if ($vlozeni_souboru == "OK"){2 if (!defined('IN_CODE')){ exit; }; 3 3 4 4 class BasicWiewer{ … … 6 6 var $id; // současná stránka 7 7 var $limit; // současná stránka 8 var $kategorie; // kategorie z nabídky 8 9 var $nastranu = 20; // počet výsledků hledání které budou vypsány 9 10 var $sql_select; // proměnná obsahující všechny výsledky pro výpis … … 11 12 12 13 // konkrétní proměnné podle toho s čím pracujme 13 var $quest; // GUID Questu14 14 var $lvl_d; // min. lvl u Questu 15 15 var $lvl_h; // max. lvl u Questu 16 var $quest; // GUID Questu 16 17 var $bug; // GUID Bugu 17 18 var $creature; // GUID Creepa … … 42 43 } 43 44 45 public function searchItem($q,$limit,$nastranu){ 46 $this->q = $q; 47 $this->limit = $limit; 48 $this->nastranu = $nastranu; 49 $this->searchItems(); // vykonáme hledání 50 return $this->sql_select; 51 } 52 44 53 public function quest($quest){ 45 54 $this->quest = $quest; … … 73 82 public function item($item){ 74 83 $this->item = $item; 75 # need to complete !!!84 $this->showItem(); // získání dat o Itemu 76 85 return $this->sql_select; 77 86 } … … 82 91 } 83 92 93 public function guids($kategorie,$guid,$str){ 94 $this->kategorie = $kategorie; 95 $this->guid = $guid; 96 $this->str = $str; 97 $this->showGuids(); // získání dat o užvatelově účtu 98 return $this->sql_select; 99 } 100 84 101 /* ================================================== 85 102 * searchQuests() 86 * 87 * Tato funkce vyhledává 88 * v databázi questy 103 * showQuest() 104 * startQuest($x) 105 * 106 * Tato funkce vrací konkrétní Quest 107 * + provádí pár dalších operací s jeho daty 89 108 * 90 109 ================================================== */ … … 105 124 while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){ 106 125 $this->sql_select['result'] .= " <tr valign='top'>"; 107 $this->sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry']. "\">".$result['Title']."</a></td>";126 $this->sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry'].$this->sid."\">".$result['Title']."</a></td>"; 108 127 $this->sql_select['result'] .= "<td>".$result['MinLevel']."</td>"; 109 $this->sql_select['result'] .= "<td>"; 110 111 $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." "); 112 while( $start_creature = @MySQL_Fetch_Array($startovni_creature_dotaz) ){ 113 $this->sql_select['result'] .= "<a href=\"index.php?creature=".$start_creature['entry']."\">".$start_creature['name']."</a><br>"; 114 }; 115 $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." "); 116 while( $start_gameobject = @MySQL_Fetch_Array($startovni_gameobject_dotaz) ){ 117 $this->sql_select['result'] .= "<a href=\"index.php?gameobject=".$start_gameobject['entry']."\">".$start_gameobject['name']."</a><br>"; 118 }; 119 $startovni_dotaz_item = mysql_query("SELECT * FROM item_template WHERE startquest='".$result['entry']."' "); 120 if( @mysql_num_rows($startovni_dotaz_item) > 0 ){ 121 while($start_item = @MySQL_Fetch_Array($startovni_dotaz_item)){ 122 switch($start_item['Quality']){ 123 case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break; 124 case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break; 125 case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break; 126 case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break; 127 case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break; 128 case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break; 129 case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break; 130 }; 131 $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?item=".$start_item['entry']."\"".$sql_select['other']['item_color'].">".$start_item['name']."</a><br>\n"; 132 }; }; 133 134 $this->sql_select['result'] .= "</td>"; 128 $this->sql_select['result'] .= "<td>".$this->startQuest($result['entry'])."</td>"; 135 129 $this->sql_select['result'] .= "<td>".$result['Objectives']."</td>"; 136 130 $this->sql_select['result'] .= "</tr>\n"; … … 148 142 } 149 143 144 function showQuest(){ 145 146 if( is_numeric($this->quest) AND empty($this->id) ){ 147 148 $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='".$this->quest."' LIMIT 1"); 149 if( @mysql_num_rows($sql_select['sql']) > 0 ){ 150 $this->sql_select['quest'] = MySQL_Fetch_Array($sql_select['sql']); 151 152 // Zjištění creatur a gameobjectů kde se Quest dá vzít 153 $startovni_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$this->sql_select['quest']['entry']." "); 154 if( @mysql_num_rows($startovni_NPC_dotaz_creature) > 0 ){ 155 while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_creature)){ 156 $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?creature=".$start_NPC['entry'].$this->sid."\">".$start_NPC['name']."</a><br>\n"; 157 }; }; 158 $startovni_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$this->sql_select['quest']['entry']." "); 159 if( @mysql_num_rows($startovni_NPC_dotaz_gameobject) > 0 ){ 160 while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_gameobject)){ 161 $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?gameobject=".$start_NPC['entry'].$this->sid."\">".$start_NPC['name']."</a><br>\n"; 162 }; }; 163 $startovni_dotaz_item = mysql_query("SELECT * FROM item_template WHERE startquest='".$this->sql_select['quest']['entry']."' "); 164 if( @mysql_num_rows($startovni_dotaz_item) > 0 ){ 165 while($start_NPC = @MySQL_Fetch_Array($startovni_dotaz_item)){ 166 $item_color = $this->itemQuality($start_NPC['Quality'],1); 167 $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?item=".$start_NPC['entry'].$this->sid."\"".$item_color.">".$start_NPC['name']."</a><br>\n"; 168 }; }; 169 if( empty($this->sql_select['other']['StartNPC']) ){ 170 $this->sql_select['other']['EndNPC'] = "<b>Úkol není kde začít!</b>"; }; 171 172 $ukoncovaci_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_involvedrelation ON creature_involvedrelation.id = creature_template.entry WHERE creature_involvedrelation.quest =".$this->sql_select['quest']['entry']." "); 173 if( @mysql_num_rows($ukoncovaci_NPC_dotaz_creature) > 0 ){ 174 while($end_NPC = @MySQL_Fetch_Array($ukoncovaci_NPC_dotaz_creature)){ 175 $this->sql_select['other']['EndNPC'] .= "<a href=\"index.php?creature=".$end_NPC['entry'].$this->sid."\">".$end_NPC['name']."</a><br>\n"; 176 }; }; 177 $ukoncovaci_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_involvedrelation ON gameobject_involvedrelation.id = gameobject_template.entry WHERE gameobject_involvedrelation.quest =".$this->sql_select['quest']['entry']." "); 178 if( @mysql_num_rows($ukoncovaci_NPC_dotaz_gameobject) > 0 ){ 179 while($end_NPC = @MySQL_Fetch_Array($ukoncovaci_NPC_dotaz_gameobject)){ 180 $this->sql_select['other']['EndNPC'] .= "<a href=\"index.php?gameobject=".$end_NPC['entry'].$this->sid."\">".$end_NPC['name']."</a><br>\n"; 181 }; }; 182 if( empty($this->sql_select['other']['EndNPC']) ){ 183 $this->sql_select['other']['EndNPC'] = "<b>Úkol není kde skončit!</b>"; }; 184 185 // Zjištění Oblasti 186 if( AbsCheck($this->sql_select['quest']['ZoneOrSort']) ){ } 187 else{ }; 188 189 // Důležitá věc 190 $SrcItemId_dotaz = mysql_query("SELECT * FROM item_template WHERE entry =".$this->sql_select['quest']['SrcItemId']." LIMIT 1;"); 191 if( @mysql_num_rows($SrcItemId_dotaz) > 0 ){ 192 $SrcItemId = @MySQL_Fetch_Array($SrcItemId_dotaz); 193 $item_color = $this->itemQuality($SrcItemId['Quality'],1); 194 $this->sql_select['other']['SrcItemId'] .= "<a href=\"index.php?item=".$SrcItemId['entry'].$this->sid."\"".$item_color.">".$SrcItemId['name']."</a><br>\n"; 195 }; 196 197 $this->sql_select['quest']['PrevQuestId']; 198 $this->sql_select['quest']['NextQuestId']; 199 200 $this->sql_select['other']['ReqItems']; // ReqItemId1-4.ReqItemCount1-4 201 202 $this->sql_select['other']['ReqSource']; // ?? 203 /* ReqSourceId1-4 204 These fields are used in core quest-drop logic. They allow players to get quest drops which are not quest delivery items (ReqItem stand for this), but needed to create quest delivery by player or needed to cast ReqSpellCasts. ReqSourceId1 is the item_template id of a source item for creation of ReqItemX or casting of ReqSpellCastX. X is the value of ReqSourceRef1. Only items which have a quest drop chance (having QuestChance > 0 in *_loot_template) should be used as sources here. 205 The same for ReqSourceId2-4 206 You may define 1, 2, 3 or even all 4 sources for the same ReqItem/ReqSpellCast or use 4 sources for 4 ReqItems/ReqSpellCasts. 207 ReqSourceCount1-4 208 Amount of ReqSourceId items the player may gather per unfinished ReqItemId or ReqSpellCast. 209 So ReqSourceId1 items will drop up to a total amount of (ReqItemCount(ReqSourceRef1) - already owned ReqItemId(ReqSourceRef1)) * ReqSourceCount1. Same for ReqSpellCast objectives. 210 ReqSourceRef1-4 211 Should be 0 or 1..4. See ReqSourceId description. */ 212 213 $this->sql_select['other']['ReqCreatureOrGOId']; // need to kill/cast 214 /* Value > 0: 1.-4. required creature_template ID the player needs to kill/cast on in order to complete the quest. 215 Value < 0: 1.-4. required gameobject_template ID the player needs to cast on in order to complete the quest. 216 If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */ 217 218 $this->sql_select['other']['ReqSpellCast']; 219 /* Spell ID of Spell that needs to be cast in order to fulfill a quest objective. 220 If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */ 221 222 $this->sql_select['other']['ReqSpellCast']; 223 /* Spell ID of Spell that needs to be cast in order to fulfill a quest objective. 224 If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */ 225 226 $this->sql_select['other']['RewChoiceItemId']; // !!! RewChoiceItemCount 227 /* Id of the 1.-6. Item available for reward choice. */ 228 229 $this->sql_select['other']['RewItemId']; // !!! RewItemCount 230 /* 1.-4. item Id given for reward (no choice). */ 231 232 233 } 234 else{ 235 $this->sql_select['error'] = "<p>Quest nebyl nalezen.</p>"; 236 }; 237 return true; 238 }; 239 240 return false; 241 } 242 243 function startQuest($x){ 244 $startovni_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$x." LIMIT 10 "); 245 if( @mysql_num_rows($startovni_dotaz_creature) > 0 ){ 246 while($start_NPC = @MySQL_Fetch_Array($startovni_dotaz_creature)){ 247 $startNPC .= "<a href=\"index.php?creature=".$start_NPC['entry'].$this->sid."\">".$start_NPC['name']."</a><br>\n"; 248 }; }; 249 $startovni_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$x." LIMIT 10 "); 250 if( @mysql_num_rows($startovni_dotaz_gameobject) > 0 ){ 251 while($start_NPC = @MySQL_Fetch_Array($startovni_dotaz_gameobject)){ 252 $startGO .= "<a href=\"index.php?gameobject=".$start_NPC['entry'].$this->sid."\">".$start_NPC['name']."</a><br>\n"; 253 }; }; 254 $startovni_dotaz_item = mysql_query("SELECT * FROM item_template WHERE startquest='".$x."' LIMIT 10 "); 255 if( @mysql_num_rows($startovni_dotaz_item) > 0 ){ 256 while($start_NPC = @MySQL_Fetch_Array($startovni_dotaz_item)){ 257 $item_color = $this->itemQuality($start_NPC['Quality'],1); 258 $startI .= "<a href=\"index.php?item=".$start_NPC['entry'].$this->sid."\"".$item_color.">".$start_NPC['name']."</a><br>\n"; 259 }; }; 260 $StartQuest = $startNPC.$startGO.$startI; 261 if( empty($StartQuest) ){ $StartQuest = "<b>Úkol není kde začít!</b>"; }; 262 return $StartQuest; 263 } 264 150 265 /* ================================================== 151 266 * searchCreeps() 152 * 153 * Tato funkce vyhledává 154 * v databázi creepy 267 * showCreature() 268 * 269 * Tato funkce vrací konkrétního Creepa 270 * + provádí pár dalších operací s jeho daty 155 271 * 156 272 ================================================== */ … … 167 283 while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){ 168 284 $this->sql_select['result'] .= " <tr valign='top'>"; 169 $this->sql_select['result'] .= "<td><a href=\"index.php?creature=".$result['entry']. "\">".$result['name']."</a></td>";285 $this->sql_select['result'] .= "<td><a href=\"index.php?creature=".$result['entry'].$this->sid."\">".$result['name']."</a></td>"; 170 286 if( $result['rank'] != 3 ){ 171 287 $this->sql_select['result'] .= "<td align='center'>".$result['minlevel']." - ".$result['maxlevel']."</td>"; … … 184 300 return false; 185 301 } 186 187 /* ==================================================188 * showQuest()189 *190 * Tato funkce vrací konkrétní Quest191 * + provádí pár dalších operací s jeho daty192 *193 ================================================== */194 195 function showQuest(){196 197 if( is_numeric($this->quest) AND empty($this->id) ){198 199 $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='".$this->quest."' LIMIT 1");200 if( @mysql_num_rows($sql_select['sql']) > 0 ){201 $this->sql_select['quest'] = MySQL_Fetch_Array($sql_select['sql']);202 203 // Zjištění creatur a gameobjectů kde se Quest dá vzít204 $startovni_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$this->sql_select['quest']['entry']." ");205 if( @mysql_num_rows($startovni_NPC_dotaz_creature) > 0 ){206 while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_creature)){207 $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?creature=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";208 }; };209 $startovni_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$this->sql_select['quest']['entry']." ");210 if( @mysql_num_rows($startovni_NPC_dotaz_gameobject) > 0 ){211 while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_gameobject)){212 $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?gameobject=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";213 }; };214 $startovni_dotaz_item = mysql_query("SELECT * FROM item_template WHERE startquest='".$this->sql_select['quest']['entry']."' ");215 if( @mysql_num_rows($startovni_dotaz_item) > 0 ){216 while($start_NPC = @MySQL_Fetch_Array($startovni_dotaz_item)){217 switch($start_NPC['Quality']){218 case 0: $item_color = "class=\"graylink\""; break;219 case 1: $item_color = "class=\"whitelink\""; break;220 case 2: $item_color = "class=\"greenlink\""; break;221 case 3: $item_color = "class=\"bluelink\""; break;222 case 4: $item_color = "class=\"purplelink\""; break;223 case 5: $item_color = "class=\"orangelink\""; break;224 case 6: $item_color = "class=\"redlink\""; break;225 };226 $this->sql_select['other']['StartNPC'] .= "<a href=\"index.php?item=".$start_NPC['entry']."\"".$item_color.">".$start_NPC['name']."</a><br>\n";227 }; };228 if( empty($this->sql_select['other']['StartNPC']) ){229 $this->sql_select['other']['EndNPC'] = "<b>Úkol není kde začít!</b>"; };230 231 $ukoncovaci_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_involvedrelation ON creature_involvedrelation.id = creature_template.entry WHERE creature_involvedrelation.quest =".$this->sql_select['quest']['entry']." ");232 if( @mysql_num_rows($ukoncovaci_NPC_dotaz_creature) > 0 ){233 while($end_NPC = @MySQL_Fetch_Array($ukoncovaci_NPC_dotaz_creature)){234 $this->sql_select['other']['EndNPC'] .= "<a href=\"index.php?creature=".$end_NPC['entry']."\">".$end_NPC['name']."</a><br>\n";235 }; };236 $ukoncovaci_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_involvedrelation ON gameobject_involvedrelation.id = gameobject_template.entry WHERE gameobject_involvedrelation.quest =".$this->sql_select['quest']['entry']." ");237 if( @mysql_num_rows($ukoncovaci_NPC_dotaz_gameobject) > 0 ){238 while($end_NPC = @MySQL_Fetch_Array($ukoncovaci_NPC_dotaz_gameobject)){239 $this->sql_select['other']['EndNPC'] .= "<a href=\"index.php?gameobject=".$end_NPC['entry']."\">".$end_NPC['name']."</a><br>\n";240 }; };241 if( empty($this->sql_select['other']['EndNPC']) ){242 $this->sql_select['other']['EndNPC'] = "<b>Úkol není kde skončit!</b>"; };243 244 // Zjištění Oblasti245 if( AbsCheck($this->sql_select['quest']['ZoneOrSort']) ){ }246 else{ };247 248 // Důležitá věc249 $SrcItemId_dotaz = mysql_query("SELECT * FROM item_template WHERE entry =".$this->sql_select['quest']['SrcItemId']." LIMIT 1;");250 if( @mysql_num_rows($SrcItemId_dotaz) > 0 ){251 $SrcItemId = @MySQL_Fetch_Array($SrcItemId_dotaz);252 switch($SrcItemId['Quality']){253 case 0: $item_color = "class=\"graylink\""; break;254 case 1: $item_color = "class=\"whitelink\""; break;255 case 2: $item_color = "class=\"greenlink\""; break;256 case 3: $item_color = "class=\"bluelink\""; break;257 case 4: $item_color = "class=\"purplelink\""; break;258 case 5: $item_color = "class=\"orangelink\""; break;259 case 6: $item_color = "class=\"redlink\""; break;260 };261 $this->sql_select['other']['SrcItemId'] .= "<a href=\"index.php?item=".$SrcItemId['entry']."\"".$item_color.">".$SrcItemId['name']."</a><br>\n";262 };263 264 $this->sql_select['quest']['PrevQuestId'];265 $this->sql_select['quest']['NextQuestId'];266 267 $this->sql_select['other']['ReqItems']; // ReqItemId1-4.ReqItemCount1-4268 269 $this->sql_select['other']['ReqSource']; // ??270 /* ReqSourceId1-4271 These fields are used in core quest-drop logic. They allow players to get quest drops which are not quest delivery items (ReqItem stand for this), but needed to create quest delivery by player or needed to cast ReqSpellCasts. ReqSourceId1 is the item_template id of a source item for creation of ReqItemX or casting of ReqSpellCastX. X is the value of ReqSourceRef1. Only items which have a quest drop chance (having QuestChance > 0 in *_loot_template) should be used as sources here.272 The same for ReqSourceId2-4273 You may define 1, 2, 3 or even all 4 sources for the same ReqItem/ReqSpellCast or use 4 sources for 4 ReqItems/ReqSpellCasts.274 ReqSourceCount1-4275 Amount of ReqSourceId items the player may gather per unfinished ReqItemId or ReqSpellCast.276 So ReqSourceId1 items will drop up to a total amount of (ReqItemCount(ReqSourceRef1) - already owned ReqItemId(ReqSourceRef1)) * ReqSourceCount1. Same for ReqSpellCast objectives.277 ReqSourceRef1-4278 Should be 0 or 1..4. See ReqSourceId description. */279 280 $this->sql_select['other']['ReqCreatureOrGOId']; // need to kill/cast281 /* Value > 0: 1.-4. required creature_template ID the player needs to kill/cast on in order to complete the quest.282 Value < 0: 1.-4. required gameobject_template ID the player needs to cast on in order to complete the quest.283 If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */284 285 $this->sql_select['other']['ReqSpellCast'];286 /* Spell ID of Spell that needs to be cast in order to fulfill a quest objective.287 If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */288 289 $this->sql_select['other']['ReqSpellCast'];290 /* Spell ID of Spell that needs to be cast in order to fulfill a quest objective.291 If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */292 293 $this->sql_select['other']['RewChoiceItemId']; // !!! RewChoiceItemCount294 /* Id of the 1.-6. Item available for reward choice. */295 296 $this->sql_select['other']['RewItemId']; // !!! RewItemCount297 /* 1.-4. item Id given for reward (no choice). */298 299 300 }301 else{302 $this->sql_select['error'] = "<p>Quest nebyl nalezen.</p>";303 };304 return true;305 };306 307 return false;308 }309 310 /* ==================================================311 * showCreature()312 *313 * Tato funkce vrací konkrétního Creepa314 * + provádí pár dalších operací s jeho daty315 *316 ================================================== */317 302 318 303 function showCreature(){ … … 334 319 if( @mysql_num_rows($questy_dotaz_creature) > 0 ){ 335 320 while($quest_NPC = @MySQL_Fetch_Array($questy_dotaz_creature)){ 336 $this->sql_select['other']['creature_quests'] .= "<a href=\"index.php?quest=".$quest_NPC['entry']. "\">".$quest_NPC['Title']."</a><br>\n";321 $this->sql_select['other']['creature_quests'] .= "<a href=\"index.php?quest=".$quest_NPC['entry'].$this->sid."\">".$quest_NPC['Title']."</a><br>\n"; 337 322 }; }; 338 323 … … 340 325 if( @mysql_num_rows($drop_creature) > 0 ){ 341 326 while($drop_NPC = @MySQL_Fetch_Array($drop_creature)){ 342 switch($drop_NPC['Quality']){ 343 case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break; 344 case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break; 345 case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break; 346 case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break; 347 case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break; 348 case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break; 349 case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break; 350 }; 351 $this->sql_select['other']['creature_drop'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>"; 327 $item_color = $this->itemQuality($drop_NPC['Quality'],1); 328 $this->sql_select['other']['creature_drop'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry'].$this->sid."\" ".$item_color.">".$drop_NPC['name']."</a></td>"; 352 329 $this->sql_select['other']['creature_drop'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n"; 353 330 }; } else{ $this->sql_select['other']['creature_drop'] = "<tr><td colspan='2'>Tento creep nemá žádný drop !</td></tr>"; }; … … 356 333 if( @mysql_num_rows($pickpocket_creature) > 0 ){ 357 334 while($drop_NPC = @MySQL_Fetch_Array($pickpocket_creature)){ 358 switch($drop_NPC['Quality']){ 359 case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break; 360 case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break; 361 case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break; 362 case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break; 363 case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break; 364 case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break; 365 case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break; 366 }; 367 $this->sql_select['other']['creature_pickpocket'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>"; 335 $item_color = $this->itemQuality($drop_NPC['Quality'],1); 336 $this->sql_select['other']['creature_pickpocket'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry'].$this->sid."\" ".$item_color.">".$drop_NPC['name']."</a></td>"; 368 337 $this->sql_select['other']['creature_pickpocket'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n"; 369 338 }; } else{ $this->sql_select['other']['creature_pickpocket'] = "<tr><td colspan='2'>Tento creep nemá žádný Pickpocket !</td></tr>"; }; … … 372 341 if( @mysql_num_rows($skin_creature) > 0 ){ 373 342 while($drop_NPC = @MySQL_Fetch_Array($skin_creature)){ 374 switch($drop_NPC['Quality']){ 375 case 0: $sql_select['other']['item_color'] = "class=\"graylink\""; break; 376 case 1: $sql_select['other']['item_color'] = "class=\"whitelink\""; break; 377 case 2: $sql_select['other']['item_color'] = "class=\"greenlink\""; break; 378 case 3: $sql_select['other']['item_color'] = "class=\"bluelink\""; break; 379 case 4: $sql_select['other']['item_color'] = "class=\"purplelink\""; break; 380 case 5: $sql_select['other']['item_color'] = "class=\"orangelink\""; break; 381 case 6: $sql_select['other']['item_color'] = "class=\"redlink\""; break; 382 }; 383 $this->sql_select['other']['creature_skin'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry']."\" ".$sql_select['other']['item_color'].">".$drop_NPC['name']."</a></td>"; 343 $item_color = $this->itemQuality($drop_NPC['Quality'],1); 344 $this->sql_select['other']['creature_skin'] .= "<tr><td><a href=\"index.php?item=".$drop_NPC['entry'].$this->sid."\" ".$item_color.">".$drop_NPC['name']."</a></td>"; 384 345 $this->sql_select['other']['creature_skin'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n"; 385 346 }; } else{ $this->sql_select['other']['creature_skin'] = "<tr><td colspan='2'>Tento creep nemá žádný Skin !</td></tr>"; }; … … 396 357 397 358 /* ================================================== 359 * searchItems() 360 * showItem() 361 * itemSpellCheck($x) 362 * itemAttribCheck() 363 * itemQuality($x) 364 * 365 * Tato funkce vrací konkrétní Item 366 * + provádí pár dalších operací s jeho daty 367 * 368 ================================================== */ 369 370 function searchItems(){ 371 372 if( !empty($this->q) AND $this->id == "items" ){ 373 374 $this->sql_select = SQLselect_Strankovani("SELECT * FROM `item_template` WHERE ( `name` LIKE '%".$this->q."%' ) ORDER BY `Quality` DESC", $this->limit, $this->nastranu, "?id=items&q=".$this->q, $this->sid); 375 if( @mysql_num_rows($this->sql_select[1]) > 0 ){ 376 $this->sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" cellspacing=\"0\" cellpadding=\"0\">\n"; 377 $this->sql_select['result'] .= "<thead><tr><td>Název itemu</td><td>Level</td></tr></thead>\n<col><col width=\"70px\">"; 378 379 while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){ 380 if( $result['RequiredLevel'] == 0 ){ $result['RequiredLevel'] = 1; }; 381 $item_color = $this->itemQuality($result['Quality'],1); 382 383 $this->sql_select['result'] .= " <tr valign='top'>"; 384 $this->sql_select['result'] .= "<td><a href=\"index.php?item=".$result['entry'].$this->sid."\" $item_color>".$result['name']."</a></td>"; 385 $this->sql_select['result'] .= "<td align='center'>".$result['RequiredLevel']."</td>"; 386 $this->sql_select['result'] .= "</tr>\n"; 387 }; 388 389 $this->sql_select['result'] .= "</table>\n"; 390 } else{ $this->sql_select['error'] = "<p>Nebyly nalezeny žádné itemy.</p>"; }; 391 return true; 392 }; 393 394 return false; 395 } 396 397 function showItem(){ 398 global $databaseR; 399 400 if( is_numeric($this->item) AND empty($this->id) ){ 401 $this->sql_select['sql'] = mysql_query("SELECT * FROM item_template WHERE `entry`='".$this->item."' LIMIT 1"); 402 if( @mysql_num_rows($this->sql_select['sql']) > 0 ){ 403 $this->sql_select['item'] = MySQL_Fetch_Array($this->sql_select['sql']); 404 405 $item_color = $this->itemQuality($this->sql_select['item']['Quality'],2); 406 $item_content .= "<h2 $item_color>".$this->sql_select['item']['name']."</h2>\n"; // jméno 407 if( $this->sql_select['item']['bonding'] != 0 ){ 408 $databaseR->resetSelection('bonding',$this->sql_select['item']['bonding'],'item'); 409 $item_content .= "<p>".$databaseR->returnResult()."</p>\n"; // bonding 410 }; 411 412 if( $this->sql_select['item']['class'] == 0 ){ 413 # need to complete !!! 414 } 415 elseif( $this->sql_select['item']['class'] == 1 ){ 416 # need to complete !!! 417 } // .. 15 418 # need to complete !!! 419 420 $item_content .= $this->itemBattleCheck(); 421 $item_content .= $this->itemAttribCheck(); 422 $item_content .= $this->itemSpellCheck(); 423 424 $this->sql_select['other']['item_content'] = $item_content; 425 426 $this->sql_select['other']['item_content'] = 427 "<table id=\"item\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n". 428 " <tr><td class=\"lefttop\"></td><td class=\"top\"></td><td class=\"righttop\"></td></tr><tr><td class=\"left\"></td><td class=\"item_content\">\n". 429 " ".$this->sql_select['other']['item_content']. 430 " </td><td class=\"right\"></td></tr><tr><td class=\"leftbottom\"></td><td class=\"bottom\"></td><td class=\"rightbottom\"></td></tr>\n". 431 "</table>\n"; 432 433 // drop 434 $drop_dotaz_creature = mysql_query("SELECT * FROM `creature_loot_template` LEFT JOIN `creature_template` ON `creature_template`.`lootid` = `creature_loot_template`.`entry` WHERE (`creature_loot_template`.`item` ='".$this->sql_select['item']['entry']."' ) ORDER BY `creature_loot_template`.`ChanceOrRef` DESC "); 435 if( @mysql_num_rows($drop_dotaz_creature) > 0 ){ 436 while($drop_NPC = @MySQL_Fetch_Array($drop_dotaz_creature)){ 437 $this->sql_select['other']['item_drop_c'] .= "<tr><td><a href=\"index.php?creature=".$drop_NPC['entry'].$this->sid."\">".$drop_NPC['name']."</a></td>"; 438 switch($drop_NPC['rank']){ 439 case 0: $creature_type = ""; break; 440 case 1: $creature_type = " Elite"; break; 441 case 2: $creature_type = " Rare"; break; 442 case 3: $creature_type = ""; break; 443 case 4: $creature_type = " Rare"; break; 444 }; 445 if( $drop_NPC['rank'] != 3 ){ 446 $this->sql_select['other']['item_drop_c'] .= "<td>".$drop_NPC['minlevel']." - ".$drop_NPC['maxlevel'].$creature_type."</td>\n"; 447 } else{ $this->sql_select['other']['item_drop_c'] .= "<td>Boss</td>"; }; 448 $this->sql_select['other']['item_drop_c'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n"; 449 }; } else{ $this->sql_select['other']['item_drop_c'] = "<tr><td colspan='3'>Tento předmět nepadá z žádného Creepa !</td></tr>"; }; 450 451 $drop_dotaz_gameobject = mysql_query("SELECT * FROM `gameobject_loot_template` LEFT JOIN `gameobject_template` ON `gameobject_template`.`lootid` = `gameobject_loot_template`.`entry` WHERE (`gameobject_loot_template`.`item` =".$this->sql_select['item']['entry']." AND `gameobject_loot_template`.`quest_freeforall`='1' ) ORDER BY `gameobject_loot_template`.`ChanceOrRef` DESC "); 452 if( @mysql_num_rows($drop_dotaz_gameobject) > 0 ){ 453 while($drop_NPC = @MySQL_Fetch_Array($drop_dotaz_gameobject)){ 454 $this->sql_select['other']['item_drop_o'] .= "<tr><td><a href=\"index.php?gameobject=".$drop_NPC['entry'].$this->sid."\">".$drop_NPC['name']."</a></td>"; 455 $this->sql_select['other']['item_drop_o'] .= "<td>".$drop_NPC['ChanceOrRef']."%</td></tr>\n"; 456 }; } else{ $this->sql_select['other']['item_drop_o'] = "<tr><td colspan='2'>Tento předmět nepadá z žádného Objektu !</td></tr>"; }; 457 458 // questy 459 $quest_dotaz_sql = "SELECT * FROM `quest_template` WHERE ( "; 460 $quest_dotaz_sql .= "`SrcItemId` =".$this->sql_select['item']['entry']." "; 461 $quest_dotaz_sql .= "OR `ReqItemId1`=".$this->sql_select['item']['entry']." "; 462 $quest_dotaz_sql .= "OR `ReqItemId2`=".$this->sql_select['item']['entry']." "; 463 $quest_dotaz_sql .= "OR `ReqItemId3`=".$this->sql_select['item']['entry']." "; 464 $quest_dotaz_sql .= "OR `ReqItemId4`=".$this->sql_select['item']['entry']." "; 465 $quest_dotaz_sql .= ") "; 466 $quest_dotaz = mysql_query($quest_dotaz_sql); 467 if( @mysql_num_rows($quest_dotaz) > 0 ){ 468 while($quest = @MySQL_Fetch_Array($quest_dotaz)){ 469 $StartQuest = $this->startQuest($quest['entry']); 470 471 $this->sql_select['other']['item_quests'] .= "<tr><td><a href=\"index.php?quest=".$quest['entry'].$this->sid."\">".$quest['Title']."</a></td>"; 472 $this->sql_select['other']['item_quests'] .= "<td>".$quest['MinLevel']."</td>"; 473 $this->sql_select['other']['item_quests'] .= "<td>".$StartQuest."</td></tr>\n"; 474 }; }; 475 if( empty($this->sql_select['other']['item_quests']) ){ 476 $this->sql_select['other']['item_quests'] = "<tr><td colspan='3'>Tento předmět nezačíná žádný Quest, ani v žádném není potřebný !</td></tr>"; 477 }; 478 479 } 480 else{ 481 $this->sql_select['error'] = "<p>Item nebyl nalezen.</p>"; 482 }; 483 return true; 484 }; 485 486 return false; 487 } 488 489 function itemSpellCheck(){ 490 for($x=1; $x<=5 ;$x++){ 491 if( $this->sql_select['item']['spellid_'.$x] != 0 ){ 492 if( !AbsCheck($this->sql_select['item']['spellcooldown_'.$x]) AND $this->sql_select['item']['spellcharges_'.$x] == 0 ){ $action = "Equip"; } 493 else{ $action = "Use"; }; 494 $item_content .= "<p class='green'>$action: Unknown spell ID ".$this->sql_select['item']['spellid_'.$x]."</p>\n"; 495 if(AbsCheck($this->sql_select['item']['spellcharges_'.$x]) AND $this->sql_select['item']['spellcharges_'.$x] != 0 ){ 496 $item_content .= "<p>Charges: ".$this->sql_select['item']['spellcharges_'.$x]."</p>\n"; 497 }; 498 }; 499 }; 500 return $item_content; 501 } 502 503 function itemAttribCheck(){ 504 global $databaseR; 505 for($x=1; $x<=10 ;$x++){ 506 if( $this->sql_select['item']['stat_type'.$x] != 0 AND $this->sql_select['item']['stat_value'.$x] != 0 ){ 507 $databaseR->resetSelection('stat_type',$this->sql_select['item']['stat_type'.$x],'item'); 508 if( AbsCheck($this->sql_select['item']['stat_value'.$x]) ){ $num = "+"; } else{ $num = "-"; }; 509 $item_content .= "<p>".$num.$this->sql_select['item']['stat_value'.$x]." ".$databaseR->returnResult()."</p>\n"; 510 }; 511 }; 512 $resistances = array("holy","fire","nature","frost","shadow","arcane"); 513 for($x=0; $x<count($resistances) ;$x++){ 514 if( $this->sql_select['item'][$resistances[$x].'_res'] != 0 ){ 515 if( AbsCheck($this->sql_select['item'][$resistances[$x].'_res']) ){ $num = "+"; } else{ $num = "-"; }; 516 $item_content .= "<p>".$num.$this->sql_select['item'][$resistances[$x].'_res']." ".FirstLetter($resistances[$x])." Resistance</p>\n"; 517 }; 518 }; 519 return $item_content; 520 } 521 522 function itemBattleCheck(){ 523 global $databaseR; 524 // dmg_min1 dmg_max1 dmg_type1 525 for($x=1; $x<=5 ;$x++){ 526 if( $this->sql_select['item']['dmg_min'.$x] != 0 AND $this->sql_select['item']['dmg_max'.$x] != 0 ){ 527 if( $this->sql_select['item']['dmg_type'.$x] != 0 ){ 528 $databaseR->resetSelection('dmg_type',$this->sql_select['item']['dmg_type'.$x],'item'); 529 $dmg_type = " ".$databaseR->returnResult(); }; 530 if( $x>1 ){ $num = "+ "; } else{ unset($num); }; 531 $item_content .= "<p>".$num.$this->sql_select['item']['dmg_min'.$x]." - ".$this->sql_select['item']['dmg_max'.$x].$dmg_type." Damage</p>\n"; 532 }; 533 }; 534 return $item_content; 535 } 536 537 function itemQuality($x,$y){ 538 if( $y==1 ){ // odkaz 539 switch($x){ 540 case 0: $item_color = "class='graylink'"; break; 541 case 1: $item_color = "class='whitelink'"; break; 542 case 2: $item_color = "class='greenlink'"; break; 543 case 3: $item_color = "class='bluelink'"; break; 544 case 4: $item_color = "class='purplelink'"; break; 545 case 5: $item_color = "class='orangelink'"; break; 546 case 6: $item_color = "class='redlink'"; break; 547 }; 548 } 549 elseif( $y==2 ){ // barva normálního textu 550 switch($x){ 551 case 0: $item_color = "class='gray'"; break; 552 case 1: $item_color = "class='white'"; break; 553 case 2: $item_color = "class='green'"; break; 554 case 3: $item_color = "class='blue'"; break; 555 case 4: $item_color = "class='purple'"; break; 556 case 5: $item_color = "class='orange'"; break; 557 case 6: $item_color = "class='red'"; break; 558 }; 559 }; 560 return $item_color; 561 } 562 563 /* ================================================== 398 564 * showBugs() 399 565 * showBug() … … 419 585 while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){ 420 586 $this->sql_select['result'] .= "<tr><td valign='top'>"; 421 $this->sql_select['result'] .= "<a href=\"./index.php?id=bugreport&bug=".$result['id']. "\">".@date("d.m.Y H:i", $result['vlozeno'])."</a>";587 $this->sql_select['result'] .= "<a href=\"./index.php?id=bugreport&bug=".$result['id'].$this->sid."\">".@date("d.m.Y H:i", $result['vlozeno'])."</a>"; 422 588 $this->sql_select['result'] .= "</td><td valign='top'>"; 423 589 $this->sql_select['result'] .= nl2br(preg_replace(array("(\<)","(\>)"), array("<",">"), $result['popis'])); … … 528 694 $this->sql_select['result']['other']['chars'] .= "<td title=\"Rasa\">".$Database['race'][$this->sql_select['result']['char'][$i]['race']]."</td>"; 529 695 $this->sql_select['result']['other']['chars'] .= "<td title=\"Povolání\">".$Database['class'][$this->sql_select['result']['char'][$i]['class']]."</td>\n"; 530 $this->sql_select['result']['other']['chars'] .= "<td> - <a href=\"./character.php?char=".$this->sql_select['result']['char'][$i]['guid']. "\">Exportovat</a></td></tr>\n";696 $this->sql_select['result']['other']['chars'] .= "<td> - <a href=\"./character.php?char=".$this->sql_select['result']['char'][$i]['guid'].$this->sid."\">Exportovat</a></td></tr>\n"; 531 697 }; 698 if( $this->sql_select['result']['char_count'] == 0 ){ 699 $this->sql_select['result']['other']['chars'] .= " <tr><td>Na tomto účtu nemáte žádné postavy</td></tr>\n"; 700 }; 532 701 $this->sql_select['result']['other']['chars'] .= "</table>"; 533 702 … … 538 707 } 539 708 709 /* ================================================== 710 * showGuids() 711 * 712 * Tato funkce slouží k práci s návody 713 * 714 ================================================== */ 715 716 function showGuids(){ 717 global $Database,$_POST,$user; 718 SwitchDB(3); // nastavení databáze na web 719 720 if( isset($_POST['send']) ){ 721 $bunky = array("nazev","keywords","obsah","vlozil","vlozil_acc","vlozil_date","kategorie"); 722 $hodnoty = array($_POST['nazev'],$_POST['keywords'],$_POST['clanek'],$_POST['podpis'],$user['acc'],time(),$_POST['kategorie']); 723 if(mysql_query("INSERT INTO `data_navody` (`".implode("`,`",$bunky)."`) VALUES ('".implode("','",$hodnoty)."') ")){ 724 $this->sql_select['other']['insert'] = "Váš návod byl vložen"; 725 } 726 else{ $this->sql_select['other']['insert'] = "Návod se nepodařilo vložit"; }; 727 }; 728 729 if( $this->id == "navody" ){ 730 731 $this->sql_select['other']['kategorie'] = " <li><a href=\"./index.php?id=navody&kat=".$this->sid."\" title=\"Vše\"><b>Kategorie:</b></a></li>\n"; 732 $this->sql_select['other']['f_options'] = " <option value=\"0\"> - - - </option>\n"; 733 $sql_select['kateg'] = mysql_query("SELECT * FROM `data_navody_kategorie` WHERE (`zobrazit`!=0) ORDER BY `poradi` ASC"); 734 while( $result = @mysql_fetch_array($sql_select['kateg']) ){ 735 $this->sql_select['other']['kategorie'] .= " <li><a href=\"./index.php?id=navody&kat=".$result['entry'].$this->sid."\">".$result['nazev_kategorie']."(".$result['pocet_navodu'].")</a></li>\n"; 736 $this->sql_select['other']['f_options'] .= " <option value=\"".$result['entry']."\">".$result['nazev_kategorie']."</option>\n"; 737 }; 738 739 if( !empty($this->kategorie) AND $this->kategorie != 0 ){ 740 $where = "WHERE ( `data_navody`.`kategorie`='".$this->kategorie."' AND "; 741 // `nadpis` LIKE '%".$this->q."%' OR `subname` LIKE '%".$this->q."%' 742 } 743 else{ $where = " LEFT JOIN `data_navody_kategorie` ON `data_navody`.`kategorie` = `data_navody_kategorie`.`entry` WHERE ( "; }; 744 745 $sql_select = SQLselect_Strankovani("SELECT * FROM `data_navody` $where `data_navody`.`schvaleno`=1 ) ORDER BY `vlozil_date` DESC, `data_navody`.`kategorie` ASC", $this->limit, $this->nastranu, "?id=navody&kat=".$this->kategorie, $this->sid); 746 $this->sql_select = array_merge($this->sql_select, $sql_select); 747 748 if( @mysql_num_rows($sql_select[1]) > 0 ){ unset($result['nazev_kategorie']); 749 $this->sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" cellspacing=\"0\" cellpadding=\"0\">\n"; 750 $this->sql_select['result'] .= "<thead><tr><td>Nadpis</td><td>Vložil</td><td>Vloženo</td></tr></thead>\n<col><col width=\"160px\"><col width=\"140px\">\n"; 751 752 while( $result = MySQL_Fetch_Array($sql_select[1]) ){ 753 if( !empty($result['nazev_kategorie']) ){ 754 $result['nazev'] = $result['nazev_kategorie']." - ".$result['nazev']; 755 }; 756 $this->sql_select['result'] .= " <tr valign='top'>"; 757 $this->sql_select['result'] .= "<td><a href=\"index.php?navod=".$result['id'].$this->sid."\">".$result['nazev']."</a></td>"; 758 $this->sql_select['result'] .= "<td>".$result['vlozil']."</td>"; 759 $this->sql_select['result'] .= "<td>".date("H:i d.m.Y" ,$result['vlozil_date'])."</td>"; 760 $this->sql_select['result'] .= "</tr>\n"; 761 }; 762 763 $this->sql_select['result'] .= "</table>\n"; 764 } else{ $this->sql_select['result'] = "<p>Nebyly nalezeny žádné návody.</p>"; }; 765 766 return true; 767 } 768 elseif( !empty($this->guid) ){ 769 $sql_select['sql'] = mysql_query("SELECT * FROM `data_navody` WHERE (`id`=".$this->guid.") LIMIT 1"); 770 if( @mysql_num_rows($sql_select['sql']) > 0 ){ 771 $this->sql_select['result'] = MySQL_Fetch_Array($sql_select['sql']); 772 mysql_query("UPDATE `data_navody` SET `precteni`='".++$this->sql_select['result']['precteni']."' WHERE `id`=".$this->guid." LIMIT 1"); 773 } else{ $this->sql_select['error'] = "<p>Návod nenalezen !</p>"; }; 774 775 return true; 776 }; 777 778 return false; 779 } 780 781 /* ================================================== 782 * showEvents() 783 * 784 * Tato funkce vrací dynamické eventy ve hře 785 * 786 ================================================== */ 787 788 public function showEvents($limit,$nastranu){ 789 790 $this->limit = $limit; 791 $this->nastranu = $nastranu; 792 793 if( $this->id == "eventy" ){ 794 795 $this->sql_select = SQLselect_Strankovani("SELECT * FROM `game_event` ORDER BY `entry` ASC", $this->limit, $this->nastranu, "?id=eventy", $this->sid); 796 797 if( @mysql_num_rows($this->sql_select[1]) > 0 ){ 798 $this->sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" cellspacing=\"0\" cellpadding=\"0\">\n"; 799 $this->sql_select['result'] .= "<thead><tr><td>Event</td><td>Počátek</td><td title='Po jakých časových úsecích se událost opakuje'>Perioda</td><td title='Doba trvání'>Trvání</td></tr></thead>\n<col><col width=\"140px\">\n"; 800 801 //entry - Entry of the game event 802 //start - Absolute start date, the event will never start before 803 //end - Absolute end date, the event will never start afler 804 //occurence - Delay in minutes between occurences of the event 805 //length - Length in minutes of the event description 806 //description - of the event displayed in console 807 808 while( $result = MySQL_Fetch_Array($this->sql_select[1]) ){ 809 810 if( $result['occurence'] > 60 ){ 811 $hours = $result['occurence']/60; 812 $time = explode(".", $hours); 813 if( $time[1] == 0 OR empty($time[1]) ){ $time[1] = "00"; } 814 else{ $time[1] = $time[1]*60; }; 815 if( $time[0] > 23 ){ 816 $days = $time[0]/24; 817 $days = explode(".", $days); 818 if( $days[1] == 0 OR empty($days[1]) ){ $days[1] = "00"; } 819 else{ $days[1] = $days[1]*24; }; 820 $time[0] = $days[1]; 821 } else{ $days[0] = "0"; }; 822 $result['occurence'] = $time[0]."h ".$time[1]."m ".$days[0]."d"; 823 }; 824 /* 825 if( $result['length'] > 60 ){ 826 $hours = $result['length']/60; 827 $time = explode(".", $hours); 828 if( $time[1] == 0 OR empty($time[1]) ){ $time[1] = "00"; } 829 else{ $time[1] = $time[1]*60; }; 830 $result['length'] = $time[0]."h ".$time[1]."m"; 831 }; 832 833 if( $result['length'] == 0 OR empty($result['length']) ){ 834 $result['length'] = "Nedefinované"; }; 835 /* 836 $time = time(); 837 $zacatek_eventu = DatabaseTime2Sec($result['start']); 838 $konec_eventu = DatabaseTime2Sec($result['end']); 839 840 if( $konec_eventu <= $time AND $konec_eventu != 0 AND $result['length'] != "Neustále" ){ 841 $probehne_za = "Už neproběhne"; } 842 elseif( $konec_eventu != 0 AND !empty($konec_eventu) AND $result['length'] != "Neustále" ){ 843 $time_betwen = $time-$zacatek_eventu; //čas mezi začátkem a tímto okamžikem 844 while( $time_betwen%$result['occurence'] > 1 ){ 845 $time_betwen = $time_betwen - $result['occurence']; 846 }; 847 $time_betwen = abs($time_betwen); 848 $probehne_za = date("m", $time_betwen)."d ". 849 date("d", $time_betwen)."d ". 850 date("H", $time_betwen)."h ". 851 date("i", $time_betwen)."m"; 852 } 853 else{ 854 $probehne_za = "Právě probíhá"; 855 }; 856 */ 857 858 $this->sql_select['result'] .= " <tr valign='top'>"; 859 $this->sql_select['result'] .= "<td>".$result['description']."</td>"; 860 $this->sql_select['result'] .= "<td>".ReorderDate($result['start'])."</td>"; 861 $this->sql_select['result'] .= "<td>".$result['occurence']."</td>"; 862 $this->sql_select['result'] .= "<td>".$result['length']."m</td>"; 863 //$this->sql_select['result'] .= "<td>".$probehne_za."</td>"; 864 $this->sql_select['result'] .= "</tr>\n"; 865 }; 866 867 $this->sql_select['result'] .= "</table>\n"; 868 } else{ $this->sql_select['result'] = "<p>Nebyly nalezeny žádné eventy.</p>"; }; 869 870 return $this->sql_select; 871 } 872 873 return false; 874 } 875 540 876 541 877 }; // konec třídy 542 878 543 }; // vložení souboru544 879 ?>
Note:
See TracChangeset
for help on using the changeset viewer.