Changeset 49 for trunk/TranslationList.php
- Timestamp:
- Jan 30, 2009, 10:33:08 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:ignore
set to
SqlTranslate.zip
-
Property svn:ignore
set to
-
trunk/TranslationList.php
r48 r49 4 4 5 5 $TranslationItemPerPage = 200; 6 7 6 8 7 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1; … … 66 65 function WriteQuests($sql, $limit, $address) 67 66 { 68 global $Database, $order, $desc ;69 67 global $Database, $order, $desc, $TranslationTree, $GroupId, $Table; 68 70 69 if($limit <> '') $limit = 'LIMIT '.$limit; 71 70 … … 81 80 82 81 echo('<table border="1" cellpadding="2" cellspacing="0"><tr> 83 <th><a href=" group='.$GroupId.'&?'.$address.'&order=ID&desc='.$desc.'">Pořadové číslo</a></th>84 <th><a href=" group='.$GroupId.'&?'.$address.'&order=entry&desc='.$desc.'">Identifikační číslo</a></th>85 <th><a href="?group='.$GroupId.'& '.$address.'&order=Title&desc='.$desc.'">Název</a></th>');86 if ($address == 'selection') echo('<th><a href="?group='.$GroupId.'& '.$address.'&order=CountQuests&desc='.$desc.'">Výskyt</a></th>');87 else if($address <> 'notran') echo('<th><a href="?group='.$GroupId.'& '.$address.'&order=user&desc='.$desc.'">Uživatel</a></th>88 <th><a href="?group='.$GroupId.'& '.$address.'&order=vote&desc='.$desc.'">Známka</a></th>89 <th><a href="?group='.$GroupId.'& '.$address.'&order=CountVote&desc='.$desc.'">Počet hlasování</a></th>');82 <th><a href="?group='.$GroupId.'&action='.$address.'&order=ID&desc='.$desc.'">Pořadové číslo</a></th> 83 <th><a href="?group='.$GroupId.'&action='.$address.'&order=entry&desc='.$desc.'">Identifikační číslo</a></th> 84 <th><a href="?group='.$GroupId.'&action='.$address.'&order=Title&desc='.$desc.'">Název</a></th>'); 85 if ($address == 'selection') echo('<th><a href="?group='.$GroupId.'&action='.$address.'&order=CountQuests&desc='.$desc.'">Výskyt</a></th>'); 86 else if($address <> 'notran') echo('<th><a href="?group='.$GroupId.'&action='.$address.'&order=user&desc='.$desc.'">Uživatel</a></th> 87 <th><a href="?group='.$GroupId.'&action='.$address.'&order=vote&desc='.$desc.'">Známka</a></th> 88 <th><a href="?group='.$GroupId.'&action='.$address.'&order=CountVote&desc='.$desc.'">Počet hlasování</a></th>'); 90 89 echo('</tr>'); 91 92 $ID = $Database->SQLCommand("$sql $order $desc $limit"); 93 while($Line = mysql_fetch_array($ID)) 94 { 95 echo('<tr><td><a href="form.php?ID='.$Line['ID'].'">'.$Line['ID'].'</a></td> 90 91 //print_r($TranslationTree[$GroupId]['Items']); 92 $ID = $Database->SQLCommand($sql.' '.$order.' '.$desc.' '.$limit); 93 while($Line = mysql_fetch_assoc($ID)) 94 { 95 //print_r($Line); 96 echo('<tr><td><a href="form.php?group='.$GroupId.'&ID='.$Line['ID'].'">'.$Line['ID'].'</a></td> 96 97 <td>'.$Line['entry'].'</td> 97 <td>'.htmlspecialchars($Line[ 'Title']).'</td>');98 <td>'.htmlspecialchars($Line[$TranslationTree[$GroupId]['Items'][0]['Column']]).'</td>'); 98 99 if($address == 'selection') echo('<td>'.$Line['CountQuest'].'</td>'); 99 else if($address <> 'notran') echo('<td>'. @$Line['User'].'</td>100 else if($address <> 'notran') echo('<td>'.$Line['User'].'</td> 100 101 <td>'.substr($Line['Vote'], 0, 4).'</td> 101 102 <td>'.$Line['CountVote'].'</td>'); … … 105 106 } 106 107 107 if($Action == 'selection')108 {109 echo('<a title="Zobrazit překlady podle vlasního filtru" href="?group='.$GroupId.'&action=filter">Filtr překladů</a> ->110 <a title="Zde můžete začít překládat" href="?group='.$GroupId.'&action=selection">Nepřeložené texty</a><br /><br />');111 112 echo('<table border="1" cellspacing="0" cellpadding="10"><tr><td>113 <br /><b>Prioritně byste měli překládat tyto texty:</b><br /><br />');114 115 WriteQuests('SELECT '.$Table.'.ID, entry, Title, CountQuest FROM '.$Table.', '.$Table.'_status116 WHERE '.$Table.'.language = 0 AND '.$Table.'.entry = '.$Table.'_status.questentry ORDER BY '.$Table.'_status.CountQuest DESC', 18, 'selection');117 118 echo('</td></tr><tr><td>119 <a href="?group='.$GroupId.'&action=notran">Ostatní nepřeložené texty</a>');120 121 echo('</td></tr></table>');122 }123 124 125 108 if($Action == 'notran') 126 109 { … … 176 159 <a title="Zatím nezkontrolované questy" href="?group='.$GroupId.'&action=admin_nocheck">Nezkontrolované texty</a><br /><br />'); 177 160 178 WritePages(' ListQuests.php?nocheck', ' WHERE Language <> 0 AND '.$Table.'.Complete = 1 AND admin_check <> 1');161 WritePages('?group='.$GroupId.'&action=nocheck', ' WHERE Language <> 0 AND '.$Table.'.Complete = 1 AND admin_check <> 1'); 179 162 180 163 WriteQuests('SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) as User … … 254 237 $Search = $_GET['search']; 255 238 256 $sql = "SELECT * FROM $Table.'` WHERE `ID` LIKE '%$Search%' 257 OR `entry` LIKE '%$Search%' 258 OR `Title` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 259 OR `Details` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 260 OR `Objectives` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 261 OR `OfferRewardText` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 262 OR `RequestItemsText` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 263 OR `EndText` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 264 OR `ObjectiveText1` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 265 OR `ObjectiveText2` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 266 OR `ObjectiveText3` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 267 OR `ObjectiveText4` LIKE CONVERT( _utf8 '%$Search%' USING latin2 ) COLLATE latin2_czech_cs 268 OR `Language` LIKE '%$Search%' 269 OR `Vote` LIKE '%$Search%' 270 OR `User` LIKE '%$Search%' 271 OR `complete` LIKE '%$Search%'"; 239 $sql = 'SELECT * FROM `'.$Table.'` WHERE `ID` LIKE "%'.$Search.'%" 240 OR `entry` LIKE "%'.$Search.'%" 241 OR `Language` LIKE "%'.$Search.'%" 242 OR `Vote` LIKE "%'.$Search.'%" 243 OR `User` LIKE "%'.$Search.'%" 244 OR `complete` LIKE "%'.$Search.'%"'; 245 foreach($TranslationTree[$GroupId]['Items'] as $Item) 246 { 247 if($Item['Column'] != '') $sql .= ' OR `'.$Item['Column'].'` LIKE "%'.$Search.'%"'; 248 } 272 249 273 250 WriteQuests($sql, '', 'search='.$Search); … … 276 253 if($Action == 'searchentry') 277 254 { 278 $Search = $_GET[' searchentry'];255 $Search = $_GET['ID']; 279 256 280 $sql = 'SELECT * FROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"';257 $sql = 'SELECT *, (SELECT user.user FROM user WHERE user.id = '.$Table.'.user) FROM `'.$Table.'` WHERE `entry` LIKE "'.$Search.'"'; 281 258 282 259 WriteQuests($sql, '', 'searchentry='.$Search); … … 308 285 <select name="users[]" size="10" multiple>'); 309 286 310 $ID = $Database->SQLCommand('SELECT user, ID FROM `user` WHERE287 $ID = $Database->SQLCommand('SELECT user, ID FROM `user` WHERE 311 288 EXISTS(SELECT 1 FROM '.$Table.' WHERE user = user.ID) ORDER BY user'); 312 while($Line = mysql_fetch_array($ID)) 289 if($ID) 290 while($Line = mysql_fetch_assoc($ID)) 313 291 echo('<option value="'.$Line['ID'].'">'.$Line['user'].'</option>'); 314 292
Note:
See TracChangeset
for help on using the changeset viewer.