Changeset 365
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Options.php
r357 r365 17 17 $redirecting = $_POST['redirecting']; 18 18 19 // $Line = mysql_fetch_assoc($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID']));20 19 if(($_SESSION['Pass'] == $OldPass) and ($NewPass == $NewPass2)) 21 20 { 22 21 // Update password 23 22 $Salt = GetPasswordSalt(); 24 $Database->SQLCommand('UPDATE user SET pass = sha1(CONCAT(sha1("'.$NewPass.'"), "'.$Salt.'")), Salt="'.$Salt.'" WHERE ID= '.$_SESSION['UserID']);23 $Database->SQLCommand('UPDATE `User` SET `Pass` = sha1(CONCAT(sha1("'.$NewPass.'"), "'.$Salt.'")), `Salt`="'.$Salt.'" WHERE `ID` = '.$_SESSION['UserID']); 25 24 echo('Heslo změněno!<br />'); 26 25 } else echo('<br />Hesla se neshodují!<br />'); 27 26 28 $Database->SQLCommand('UPDATE user SET Email = "'.$Email.'", Language = "'.$Language.'", redirecting = "'.$redirecting.'" WHERE ID= '.$_SESSION['UserID']);27 $Database->SQLCommand('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$redirecting.'" WHERE `ID` = '.$_SESSION['UserID']); 29 28 echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User.'</b><br />'); 30 29 WriteLog('Úprava nastavení!', LOG_TYPE_USER); 31 30 } else 32 31 { 33 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM user WHERE ID= '.$_SESSION['UserID']));32 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID'])); 34 33 echo('<form action="Options.php" method="post"> 35 34 <fieldset><legend>Nastavení uživatele</legend> … … 86 85 { 87 86 echo('<option value="'.$LineTeam['Id'].'"'); 88 if ($LineTeam['Id'] == $Line[' team']) echo(' selected="selected"');87 if ($LineTeam['Id'] == $Line['Team']) echo(' selected="selected"'); 89 88 echo('>'.$LineTeam['Name'].'</option>'); 90 89 } -
trunk/TranslationList.php
r322 r365 8 8 9 9 // Get total item count 10 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS T');10 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `T`'); 11 11 $DbRow = mysql_fetch_row($DbResult); 12 12 $PageList = GetPageList($DbRow[0]); … … 16 16 $TableColumns = array( 17 17 array('Name' => 'ID', 'Title' => 'Pořadové číslo'), 18 array('Name' => ' entry', 'Title' => 'Identifikační číslo'),18 array('Name' => 'Entry', 'Title' => 'Identifikační číslo'), 19 19 array('Name' => $TranslationTree[$GroupId]['Items'][0]['Column'], 'Title' => 'Název'), 20 20 array('Name' => 'VersionStart', 'Title' => 'Verze'), … … 31 31 while($Line = mysql_fetch_assoc($DbResult)) 32 32 { 33 echo('<tr><td><a href="form.php?group='.$GroupId.'&ID='.$Line['ID'].'">'.$Line['ID'].'</a></td><td>'.$Line[' entry'].'</td>'.33 echo('<tr><td><a href="form.php?group='.$GroupId.'&ID='.$Line['ID'].'">'.$Line['ID'].'</a></td><td>'.$Line['Entry'].'</td>'. 34 34 '<td>'.htmlspecialchars($Line[$TranslationTree[$GroupId]['Items'][0]['Column']]).'</td>'. 35 35 '<td>'.GetVersionWOW($Line['VersionStart']).'-'.GetVersionWOW($Line['VersionEnd']).'</td>'); … … 51 51 '<strong>Vypsání nepřeložených textů s limitem na stránku</strong><br /><br />'); 52 52 53 WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.` entry` = `items`.`entry`) AND (`sub`.`Complete`=1) AND (`sub`.`VersionStart` = `items`.`VersionStart`) AND (`sub`.`VersionEnd` = `items`.`VersionEnd`))');53 WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`Entry` = `items`.`Entry`) AND (`sub`.`Complete`=1) AND (`sub`.`VersionStart` = `items`.`VersionStart`) AND (`sub`.`VersionEnd` = `items`.`VersionEnd`))'); 54 54 } 55 55 … … 60 60 if(array_key_exists('connexion_id', $_GET)) $_SESSION['connexion_id'] = $_GET['connexion_id']; 61 61 62 //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1)63 62 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT `Name` FROM `connexion` WHERE `Id` = '.$_SESSION['connexion_id'])); 64 63 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> … … 66 65 <strong>Vypsání souvislostí ze skupiny '.$Line['Name'].'</strong><br /><br />'); 67 66 68 WriteQuests('SELECT *, (SELECT `sub`.`User` FROM `'.$Table.'` AS `sub` WHERE (`sub`.` entry` = `'.$Table.'`.`entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`entry` IN(SELECT `entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].') AND `VersionEnd` = "'.$BuildNumber_max.'" AND `VersionEnd` = "'.$BuildNumber_max.'"');67 WriteQuests('SELECT *, (SELECT `sub`.`User` FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Entry` = `'.$Table.'`.`Entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` IN(SELECT `Entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].') AND `VersionEnd` = "'.$BuildNumber_max.'" AND `VersionEnd` = "'.$BuildNumber_max.'"'); 69 68 } 70 69 … … 73 72 global $GroupId, $Table, $BuildNumber_max, $Database; 74 73 75 //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1)76 74 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> '. 77 75 '<a title="Zde je seznam souvislostí" href="?group='.$GroupId.'&action=connexion">Souvislosti</a> - > '. … … 79 77 echo('<table class="BaseTable"><tr><th>Pořadové číslo</th><th>Název</th>'); 80 78 echo('</tr>'); 81 $ID = $Database->SQLCommand('SELECT * FROM connexionWHERE `Group` = '.$GroupId);79 $ID = $Database->SQLCommand('SELECT * FROM `connexion` WHERE `Group` = '.$GroupId); 82 80 while($Line = mysql_fetch_assoc($ID)) 83 81 { … … 96 94 <strong>Vypsání nedokončených textů s limitem na stránku</strong><br /><br />'); 97 95 98 WriteQuests('SELECT `items`.*, ` user`.`user` AS `UserName` FROM `'.$Table.'` AS `items` JOIN `user` ON `user`.`id` = `items`.`User` WHERE (`items`.`Language` = 0) AND99 NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.` entry` = `items`.`entry`) AND (`sub`.`Complete` = 1) AND (`VersionEnd` = '.$BuildNumber_max.')) AND100 EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub2` WHERE (`sub2`.`Language` <> 0) AND (`sub2`.` entry` = `items`.`entry`) AND (`sub2`.`Complete` = 0) AND (`VersionEnd` = '.$BuildNumber_max.')) AND (`items`.`VersionEnd` = '.$BuildNumber_max.')');96 WriteQuests('SELECT `items`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` AS `items` JOIN `User` ON `User`.`ID` = `items`.`User` WHERE (`items`.`Language` = 0) AND 97 NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> 0) AND (`sub`.`Entry` = `items`.`Entry`) AND (`sub`.`Complete` = 1) AND (`VersionEnd` = '.$BuildNumber_max.')) AND 98 EXISTS(SELECT 1 FROM `'.$Table.'` AS `sub2` WHERE (`sub2`.`Language` <> 0) AND (`sub2`.`Entry` = `items`.`Entry`) AND (`sub2`.`Complete` = 0) AND (`VersionEnd` = '.$BuildNumber_max.')) AND (`items`.`VersionEnd` = '.$BuildNumber_max.')'); 101 99 } 102 100 … … 108 106 <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat texty" href="?group='.$GroupId.'&action=Translate">Přeložené texty</a><br /><br />'); 109 107 110 WriteQuests('SELECT `'.$Table.'`.*, ` user`.`user` AS `UserName` FROM `'.$Table.'` JOIN `user` ON `user`.`id` = `'.$Table.'`.`User` WHERE (`'.$Table.'`.`Language` <> 0) AND (`'.$Table.'`.`Complete` = 1)');108 WriteQuests('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` JOIN `User` ON `User`.`ID` = `'.$Table.'`.`User` WHERE (`'.$Table.'`.`Language` <> 0) AND (`'.$Table.'`.`Complete` = 1)'); 111 109 } 112 110 … … 117 115 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 118 116 <a title="Přeložené questy přilášeného uživatele" href="?group='.$GroupId.'&action=my">Moje překlady</a><br /><br />'); 119 WriteQuests('SELECT `'.$Table.'`.*, ` user`.`user` AS `UserName` FROM `'.$Table.'` JOIN `user` ON `user`.`id` = `'.$Table.'`.`user` WHERE `'.$Table.'`.`user` = '.$_SESSION['UserID']);117 WriteQuests('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` JOIN `User` ON `User`.`id` = `'.$Table.'`.`User` WHERE `'.$Table.'`.`User` = '.$_SESSION['UserID']); 120 118 } 121 119 … … 126 124 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 127 125 <a title="Nedokončené texty" href="?group='.$GroupId.'&action=mydevelop">Rozepsané překlady</a><br /><br />'); 128 WriteQuests('SELECT *, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `user` = '.$_SESSION['UserID'].' AND `Complete` = 0');126 WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `User` = '.$_SESSION['UserID'].' AND `Complete` = 0'); 129 127 } 130 128 … … 146 144 if($WhereUsers == '') $WhereUsers = '0'; 147 145 148 WriteQuests('SELECT *, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE '.$WhereUsers);146 WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE '.$WhereUsers); 149 147 } 150 148 … … 153 151 global $Database, $Table, $GroupId, $TranslationTree; 154 152 155 $ID = $Database->SQLCommand('SELECT ` user` FROM `user` WHERE `id` = '.$_GET['user']);153 $ID = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID` = '.$_GET['user']); 156 154 $Line = mysql_fetch_row($ID); 157 155 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a>'. … … 165 163 if(array_key_exists('not', $_GET)) 166 164 { 167 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `Complete` = 0 AND ` user`='.$_GET['user'];165 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `Complete` = 0 AND `User`='.$_GET['user']; 168 166 $ID = $Database->SQLCommand($sql); 169 167 $Line = mysql_fetch_row($ID); … … 173 171 } else 174 172 { 175 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE ` user`='.$_GET['user'];173 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `User`='.$_GET['user']; 176 174 $ID = $Database->SQLCommand($sql); 177 175 $Line = mysql_fetch_row($ID); … … 223 221 if(array_key_exists('user', $_GET)) 224 222 { 225 $ID = $Database->SQLCommand('SELECT ` user` FROM `user` WHERE `id` = '.($_GET['user'] * 1));223 $ID = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID` = '.($_GET['user'] * 1)); 226 224 if(mysql_num_rows($ID) > 0) 227 225 { … … 230 228 '<strong>Vypis překladů uživatele '.$Line[0].': </strong><br /><br />'); 231 229 if(array_key_exists('not', $_GET)) 232 WriteQuests('SELECT *, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE (`Complete` = 0) AND (`user` = '.$_GET['user'].')');233 else WriteQuests('SELECT *, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `user` = '.$_GET['user']);230 WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Complete` = 0) AND (`User` = '.$_GET['user'].')'); 231 else WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `User` = '.$_GET['user']); 234 232 } else echo('Nebyl nalezen uživatel se zadaným id'); 235 233 } else echo('Je nutno zadat id uživatele.'); … … 244 242 else ErrorMessage('Nebyl zadán text k vyhledání.'); 245 243 246 $sql = 'SELECT *, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"247 OR ` entry` LIKE "%'.$Search.'%"244 $sql = 'SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%" 245 OR `Entry` LIKE "%'.$Search.'%" 248 246 OR `Language` LIKE "%'.$Search.'%" 249 247 OR `User` LIKE "%'.$Search.'%" … … 265 263 else $Search = ''; 266 264 267 $sql = 'SELECT *, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `UserName` FROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"';265 $sql = 'SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `Entry` LIKE "'.$Search.'"'; 268 266 269 267 WriteQuests($sql); … … 278 276 <strong>Výpis všech textů s limitem na stránku</strong><br /><br />'); 279 277 280 WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0)');278 WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`'.$Table.'`.`Language` = 0)'); 281 279 } 282 280 … … 307 305 '<select name="users[]" size="10" multiple="multiple" class="UserList">'); 308 306 309 $ID = $Database->SQLCommand('SELECT ` user`, `ID` FROM `user` WHERE310 EXISTS(SELECT 1 FROM `'.$Table.'` WHERE ` user` = `user`.`ID`) ORDER BY `user`');307 $ID = $Database->SQLCommand('SELECT `Name`, `ID` FROM `User` WHERE 308 EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `User` = `User`.`ID`) ORDER BY `Name`'); 311 309 if($ID) 312 310 while($Line = mysql_fetch_assoc($ID)) 313 echo('<option value="'.$Line['ID'].'">'.$Line[' user'].'</option>');311 echo('<option value="'.$Line['ID'].'">'.$Line['Name'].'</option>'); 314 312 315 313 echo('</select><br /> … … 331 329 332 330 echo('</table>'); 333 // WriteQuests("SELECT * FROM quests Where user = ".$_SESSION['UserID']." AND Complete = '0'", '', 'mydevelop');334 331 } 335 332 -
trunk/action.php
r358 r365 15 15 $Table = $Group['TablePrefix']; 16 16 17 $sql = 'SELECT count(*) FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"18 OR ` entry` LIKE "%'.$Search.'%"17 $sql = 'SELECT COUNT(*) FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%" 18 OR `Entry` LIKE "%'.$Search.'%" 19 19 OR `User` LIKE "%'.$Search.'%" 20 20 OR `Complete` LIKE "%'.$Search.'%"'; … … 27 27 } 28 28 29 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM ` user` WHERE `user` LIKE "%'.$Search.'%"'));29 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `User` WHERE `User` LIKE "%'.$Search.'%"')); 30 30 echo('<tr><td><a href="userlist.php?search='.$Search.'">Uživatelé</a></td><td>'.$Line[0].'</td></tr>'); 31 31 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"')); … … 34 34 echo('<tr><td><a href="download.php?addon">Čeština pro klienta</a></td><td>'.$Line[0].'</td></tr>'); 35 35 echo('<tr><td><a href="aowow/?search='.$Search.'">Vyhledávací databáze AoWoW</a></td></tr>'); 36 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM ` dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND Language= 0'));36 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = 0')); 37 37 echo('<tr><td><a href="dictionary.php?search='.$Search.'">Slovníček</a></td><td>'.$Line[0].'</td></tr>'); 38 38 39 39 echo('</table>'); 40 40 } 41 42 41 43 42 function DatabaseKit() … … 62 61 if(array_key_exists('Type',$_POST)) 63 62 { 64 $sql = 'DELETE FROM log WHERE Type= '.$_POST['Type'];63 $sql = 'DELETE FROM `Log` WHERE `Type` = '.$_POST['Type']; 65 64 $Database->SQLCommand($sql); 66 65 WriteLog('Vymazán log '.$_POST['Type'], LOG_TYPE_MODERATOR); … … 79 78 echo($Table.' '); 80 79 81 $sql = 'SELECT * FROM '.$Table.' WHERE ( Language<> 0) AND (';80 $sql = 'SELECT * FROM '.$Table.' WHERE (`Language` <> 0) AND ('; 82 81 foreach($Group['Items'] as $Item) 83 82 { … … 97 96 } 98 97 $sql = substr($sql,0,strlen($sql)-1); 99 $sql .= ' WHERE ID= '.$Line['ID'];98 $sql .= ' WHERE `ID` = '.$Line['ID']; 100 99 $Database->SQLCommand($sql); 101 100 echo ('.'); … … 121 120 echo($Table.' '); 122 121 123 $sql = 'SELECT ID,entry as entry_tran, Take,124 (SELECT ID FROM '.$Table.' WHERE Language = 0 AND entry = entry_tran LIMIT 1) as ID_orig125 FROM '.$Table.' as tran WHERE (Language <> 0) AND ((Take = 0) OR (ID = Take) OR NOT EXISTS(SELECT 1 FROM '.$Table.' WHERE ID = tran.Take))';122 $sql = 'SELECT `ID`, `Entry` AS EntryTran, `Take`, 123 (SELECT `ID` FROM `'.$Table.'` WHERE `Language = 0 AND `Entry` = `EntryTran` LIMIT 1) AS `IDOrig` 124 FROM `'.$Table.'` AS `Tran` WHERE (`Language` <> 0) AND ((`Take` = 0) OR (`ID` = `Take`) OR NOT EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `ID` = `Tran`.`Take`))'; 126 125 127 126 $ID = $Database->SQLCommand($sql); 128 127 while($Line = mysql_fetch_assoc($ID)) 129 128 { 130 $sql = 'UPDATE '.$Table.' SET Take = '.$Line['ID_orig'].' WHERE ID= '.$Line['ID'];129 $sql = 'UPDATE `'.$Table.'` SET `Take` = '.$Line['IDOrig'].' WHERE `ID` = '.$Line['ID']; 131 130 $Database->SQLCommand($sql); 132 131 echo('.'); … … 151 150 { 152 151 echo ($Table.' '); 153 $sql = 'SELECT gs_orig.ID, gs_tran.entry, gs_tran.ShortCut as ShortCut_tran, gs_orig.ShortCut as ShortCut_orig FROM '.$Table.' as gs_tran JOIN '.$Table.' as gs_orig ON gs_orig.entry = gs_tran.entry WHERE gs_tran.Language <> 0 AND gs_tran.ShortCut <> gs_orig.ShortCut';152 $sql = 'SELECT `gs_orig`.`ID`, `gs_tran`.`Entry`, `gs_tran`.`ShortCut` AS `ShortCut_tran`, `gs_orig`.`ShortCut` AS `ShortCut_orig` FROM `'.$Table.'` AS `gs_tran` JOIN `'.$Table.'` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` WHERE `gs_tran`.`Language` <> 0 AND `gs_tran`.`ShortCut` <> `gs_orig`.`ShortCut`'; 154 153 $ID = $Database->SQLCommand($sql); 155 154 while ($Line = mysql_fetch_assoc($ID)) 156 155 { 157 $sql = 'UPDATE '.$Table.' SET ShortCut = '.$Line['ShortCut_orig'].' WHERE ID= '.$Line['ID'];156 $sql = 'UPDATE `'.$Table.'` SET `ShortCut` = '.$Line['ShortCut_orig'].' WHERE `ID` = '.$Line['ID']; 158 157 $Database->SQLCommand($sql); 159 158 echo ('.'); … … 178 177 { 179 178 $TextID = $_GET['ID']; 180 $Database->SQLCommand('DELETE FROM '.$Table.' WHERE ID = '.$TextID.' AND Language<> 0');179 $Database->SQLCommand('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> 0'); 181 180 echo('Překlad byl smazán!'); 182 181 WriteLog('Překlad byl smazán! <a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', LOG_TYPE_MODERATOR); … … 205 204 else die('Pro vkládaní musíte byt registrováni!'); 206 205 $text = $_POST['text']; 207 $Database->SQLCommand('INSERT INTO ` shoutbox` ( `user` , `text` , `date` , `IP` )206 $Database->SQLCommand('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` ) 208 207 VALUES ("'.$user.'", "'.$text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")'); 209 208 echo('Zpráva vložena!<br>Budete přesměrováni...'); … … 219 218 global $Database; 220 219 221 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` shoutbox`');220 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ShoutBox`'); 222 221 $DbRow = mysql_fetch_row($DbResult); 223 222 $PageList = GetPageList($DbRow[0]); … … 227 226 if(Licence(LICENCE_USER)) echo(' <a href="action.php?action=shoutbox">Vložit</a>'); 228 227 echo('<div class="shoutbox">'); 229 $ID = $Database->SQLCommand('SELECT * FROM ` shoutbox` ORDER BY `ID` DESC '.$PageList['SQLLimit']);228 $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']); 230 229 while($Line = mysql_fetch_assoc($ID)) 231 echo('<div><strong>'.$Line[' user'].'</strong>: '.htmlspecialchars($Line['text']).'</div>');230 echo('<div><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</div>'); 232 231 echo('</div>'); 233 232 echo($PageList['Output']); … … 238 237 global $Database; 239 238 240 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` news`');239 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `News`'); 241 240 $DbRow = mysql_fetch_row($DbResult); 242 241 $PageList = GetPageList($DbRow[0]); … … 246 245 if(Licence(LICENCE_USER)) echo(' <a href="admin.php?action=addnew">Vložit</a>'); 247 246 echo('<div class="shoutbox">'); 248 $ID = $Database->SQLCommand('SELECT ` news`.`time`, `news`.`text`, `user`.`user` FROM `news` JOIN `user` ON `user`.`ID`=`news`.`user` ORDER BY `news`.`time` DESC '.$PageList['SQLLimit']);247 $ID = $Database->SQLCommand('SELECT `News`.`Time`, `News`.`Text`, `User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`ID`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']); 249 248 while($Line = mysql_fetch_assoc($ID)) 250 echo('<div><strong>'.HumanDate($Line[' time']).'</strong> '.$Line['text'].' ('.$Line['user'].')</div>');249 echo('<div><strong>'.HumanDate($Line['Time']).'</strong> '.$Line['Text'].' ('.$Line['User'].')</div>'); 251 250 echo('</div>'); 252 251 echo($PageList['Output']); -
trunk/admin.php
r358 r365 44 44 if(array_key_exists('text', $_POST)) 45 45 { 46 $querty = 'INSERT INTO ` news` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$_SESSION['UserID'].', "'.$_POST['text'].'")';46 $querty = 'INSERT INTO `News` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$_SESSION['UserID'].', "'.$_POST['text'].'")'; 47 47 $Database->SQLCommand($querty); 48 48 echo('Aktualita uložena!'); … … 55 55 global $Database; 56 56 57 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` user`');57 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `User`'); 58 58 $DbRow2 = mysql_fetch_row($DbResult); 59 59 … … 61 61 ' AND (`ID` != 128)'. // Skip user Neznámý 62 62 ' AND (`LastLogin` < DATE_SUB(NOW(), INTERVAL 3 MONTH))'. // Time limit 63 ' AND (NOT EXISTS (SELECT `Id` FROM `Export` WHERE ` user`.`ID` = `Export`.`User`))'. // Without exports64 ' AND (NOT EXISTS (SELECT `ID` FROM ` dictionary` WHERE `user`.`ID` = `dictionary`.`user`))'. // Without dictionary words65 ' AND (NOT EXISTS (SELECT `Id` FROM ` news` WHERE `user`.`ID` = `news`.`user`))'. // Without news66 ' AND (NOT EXISTS (SELECT `ID` FROM ` shoutbox` WHERE `user`.`user` = `shoutbox`.`user`))'. // Without shoutbox messages63 ' AND (NOT EXISTS (SELECT `Id` FROM `Export` WHERE `User`.`ID` = `Export`.`User`))'. // Without exports 64 ' AND (NOT EXISTS (SELECT `ID` FROM `Dictionary` WHERE `User`.`ID` = `Dictionary`.`User`))'. // Without dictionary words 65 ' AND (NOT EXISTS (SELECT `Id` FROM `News` WHERE `User`.`ID` = `News`.`User`))'. // Without news 66 ' AND (NOT EXISTS (SELECT `ID` FROM `ShoutBox` WHERE `User`.`User` = `ShoutBox`.`User`))'. // Without shoutbox messages 67 67 ''; 68 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` user`'.$Condition);68 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `User`'.$Condition); 69 69 $DbRow = mysql_fetch_row($DbResult); 70 $Database->SQLCommand('DELETE FROM ` user`'.$Condition);70 $Database->SQLCommand('DELETE FROM `User`'.$Condition); 71 71 echo('Smazáno '.$DbRow[0].' účtů ze všech '.$DbRow2[0].'<br/>'); 72 72 73 73 // Delete logs without user 74 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` log`');74 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log`'); 75 75 $DbRow2 = mysql_fetch_row($DbResult); 76 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` log` WHERE (NOT EXISTS (SELECT `ID` FROM `user` WHERE `user`.`ID` = `log`.`user`)) AND (user!= 0)');76 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)'); 77 77 $DbRow = mysql_fetch_row($DbResult); 78 $Database->SQLCommand('DELETE FROM ` log` WHERE (NOT EXISTS (SELECT `ID` FROM `user` WHERE `user`.`ID` = `log`.`user`)) AND (user!= 0)');78 $Database->SQLCommand('DELETE FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)'); 79 79 echo('Smazáno '.$DbRow[0].' položek logu ze všech '.$DbRow2[0].'<br/>'); 80 80 … … 82 82 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser`'); 83 83 $DbRow2 = mysql_fetch_row($DbResult); 84 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM ` user` WHERE `user`.`ID` = `ExportUser`.`User`))');84 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))'); 85 85 $DbRow = mysql_fetch_row($DbResult); 86 $Database->SQLCommand('DELETE FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM ` user` WHERE `user`.`ID` = `ExportUser`.`User`))');86 $Database->SQLCommand('DELETE FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))'); 87 87 echo('Smazáno '.$DbRow[0].' položek výběru překladatelů u exportů ze všech '.$DbRow2[0].'<br/>'); 88 88 … … 90 90 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team`'); 91 91 $DbRow2 = mysql_fetch_row($DbResult); 92 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE (SELECT COUNT(*) FROM ` user` WHERE `user`.`Team` = `Team`.`Id`) = 0');92 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 93 93 $DbRow = mysql_fetch_row($DbResult); 94 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM ` user` WHERE `user`.`team` = `Team`.`Id`) = 0');94 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`team` = `Team`.`Id`) = 0'); 95 95 echo('Smazáno '.$DbRow[0].' týmů ze všech '.$DbRow2[0].'<br/>'); 96 96 97 97 // Set new leader for teams where old leader went to other team 98 $Database->SQLCommand('UPDATE Team SET Leader=(SELECT Id FROM `user` WHERE user.Team=Team.Id ORDER BY user.RegistrationTime LIMIT 1) WHERE Leader NOT IN (SELECT ID FROM user WHERE user.Team=Team.Id);');98 $Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);'); 99 99 100 100 WriteLog('Smazány staré uživatelské účty', LOG_TYPE_ADMINISTRATION); … … 105 105 global $Database; 106 106 107 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` log` WHERE `type`='.LOG_TYPE_ERROR);107 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR); 108 108 $DbRow = mysql_fetch_row($DbResult); 109 $Database->SQLCommand('DELETE FROM ` log` WHERE `type`='.LOG_TYPE_ERROR);109 $Database->SQLCommand('DELETE FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR); 110 110 WriteLog('Vymazány chybové záznamy', LOG_TYPE_ADMINISTRATION); 111 111 echo('Smazáno všech '.$DbRow[0].' chybových záznamů.<br/>'); -
trunk/banners.php
r290 r365 18 18 echo($BannerSmall.' <textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />'); 19 19 20 $ID = $Database->SQLCommand('SELECT * FROM ` banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');20 $ID = $Database->SQLCommand('SELECT * FROM `Banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)'); 21 21 22 22 echo('<br/><strong>Servery odkazující na nás:</strong> <br /> -
trunk/banners/banner.php
r301 r365 16 16 { 17 17 $Referer = 'http://'.$HostName.'/'; 18 $DbResult = $System->Database->query('SELECT * FROM ` banner` WHERE `Web` = "'.$Referer.'"');18 $DbResult = $System->Database->query('SELECT * FROM `Banner` WHERE `Web` = "'.$Referer.'"'); 19 19 if($DbResult->num_rows > 0) 20 $System->Database->query('UPDATE ` banner` SET `DateLast` = NOW(), `LastURL` = "'.addslashes($_SERVER['HTTP_REFERER']).'" WHERE `Web` = "'.$Referer.'"');21 else $System->Database->query('INSERT INTO ` banner` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")');20 $System->Database->query('UPDATE `Banner` SET `DateLast` = NOW(), `LastURL` = "'.addslashes($_SERVER['HTTP_REFERER']).'" WHERE `Web` = "'.$Referer.'"'); 21 else $System->Database->query('INSERT INTO `Banner` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")'); 22 22 } 23 23 -
trunk/comparison.php
r320 r365 72 72 foreach($Line as $Index => $LineItem) 73 73 { 74 $LineUser = mysql_fetch_array($Database->SQLCommand('SELECT * FROM user WHERE id= '.$LineItem['User']));75 echo('<th>'.$LineUser[' user'].'</th>');74 $LineUser = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$LineItem['User'])); 75 echo('<th>'.$LineUser['Name'].'</th>'); 76 76 } 77 77 echo('</tr>'); -
trunk/dictionary.php
r288 r365 93 93 if(Licence(LICENCE_USER)) 94 94 { 95 $DbResult = $Database->SQLCommand('SELECT `Language` FROM ` user` WHERE `ID`='.$_SESSION['UserID']);95 $DbResult = $Database->SQLCommand('SELECT `Language` FROM `User` WHERE `ID`='.$_SESSION['UserID']); 96 96 $User = mysql_fetch_assoc($DbResult); 97 97 $_SESSION['language'] = $User['Language']; … … 144 144 if(array_key_exists('Original', $_POST) and array_key_exists('Translated', $_POST) and array_key_exists('Description', $_POST)) 145 145 { 146 $DbResult = $Database->SQLCommand('SELECT * FROM ` dictionary` WHERE `Text` = "'.$_POST['Original'].'" AND Language=0');146 $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `Text` = "'.$_POST['Original'].'" AND `Language`=0'); 147 147 if(mysql_num_rows($DbResult) > 0) 148 148 { … … 151 151 } else 152 152 { 153 $DbResult = $Database->SQLCommand('SELECT MAX( Entry) FROM dictionary');153 $DbResult = $Database->SQLCommand('SELECT MAX(`Entry`) FROM `Dictionary`'); 154 154 $DbRow = mysql_fetch_row($DbResult); 155 155 $Entry = $DbRow[0] + 1; 156 $Database->SQLCommand('INSERT INTO ` dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", 0, 0);');156 $Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", 0, 0);'); 157 157 } 158 158 159 $DbResult = $Database->SQLCommand('SELECT Id FROM `dictionary` WHERE `Entry` = '.$Entry.' AND Language='.$_SESSION['language'].' AND User='.$_SESSION['UserID']);159 $DbResult = $Database->SQLCommand('SELECT `Id` FROM `Dictionary` WHERE `Entry` = '.$Entry.' AND `Language`='.$_SESSION['language'].' AND `User`='.$_SESSION['UserID']); 160 160 if(mysql_num_rows($DbResult) > 0) 161 161 { 162 162 $DbRow = mysql_fetch_assoc($DbResult); 163 $Database->SQLCommand('UPDATE ` dictionary` SET `Text`="'.$_POST['Translated'].'", `Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']);163 $Database->SQLCommand('UPDATE `Dictionary` SET `Text`="'.$_POST['Translated'].'", `Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']); 164 164 } else 165 $Database->SQLCommand('INSERT INTO ` dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$_SESSION['UserID'].', '.$_SESSION['language'].')');165 $Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$_SESSION['UserID'].', '.$_SESSION['language'].')'); 166 166 echo('Záznam byl uložen!'); 167 167 } else echo('Nebyly zaslány všechny položky formuláře.'); … … 169 169 if(($_GET['action'] == 'remove') and Licence(LICENCE_USER)) 170 170 { 171 $Database->SQLCommand('DELETE FROM dictionary WHERE User='.$_SESSION['UserID'].' AND Language='.$_SESSION['language'].' AND Entry='.$_GET['entry']);171 $Database->SQLCommand('DELETE FROM `Dictionary` WHERE `User`='.$_SESSION['UserID'].' AND `Language`='.$_SESSION['language'].' AND `Entry`='.$_GET['entry']); 172 172 } else 173 173 if(($_GET['action'] == 'modify') and Licence(LICENCE_USER)) 174 174 { 175 $DbResult = $Database->SQLCommand('SELECT * FROM dictionary WHERE User='.$_SESSION['UserID'].' AND Entry='.$_GET['entry'].' AND Language='.$_SESSION['language']);175 $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`='.$_SESSION['UserID'].' AND `Entry`='.$_GET['entry'].' AND `Language`='.$_SESSION['language']); 176 176 $DbRow = mysql_fetch_assoc($DbResult); 177 $DbResult = $Database->SQLCommand('SELECT * FROM dictionary WHERE User=0 AND Entry='.$_GET['entry'].' AND Language=0');177 $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`=0 AND `Entry`='.$_GET['entry'].' AND `Language`=0'); 178 178 $DbRow2 = mysql_fetch_assoc($DbResult); 179 179 echo('<form action="dictionary.php?action=save" method="post">'. … … 216 216 if($Search <> '') 217 217 { 218 $sql = 'SELECT ` user`.`user` AS `UserName`, `user`. `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT T2.User, `T1`.Language, `T1`.`Text` AS Original, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `dictionary` AS `T1` JOIN `dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].' WHERE LOWER(T1.Text) LIKE LOWER("%'.$Search.'%") OR LOWER(T1.Description) LIKE LOWER("%'.$Search.'%") ) AS T3 JOIN `user` ON `user`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0';219 } else $sql = 'SELECT ` user`.`user` AS `UserName`, `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT T2.User, `T1`.Language, `T1`.`Text` AS Original, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `dictionary` AS `T1` JOIN `dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].') AS T3 JOIN `user` ON `user`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0';220 221 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$sql.') AS T1');218 $sql = 'SELECT `User`.`Name` AS `UserName`, `User`. `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.`Language`, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].' WHERE LOWER(`T1`.`Text`) LIKE LOWER("%'.$Search.'%") OR LOWER(`T1`.`Description`) LIKE LOWER("%'.$Search.'%") ) AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0'; 219 } else $sql = 'SELECT `User`.`Name` AS `UserName`, `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.Language, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].') AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0'; 220 221 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$sql.') AS `T1`'); 222 222 $DbRow = mysql_fetch_row($DbResult); 223 223 $PageList = GetPageList($DbRow[0]); -
trunk/download.php
r361 r365 13 13 $Group = $TranslationTree[$TableID]; 14 14 15 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(entry)) FROM '.$Group['TablePrefix'].' WHERE (Language <> 0) AND (Complete = 1) AND UserIN('.$Users.')'));15 $ID = mysql_fetch_row($Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM '.$Group['TablePrefix'].' WHERE (`Language` <> 0) AND (`Complete` = 1) AND `User` IN('.$Users.')')); 16 16 $NumberTranslate = $ID[0]; 17 17 18 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Group['TablePrefix'].' WHERE (Language= 0)'));18 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE (`Language` = 0)')); 19 19 $NumberAJ = $ID[0]; 20 20 … … 28 28 } 29 29 30 if (array_key_exists('createverse', $_GET) and Licence(LICENCE_ADMIN)) { 30 /* 31 if (array_key_exists('createverse', $_GET) and Licence(LICENCE_ADMIN)) { 31 32 if (array_key_exists('verse', $_POST)) { //ukládání 32 $Database->SQLCommand('INSERT INTO `verseclient` (`verse` ,`date` ,`text` ,` user`)33 $Database->SQLCommand('INSERT INTO `verseclient` (`verse` ,`date` ,`text` ,`User`) 33 34 VALUES ( "'.$_POST['verse'].'", NOW( ) , "'.$_POST['text'].'", "'.$_SESSION['UserID'].'");'); 34 35 WriteLog('Nová verze ('.$_POST['verse'].') češtiny pro clienta uložena.', LOG_TYPE_MODERATOR); … … 37 38 'Verze: <input type="text" name="verse" /> <input type="submit" value="Uložit" /><br />'. 38 39 'Popis: <textarea rows="20" cols="60" name="text">'); 39 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT ExportSetting FROM user Where ID= '.$_SESSION['UserID']));40 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT `ExportSetting` FROM `User` WHERE `ID` = '.$_SESSION['UserID'])); 40 41 $ExportSetting = unserialize($Line['ExportSetting']); 41 42 … … 44 45 foreach($ExportSetting['groups'] as $Index) $Tables .= GetPercentOfTable($Index,implode(',', $ExportSetting['users-selection'])); 45 46 46 $ID = $Database->SQLCommand('SELECT user FROM user WHERE IDIN('.implode(',', $ExportSetting['users-selection']).')');47 $ID = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID` IN('.implode(',', $ExportSetting['users-selection']).')'); 47 48 $Users = 'Vyexportovány překlady od uživatelů: ( '; 48 while($ Line = mysql_fetch_assoc($ID)) $Users .= $Line['user'].', '; $Users .= ' )';49 while($User = mysql_fetch_assoc($ID)) $Users .= $User['Name'].', '; $Users .= ' )'; 49 50 //Výpis 50 51 echo (' … … 55 56 } 56 57 } 58 */ 57 59 58 60 if(array_key_exists('addon', $_GET)) … … 60 62 echo('<br />Stažený soubor pouze rozbalte a zkopírujte do kořenové složky wow (C:\Program Files\World Of Warcraft\). Hru spouštějte přes soubor WoWME.exe <br /><br />'. 61 63 '<table class="BaseTable"><tr><th>Verze/datum</th><th>Popis</th></tr>'); 62 $ID = $Database->SQLCommand('SELECT * FROM verseclient ORDER BY DATEDESC');64 $ID = $Database->SQLCommand('SELECT * FROM `verseclient` ORDER BY `Date` DESC'); 63 65 while($Line = mysql_fetch_assoc($ID)) 64 66 { -
trunk/export/export.php
r364 r365 37 37 $this->SelectedUsers = ''; 38 38 $this->UserNames = ''; 39 $DbResult = $this->Database->query('SELECT `ExportUser`.*, ` user`.`user` FROM `ExportUser` LEFT JOIN `user` ON `user`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`');39 $DbResult = $this->Database->query('SELECT `ExportUser`.*, `User`.`Name`, `User`.`ID` FROM `ExportUser` LEFT JOIN `User` ON `User`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`'); 40 40 while($User = $DbResult->fetch_assoc()) 41 41 { 42 $this->SelectedUsers .= ','.$User[' User'];43 $this->UserNames .= ','.$User[' user'];42 $this->SelectedUsers .= ','.$User['ID']; 43 $this->UserNames .= ','.$User['Name']; 44 44 } 45 45 $this->SelectedUsers = substr($this->SelectedUsers, 1); … … 59 59 if(isset($_SESSION) and ($_SESSION['UserID'] != '')) 60 60 { 61 $DbResult = $this->Database->query('SELECT ` user` FROM `user` WHERE `ID`='.$_SESSION['UserID']);61 $DbResult = $this->Database->query('SELECT `Name` FROM `User` WHERE `ID`='.$_SESSION['UserID']); 62 62 $this->User = $DbResult->fetch_assoc(); 63 } else $this->User = array(' user' => 'Neznámý');63 } else $this->User = array('User' => 'Neznámý'); 64 64 65 65 … … 82 82 "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n". 83 83 "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n". 84 "-- Vygeneroval uživatel: ".$this->User[' user']."\n".84 "-- Vygeneroval uživatel: ".$this->User['Name']."\n". 85 85 "-- Vzato od uživatelů: ".$this->UserNames."\n". 86 86 "-- Generované tabulky: "; … … 98 98 if($Group['MangosTable'] != '') 99 99 { 100 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE ( Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T GROUP BY T.entry';100 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND `VersionStart` <= '.$this->ClientVersion['BuildNumber'].' AND `VersionEnd` >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T` GROUP BY `T`.`Entry`'; 101 101 //echo($Query); 102 102 $Buffer .= "\n\n-- ".$Group['Name']."\n\n"; … … 111 111 } 112 112 $Values = substr($Values, 2); 113 $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line[' entry'].';'."\n";113 $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line['Entry'].';'."\n"; 114 114 } 115 115 } … … 146 146 { 147 147 $Ori_text = $Line['name']; 148 $DbResult2 = $Database2->query('SELECT text asen,148 $DbResult2 = $Database2->query('SELECT `text` AS en, 149 149 (SELECT `text` FROM `'.$Config['Database']['Database'].'`.`global_strings` AS `tabletran` 150 150 WHERE `tableen`.`entry` = `tabletran`.`entry` AND (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `tran` … … 186 186 " <time>".date('r')."</time>\n". 187 187 " <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n". 188 " <author>".$this->User[' user']."</author>\n".188 " <author>".$this->User['Name']."</author>\n". 189 189 " <contributors>\n"; 190 190 foreach(explode(',', $this->UserNames) as $UserName) … … 203 203 $Group['MangosTableIndex'] = 'entry'; 204 204 } 205 $Query = 'SELECT *,(SELECT ` user` FROM `user` WHERE `user`.`ID`=`T`.`User`) AS `UserName` FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`';205 $Query = 'SELECT *,(SELECT `Name` FROM `User` WHERE `User`.`ID`=`T`.`User`) AS `UserName` FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`'; 206 206 //echo($Query); 207 207 $Buffer .= ' <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n"; … … 251 251 { 252 252 $Line = $DBCFile->GetLine($I); 253 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE ( Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (entry='.$Line[0].') AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';253 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`Entry`='.$Line[0].') AND `VersionStart` <= '.$this->ClientVersion['BuildNumber'].' AND `VersionEnd` >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(`User`, '.$this->SelectedUsers.')) AS `T` GROUP BY `T`.`Entry`'; 254 254 $DbResult2 = $this->Database->query($Query); 255 255 if($DbResult2->num_rows > 0) … … 299 299 $Value['Comment'] = substr(trim($LineParts[1]), 3); 300 300 301 $Query = 'SELECT * FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`ShortCut`="'.$Value['ShortCut'].'") AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'.$this->OrderByUserList.') AS `T` GROUP BY `T`.` entry`';301 $Query = 'SELECT * FROM (SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`ShortCut`="'.$Value['ShortCut'].'") AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'.$this->OrderByUserList.') AS `T` GROUP BY `T`.`Entry`'; 302 302 //echo($Query); 303 303 $DbResult2 = $this->Database->query($Query); -
trunk/export/index.php
r357 r365 42 42 echo($Order['Output']); 43 43 44 $DbResult = $Database->SQLCommand('SELECT ` user`.`user` AS `UserName`, `Export`.*, (SELECT COUNT(*) FROM ExportGroup WHERE ExportGroup.Export=Export.Id) AS GroupCount, (SELECT COUNT(*) FROM ExportUser WHERE ExportUser.Export=Export.Id) AS UserCount FROM `Export` LEFT JOIN `user` ON `user`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);44 $DbResult = $Database->SQLCommand('SELECT `User`.`Name` AS `UserName`, `Export`.*, (SELECT COUNT(*) FROM `ExportGroup` WHERE `ExportGroup`.`Export`=`Export`.`Id`) AS `GroupCount`, (SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']); 45 45 while($Export = mysql_fetch_assoc($DbResult)) 46 46 { … … 178 178 else $InitialOrder = ''; 179 179 180 $Query = 'SELECT (@I := @I + 1) AS Sequence2, TT.* FROM (SELECT ExportUser.Sequence, T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, TranslatedCount FROM `user`) AS T';181 $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID';182 $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(ExportUser.Sequence, 100000000)'.$InitialOrder.') AS TT';183 184 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');180 $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `TT`.* FROM (SELECT `ExportUser`.`Sequence`, `T`.`ID`, `T`.`TranslatedCount`, `T`.`Name`, `T`.`XP` FROM (SELECT `User`.`ID`, `User`.`Name`, `User`.`XP`, `TranslatedCount` FROM `User`) AS T'; 181 $Query .=' LEFT JOIN `ExportUser` ON `ExportUser`.`Export` = '.$_GET['ExportId'].' AND `ExportUser`.`User`=`T`.`ID`'; 182 $Query .=' WHERE `T`.`TranslatedCount` > 0 ORDER BY COALESCE(`ExportUser`.`Sequence`, 100000000)'.$InitialOrder.') AS `TT`'; 183 184 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 185 185 $DbRow = mysql_fetch_row($DbResult); 186 186 $PageList = GetPageList($DbRow[0]); … … 210 210 $Sequence = '<input type="text" name="seq'.$User['ID'].'" style="text-align: center; width: 40px;" value="'.$User['Sequence2'].'"'.$DisabledInput[$Editable].'/>'; 211 211 echo('<tr> 212 <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User[' user'].'</a></td>212 <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['Name'].'</a></td> 213 213 <td>'.$User['TranslatedCount'].'</td> 214 <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User[' user'].'/level.png" alt="Úroveň uživatele" /></td>214 <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User['Name'].'/level.png" alt="Úroveň uživatele" /></td> 215 215 <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>'); 216 216 } … … 269 269 if(array_key_exists('ExportId', $_GET)) 270 270 { 271 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);271 $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 272 272 if(mysql_num_rows($DbRows) > 0) 273 273 { … … 289 289 if(array_key_exists('sel'.$LanguageId, $_POST)) $Selected = true; 290 290 else $Selected = false; 291 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND Language='.$LanguageId;292 $DbResult = $Database->SQLCommand('SELECT * FROM ExportLanguage'.$Condition);291 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND `Language`='.$LanguageId; 292 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportLanguage` '.$Condition); 293 293 if(mysql_num_rows($DbResult) > 0) 294 294 { 295 if(!$Selected) $Database->SQLCommand('DELETE FROM ExportLanguage'.$Condition);296 else $Database->SQLCommand('UPDATE ExportLanguage SET Sequence='.$Value.$Condition);295 if(!$Selected) $Database->SQLCommand('DELETE FROM `ExportLanguage` '.$Condition); 296 else $Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence`='.$Value.$Condition); 297 297 } else 298 298 { 299 if($Selected) $Database->SQLCommand('INSERT INTO ExportLanguage (Export, Language, Sequence) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')');299 if($Selected) $Database->SQLCommand('INSERT INTO `ExportLanguage` (`Export`, `Language`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')'); 300 300 } 301 301 } … … 304 304 // Recalculate sequence number 305 305 $Database->SQLCommand('SET @I = 0'); 306 $Database->SQLCommand('UPDATE ExportLanguage SET Sequence = (@I := @I + 1) WHERE Export='.$_GET['ExportId'].' ORDER BY Sequence;');306 $Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;'); 307 307 } 308 308 } 309 309 310 $Query = 'SELECT (@I := @I + 1) AS Sequence2, Sequence, language.Id, Name FROM language';311 $Query .=' LEFT JOIN ExportLanguage ON ExportLanguage.Export = '.$_GET['ExportId'].' AND ExportLanguage.Language=language.Id';312 $Query .=' WHERE language.Enabled = 1 ORDER BY COALESCE(Sequence, 100)';310 $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `Sequence`, `Language`.`Id`, `Name` FROM `Language`'; 311 $Query .=' LEFT JOIN `ExportLanguage` ON `ExportLanguage`.`Export` = '.$_GET['ExportId'].' AND `ExportLanguage`.`Language`=`Language`.`Id`'; 312 $Query .=' WHERE `Language`.`Enabled` = 1 ORDER BY COALESCE(`Sequence`, 100)'; 313 313 314 314 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); … … 451 451 if(array_key_exists('ExportId', $_GET)) 452 452 { 453 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);453 $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 454 454 if(mysql_num_rows($DbRows) > 0) 455 455 { … … 463 463 } 464 464 465 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);465 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 466 466 $Export = mysql_fetch_assoc($DbResult); 467 467 … … 473 473 '<br />'); 474 474 } 475 $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType ORDER BY Name');475 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportOutputType` ORDER BY `Name`'); 476 476 while($ExportFormat = mysql_fetch_assoc($DbResult)) 477 477 { … … 490 490 if(array_key_exists('ExportId', $_GET)) 491 491 { 492 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);492 $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 493 493 if(mysql_num_rows($DbRows) > 0) 494 494 { … … 499 499 if(array_key_exists('ClientVersion', $_POST)) 500 500 { 501 $Database->SQLCommand('UPDATE Export SET ClientVersion='.$_POST['ClientVersion'].' WHERE Id='.$_GET['ExportId']);502 } 503 504 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);501 $Database->SQLCommand('UPDATE `Export` SET `ClientVersion`='.$_POST['ClientVersion'].' WHERE `Id`='.$_GET['ExportId']); 502 } 503 504 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 505 505 $Export = mysql_fetch_assoc($DbResult); 506 506 507 $Query = 'SELECT wow_client_version.* FROM ExportVersion LEFT JOIN wow_client_version ON wow_client_version.Id=ExportVersion.ClientVersion WHERE ExportType='.$Export['OutputType'];508 509 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');507 $Query = 'SELECT `wow_client_version`.* FROM `ExportVersion` LEFT JOIN `wow_client_version` ON `wow_client_version`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 508 509 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 510 510 $DbRow = mysql_fetch_row($DbResult); 511 511 $PageList = GetPageList($DbRow[0]); … … 532 532 echo($Order['Output']); 533 533 534 $Query = 'SELECT * FROM ('.$Query.') AS TX'.$Order['SQL'].$PageList['SQLLimit'];534 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 535 535 $DbResult = $Database->SQLCommand($Query); 536 536 while($Version = mysql_fetch_assoc($DbResult)) … … 551 551 global $Database; 552 552 553 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);553 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 554 554 $Export = mysql_fetch_assoc($DbResult); 555 $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType WHERE Id='.$Export['OutputType']);555 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']); 556 556 if(mysql_num_rows($DbResult) > 0) 557 557 { 558 $DbResult = $Database->SQLCommand('SELECT * FROM ExportVersion WHERE ExportType='.$Export[ 'OutputType'].' AND ClientVersion='.$Export['ClientVersion']);558 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportVersion` WHERE `ExportType`='.$Export[ 'OutputType'].' AND `ClientVersion`='.$Export['ClientVersion']); 559 559 if(mysql_num_rows($DbResult) > 0) 560 560 { … … 569 569 global $Database; 570 570 571 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);571 $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 572 572 $Export = mysql_fetch_assoc($DbResult); 573 $DbResult = $Database->SQLCommand('SELECT * FROM user WHERE ID='.$Export['User']);573 $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID`='.$Export['User']); 574 574 $User = mysql_fetch_assoc($DbResult); 575 echo('Export <strong><a href="?Action=View&Tab=6&ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User[' user'].'</strong> s označením <strong>'.$Export['Title'].'</strong>');575 echo('Export <strong><a href="?Action=View&Tab=6&ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User['Name'].'</strong> s označením <strong>'.$Export['Title'].'</strong>'); 576 576 ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', 'Výstup')); 577 577 echo('<div id="content">'); -
trunk/export/process_aowow_export.php
r349 r365 18 18 // Rebuild user selection 19 19 $UserSelection = array(); 20 $DbResult = $Database->SQLCommand('SELECT `ID`, `XP` FROM ` user`');20 $DbResult = $Database->SQLCommand('SELECT `ID`, `XP` FROM `User`'); 21 21 while($DbRow = mysql_fetch_assoc($DbResult)) 22 22 { -
trunk/form.php
r321 r365 17 17 if(!$Line) die('Překlad nenalezen.'); 18 18 19 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0 AND ` entry` = '.$Line['entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1');19 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0 AND `Entry` = '.$Line['Entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1'); 20 20 $LineAJ = mysql_fetch_assoc($DbResult); 21 21 if(!$Line) die('Anglický originál k překladu nenalezen.'); 22 22 23 23 $User = @$_SESSION['User']; 24 $IDUser = $Database->SQLCommand('SELECT * FROM ` user` WHERE `id` = '.$Line['User']);24 $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$Line['User']); 25 25 $LineUser = mysql_fetch_array($IDUser); 26 26 27 27 echo('Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />'); 28 28 29 if(($Line['Language'] <> 0) and ($LineUser[' user'] <> ''))30 echo('Přeložil: <strong>'.$LineUser[' user'].'</strong> <br />');29 if(($Line['Language'] <> 0) and ($LineUser['Name'] <> '')) 30 echo('Přeložil: <strong>'.$LineUser['Name'].'</strong> <br />'); 31 31 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 32 32 { … … 47 47 echo('<br />'); 48 48 49 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE ` entry` = '.$Line['entry'].' AND `Language` <> 0');49 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `Entry` = '.$Line['Entry'].' AND `Language` <> 0'); 50 50 $Version = mysql_fetch_row($DbResult); 51 51 $Version = $Version[0]; 52 52 if($Version > 0) 53 53 { 54 echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line[' entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>54 echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line['Entry'].'">Počet verzí: <strong>'.$Version.'</strong></a> 55 55 <input type="hidden" name="group" value="'.$GroupId.'" /> 56 <input type="hidden" name="entry" value="'.$Line[' entry'].'" />56 <input type="hidden" name="entry" value="'.$Line['Entry'].'" /> 57 57 <input type="hidden" name="ID2" value="'.$TextID.'" /> 58 58 <select onchange="this.form.submit();" name="ID1"> 59 59 <option value="-1">Vyberte text k porovnání</option> 60 60 <option value="-1">Zobrazit/porovnat všechny</option>'); 61 $DataID = $Database->SQLCommand('SELECT *, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE (`entry` = '.$Line['entry'].') AND (`ID` <> '.$Line['ID'].')');61 $DataID = $Database->SQLCommand('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].')'); 62 62 while($version = mysql_fetch_array($DataID)) 63 63 { … … 65 65 else 66 66 { 67 if($version['Language'] == 0) $version['User '] = 'Předloha';68 echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['User '].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');67 if($version['Language'] == 0) $version['UserName'] = 'Předloha'; 68 echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['UserName'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>'); 69 69 } 70 70 } … … 72 72 } else 73 73 { 74 echo('<a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line[' entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>');74 echo('<a href="TranslationList.php?group='.$GroupId.'&action=searchentry&ID='.$Line['Entry'].'">Počet verzí: <strong>'.$Version.'</strong></a>'); 75 75 } 76 76 … … 87 87 88 88 if($TranslationTree[$GroupId]['WowheadName'] != '') 89 $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ[' entry'].'">'.$LineAJ['entry'].'</a>';90 else $WowheadLink = $LineAJ[' entry'];89 $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['Entry'].'">'.$LineAJ['Entry'].'</a>'; 90 else $WowheadLink = $LineAJ['Entry']; 91 91 92 echo('<input type="hidden" name="entry" value="'.$LineAJ[' entry'].'" />92 echo('<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" /> 93 93 <input type="hidden" name="user" value="'.$User.'" /> 94 94 <input type="hidden" name="ID" value="'.$TextID.'" /> … … 107 107 else if($_SESSION['UserID'] != '') 108 108 { 109 $IDUser = $Database->SQLCommand('SELECT * FROM ` user` WHERE `id` = '.$_SESSION['UserID']);109 $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID']); 110 110 $LineUser = mysql_fetch_array($IDUser); 111 $Language = $LineUser['Language']; // jiný user vyčítám111 $Language = $LineUser['Language']; // jiný user vyčítám 112 112 } else $Language = 0; 113 113 WriteLanguages($Language); -
trunk/img_level.php
r357 r365 72 72 else $groupby .= ', '.$TextItem['Column']; 73 73 } 74 $IDtran = $Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE User = '.$user_ID.' AND Complete= 1 '.$groupby);74 $IDtran = $Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE `User` = '.$user_ID.' AND `Complete` = 1 '.$groupby); 75 75 while($Line = mysql_fetch_array($IDtran)) 76 76 { //jednotlivé překlady … … 106 106 107 107 // Hlavní kod pro uživatele 108 $ID = $Database->SQLCommand('SELECT `ID`, ` user` FROM `user` WHERE `NeedUpdate` = 1');108 $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `User` WHERE `NeedUpdate` = 1'); 109 109 while($LineUser = mysql_fetch_array($ID)) 110 110 { … … 120 120 121 121 $xp = GetXPFromTranslation($LineUser['ID']); 122 $Database->SQLCommand('UPDATE ` user` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `user`.`ID` = '.$LineUser['ID']);123 CreateImg('user', $LineUser[' user'], $xp);122 $Database->SQLCommand('UPDATE `User` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `User`.`ID` = '.$LineUser['ID']); 123 CreateImg('user', $LineUser['Name'], $xp); 124 124 } 125 125 126 126 // Hlavní kod pro překladatelské týmy 127 $ID = $Database->SQLCommand('SELECT `ID`, ` name`, (SELECT AVG(`XP`) FROM `user` WHERE `team` = `Team`.`Id`) AS `average` FROM `Team` WHERE `ID` IN (SELECT `Team` FROM `user` WHERE `NeedUpdate` = 1)');127 $ID = $Database->SQLCommand('SELECT `ID`, `Name`, (SELECT AVG(`XP`) FROM `User` WHERE `Team` = `Team`.`Id`) AS `Average` FROM `Team` WHERE `ID` IN (SELECT `Team` FROM `User` WHERE `NeedUpdate` = 1)'); 128 128 while($LineTeam = mysql_fetch_array($ID)) 129 129 { 130 CreateImg('team', $LineTeam[' name'], substr($LineTeam['average'], 0, strpos($LineTeam['average'],'.'))); //vytváření obrázku130 CreateImg('team', $LineTeam['Name'], substr($LineTeam['Average'], 0, strpos($LineTeam['Average'],'.'))); //vytváření obrázku 131 131 } 132 $Database->SQLCommand('UPDATE ` user` SET `NeedUpdate` = 0');132 $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 0'); 133 133 } 134 134 … … 138 138 139 139 // Do update for all users 140 $Database->SQLCommand('UPDATE ` user` SET `NeedUpdate` = 1');140 $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1'); 141 141 ImgLevelUpdate(); 142 142 143 143 echo('<strong>Uživatelé</strong><br/>'); 144 $ID = $Database->SQLCommand('SELECT `ID`, ` user` FROM `user`');144 $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `User`'); 145 145 while($LineUser = mysql_fetch_array($ID)) 146 146 { 147 echo('<img src="tmp/user/'.$LineUser[' user'].'/level.png" /> '.$LineUser['user'].'<br />');147 echo('<img src="tmp/user/'.$LineUser['Name'].'/level.png" /> '.$LineUser['Name'].'<br />'); 148 148 } 149 149 150 150 echo('<br/><strong>Týmy</strong><br/>'); 151 $ID = $Database->SQLCommand('SELECT ID, Name FROM Team');151 $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `Team`'); 152 152 while($LineTeam = mysql_fetch_array($ID)) 153 153 { -
trunk/img_statistic.php
r349 r365 10 10 if(array_key_exists('team', $_GET)) 11 11 { 12 $team = ' AND `User` IN (SELECT `ID` FROM ` user` WHERE `team` = '.($_GET['team'] * 1).')';12 $team = ' AND `User` IN (SELECT `ID` FROM `User` WHERE `Team` = '.($_GET['team'] * 1).')'; 13 13 } else $team = ''; 14 14 … … 24 24 25 25 $where = 'VersionEnd = '.$BuildNumber_max.' AND (`Language` <> 0) AND (`Complete` = 1) '.$team.$language; 26 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(`entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where));26 $ID = mysql_fetch_row($Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where)); 27 27 $NumberTranslate = $ID[0]; 28 28 29 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(`entry`)) FROM `'.$Group['TablePrefix'].'` WHERE `VersionEnd` = '.$BuildNumber_max.' AND (`Language` = 0)'));29 $ID = mysql_fetch_row($Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE `VersionEnd` = '.$BuildNumber_max.' AND (`Language` = 0)')); 30 30 $NumberAJ = $ID[0]; 31 31 32 $DbResult = $Database->SQLCommand('SELECT count(*) FROM `log` WHERE (`Type` = 1) AND (`date` >= CURRENT_DATE - INTERVAL '.$Days.' DAY) AND (`text` LIKE "%'.$Group['Name'].'%")');32 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE (`Type` = 1) AND (`Date` >= CURRENT_DATE - INTERVAL '.$Days.' DAY) AND (`Text` LIKE "%'.$Group['Name'].'%")'); 33 33 $ID = mysql_fetch_row($DbResult); 34 34 $NumberPerDay = $ID[0]; //date ("Y-m-d H:i:s") -
trunk/import/import_dbc.php
r357 r365 5 5 UPDATE `gametips` SET VersionStart = 8606,VersionEnd = 8606; 6 6 UPDATE `spell` SET VersionStart = 8606,VersionEnd = 8606; 7 DELETE FROM ` log` WHERE Type = 11;7 DELETE FROM `Log` WHERE Type = 11; 8 8 */ 9 9 -
trunk/includes/global.php
r362 r365 44 44 if(Licence(LICENCE_USER)) echo(' <a href="'.$Config['Web']['BaseURL'].'action.php?action=shoutbox">Vložit</a>'); 45 45 echo('<div class="box"><table>'); 46 $ID = $Database->SQLCommand('SELECT * FROM shoutbox ORDER BY IDDESC LIMIT 20');46 $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20'); 47 47 while($Line = mysql_fetch_assoc($ID)) 48 echo('<tr><td><strong>'.$Line[' user'].'</strong>: '.htmlspecialchars($Line['text']).'</td></tr>');48 echo('<tr><td><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</td></tr>'); 49 49 echo('</table></div>'); 50 50 } … … 58 58 if(Licence(LICENCE_USER)) 59 59 { 60 $DbResult = $Database->SQLCommand('SELECT ` team`, `user` FROM `user` WHERE ID='.$_SESSION['UserID']);60 $DbResult = $Database->SQLCommand('SELECT `Team`, `Name` FROM `User` WHERE ID='.$_SESSION['UserID']); 61 61 $User = mysql_fetch_assoc($DbResult); 62 $DbResult = $Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE Id='.$User[' team']);62 $DbResult = $Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE Id='.$User['Team']); 63 63 $Team = mysql_fetch_assoc($DbResult); 64 64 65 65 //echo('<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>'); 66 echo('<span class="MenuItem2">'.$User[' user'].' <a href="'.$Config['Web']['BaseURL'].'?Logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>');66 echo('<span class="MenuItem2">'.$User['Name'].' <a href="'.$Config['Web']['BaseURL'].'?Logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>'); 67 67 } else 68 68 { … … 189 189 190 190 echo('Online překladatelé:<br />'); 191 $ID = $Database->SQLCommand('SELECT `user`, `GM`, `ID` FROM `user` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))'); 192 while ($Line = mysql_fetch_assoc($ID)) 193 { 194 if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>'; 195 else $Name = $Line['user']; 196 //if($Line['GM'] <> 0) $TextGM = '<small>('.$Moderators[$Line['GM']].')</small>'; 197 //else 191 $ID = $Database->SQLCommand('SELECT `Name`, `GM`, `ID` FROM `User` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))'); 192 while($User = mysql_fetch_assoc($ID)) 193 { 194 if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$User['ID'].'">'.$User['Name'].'</a>'; 195 else $Name = $User['Name']; 198 196 $TextGM = ''; 199 197 echo('<strong>'.$Name.'</strong>'.$TextGM.'<br />'); … … 215 213 $_SESSION['Pass'] = $_POST['LoginPass']; 216 214 217 $DbResult = $Database->SQLCommand('SELECT * FROM ` user` WHERE LOWER(`user`) = LOWER("'.$_SESSION['User'].'") AND `pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))');215 $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE LOWER(`Name`) = LOWER("'.$_SESSION['User'].'") AND `Pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))'); 218 216 if(mysql_num_rows($DbResult) == 0) 219 217 { … … 226 224 $User = mysql_fetch_assoc($DbResult); 227 225 $_SESSION['UserID'] = $User['ID']; 228 $_SESSION['User'] = $User[' user'];226 $_SESSION['User'] = $User['Name']; 229 227 WriteLog('Login: '.$_SESSION['User'], LOG_TYPE_USER); 230 228 } … … 236 234 WriteLog('Odhlášení', LOG_TYPE_USER); 237 235 if(is_numeric($_SESSION['UserID'])) 238 $Database->SQLCommand('UPDATE ` user` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']);236 $Database->SQLCommand('UPDATE `User` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']); 239 237 $_SESSION['User'] = ''; 240 238 $_SESSION['Pass'] = ''; … … 244 242 // Záznam o aktivitě 245 243 if(Licence(LICENCE_USER) and array_key_exists('REMOTE_ADDR', $_SERVER)) 246 $Database->SQLCommand('UPDATE ` user` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']);244 $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']); 247 245 } 248 246 -
trunk/includes/global_function.php
r357 r365 223 223 // $User = $_SESSION['User']; 224 224 $Pass = $_SESSION['Pass']; 225 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM user WHERE ID = '.$_SESSION['UserID'].' AND GM >= '.$Licence.' AND pass = sha1(CONCAT(sha1("'.$Pass.'"), Salt))'));225 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID'].' AND `GM` >= '.$Licence.' AND `Pass` = sha1(CONCAT(sha1("'.$Pass.'"), `Salt`))')); 226 226 return($Line); 227 227 } else … … 245 245 246 246 $Result = array(); 247 $DbResult = $Database->SQLCommand('SELECT * FROM ` language` WHERE `Enabled` = 1');247 $DbResult = $Database->SQLCommand('SELECT * FROM `Language` WHERE `Enabled` = 1'); 248 248 while($DbRow = mysql_fetch_assoc($DbResult)) 249 249 $Result[$DbRow['Id']] = $DbRow; … … 288 288 289 289 $Database->SelectDatabase($Config['Database']['Database']); 290 $Query = 'INSERT INTO ` log` ( `user` , `type` , `text` , `date` , `IP` )290 $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP` ) 291 291 VALUES ('.$user.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$ip.'")'; 292 292 $Database->SQLCommand($Query); -
trunk/index.php
r357 r365 8 8 9 9 $Output = '<strong>Změny systému:</strong><div class="NewsBox">'; 10 $DbResult = $Database->SQLCommand('SELECT news.Time, user.user, news.Text FROM news JOIN user ON user.ID = news.User ORDER BY TimeDESC LIMIT 10');10 $DbResult = $Database->SQLCommand('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 11 11 while($DbRow = mysql_fetch_assoc($DbResult)) 12 $Output .= '<div><strong>'.$DbRow[' user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>';12 $Output .= '<div><strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>'; 13 13 $Output .= '<a href="action.php?action=news">Všechny zprávy</a>'; 14 14 $Output .= '</div>'; … … 21 21 22 22 $Output = '<br /><strong>Poslední překlady:</strong><div class="NewsBox">'; 23 $DbResult = $Database->SQLCommand('SELECT date,user.user,text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY dateDESC LIMIT 20');23 $DbResult = $Database->SQLCommand('SELECT `Date`, `User`.`Name`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 20'); 24 24 while($DbRow = mysql_fetch_assoc($DbResult)) 25 $Output .= '<strong>'.$DbRow[' user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['date'])).')</strong>26 '.$DbRow[' text'].' <br />';25 $Output .= '<strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Date'])).')</strong> 26 '.$DbRow['Text'].' <br />'; 27 27 $Output .= '</div>'; 28 28 return($Output); … … 36 36 if($_GET['rss'] == 'news') 37 37 { 38 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP( news.Time), news.Time, user.user, news.Text FROM news JOIN user ON user.ID = news.User ORDER BY TimeDESC LIMIT 10');38 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 39 39 while($DbRow = mysql_fetch_assoc($DbResult)) 40 40 { 41 41 $Items[] = array 42 42 ( 43 'Title' => $DbRow[' user'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')',43 'Title' => $DbRow['Name'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')', 44 44 'Link' => $Config['Web']['BaseURL'], 45 45 'Description' => $DbRow['Text'], 46 'Time' => $DbRow['U NIX_TIMESTAMP(news.Time)'],46 'Time' => $DbRow['UnixTime'], 47 47 ); 48 48 } … … 58 58 if($_GET['rss'] == 'translation') 59 59 { 60 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP( date), date, user.user, text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY dateDESC LIMIT 100');60 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100'); 61 61 while($DbRow = mysql_fetch_assoc($DbResult)) 62 62 { 63 63 $Items[] = array 64 64 ( 65 'Title' => strip_tags($DbRow[' text'].' ('.$DbRow['user'].')'),65 'Title' => strip_tags($DbRow['Text'].' ('.$DbRow['UserName'].')'), 66 66 'Link' => $Config['Web']['BaseURL'], 67 'Description' => $DbRow[' text'],68 'Time' => $DbRow[' UNIX_TIMESTAMP(date)'],67 'Description' => $DbRow['Text'], 68 'Time' => $DbRow['Date'], 69 69 ); 70 70 } … … 82 82 $TitleLength = 50; 83 83 mb_internal_encoding('utf-8'); 84 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP( date), user, text FROM shoutbox ORDER BY IDDESC LIMIT 20');84 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `Text` FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20'); 85 85 while($DbRow = mysql_fetch_assoc($DbResult)) 86 86 { … … 89 89 $Items[] = array 90 90 ( 91 'Title' => $DbRow[' user'].': '.$Title,91 'Title' => $DbRow['User'].': '.$Title, 92 92 'Link' => $Config['Web']['BaseURL'], 93 'Description' => $DbRow[' text'],94 'Time' => $DbRow['U NIX_TIMESTAMP(date)'],93 'Description' => $DbRow['Text'], 94 'Time' => $DbRow['UnixDate'], 95 95 ); 96 96 } -
trunk/log.php
r357 r365 6 6 { 7 7 $Items = array(); 8 if(array_key_exists('type', $_GET)) $Where = ' WHERE ` type` = "'.($_GET['type'] * 1).'"';8 if(array_key_exists('type', $_GET)) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"'; 9 9 else $Where = ''; 10 $sql = 'SELECT *,UNIX_TIMESTAMP(` date`), (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `log`.`user`) AS `user` FROM `log`'.$Where.' ORDER BY `date` DESC LIMIT 100';10 $sql = 'SELECT *,UNIX_TIMESTAMP(`Date`), (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `User` FROM `Log`'.$Where.' ORDER BY `Date` DESC LIMIT 100'; 11 11 $ID = $Database->SQLCommand($sql); 12 12 while($Line = mysql_fetch_assoc($ID)) 13 13 { 14 $DbResult = $Database->SQLCommand('SELECT * FROM `LogType` WHERE `Id`='.$Line[' type']);14 $DbResult = $Database->SQLCommand('SELECT * FROM `LogType` WHERE `Id`='.$Line['Type']); 15 15 $LogType = mysql_fetch_assoc($DbResult); 16 16 17 17 $Items[] = array 18 18 ( 19 'Title' => strip_tags($LogType['Name'].': '.$Line[' text'].' ('.$Line['user'].', '.$Line['IP'].')'),19 'Title' => strip_tags($LogType['Name'].': '.$Line['Text'].' ('.$Line['Name'].', '.$Line['IP'].')'), 20 20 'Link' => $Config['Web']['BaseURL'].'log.php', 21 'Description' => $LogType['Name'].': '.$Line[' text'].' ('.$Line['user'].', '.$Line['IP'].')',22 'Time' => $Line['UNIX_TIMESTAMP( date)'],21 'Description' => $LogType['Name'].': '.$Line['Text'].' ('.$Line['Name'].', '.$Line['IP'].')', 22 'Time' => $Line['UNIX_TIMESTAMP(Date)'], 23 23 ); 24 24 } … … 39 39 if(array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group']; 40 40 41 if($_SESSION['type'] != '') $WhereType = ' ` type`='.$_SESSION['type'];41 if($_SESSION['type'] != '') $WhereType = ' `Type`='.$_SESSION['type']; 42 42 else $WhereType = '1=1'; 43 43 … … 61 61 else 62 62 { 63 if(array_key_exists('group', $_SESSION)) $Where = ' WHERE ` text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';63 if(array_key_exists('group', $_SESSION)) $Where = ' WHERE `Text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"'; 64 64 else $Where = ''; 65 65 } 66 66 //if(($Where != '') and (array_key_exists('group', $_SESSION))) $Where .= ' AND text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"'; 67 67 68 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` log` '.$Where);68 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` '.$Where); 69 69 $DbRow = mysql_fetch_row($DbResult); 70 70 $PageList = GetPageList($DbRow[0]); … … 75 75 array('Name' => 'date', 'Title' => 'Čas'), 76 76 array('Name' => 'text', 'Title' => 'Text'), 77 array('Name' => ' user', 'Title' => 'Uživatel'),77 array('Name' => 'User', 'Title' => 'Uživatel'), 78 78 array('Name' => 'IP', 'Title' => 'Adresa'), 79 79 ); … … 82 82 echo($Order['Output']); 83 83 84 $sql = 'SELECT *, `LogType`.`Color` AS `LogColor`, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `log`.`user`) AS `user` FROM `log` LEFT JOIN `LogType` ON `LogType`.`Id`=`log`.`type` '.$Where.$Order['SQL'].$PageList['SQLLimit'];84 $sql = 'SELECT *, `LogType`.`Color` AS `LogColor`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `User` FROM `Log` LEFT JOIN `LogType` ON `LogType`.`Id`=`Log`.`Type` '.$Where.$Order['SQL'].$PageList['SQLLimit']; 85 85 //echo($sql); 86 86 $ID = $Database->SQLCommand($sql); 87 87 while($Line = mysql_fetch_assoc($ID)) 88 88 { 89 echo('<tr><td>'.$Line[' date'].'</td><td><span style="color: '.$Line['LogColor'].'">'.$Line['text'].'</span></td><td>'.$Line['user'].'</td><td>'.$Line['IP'].'</td></tr>');89 echo('<tr><td>'.$Line['Date'].'</td><td><span style="color: '.$Line['LogColor'].'">'.$Line['Text'].'</span></td><td>'.$Line['Name'].'</td><td>'.$Line['IP'].'</td></tr>'); 90 90 } 91 91 echo('</table>'); -
trunk/registrace.php
r357 r365 7 7 if(array_key_exists('user', $_POST)) 8 8 { 9 $User = $_POST['user'];9 $UserName = $_POST['user']; 10 10 $Pass = $_POST['pass']; 11 11 $Pass2 = $_POST['pass2']; … … 19 19 if($Pass == $Pass2) 20 20 { 21 $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM user WHERE user= "'.$User.'"'));21 $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM `User` WHERE `User` = "'.$User.'"')); 22 22 if(!$Line) 23 23 { 24 24 $Address = $_SERVER['REMOTE_ADDR']; 25 25 $Salt = GetPasswordSalt(); 26 $Database->SQLCommand('INSERT INTO `user` (`user` , `pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `team` , `NeedUpdate`, `RegistrationTime` ) 27 VALUES ("'.$User.'", sha1(CONCAT(sha1("'.$Pass.'"), "'.$Salt.'")), "'.$Salt.'", "'.$Address.'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())'); 28 // $Database->SQLCommand("INSERT INTO user () VALUES('$User','$Pass','0','$Addres',now(),'0','$Email')"); 26 $Database->SQLCommand('INSERT INTO `User` (`Name` , `Pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime` ) 27 VALUES ("'.$UserName.'", sha1(CONCAT(sha1("'.$Pass.'"), "'.$Salt.'")), "'.$Salt.'", "'.$Address.'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())'); 29 28 echo('Registrace proběhla úspěšně.<br />'); 30 29 31 $_SESSION['User'] = $User ;30 $_SESSION['User'] = $UserName; 32 31 $_SESSION['Pass'] = $Pass; 33 32 34 $Line = mysql_fetch_array($Database->SQLCommand('SELECT ID FROM user WHERE user= "'.$_SESSION['User'].'"'));33 $Line = mysql_fetch_array($Database->SQLCommand('SELECT `ID` FROM `User` WHERE `Name` = "'.$_SESSION['User'].'"')); 35 34 $_SESSION['UserID'] = $Line['ID']; 36 35 WriteLog('Uživatel se zaregistroval: '.$User, LOG_TYPE_USER); -
trunk/save.php
r357 r365 19 19 else $complete = 0; 20 20 21 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (` entry` = '.$entry.')');21 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$entry.')'); 22 22 if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky'); 23 23 $LineAJ = mysql_fetch_array($DbResult); 24 24 $LineTake = mysql_fetch_array($Database->SQLCommand('SELECT `VersionEnd`, `VersionStart` FROM `'.$Table.'` WHERE `ID` = '.$TextID)); 25 25 if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky'); 26 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (` user`='.$UserID.') AND (`entry` = '.$entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')');26 $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$UserID.') AND (`Entry` = '.$entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'); 27 27 $Line = mysql_fetch_array($DbResult); 28 28 if(!$Line) … … 69 69 while($SameTranLine = mysql_fetch_assoc($SameTranID)) 70 70 { 71 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (` user`='.$UserID.') AND (`entry` = '.$SameTranLine['entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'));71 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$UserID.') AND (`Entry` = '.$SameTranLine['Entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')')); 72 72 if(!$Line) 73 73 { … … 79 79 if($Rank_number <> '') $Rank_cur = $Rank.' '.$Rank_number; 80 80 else $Rank_cur = $SameTranLine['Rank']; 81 $Database->SQLCommand('INSERT INTO `'.$Table.'` (` entry`, '.$Columns.', `Rank`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$Rank_cur.'")');81 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.', `Rank`) VALUES ('.$SameTranLine['Entry'].','.$Values.',"'.$Rank_cur.'")'); 82 82 } else 83 83 { 84 $Database->SQLCommand('INSERT INTO `'.$Table.'` (` entry`, '.$Columns.') VALUES ('.$SameTranLine['entry'].','.$Values.')');84 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.') VALUES ('.$SameTranLine['Entry'].','.$Values.')'); 85 85 } 86 86 } else 87 87 { 88 $Database->SQLCommand('INSERT INTO `'.$Table.'` (` entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")');88 $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.', `ShortCut`) VALUES ('.$SameTranLine['Entry'].','.$Values.',"'.$SameTranLine['ShortCut'].'")'); 89 89 } 90 90 $LastIDs[] = mysql_insert_id(); … … 119 119 $next = FollowingTran($TextID, $Table, $GroupId); 120 120 echo('<br /><br />'); 121 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT ` redirecting` FROM `user` WHERE `ID`='.$UserID));121 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `Redirecting` FROM `User` WHERE `ID`='.$UserID)); 122 122 123 123 switch($redirecting['redirecting']) … … 145 145 146 146 // Aktualizace informace o nutnosti načíst XP 147 $Database->SQLCommand('UPDATE ` user` SET `NeedUpdate` = 1 WHERE `ID` = '.$UserID);147 $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$UserID); 148 148 } else 149 149 { -
trunk/statistic.php
r328 r365 22 22 <div>Počet stáhnutí přeložených textů v SQL souboru: <strong>'); 23 23 24 $ID = $Database->SQLCommand('SELECT count(distinct( IP)) FROM log WHERE type= 2');24 $ID = $Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2'); 25 25 $Line = mysql_fetch_row($ID); 26 26 echo($Line[0]); … … 29 29 <div>Počet stáhnutí: <strong>'); 30 30 31 $ID = $Database->SQLCommand('SELECT count(distinct( IP)) FROM log WHERE type= 0');31 $ID = $Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0'); 32 32 $Line = mysql_fetch_row($ID); 33 33 echo($Line[0]); -
trunk/team.php
r357 r365 31 31 echo($Order['Output']); 32 32 33 if(array_key_exists('search', $_GET)) $_SESSION['search'] = ' WHERE ` name` LIKE "%'.$_GET['search'].'%" OR `description` LIKE "%'.$_GET['search'].'%"';33 if(array_key_exists('search', $_GET)) $_SESSION['search'] = ' WHERE `Name` LIKE "%'.$_GET['search'].'%" OR `Description` LIKE "%'.$_GET['search'].'%"'; 34 34 else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; 35 35 if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; … … 46 46 if(!is_numeric($_SESSION['team'])) echo(' <a href="?Where">Zrušit filtr týmů</a><br />'); 47 47 */ 48 $DbResult = $Database->SQLCommand('SELECT `Team` FROM ` user` WHERE `ID`='.$_SESSION['UserID']);48 $DbResult = $Database->SQLCommand('SELECT `Team` FROM `User` WHERE `ID`='.$_SESSION['UserID']); 49 49 $User = mysql_fetch_assoc($DbResult); 50 50 51 $ID = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM ` user` WHERE `user`.`team` = `Team`.`Id`) AS `NumberUser`, (SELECT `user` FROM `user` WHERE `user`.`ID`=`Team`.`Leader`) AS `LeaderName` FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']);51 $ID = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) AS `NumberUser`, (SELECT `Name` FROM `User` WHERE `User`.`ID`=`Team`.`Leader`) AS `LeaderName` FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']); 52 52 while($Team = mysql_fetch_assoc($ID)) 53 53 { … … 81 81 if(array_key_exists('id', $_GET)) 82 82 { 83 $Database->SQLCommand('UPDATE ` user` SET `team` = '.$_GET['id'].' WHERE `ID` = '.$_SESSION['UserID']);83 $Database->SQLCommand('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$_SESSION['UserID']); 84 84 echo('<strong>Vstoupil jsi do týmu</strong><br /><br />'); 85 85 WriteLog('Uživatel vstoupil do týmu '.$_GET['id'], LOG_TYPE_USER); 86 86 87 87 // Delete all teams without users 88 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM ` user` WHERE `user`.`team` = `Team`.`Id`) = 0');88 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 89 89 90 90 // Set new leader for teams where old leader went to other team 91 $Database->SQLCommand('UPDATE Team SET Leader=(SELECT Id FROM `user` WHERE user.Team=Team.Id ORDER BY user.RegistrationTime LIMIT 1) WHERE Leader NOT IN (SELECT ID FROM user WHERE user.Team=Team.Id);');91 $Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);'); 92 92 93 93 ShowTeamList(); … … 110 110 { 111 111 $Database->SQLCommand('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`,`Leader`) VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'.$_POST['URL'].'", NOW(), '.$_SESSION['UserID'].')'); 112 $Database->SQLCommand('UPDATE ` user` SET `team` = '.mysql_insert_id().' WHERE `ID` = '.$_SESSION['UserID']);112 $Database->SQLCommand('UPDATE `User` SET `Team` = '.mysql_insert_id().' WHERE `ID` = '.$_SESSION['UserID']); 113 113 echo('<strong>Překladatelský tým vytvořen</strong><br /><br />'); 114 114 WriteLog('Překladatelský tým vytvořen '.$_POST['Name'], LOG_TYPE_USER); 115 115 116 116 // Delete all teams without users 117 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM ` user` WHERE `user`.`team` = `Team`.`Id`) = 0');117 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 118 118 } else echo('Již existuje tým se stejným jménem'); 119 119 } else echo('Chybí údaje formuláře'); … … 195 195 ImgLevelUpdate(); 196 196 197 $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT count(*) FROM `user` WHERE `team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `user` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']));198 $DbResult = $Database->SQLCommand('SELECT user FROM user WHERE ID='.$Team['Leader']);197 $Team = mysql_fetch_assoc($Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `Team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `User` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id'])); 198 $DbResult = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID`='.$Team['Leader']); 199 199 if(mysql_num_rows($DbResult) > 0) 200 200 { 201 201 $Leader = mysql_fetch_assoc($DbResult); 202 $Leader = $Leader[' user'];202 $Leader = $Leader['Name']; 203 203 } else $Leader = ''; 204 204 … … 227 227 if(Licence(LICENCE_USER)) 228 228 { 229 $Database->SQLCommand('UPDATE ` user` SET `team` = 0 WHERE `ID` = '.$_SESSION['UserID']);229 $Database->SQLCommand('UPDATE `User` SET `Team` = 0 WHERE `ID` = '.$_SESSION['UserID']); 230 230 echo('<strong>Nyní nejste členem žádného týmu</strong><br /><br />'); 231 231 WriteLog('Uživatel vystoupil z týmu', LOG_TYPE_USER); 232 232 233 233 // Delete all teams without users 234 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM ` user` WHERE `user`.`team` = `Team`.`Id`) = 0');234 $Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 235 235 236 236 // Set new leader for teams where old leader went to other team 237 $Database->SQLCommand('UPDATE Team SET Leader=(SELECT Id FROM `user` WHERE user.Team=Team.Id ORDER BY user.RegistrationTime LIMIT 1) WHERE Leader NOT IN (SELECT ID FROM user WHERE user.Team=Team.Id);');237 $Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);'); 238 238 239 239 ShowTeamList(); -
trunk/user.php
r350 r365 10 10 $email = $_POST['email']; 11 11 $subject = $_POST['subject']; 12 echo(' email: <strong>'.$email.'</strong><br />');13 echo(' předmět: <strong>'.$subject.'</strong><br />');14 echo(' text: <strong>'.$text.'</strong><br />');12 echo('Email: <strong>'.$email.'</strong><br />'); 13 echo('Předmět: <strong>'.$subject.'</strong><br />'); 14 echo('Text: <strong>'.$text.'</strong><br />'); 15 15 16 16 if(@mail($email, $subject, $text, 'From: '.$Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/')) … … 26 26 if(array_key_exists('user', $_GET) and Licence(LICENCE_MODERATOR)) 27 27 { 28 $Query = 'SELECT * FROM ` user` WHERE ID= '.$_GET['user'];29 $ LineUser = mysql_fetch_array($Database->SQLCommand($Query));28 $Query = 'SELECT * FROM `User` WHERE `ID` = '.$_GET['user']; 29 $User = mysql_fetch_array($Database->SQLCommand($Query)); 30 30 31 echo('ID: <strong>'.$ _GET['user'].'</strong><br />');32 echo('Jméno: <strong>'.$ LineUser['user'].'</strong><br />');33 echo('Výchozí jazyk: <strong>'.$LanguageList[$ LineUser['Language']]['Name'].'</strong><br />');34 echo('Poslední připojení: <strong>'.$ LineUser['LastLogin'].'</strong><br />');35 echo('Poslední IP: <strong>'.$ LineUser['LastIP'].'</strong><br />');36 echo('Počet přeložených: <a href="TranslationList.php?user='.$ _GET['user'].'&action=userall" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$LineUser['TranslatedCount'].'</strong></a><br />');37 echo('Email: <strong>'.$ LineUser['Email'].'</strong><br />');31 echo('ID: <strong>'.$User['ID'].'</strong><br />'); 32 echo('Jméno: <strong>'.$User['Name'].'</strong><br />'); 33 echo('Výchozí jazyk: <strong>'.$LanguageList[$User['Language']]['Name'].'</strong><br />'); 34 echo('Poslední připojení: <strong>'.$User['LastLogin'].'</strong><br />'); 35 echo('Poslední IP: <strong>'.$User['LastIP'].'</strong><br />'); 36 echo('Počet přeložených: <a href="TranslationList.php?user='.$User['ID'].'&action=userall" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$User['TranslatedCount'].'</strong></a><br />'); 37 echo('Email: <strong>'.$User['Email'].'</strong><br />'); 38 38 echo('<br /> 39 39 40 40 <form action="user.php" method="post"><div> 41 41 Napsat E-mail: 42 <input type="text" name="email" value="'.$ LineUser['Email'].'" />42 <input type="text" name="email" value="'.$User['Email'].'" /> 43 43 Předmět: 44 44 <input type="text" name="subject" value="Projekt překládání textů WoW" /> -
trunk/userlist.php
r352 r365 11 11 if(array_key_exists('search', $_GET)) 12 12 { 13 $_SESSION['Where'] = ' WHERE ` user`.`user` LIKE "%'.$_GET['search'].'%"';13 $_SESSION['Where'] = ' WHERE `User`.`User` LIKE "%'.$_GET['search'].'%"'; 14 14 } 15 15 if(array_key_exists('team', $_GET)) 16 16 { 17 $_SESSION['Where'] = ' WHERE team='.$_GET['team'];17 $_SESSION['Where'] = ' WHERE `Team`='.$_GET['team']; 18 18 if($_GET['team'] == '') $_SESSION['Where'] = ''; 19 19 } … … 26 26 //if($_SESSION['Where'] <> '') echo(' <a href="?action=nofilter">Zrušit filtr uživatelů</a><br />'); 27 27 28 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` user`'.$_SESSION['Where']);28 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `User`'.$_SESSION['Where']); 29 29 $DbRow = mysql_fetch_row($DbResult); 30 30 $PageList = GetPageList($DbRow[0]); … … 34 34 35 35 $TableColumns = array( 36 array('Name' => ' user', 'Title' => 'Jméno'),36 array('Name' => 'User', 'Title' => 'Jméno'), 37 37 array('Name' => 'TranslatedCount', 'Title' => 'Přeložených'), 38 38 array('Name' => 'XP', 'Title' => 'Úroveň'), … … 44 44 45 45 46 $Query = 'SELECT `ID`, ` user`.`user`, `LastLogin`, `GM`, `TranslatedCount` FROM `user` '.$_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit'];46 $Query = 'SELECT `ID`, `User`.`Name`, `LastLogin`, `GM`, `TranslatedCount` FROM `User` '.$_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit']; 47 47 48 48 $ID = $Database->SQLCommand($Query); … … 50 50 { 51 51 if(Licence(LICENCE_MODERATOR)) 52 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line[' user'].'</a>';53 else $Name = $Line[' user'];52 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['Name'].'</a>'; 53 else $Name = $Line['Name']; 54 54 55 55 echo('<tr><td>'.$Name.'</td> 56 56 <td style="text-align: center;"><a href="TranslationList.php?user='.$Line['ID'].'&action=userall" title="Zobrazit Všechny jeho přeložené texty">'.$Line['TranslatedCount'].'</a></td> 57 <td><img src="tmp/user/'.$Line[' user'].'/level.png" alt="Úroveň uživatele" /></td>57 <td><img src="tmp/user/'.$Line['Name'].'/level.png" alt="Úroveň uživatele" /></td> 58 58 <td>'.$Moderators[$Line['GM']].'</td> 59 59 <td>'.HumanDate($Line['LastLogin']).'</td></tr>');
Note:
See TracChangeset
for help on using the changeset viewer.