Changeset 282
- Timestamp:
- Sep 4, 2009, 1:27:18 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/download.php
r266 r282 8 8 { 9 9 10 10 global $Database; 11 11 12 13 12 $TranslationTree = GetTranslationTree(); 13 $Group = $TranslationTree[$TableID]; 14 14 15 16 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 $NumberTranslate = $ID[0]; 17 17 18 19 18 $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Group['TablePrefix'].' WHERE (Language = 0)')); 19 $NumberAJ = $ID[0]; 20 20 21 22 23 24 if (($TableID == 14) or ($TableID == 15)) $result = true; 25 26 27 21 if($NumberAJ > 0) $Percent = ($NumberTranslate / $NumberAJ) * 100; else $Percent = 0; 22 $Percent = substr($Percent, 0, 5); 23 24 if (($TableID == 14) or ($TableID == 15)) $result = true; 25 26 return ($Group['Name'].': '.$NumberTranslate.'/'.$NumberAJ.' '.$Percent.'% 27 '); 28 28 } 29 29 30 31 32 33 34 35 36 37 38 'Popis: <textarea rows="20" cols="60"name="text">');39 40 $ExportSetting = unserialize($Line['ExportSetting']); 41 42 30 if (array_key_exists('createverse', $_GET) and Licence(LICENCE_ADMIN)) { 31 if (array_key_exists('verse', $_POST)) { //ukládání 32 $Database->SQLCommand('INSERT INTO `verseclient` (`verse` ,`date` ,`text` ,`user`) 33 VALUES ( "'.$_POST['verse'].'", NOW( ) , "'.$_POST['text'].'", "'.$_SESSION['UserID'].'");'); 34 WriteLog('Nová verze ('.$_POST['verse'].') češitny pro clienta uložena.',4); 35 } else { //formulář 36 echo ('<form action"" method="post">'. 37 'Verze: <input type="text" name="verse" /> <input type="submit" value="Uložit" /><br />'. 38 'Popis: <textarea rows="20" cols="60" name="text">'); 39 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT ExportSetting FROM user Where ID = '.$_SESSION['UserID'])); 40 $ExportSetting = unserialize($Line['ExportSetting']); 41 42 $Tables = 'Texty obsažené v addonu: Přeložené/nepřeložené ProcentaPřeložených% 43 43 '; 44 45 46 47 48 49 50 44 foreach($ExportSetting['groups'] as $Index) $Tables .= GetPercentOfTable($Index,implode(',', $ExportSetting['users-selection'])); 45 46 $ID = $Database->SQLCommand('SELECT user FROM user WHERE ID IN('.implode(',', $ExportSetting['users-selection']).')'); 47 $Users = 'Vyexportovány překlady od uživatelů: ( '; 48 while($Line = mysql_fetch_assoc($ID)) $Users .= $Line['user'].', '; $Users .= ' )'; 49 //Výpis 50 echo (' 51 51 '.$Users.' 52 52 '.$Tables); 53 54 55 56 53 54 echo ('</textarea></form>'); 55 } 56 } 57 57 58 58 if(array_key_exists('addon', $_GET)) … … 63 63 while($Line = mysql_fetch_assoc($ID)) 64 64 { 65 65 echo('<tr>'. 66 66 '<td><strong>'.$Line['verse'].'</strong> <a href="tmp/Addon/CzWoW_'.$Line['verse'].'.zip">Stáhnout</a> <br />'.$Line['date'].'</td>'. 67 67 '<td>'.str_replace(chr(13),'<br />',$Line['text']).'</td>'); 68 68 echo('</tr>'); 69 69 } 70 70 echo('</table>'); 71 71 } else 72 72 { 73 74 73 echo('<br /><h3><a href="export/">Export textů</a> - Export podle vlastního výběru do SQL, XML, LUA nebo Addonu</h3>'. 74 '<br />Exportovat podle zálohovaného nastavení:<form action="export" method="get"><div>'. 75 '<input name="action" value="output" type="hidden" />'. 76 '<textarea name="ExportSetting" rows="10" cols="40"></textarea>'. 77 '<input type="submit" value="Exportovat" /></div></form><br /><br />'); 75 78 76 echo(' 77 <br /> 78 <h3><a href="export/">Export textů</a> - Export podle vlastního výběru do SQL, XML, LUA nebo Addonu</h3> 79 <br />Exportovat podle zálohovaného nastavení:<form action="export" method="get"> 80 <input name="action" value="output" type="hidden"> 81 <textarea name="ExportSetting" rows="10" cols="40"></textarea><input type="submit" value="Exportovat" /></form><br /> 82 <br />'); 83 84 if (Licence(LICENCE_USER)) { 79 if (Licence(LICENCE_USER)) 80 { 85 81 $ID = $Database->SQLCommand('SELECT * FROM tasks WHERE User = '.$_SESSION['UserID'].' ORDER BY Date DESC LIMIT 10'); 86 82 if (mysql_num_rows($ID) > 0) … … 90 86 while($Line = mysql_fetch_assoc($ID)) 91 87 { 92 if ($Line['Active'] == 0) 93 { 94 $Active = 'Hotovo'; 95 $Download = '<a href="'.$Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_DBC.zip">Stáhnout - CzWoW_DBC.zip</a>'; 96 } else { 97 $Active = 'Čeká na zpracování'; 98 $Download = 'CzWoW_DBC.zip'; 99 } 100 if ($Line['Downloaded'] == 1) $Downloaded = 'Staženo'; else $Downloaded = 'Nestaženo'; 101 echo('<tr>'. 88 if ($Line['Active'] == 0) 89 { 90 $Active = 'Hotovo'; 91 $Download = '<a href="'.$Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_DBC.zip">Stáhnout - CzWoW_DBC.zip</a>'; 92 } else 93 { 94 $Active = 'Čeká na zpracování'; 95 $Download = 'CzWoW_DBC.zip'; 96 } 97 if ($Line['Downloaded'] == 1) $Downloaded = 'Staženo'; else $Downloaded = 'Nestaženo'; 98 echo('<tr>'. 102 99 '<td><strong>'.HumanDate($Line['Date']).'</strong></td>'. 103 100 '<td>'.$Active.'</td>'. … … 105 102 '<td>'.$Download.'</td>'. 106 103 '<td><textarea>'.$Line['ExportSetting'].'</textarea></td>'); 107 104 echo('</tr>'); 108 105 } 109 echo('</table><br />'); 106 echo('</table><br />'); 110 107 } 111 108 } … … 123 120 <br />'); 124 121 125 echo('<h3>Pomocné programy:</h3> 126 127 <a href="download/mpqediten32.zip">Ladik\'s MPQ Editor</a><br /> 128 '); 129 122 echo('<h3>Pomocné programy:</h3>'. 123 '<a href="download/mpqediten32.zip">Ladik\'s MPQ Editor</a><br />'); 130 124 } 131 125 -
trunk/includes/global.php
r279 r282 15 15 16 16 include('config.php'); 17 include _once('error.php');17 include('error.php'); 18 18 include('databaseconection.php'); 19 19 include('global_function.php'); 20 include('rss.php'); 20 21 21 22 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); … … 72 73 { 73 74 global $Config; 74 echo('<strong>Hledání:</strong> 75 <form action="'.$Config['Web']['BaseURL'].'action.php" method="get"><input type="hidden" name="action" value="search" /> 75 76 echo('<strong>Hledání:</strong> 77 <form action="'.$Config['Web']['BaseURL'].'action.php" method="get"><div> 78 <input type="hidden" name="action" value="search" /> 76 79 <table> 77 80 <tr> … … 81 84 <th><input type="submit" value="Hledat" /></th> 82 85 </tr> 83 </table> 86 </table></div> 84 87 </form>'); 85 88 } … … 107 110 $Config['Web']['BaseURL'].'Options.php' => array(LICENCE_USER, 'Nastavení uživatele', 'Nastavení'), 108 111 $Config['Web']['BaseURL'].'index.php?Logout' => array(LICENCE_USER, 'Odhlášení ze systému', 'Odhlásit'), 109 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667& channel=%23wowpreklad&forcePrompt=true&charset=utf-8' => array(LICENCE_ANONYMOUS, 'IRC chat pro překladatele', 'Chat'),112 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&channel=%23wowpreklad&forcePrompt=true&charset=utf-8' => array(LICENCE_ANONYMOUS, 'IRC chat pro překladatele', 'Chat'), 110 113 $Config['Web']['BaseURL'].'log.php' => array(LICENCE_MODERATOR, 'Log dění (Pouze moderátor)', 'Záznamy'), 111 114 $Config['Web']['BaseURL'].'import/' => array(LICENCE_ADMIN, 'Načtení zdrojových textů do databáze (pouze admin)', 'Import textů'), … … 147 150 echo(' <a title="Zde můžete začít překládat" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&action=notran">Nepřeložené</a><br /> 148 151 <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&action=Translate">Přeložené</a><br />'); 149 152 $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$Group['Id']); 150 153 if (mysql_num_rows($ID) > 0) 151 154 echo(' <a title="Vypsání souvislostí" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&action=connexion_list">Souvislosti</a><br />'); 152 155 153 156 if(Licence(LICENCE_USER)) 154 157 { 155 158 echo(' <a title="Nedokončené překlady" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&action=mydevelop">Rozepsané</a><br /> … … 166 169 global $Database, $Moderators; 167 170 168 echo('Online uživatelé:<br />');171 echo('Online překladatelé:<br />'); 169 172 $ID = $Database->SQLCommand('SELECT user, GM, ID FROM `user` WHERE LastLogin >= Now() - 300 AND ((LastLogout < LastLogin) OR (ISNULL(LastLogout)))'); 170 173 while ($Line = mysql_fetch_assoc($ID)) … … 183 186 184 187 echo('<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?> 185 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">186 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">187 <head>'.188 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 189 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">'. 190 '<head>'. 188 191 '<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />'. 189 192 '<meta name="keywords" content="wow, quest, questy, questů, preklad, mangos, překlad, překládání, přeložený, přeložení, čeština, world of warcraft, open source, free, addon" />'. -
trunk/index.php
r168 r282 2 2 3 3 include('includes/global.php'); 4 include('rss.php');5 4 6 5 function ShowNews() … … 29 28 } 30 29 31 if(array_key_exists('rss', $_GET))30 function ShowRSSChannel() 32 31 { 32 global $Database, $Config; 33 33 34 $Items = array(); 34 35 if($_GET['rss'] == 'news') … … 38 39 { 39 40 $Items[] = array 40 41 ( 41 42 'Title' => $DbRow['user'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')', 42 43 'Link' => $Config['Web']['BaseURL'], … … 44 45 'Time' => $DbRow['UNIX_TIMESTAMP(news.Time)'], 45 46 ); 46 } 47 } 47 48 echo(GenerateRSS(array 48 49 ( … … 60 61 { 61 62 $Items[] = array 62 63 ( 63 64 'Title' => strip_tags($DbRow['text'].' ('.$DbRow['user'].')'), 64 65 'Link' => $Config['Web']['BaseURL'], … … 66 67 'Time' => $DbRow['UNIX_TIMESTAMP(date)'], 67 68 ); 68 } 69 } 69 70 echo(GenerateRSS(array 70 71 ( … … 78 79 if($_GET['rss'] == 'shoutbox') 79 80 { 80 81 81 $TitleLength = 50; 82 mb_internal_encoding('utf-8'); 82 83 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(date), user, text FROM shoutbox ORDER BY ID DESC LIMIT 20'); 83 84 while($DbRow = mysql_fetch_assoc($DbResult)) 84 85 { 85 86 86 $Title = mb_substr($DbRow['text'], 0, $TitleLength); 87 if(mb_strlen($Title) == $TitleLength) $Title .= '...'; 87 88 $Items[] = array 88 89 ( 89 90 'Title' => $DbRow['user'].': '.$Title, 90 91 'Link' => $Config['Web']['BaseURL'], … … 92 93 'Time' => $DbRow['UNIX_TIMESTAMP(date)'], 93 94 ); 94 } 95 } 95 96 echo(GenerateRSS(array 96 97 ( … … 102 103 ))); 103 104 } 105 } 106 107 if(array_key_exists('rss', $_GET)) 108 { 109 ShowRSSChannel(); 104 110 } else 105 111 { -
trunk/registrace.php
r198 r282 20 20 $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM user WHERE user = "'.$User.'"')); 21 21 if(!$Line) 22 22 { 23 23 $Address = $_SERVER['REMOTE_ADDR']; 24 24 $Database->SQLCommand('INSERT INTO `user` (`user` , `pass` , `LastIP` , `LastLogin` , `Email` , `Language` , `team` , `NeedUpdate` ) … … 36 36 // echo $Database->id_connection; 37 37 } else 38 38 { 39 39 echo('Uživatel s touto přezdívkou již existuje. <a href="?">Zpět</a>'); 40 40 } 41 41 } else 42 42 { 43 43 echo('Hesla se neshodují. <a href="?">Zpět</a>'); 44 44 } 45 45 } else … … 70 70 </tr> 71 71 <tr> 72 <tr>73 72 <td>Patřím do týmu: </td> 74 73 <td><select name="Team"><option value="0">Žádného</option> 75 74 '); 76 77 75 $ID = $Database->SQLCommand('SELECT name,ID FROM team'); 76 while($Line = mysql_fetch_assoc($ID)) 78 77 { 79 80 78 echo('<option value="0'.$Line['ID'].'">'.$Line['name'].'</option>'); 79 } 81 80 echo('</select></td> 82 81 </tr>
Note:
See TracChangeset
for help on using the changeset viewer.