Changeset 800
- Timestamp:
- Mar 16, 2014, 11:15:43 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ClientVersion/ClientVersion.php
r790 r800 13 13 $this->Dependencies = array(''); 14 14 } 15 15 16 16 function Start() 17 17 { … … 38 38 return($Output); 39 39 } 40 40 41 41 function ShowItem() 42 42 { 43 $YesNo = array('Ne', 'Ano'); 44 $DbResult = $this->System->Database->query('SELECT * FROM ClientVersion WHERE Id='.($_GET['id']*1)); 45 if($DbResult->num_rows > 0) 46 { 47 $Version = $DbResult->fetch_assoc(); 48 49 $Output = '<h3>'.T('Client version').'</h3>'; 50 $Output .= '<table class="BaseTable">'. 43 if(array_key_exists('id', $_GET)) 44 { 45 $YesNo = array('Ne', 'Ano'); 46 $DbResult = $this->System->Database->query('SELECT * FROM ClientVersion WHERE Id='.($_GET['id']*1)); 47 if($DbResult->num_rows > 0) 48 { 49 $Version = $DbResult->fetch_assoc(); 50 51 $Output = '<h3>'.T('Client version').'</h3>'; 52 $Output .= '<table class="BaseTable">'. 51 53 '<tr><td>'.T('Version').'</td><td>'.$Version['Version'].'</td></tr>'. 52 54 '<tr><td>'.T('More information').'</td><td><a href="http://www.wowwiki.com/Patch_'.$Version['Version'].'">wowwiki.com'. … … 58 60 '</table>'; 59 61 $Output .= '<div><a href="?">'.T('All versions list').'</a></div>'; 60 if($Version['Imported']) 62 if($Version['Imported']) 61 63 $Output .= '<div><a href="'.$this->System->Link('/progress/?Version='.$Version['Version']).'">'.T('Progress').'</a></div>'; 62 } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 64 } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 65 } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 63 66 return($Output); 64 67 } 65 68 66 69 function ShowList() 67 { 70 { 68 71 $this->Title = T('Game version'); 69 72 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ClientVersion`'); 70 73 $DbRow = $DbResult->fetch_row(); 71 $PageList = GetPageList($DbRow[0]); 74 $PageList = GetPageList($DbRow[0]); 72 75 73 76 $Output = '<h3>'.T('Game version').'</h3>'. … … 75 78 76 79 $TableColumns = array( 77 array('Name' => 'Version', 'Title' => T('Version')), 78 array('Name' => 'BuildNumber', 'Title' => T('Build')), 79 array('Name' => 'ReleaseDate', 'Title' => T('Release date')), 80 array('Name' => 'Title', 'Title' => T('Title')), 80 array('Name' => 'Version', 'Title' => T('Version')), 81 array('Name' => 'BuildNumber', 'Title' => T('Build')), 82 array('Name' => 'ReleaseDate', 'Title' => T('Release date')), 83 array('Name' => 'Title', 'Title' => T('Title')), 81 84 array('Name' => 'Imported', 'Title' => T('Imported')), 82 85 ); … … 84 87 $Output .= '<table class="BaseTable">'. 85 88 $Order['Output']; 86 89 87 90 $YesNo = array('Ne', 'Ano'); 88 91 … … 97 100 $Output .= '</table>'. 98 101 $PageList['Output']; 99 return($Output); 102 return($Output); 100 103 } 101 104 } -
trunk/Modules/Download/Download.php
r791 r800 17 17 { 18 18 $this->System->RegisterPage('download', 'PageDownload'); 19 $this->System->RegisterPage('download.php', 'PageDownload');20 19 $this->System->RegisterMenuItem(array( 21 20 'Title' => T('Download'), … … 35 34 $Output = '<h3>'.T('Accessories for client').'</h3>'. 36 35 '<strong><a href="'.$fileslink.'/WowLua/wowpatcher.exe">wowpatcher</a></strong> - '.T('Tool to command line, which search and edit file wow.exe for support editing files Glue Strings.lua and GlobalStrings.lua.').' '. 37 T('Designed for one-time creation of new modified version of wow.exe. Help can be called with the - help option. The ability to modify future versions not guaranteed.').' '. 36 T('Designed for one-time creation of new modified version of wow.exe. Help can be called with the - help option. The ability to modify future versions not guaranteed.').' '. 38 37 '<br /><br/>'. 39 '<strong>WowLua</strong> - '.T('Specific modified version of WoW.exe for free servers with support for translation Lua files').'<br/>'. 38 '<strong>WowLua</strong> - '.T('Specific modified version of WoW.exe for free servers with support for translation Lua files').'<br/>'. 40 39 'enGB a enUS: '. 41 40 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.5a.exe">3.3.5a</a>'. … … 46 45 ' <a href="'.$fileslink.'/WowLua/WowLua_1.12.1.exe">1.12.1</a>'. 47 46 '<br/><br/>'. 48 '<strong>WoWMe</strong> - '.T('Edited files wow.exe with support of translation dbc files').':<br/>'. 47 '<strong>WoWMe</strong> - '.T('Edited files wow.exe with support of translation dbc files').':<br/>'. 49 48 '<a href="'.$fileslink.'/WoWMe/WoWMe_4.3.4.zip">4.3.4</a> '. 50 49 '<a href="'.$fileslink.'/WoWMe/WoWMe_3.2.0.rar">3.2.0</a> '. … … 54 53 '<br/><br/>'. 55 54 '<strong>CzechWoW</strong> - '.T('Czech for client with edited client files (old)').'<br/>'; 56 55 57 56 $Output .= '<a href="'.$fileslink.'/CzechWoW/Instalace_CzechWoW_3.3.5a_2010-09-09.exe">Instalace CzechWoW 3.3.5a 2010-09-09.exe</a><br/>'. 58 57 '<a href="'.$fileslink.'/CzechWoW/Instalace_CzechWoW_3.3.3a_2010-04-23.exe">Instalace CzechWoW 3.3.3a 2010-04-23.exe</a><br/>'. … … 77 76 return($Output); 78 77 } 79 80 function ShowDownload() 78 79 function ShowDownload() 81 80 { 82 81 $Output = '<h3>'.T('Download czech').'</h3><br />'; 83 82 84 83 $Output .= T('Additional files: modified wow.exe, fonts to game, translated interface aowow and more can be found on page').' <a href="'.$this->System->Link('/download/?Files').'">'.T('Files').'</a><br />'; 85 84 $Output .= T('If none of these files is suitable for you, for example, to the Czech without the translated interface. You can generate your own section in section').' <a href="'.$this->System->Link('/export').'">'.T('Export').'</a><br /><br />'; … … 87 86 $Output .= T('If you no longer want translation in game, you can uninstall it by file Uninstall.exe at the directory of game.').'<br />'; 88 87 $Output .= '<br /><br />'; 89 88 90 89 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `Featured`=1'); 91 90 $DbRow = $DbResult->fetch_row(); 92 $PageList = GetPageList($DbRow[0]); 91 $PageList = GetPageList($DbRow[0]); 93 92 94 93 $Output .= $PageList['Output']; 95 94 $TableColumns = array( 96 array('Name' => 'Version', 'Title' => T('Download')), 97 array('Name' => 'Title', 'Title' => T('Name2'),), 98 array('Name' => 'TimeCreate', 'Title' => T('Creation date')), 95 array('Name' => 'Version', 'Title' => T('Download')), 96 array('Name' => 'Title', 'Title' => T('Name2'),), 97 array('Name' => 'TimeCreate', 'Title' => T('Creation date')), 99 98 array('Name' => 'Description', 'Title' => T('Description')), 100 ); 99 ); 101 100 $Order = GetOrderTableHeader($TableColumns, 'Id', 1); 102 101 $Output .= '<table class="BaseTable">'. 103 $Order['Output']; 102 $Order['Output']; 104 103 $DbRows = $this->Database->query('SELECT `ClientVersion`.`Version` AS `Version`, '. 105 104 '`Export`.`Id`, `Export`.`ClientVersion`, `Export`.`OutputType`, `Export`.`Title`, '. … … 107 106 'JOIN `ClientVersion` as `ClientVersion` ON `ClientVersion`.`Id`=`Export`.`ClientVersion` '. 108 107 'WHERE `Featured`=1 '.$Order['SQL'].$PageList['SQLLimit']); 109 while ($DbExport = $DbRows->fetch_assoc()) 108 while ($DbExport = $DbRows->fetch_assoc()) 110 109 { 111 110 $ExportId = $DbExport['Id']; 112 111 113 112 if ($DbExport['OutputType'] == 10) 114 113 $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'Instalace_CzechWoW_'.$DbExport['Version'].'.exe'; 115 114 if ($DbExport['OutputType'] == 7) 116 115 $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'CzWoW_Addon-'.$DbExport['Version'].'.zip'; 117 116 118 117 if ($DbExport['OutputType'] == 10) 119 118 $Output .= '<tr><td><a href="'.$this->System->Link('/'.$filename). … … 129 128 $ExportId.'&Tab=7').'">'.T('Make export').'</a><br /> <a href="'. 130 129 $this->System->Link('/export/?Action=View&ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>'; 131 130 132 131 $Output .= '<td>'.$DbExport['Title'].'</td>'; //.'<td>'.$DbExport['ClientVersion'].'</td>'; 133 132 134 133 if ((($DbExport['OutputType'] == 10) or ($DbExport['OutputType'] == 7)) and (file_exists($filename))) 135 134 $Output .= '<td>'.date('d.m.y H:i',filemtime($filename)).'</td>'; … … 137 136 $Output .= '<td> </td>'; 138 137 139 $Output .= 138 $Output .= 140 139 '<td>'.str_replace("\n", '<br />',$DbExport['Description']).'</td>'. 141 140 '</tr>'; … … 143 142 $Output .= '</table>'. 144 143 $PageList['Output']; 145 144 146 145 return($Output); 147 146 } 148 149 function Show() 147 148 function Show() 150 149 { 151 150 $this->Title = T('Download'); … … 153 152 if (isset($_GET['Files'])) $Output .= $this->ShowFiles(); 154 153 else $Output .= $this->ShowDownload(); 155 154 156 155 return($Output); 157 } 156 } 158 157 } 159 -
trunk/Modules/Translation/Save.php
r727 r800 25 25 $Language = $_POST['Language'] * 1; 26 26 if(array_key_exists('End', $_POST)) $Complete = 1; 27 else $Complete = 0;27 else $Complete = 0; 28 28 29 29 // Get source text record from database by ID … … 34 34 35 35 // Get data for english original 36 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry']. 37 ') AND (`Language` = '.$this->System->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].38 ')AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');36 $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') '. 37 'AND (`Language` = '.$this->System->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') '. 38 'AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 39 39 if($DbResult->num_rows > 0) 40 40 { -
trunk/includes/AppModule.php
r545 r800 6 6 var $Name; 7 7 var $Version; 8 var $License; 8 var $License; 9 9 var $Creator; 10 10 var $Description; … … 19 19 var $Manager; 20 20 var $OnChange; 21 21 22 22 function __construct($System) 23 23 { … … 27 27 $this->Dependencies = array(); 28 28 } 29 29 30 30 function Install() 31 31 { 32 32 } 33 33 34 34 function Uninstall() 35 35 { 36 36 } 37 37 38 38 function Start() 39 39 { 40 40 } 41 41 42 42 function Stop() 43 43 { 44 } 44 } 45 45 } 46 46 47 class AppModuleManager 47 class AppModuleManager 48 48 { 49 49 var $Modules; 50 50 51 51 function __construct() 52 52 { 53 $this->Modules = array(); 53 $this->Modules = array(); 54 54 } 55 55 56 56 function StartAll() 57 57 { … … 71 71 } 72 72 } 73 73 74 74 function ModulePresent($Name) 75 75 { 76 76 return(array_key_exists($Name, $this->Modules)); 77 77 } 78 78 79 79 function RegisterModule(AppModule $Module) 80 80 { 81 $this->Modules[$Module->Name] = &$Module; 82 $Module->Manager = &$this; 83 $Module->OnChange = &$this->OnModuleChange; 81 if(!isset($this->Modules[$Module->Name])) 82 { 83 $this->Modules[$Module->Name] = &$Module; 84 $Module->Manager = &$this; 85 $Module->OnChange = &$this->OnModuleChange; 86 } else throw new Exception('Module '.$Module->Name.' redefined'); 84 87 } 85 88 86 89 function UnregisterModule($Module) 87 90 { 88 unset($this->Modules[array_search($Module, $this->Modules)]); 91 unset($this->Modules[array_search($Module, $this->Modules)]); 89 92 } 90 93 91 94 /* @return Module */ 92 95 function SearchModuleById($Id) … … 98 101 } 99 102 return(''); 100 } 103 } 101 104 } -
trunk/includes/Database.php
r770 r800 8 8 var $PDOStatement; 9 9 var $num_rows = 0; 10 10 11 11 function fetch_assoc() 12 12 { 13 13 return($this->PDOStatement->fetch(PDO::FETCH_ASSOC)); 14 14 } 15 15 16 16 function fetch_array() 17 17 { … … 29 29 var $Prefix; 30 30 var $Functions; 31 var $Type; 31 var $Type; 32 32 var $PDO; 33 33 var $Error; … … 37 37 var $ShowSQLQuery; 38 38 var $LogFile; 39 39 40 40 function __construct() 41 { 41 { 42 42 $this->Functions = array('NOW()', 'CURDATE()', 'CURTIME()', 'UUID()'); 43 43 $this->Type = 'mysql'; // mysql, pgsql … … 47 47 $this->LogFile = dirname(__FILE__).'/../Query.log'; 48 48 } 49 49 50 50 function Connect($Host, $User, $Password, $Database) 51 { 51 { 52 52 if($this->Type == 'mysql') $ConnectionString = 'mysql:host='.$Host.';dbname='.$Database; 53 53 else if($this->Type == 'pgsql') $ConnectionString = 'pgsql:dbname='.$Database.';host='.$Host; … … 55 55 $this->PDO = new PDO($ConnectionString, $User, $Password); 56 56 } 57 57 58 58 function select_db($Database) 59 59 { 60 60 $this->query('USE `'.$Database.'`'); 61 61 } 62 62 63 63 function query($Query) 64 64 { … … 67 67 $Result = new DatabaseResult(); 68 68 $Result->PDOStatement = $this->PDO->query($Query); 69 if(($this->ShowSQLQuery == true) or ($this->LogSQLQuery == true)) 70 $Duration = ' ; '.round(microtime() - $QueryStartTime, 3). ' s';69 if(($this->ShowSQLQuery == true) or ($this->LogSQLQuery == true)) 70 $Duration = ' ; '.round(microtime() - $QueryStartTime, 4). ' s'; 71 71 if($this->LogSQLQuery == true) 72 72 file_put_contents($this->LogFile, $Query.$Duration."\n", FILE_APPEND); … … 81 81 $this->Error = $this->PDO->errorInfo(); 82 82 $this->Error = $this->Error[2]; 83 if(($this->Error != '') and ($this->ShowSQLError == true)) 83 if(($this->Error != '') and ($this->ShowSQLError == true)) 84 84 echo('<div><strong>SQL Error: </strong>'.$this->Error.'<br />'.$Query.'</div>'); 85 85 throw new Exception('SQL Error: '.$this->Error); 86 86 } 87 return($Result); 87 return($Result); 88 88 } 89 89 90 90 function select($Table, $What = '*', $Condition = 1) 91 { 92 return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition)); 91 { 92 return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition)); 93 93 } 94 94 95 95 function delete($Table, $Condition) 96 96 { 97 $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition); 98 } 99 97 $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition); 98 } 99 100 100 function insert($Table, $Data) 101 101 { … … 105 105 { 106 106 $Name .= ',`'.$Key.'`'; 107 if(!in_array($Value, $this->Functions)) 107 if(!in_array($Value, $this->Functions)) 108 108 { 109 109 if(is_null($Value)) $Value = 'NULL'; … … 114 114 $Name = substr($Name, 1); 115 115 $Values = substr($Values, 1); 116 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 116 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 117 117 $this->insert_id = $this->PDO->lastInsertId(); 118 118 } 119 119 120 120 function update($Table, $Condition, $Data) 121 121 { … … 123 123 foreach($Data as $Key => $Value) 124 124 { 125 if(!in_array($Value, $this->Functions)) 125 if(!in_array($Value, $this->Functions)) 126 126 { 127 127 if(is_null($Value)) $Value = 'NULL'; … … 130 130 $Values .= ', `'.$Key.'`='.$Value; 131 131 } 132 $Values = substr($Values, 2); 132 $Values = substr($Values, 2); 133 133 $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')'); 134 134 } 135 135 136 136 function replace($Table, $Data) 137 137 { … … 140 140 foreach($Data as $Key => $Value) 141 141 { 142 if(!in_array($Value, $this->Functions)) 142 if(!in_array($Value, $this->Functions)) 143 143 { 144 144 if(is_null($Value)) $Value = 'NULL'; … … 154 154 //echo($this->error().'<br>'); 155 155 } 156 156 157 157 function charset($Charset) 158 158 { 159 159 $this->query('SET NAMES "'.$Charset.'"'); 160 160 } 161 161 162 162 function real_escape_string($Text) 163 163 { 164 164 return(addslashes($Text)); 165 165 } 166 166 167 167 function quote($Text) 168 168 { 169 169 return($this->PDO->quote($Text)); 170 170 } 171 171 172 172 function __sleep() 173 173 { … … 177 177 function __wakeup() 178 178 { 179 } 179 } 180 180 } 181 181 … … 183 183 { 184 184 if($Time == NULL) return(NULL); 185 else return(date('Y-m-d H:i:s', $Time)); 185 else return(date('Y-m-d H:i:s', $Time)); 186 186 } 187 187 … … 189 189 { 190 190 if($Time == NULL) return(NULL); 191 else return(date('Y-m-d', $Time)); 191 else return(date('Y-m-d', $Time)); 192 192 } 193 193 … … 195 195 { 196 196 if($Time == NULL) return(NULL); 197 else return(date('H:i:s', $Time)); 197 else return(date('H:i:s', $Time)); 198 198 } 199 199 200 200 function MysqlDateTimeToTime($DateTime) 201 201 { 202 if($DateTime == '') return(0); 202 if($DateTime == '') return(0); 203 203 $Parts = explode(' ', $DateTime); 204 $DateParts = explode('-', $Parts[0]); 204 $DateParts = explode('-', $Parts[0]); 205 205 $TimeParts = explode(':', $Parts[1]); 206 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 207 return($Result); 206 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 207 return($Result); 208 208 } 209 209 … … 211 211 { 212 212 if($Date == '') return(0); 213 return(MysqlDateTimeToTime($Date.' 0:0:0')); 213 return(MysqlDateTimeToTime($Date.' 0:0:0')); 214 214 } 215 215 … … 217 217 { 218 218 if($Time == '') return(0); 219 return(MysqlDateTimeToTime('0000-00-00 '.$Time)); 220 } 219 return(MysqlDateTimeToTime('0000-00-00 '.$Time)); 220 } -
trunk/includes/Version.php
r799 r800 6 6 // and system will need database update. 7 7 8 $Revision = 799; // Subversion revision8 $Revision = 800; // Subversion revision 9 9 $DatabaseRevision = 787; // Database structure revision 10 $ReleaseTime = '2014-03- 09';10 $ReleaseTime = '2014-03-16'; -
trunk/includes/global.php
r798 r800 11 11 include_once(dirname(__FILE__).'/AppModule.php'); 12 12 include_once(dirname(__FILE__).'/Locale.php'); 13 require_once(dirname(__FILE__).'/../HTML/BBCodeParser2.php'); 13 14 14 15 // Include application modules … … 33 34 include_once(dirname(__FILE__).'/../Modules/Download/Download.php'); 34 35 include_once(dirname(__FILE__).'/../Modules/Forum/Forum.php'); 35 require_once(dirname(__FILE__).'/../HTML/BBCodeParser2.php');36 include_once(dirname(__FILE__).'/../Modules/Redirection/Redirection.php'); 36 37 37 38 -
trunk/includes/system.php
r798 r800 158 158 $this->ModuleManager->RegisterModule(new ModuleDownload($System)); 159 159 $this->ModuleManager->RegisterModule(new ModuleForum($System)); 160 $this->ModuleManager->RegisterModule(new ModuleRedirection($System)); 160 161 $this->ModuleManager->StartAll(); 161 162 … … 203 204 function SearchPage($PathItems, $Pages) 204 205 { 205 if(count($PathItems) > 0) $PathItem = $PathItems[0];206 else $PathItem = '';206 if(count($PathItems) == 0) $PathItems = array(''); 207 $PathItem = $PathItems[0]; 207 208 if(array_key_exists($PathItem, $Pages)) 208 209 { … … 237 238 /* @var $Page Page */ 238 239 $ClassName = $this->SearchPage($this->PathItems, $this->Pages); 239 if( $ClassName != '')240 if(($ClassName != '') and (class_exists($ClassName))) 240 241 { 241 242 $Page = new $ClassName($this);
Note:
See TracChangeset
for help on using the changeset viewer.