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