Changeset 286 for trunk/TranslationList.php
- Timestamp:
- Dec 22, 2009, 10:22:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TranslationList.php
r280 r286 6 6 7 7 $TranslationItemPerPage = 200; 8 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group'] * 1; else $GroupId = 1;8 $GroupId = LoadGroupIdParameter(); 9 9 if(array_key_exists('connexion_id', $_GET)) { 10 10 $_SESSION['connexion_id'] = $_GET['connexion_id']; 11 }12 $DbResult = $Database->SQLCommand('SELECT Id FROM `group` WHERE `Id`='.$GroupId);13 if(mysql_num_rows($DbResult) == 0)14 {15 echo('Neexistující id překladové skupiny.');16 ShowFooter();17 die();18 11 } 19 12 $Table = $TranslationTree[$GroupId]['TablePrefix']; … … 144 137 if($Action == 'connexion') 145 138 { //SELECT * FROM spell WHERE entry IN(SELECT entry FROM connexion_item WHERE connexion = 1) 146 139 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT Name FROM connexion WHERE `Id` = '.$_SESSION['connexion_id'])); 147 140 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 148 141 <a title="Zde je seznam souvislostí" href="?group='.$GroupId.'&action=connexion">Souvislosti</a> - > … … 166 159 <td>'.$Line['Name'].'</td>'); 167 160 } 168 161 echo ('</table>'); 169 162 } else 170 163 if($Action == 'nocomplete') … … 196 189 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 197 190 <a title="Přeložené questy přilášeného uživatele" href="?group='.$GroupId.'&action=my">Moje překlady</a><br /><br />'); 198 WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User FROM '.$Table.' Where user= '.$_SESSION['UserID'], '', 'my');191 WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = '.$Table.'.`user`) AS `User` FROM `'.$Table.'` Where `user` = '.$_SESSION['UserID'], '', 'my'); 199 192 } else 200 193 if(($Action == 'mydevelop') and Licence(LICENCE_USER)) … … 202 195 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 203 196 <a title="Nedokončené texty" href="?group='.$GroupId.'&action=mydevelop">Rozepsané překlady</a><br /><br />'); 204 WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User FROM '.$Table.' Where user = '.$_SESSION['UserID'].' AND Complete= 0', '', 'mydevelop');197 WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` Where `user` = '.$_SESSION['UserID'].' AND `Complete` = 0', '', 'mydevelop'); 205 198 } else 206 199 if($Action == 'users') … … 208 201 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a> -> 209 202 <strong>Vypsání textů od určitých uživatelů</strong><br /><br />'); 210 $users = @$_POST['users'];211 212 $WhereUsers = '';213 203 if(array_key_exists('users', $_POST)) $users = $_POST['users']; 204 else $users = array(); 205 206 $WhereUsers = ''; 214 207 for($i = 0; $i < Count($users); $i++) 215 208 { 216 if($WhereUsers <> '') $WhereUsers .= ' OR User = '.$users[$i]; 217 else $WhereUsers .= ' User = '.$users[$i]; 218 } 219 WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User FROM '.$Table.' Where '.$WhereUsers, '', 'users'); 209 if($WhereUsers <> '') $WhereUsers .= ' OR `User` = '.$users[$i]; 210 else $WhereUsers .= ' `User` = '.$users[$i]; 211 } 212 if($WhereUsers == '') $WhereUsers = '0'; 213 214 215 WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE '.$WhereUsers, '', 'users'); 220 216 } else 221 217 if($Action == 'userall') 222 218 { 223 $ID = $Database->SQLCommand('SELECT user FROM user WHERE id= '.$_GET['user']);219 $ID = $Database->SQLCommand('SELECT `user` FROM `user` WHERE `id` = '.$_GET['user']); 224 220 $Line = mysql_fetch_row($ID); 225 221 echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&action=filter">Filtr textů</a>'. … … 232 228 { 233 229 if(array_key_exists('not', $_GET)) { 234 $sql = 'SELECT COUNT(*) FROM '.$Group['TablePrefix'].' WHERE Complete = 0 AND user='.$_GET['user'];230 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `Complete` = 0 AND `user`='.$_GET['user']; 235 231 $ID = $Database->SQLCommand($sql); 236 232 $Line = mysql_fetch_row($ID); … … 239 235 $Total += $Line[0]; 240 236 } else { 241 $sql = 'SELECT COUNT(*) FROM '.$Group['TablePrefix'].' WHERE user='.$_GET['user'];237 $sql = 'SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE `user`='.$_GET['user']; 242 238 $ID = $Database->SQLCommand($sql); 243 239 $Line = mysql_fetch_row($ID); … … 289 285 if(array_key_exists('user', $_GET)) 290 286 { 291 $ID = $Database->SQLCommand('SELECT user FROM user WHERE id= '.($_GET['user'] * 1));287 $ID = $Database->SQLCommand('SELECT `user` FROM `user` WHERE `id` = '.($_GET['user'] * 1)); 292 288 if(mysql_num_rows($ID) > 0) 293 289 { … … 296 292 '<strong>Vypis překladů uživatele '.$Line[0].': </strong><br /><br />'); 297 293 if(array_key_exists('not', $_GET)) 298 WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User FROM '.$Table.' Where Complete = 0 AND user= '.$_GET['user'], '', 'userid');299 else WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User FROM '.$Table.' Where user= '.$_GET['user'], '', 'userid');294 WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` Where `Complete` = 0 AND `user` = '.$_GET['user'], '', 'userid'); 295 else WriteQuests('SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` Where `user` = '.$_GET['user'], '', 'userid'); 300 296 } else echo('Nebyl nalezen uživatel se zadaným id'); 301 297 } else echo('Je nutno zadat id uživatele.'); … … 306 302 else $Search = $_POST['search']; 307 303 308 $sql = 'SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as UserFROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%"304 $sql = 'SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%" 309 305 OR `entry` LIKE "%'.$Search.'%" 310 306 OR `Language` LIKE "%'.$Search.'%" … … 323 319 else $Search = $_POST['ID']; 324 320 325 $sql = 'SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as UserFROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"';321 $sql = 'SELECT *, (SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `'.$Table.'`.`user`) AS `User` FROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"'; 326 322 327 323 WriteQuests($sql, '', 'searchentry='.$Search); … … 333 329 <strong>Výpis všech textů s limitem na stránku</strong><br /><br />'); 334 330 335 WritePages('?group='.$GroupId.'&action=all', ' AS items WHERE (items.Language= 0)');336 337 WriteQuests('SELECT * FROM '.$Table.' AS items WHERE (items.Language= 0)', $_SESSION['limitx'].','.$_SESSION['limity'], 'all');331 WritePages('?group='.$GroupId.'&action=all', ' AS `items` WHERE (`items`.`Language` = 0)'); 332 333 WriteQuests('SELECT * FROM `'.$Table.'` AS `items` WHERE (`items`.`Language` = 0)', $_SESSION['limitx'].','.$_SESSION['limity'], 'all'); 338 334 } else 339 335 if($Action == 'filter') … … 359 355 360 356 echo('<tr><td><form action="?group='.$GroupId.'&action=users" method="post"><div>'. 361 '<select name="users[]" size="10" multiple="multiple" >');362 363 $ID = $Database->SQLCommand('SELECT user, IDFROM `user` WHERE364 EXISTS(SELECT 1 FROM '.$Table.' WHERE user = user.ID) ORDER BY user');357 '<select name="users[]" size="10" multiple="multiple" class="UserList">'); 358 359 $ID = $Database->SQLCommand('SELECT `user`, `ID` FROM `user` WHERE 360 EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `user` = `user`.`ID`) ORDER BY `user`'); 365 361 if($ID) 366 362 while($Line = mysql_fetch_assoc($ID))
Note:
See TracChangeset
for help on using the changeset viewer.