- Timestamp:
- Jan 20, 2008, 8:44:37 PM (17 years ago)
- Location:
- quests
- Files:
-
- 7 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/export.php
r249 r251 23 23 $Vote = $_POST['Vote']; 24 24 $users = @$_POST['users']; 25 26 27 $AddDetails = @$_POST['AddDetails']; 28 $AddObjectives = @$_POST['AddObjectives']; 29 $AddOfferRewardText = @$_POST['AddOfferRewardText']; 30 $AddRequestItemsText = @$_POST['AddRequestItemsText']; 31 $AddEndText = @$_POST['AddEndText']; 32 $AddObjectiveText1 = @$_POST['AddObjectiveText1']; 33 $AddObjectiveText2 = @$_POST['AddObjectiveText2']; 34 $AddObjectiveText3 = @$_POST['AddObjectiveText3']; 35 $AddObjectiveText4 = @$_POST['AddObjectiveText4']; 36 37 if (($Export == 'Mangos') and (Licence(2) == False)) {die('Nemáte oprávnìní');} 38 39 40 $Buffer = ' 25 26 $BufferHeader = ' 41 27 /* File made by maron web aplikacion 42 28 ================================= … … 44 30 WebProject: http://wow.zdechov.net/quests/ 45 31 email: maron2@cetrum.cz 46 DateExport: '.date("m.d.y H:i").' */ 32 DateExport: '.date("m.d.y H:i").' 33 Diakritika: '.$Diacritical.' 34 Poèet nutných hlasù: '.$NumberVote.' 35 Známka vy¾¹í jak: '.$Vote.' 36 Tabluky: Quests: '.@$_POST['Quests'].' , NPC_text: '.@$_POST['NPC_texts'].' */ 47 37 48 38 '; 49 39 50 if (isset($Use)) $Buffer .= 'USE `mangos`;40 if (isset($Use)) $BufferHeader .= 'USE `mangos`; 51 41 52 42 '; 53 43 54 $sql = "SELECT * FROM quests.quests WHERE Complete = '1' AND CountVote >= '$NumberVote' AND Vote >= '$Vote'"; 44 55 45 $WhereLang = ''; 56 46 if (isset($CZ)) $WhereLang .= " Language = '1'"; … … 76 66 $WhereUsers .= " User = ".$users[$i]; 77 67 endfor; 68 69 70 if (array_key_exists('Quests', $_POST)) { 71 $AddDetails = @$_POST['AddDetails']; 72 $AddObjectives = @$_POST['AddObjectives']; 73 $AddOfferRewardText = @$_POST['AddOfferRewardText']; 74 $AddRequestItemsText = @$_POST['AddRequestItemsText']; 75 $AddEndText = @$_POST['AddEndText']; 76 $AddObjectiveText1 = @$_POST['AddObjectiveText1']; 77 $AddObjectiveText2 = @$_POST['AddObjectiveText2']; 78 $AddObjectiveText3 = @$_POST['AddObjectiveText3']; 79 $AddObjectiveText4 = @$_POST['AddObjectiveText4']; 80 81 if (($Export == 'Mangos') and (Licence(2) == False)) {die('Nemáte oprávnìní');} 82 83 84 $sql = "SELECT * FROM quests.quests WHERE Complete = '1' AND CountVote >= '$NumberVote' AND Vote >= '$Vote'"; 78 85 79 86 if ($WhereLang <> '') $sql .= " AND ($WhereLang)"; … … 82 89 // echo $sql; 83 90 84 91 $i = 0; 85 92 $ID = $Database->SQLCommand($sql." ORDER BY vote"); 86 93 while ($Line = mysql_fetch_array($ID)) { … … 127 134 if ($Diacritical == False) $sql=WithOutDiacritical($sql); 128 135 129 if ($Export == 'Mangos') { 130 $Database->SelectDatabase($Config['Database']['DatabaseMangos']); 131 $Database->SQLCommand($sql); 132 } 133 $Buffer .= $sql." 134 "; 135 136 $Buffer[$i] = $sql; 137 ++$i; 138 139 } 136 140 } 137 141 142 //export npc_textù 143 $x = 0; 144 if (array_key_exists('NPC_texts', $_POST)) { 145 146 $sql = "SELECT * FROM NPC_text WHERE Complete = '1' AND CountVote >= '$NumberVote' AND Vote >= '$Vote'"; 147 148 if ($WhereLang <> '') $sql .= " AND ($WhereLang)"; 149 if ($WhereUsers <> '') $sql .= "AND ($WhereUsers)"; 150 151 $ID = $Database->SQLCommand($sql." ORDER BY vote"); 152 while ($Line = mysql_fetch_array($ID)) { 153 154 $sql = "UPDATE npc_text SET "; 155 for ($i=0; $i<count($npc_text); ++$i) { 156 if ($Line[$npc_text[$i]] <> '') 157 $sql .= " ".$npc_text[$i]." = '".$Line[$npc_text[$i]]."' , "; 158 } 159 $sql .= " ID = '".$Line['entry']."' WHERE ID = ".$Line['entry']; 160 if ($Diacritical == False) $sql=WithOutDiacritical($sql); 161 162 $BufferNPC[$x] = $sql; 163 ++$x; 164 } 165 } 166 167 //vypisování 138 168 if ($Export == 'Display') { 139 169 echo 'Vygenerovaný SQL kód: <br /><textarea rows="30" cols="100">'; 140 echo $Buffer; 170 echo $BufferHeader; 171 for ($i=0; $i<count(@$Buffer); ++$i) { 172 echo $Buffer[$i].' 173 '; 174 } 175 for ($i=0; $i<count(@$BufferNPC); ++$i) { 176 echo $BufferNPC[$i].' 177 '; 178 } 141 179 echo '</textarea>'; 142 180 } 143 if ($Export == 'Mangos') { 144 echo 'Hotovo'; 145 } 181 182 if ($Export == 'Mangos') { 183 $Database->SelectDatabase($Config['Database']['DatabaseMangos']); 184 for ($i=0; $i<count(@$Buffer); ++$i) { 185 $Database->SQLCommand($Buffer[$i]); 186 } 187 for ($i=0; $i<count(@$BufferNPC); ++$i) { 188 $Database->SQLCommand($BufferNPC[$i]); 189 } 190 } 146 191 147 192 if ($Export == 'Zip') { … … 149 194 $save_filename = 'SqlTranslate.zip'; 150 195 $SQL_filename = 'SqlTranslate.sql'; 151 196 197 $BufferZip = $BufferHeader; 198 for ($i=0; $i<count(@$Buffer); ++$i) { 199 $BufferZip .= $Buffer[$i]; 200 } 201 for ($i=0; $i<count(@$BufferNPC); ++$i) { 202 $BufferZip .= $BufferNPC[$i]; 203 } 204 205 $Buffer = $BufferZip; 206 152 207 $zipfile = new zipfile(); 153 208 $zipfile -> addFile($Buffer, $SQL_filename); … … 188 243 <input type="checkbox" name="Use" checked="true"> Pøidat Use mangos <br> 189 244 <br /> 245 <input type="checkbox" name="Quests" checked="true"> Questy <br> 246 <input type="checkbox" name="NPC_texts" checked="true"> NPC_texts <br> 190 247 </td><td> 191 248 <input type="text" name="NumberVote" value="3" size="1"> Poèet nutných hlasù <br> … … 197 254 // multiple="multiple" 198 255 $ID = $Database->SQLCommand("SELECT user,ID FROM `user` WHERE 199 EXISTS(SELECT 1 FROM quests WHERE user = user.ID) ORDER BY user"); 256 EXISTS(SELECT 1 FROM quests WHERE user = user.ID) OR 257 EXISTS(SELECT 1 FROM npc_text WHERE user = user.ID) ORDER BY user"); 200 258 while ($Line = mysql_fetch_array($ID)) 201 259 echo '<option value="'.$Line['ID'].'">'.$Line['user'].'</option>'; … … 225 283 </td></tr> 226 284 </table> 227 <br><input type="submit" value="Generovat SQL soubor Questù"> (Sta¾ení)285 <br><input type="submit" value="Generovat SQL soubor pøekladu"> (Sta¾ení) 228 286 </form> 229 287 <b>Èeský pøeklad MaNGOS Minimanageru:</b><br /> -
quests/form.php
r250 r251 80 80 <td width="300">Anglický</td> 81 81 <td> 82 Pøe kládámdo: <?php82 Pøelo¾eno do: <?php 83 83 if ($Line['Language'] <> 0) 84 84 $Language = $Line['Language']; -
quests/includes/global.php
r250 r251 26 26 <script type="text/javascript" language="JavaScript"> 27 27 <!-- 28 var Open = ""29 var Closed = ""30 31 28 function show(what){ 32 29 what.style.display=\'\'; … … 39 36 40 37 '; 41 42 43 // SQL injection hack protection44 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);45 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);46 38 47 39 … … 89 81 echo '<a Title="Registrace u¾ivatele pro pøekládání" href="registrace.php" style="color: red">Registrace</a><br />'; 90 82 91 echo '<br /><div style="background-color: #ffff66" onMouseMove="show(menu2outline)" onmouseout="hide(menu2outline)"><a Title="Pøekládání questù" 92 href="ListQuests.php?filter">Questy</a></div> 83 //questy rolovací menu 84 echo '<br /><div style="background-color: #ffff66" onMouseMove="show(menu2outline)" onmouseout="hide(menu2outline)"> 85 <a href="ListQuests.php?filter">Questy</a></div> 93 86 94 95 <div style="position: absolute; left: 70; top: 165; 96 display:none; width: 200; font-family: Verdana;font-size: 13px; background-color: #ffff66; 97 border: 2px dotted black; padding: 5px 5px 5px 5px;" 98 id="menu2outline" onMouseMove="show(menu2outline)" onmouseout="hide(menu2outline)"> 99 <a Title="Zde mù¾ete zaèít pøekládat" href="ListQuests.php?selection">Nepøelo¾ené questy</a><br> 100 <a Title="Pøelo¾ené questy, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a><br> 87 <div id="menu2outline" style="position: absolute; left: 100; top: 170; display:none; width: 200; background-color: #ffff66; border: 2px dotted black; padding: 5px 5px 5px 5px;" onMouseMove="show(menu2outline)" onmouseout="hide(menu2outline)"> 88 <a href="ListQuests.php?selection">Nepøelo¾ené questy</a><br> 89 <a href="ListQuests.php?Translate">Pøelo¾ené questy</a><br> 101 90 '; 102 91 if (Licence(0)) { 103 echo ' <a Title="Nedokonèené questy" href="ListQuests.php?mydevelop">Rozepsané questy</a><br />104 <a Title="Pøelo¾ené questy pøilá¹eného u¾ivatele" href="ListQuests.php?my">Moje questy</a><br />105 <a Title="Zatím neznámkované questy" href="ListQuests.php?notvote">Neznámkované questy</a><br />';92 echo ' <a href="ListQuests.php?mydevelop">Rozepsané questy</a><br> 93 <a href="ListQuests.php?my">Moje questy</a><br> 94 <a href="ListQuests.php?notvote">Neznámkované questy</a><br>'; 106 95 } 107 echo ' <a Title="Zobrazit questy podle vlastního fitru" href="ListQuests.php?filter">Filtr questù ...</a><br>'; 96 echo ' <a href="ListQuests.php?filter">Filtr questù ...</a><br>'; 97 echo '</div>'; 98 99 //npc rolovací menu 100 echo '<br /><div style="background-color: #ffff66" onMouseMove="show(npc_menu)" onmouseout="hide(npc_menu)"> 101 <a href="npc_list.php?filter">NPC_texty</a></div> 102 103 <div id="npc_menu" style="position: absolute; left: 100; top: 213; display:none; width: 200; background-color: #ffff66; border: 2px dotted black; padding: 0px 5px 5px 5px;" onMouseMove="show(npc_menu)" onmouseout="hide(npc_menu)"> 104 <a href="npc_list.php?notran">Nepøelo¾ené npc_text</a><br> 105 <a href="npc_list.php?Translate">Pøelo¾ené npc_text</a><br> 106 '; 107 /* if (Licence(0)) { 108 echo ' <a href="npc_list.php?mydevelop">Rozepsané npc_text</a><br> 109 <a href="npc_list.php?my">Moje npc_text</a><br> 110 <a href="npc_list.php?notvote">Neznámkované npc_text</a><br>'; 111 } */ 112 echo ' <a href="npc_list.php?filter">Filtr npc_text ...</a><br>'; 108 113 echo '</div> 109 114 -
quests/includes/global_function.php
r250 r251 63 63 array('4','Moderátor', 'red', 'Pøihlá¹ení u¾ivatelù'), 64 64 array('5','Hlasování', 'yellowgreen', 'Pøihlá¹ení u¾ivatelù'), 65 array('6','Npc_text', 'tomato', 'Operace s NPC_texty'), 65 66 ); 66 67 … … 81 82 } // END function Log 82 83 84 $npc_text = array( 85 '0' => 'text0_0', 86 '1' => 'text0_1', 87 '2' => 'text1_0', 88 '3' => 'text1_1', 89 '4' => 'text2_0', 90 '5' => 'text2_1', 91 '6' => 'text3_0', 92 '7' => 'text3_1', 93 '8' => 'text4_0', 94 '9' => 'text4_1', 95 '10' => 'text5_0', 96 '11' => 'text5_1', 97 '12' => 'text6_0', 98 '13' => 'text6_1', 99 '14' => 'text7_0', 100 '15' => 'text7_1', 101 ); 102 83 103 ?> -
quests/quests_statistic.php
r245 r251 28 28 imagefilledrectangle($obrazek,0,0,$PercentBar,59,$Color2); 29 29 imagestring($obrazek, 10, 120, 15, $NumberTranslate.'/'.$NumberAJQuests, $Color3); 30 imagestring($obrazek, 3, 300, 15, 'Questy', $Color3); 30 31 imagestring($obrazek, 10, 120, 30, $Percent.' %', $Color3); 31 32 imagestring($obrazek, 1, 240, 50, 'Aktualizováno: '.date("m.d.y H:i"), $Color3); -
quests/save.php
r247 r251 2 2 3 3 include('includes/global.php'); 4 5 // SQL injection hack protection 6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 7 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 4 8 5 9 if (array_key_exists('entry', $_POST)) { … … 39 43 if (!$Line) { 40 44 41 $Database->SQLCommand("INSERT INTO `quests` (`entry` , `Title` , `Details` , `Objectives` , `OfferRewardText` , `RequestItemsText` , `EndText` , `ObjectiveText1` , `ObjectiveText2` , `ObjectiveText3` , `ObjectiveText4` , `Language` , `User` , `complete` , `Take` ) 42 VALUES('$entry','$Title','$Details','$Objectives','$OfferRewardText','$RequestItemsText','$EndText','$ObjectiveText1','$ObjectiveText2','$ObjectiveText3','$ObjectiveText4','$Language','$UserID','$complete','$QuestID')"); 45 $Database->SQLCommand("INSERT INTO `quests` (`entry` , `Title` , `Details` , `Objectives` , `OfferRewardText` , `RequestItemsText` , 46 `EndText` , `ObjectiveText1` , `ObjectiveText2` , `ObjectiveText3` , `ObjectiveText4` , `Language` , `User` , `complete` , `Take` , `Vote` , `CountVote` ) 47 VALUES('$entry','$Title','$Details','$Objectives','$OfferRewardText','$RequestItemsText','$EndText','$ObjectiveText1', 48 '$ObjectiveText2','$ObjectiveText3','$ObjectiveText4','$Language','$UserID','$complete','$QuestID','3','1')"); 43 49 echo 'Quest: '.$entry.' ulo¾en!<br />'; 44 WriteLog('Quest: '.$entry.' ulo ¾en! <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 1);50 WriteLog('Quest: '.$entry.' uloµen! <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 1); 45 51 } else { 46 52 $sql = "UPDATE quests SET complete = '$complete', Title = '$Title', … … 54 60 // echo $sql.'<br />'; 55 61 echo 'Zmìny v Questu: '.$entry.' ulo¾eny!<br />'; 56 WriteLog('Zmìny v Questu: '.$entry.' ulo ¾eny! <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 1);62 WriteLog('Zmìny v Questu: '.$entry.' uloµeny! <a href="form.php?ID='.$QuestID.'">'.$QuestID.'</a>', 1); 57 63 $Database->SQLCommand("DELETE FROM `quests_vote` WHERE `quests_vote`.`IDquest` = ".$QuestID); 58 64 } 59 65 60 echo 'Pøekládat: <a href="ListQuests.php?selection">Nepøelo µené</a> ';66 echo 'Pøekládat: <a href="ListQuests.php?selection">Nepøeloené</a> '; 61 67 62 68 } -
quests/statistic.php
r247 r251 5 5 ?> 6 6 7 <b>Statistika pøelo¾ených questù:</b><br>7 <b>Statistika:</b><br> 8 8 <img alt="quests" src="quests_statistic.php" title="statistika pøekladu úkolù"><br /> 9 <br /> 10 <img alt="npc_text" src="npc_statistic.php" title="statistika pøekladu NPC_textù"><br /> 9 11 <br /> 10 12 <b>Statistika v závislosti na èase: </b><a href="http://game-server.zdechov.net/statistic/?Measure=18">Pøelo¾ených textù</a><br> … … 33 35 34 36 echo '<tr><th><a href="statistic.php?order=user&desc='.$desc.'">Jméno</a></th> 35 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" Title="Poèet pøelo¾ených questù">Pøelo¾ených</a></th> 36 <th><a href="statistic.php?order=vote&desc='.$desc.'" Title="Prùmìrná známka questù">Známka</a></th> 37 <th><a href="statistic.php?order=NumberTranslate&desc='.$desc.'" Title="Poèet pøelo¾ených questù">Pøel. Q.</a></th> 38 <th><a href="statistic.php?order=NumberTranslateNPC&desc='.$desc.'" Title="Poèet pøelo¾ených NPC_textù">Pøel. N.</a></th> 39 <th><a href="statistic.php?order=vote&desc='.$desc.'" Title="Prùmìrná známka questù">Z. Q</a></th> 40 <th><a href="statistic.php?order=voteNPC&desc='.$desc.'" Title="Prùmìrná známka NPC_text">Z. N.</a></th> 37 41 <th><a href="statistic.php?order=GM&desc='.$desc.'">Oprávnìní</a></th> 38 42 <th><a href="statistic.php?order=LastLogin&desc='.$desc.'">Poslední pøipojení</a></th></tr>'; … … 40 44 $ID = $Database->SQLCommand("SELECT user,Email,LastLogin,GM, 41 45 (SELECT count(*) FROM `quests` WHERE User = user.id AND User <> 0) as NumberTranslate, 42 (SELECT avg(vote) FROM `quests` WHERE User = user.id AND Complete = 1) as vote 46 (SELECT count(*) FROM `npc_text` WHERE User = user.id AND User <> 0) as NumberTranslateNPC, 47 (SELECT avg(vote) FROM `quests` WHERE User = user.id AND Complete = 1) as vote, 48 (SELECT avg(Vote) FROM `npc_text` WHERE User = user.id AND Complete = 1) as voteNPC 43 49 FROM `user` ORDER BY $order $desc"); 44 50 while ($Line = mysql_fetch_array($ID)) 45 51 echo '<tr><td>'.$Line['user'].'</td> 46 52 <td>'.$Line['NumberTranslate'].'</td> 53 <td>'.$Line['NumberTranslateNPC'].'</td> 47 54 <td>'.substr($Line['vote'], 0, 4).'</td> 55 <td>'.substr($Line['voteNPC'], 0, 4).'</td> 48 56 <td>'.$Moderators[$Line['GM']].'</td> 49 57 <td>'.$Line['LastLogin'].'</td></tr>';
Note:
See TracChangeset
for help on using the changeset viewer.