Changeset 365 for trunk/action.php
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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']);
Note:
See TracChangeset
for help on using the changeset viewer.