Changeset 334
- Timestamp:
- Feb 22, 2010, 3:15:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/create_addon.php
r333 r334 26 26 $Man = str_replace(' ', '', $Man); 27 27 $Woman = str_replace(' ', '', $Woman); 28 $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'. 29 $Man.'"), "^3$", "'.$Woman.'").."'.$After; 28 $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"), "^3$", "'.$Woman.'").."'.$After; 30 29 } 31 30 $Gender = '$g'; … … 40 39 $Man = str_replace(' ', '', $Man); 41 40 $Woman = str_replace(' ', '', $Woman); 42 $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"), 43 "^3$", "'.$Woman.'").."'.$After; 41 $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"),"^3$", "'.$Woman.'").."'.$After; 44 42 } 45 43 … … 106 104 $CreatedFileListCount = array(); 107 105 108 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN 109 `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE 110 `ExportGroup`.`Export`='.$this->Id.' AND `group`.`TablePrefix` != ""'); 106 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`TablePrefix` != ""'); 111 107 while($Group = $DbResult->fetch_assoc()) 112 108 { … … 120 116 121 117 $CreatedFileList[] = $Column['AddonFileName'].'_'.$FileIndex; 122 $FileName = 123 $this->TempDir.'CzWoW/'.$Column['AddonFileName'].'_'.$FileIndex.'.lua'; 124 if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 125 0777, true); 118 $FileName = $this->TempDir.'CzWoW/'.$Column['AddonFileName'].'_'.$FileIndex.'.lua'; 119 if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true); 126 120 echo($Column['AddonFileName'].': '); 127 121 $i = 0; 128 122 129 $Buffer = 'CZWOW_'.$Column['AddonFileName']. 130 '_count='.$FileIndex.'; 131 CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={'; 132 133 $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, 134 T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, 135 T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM 136 '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= 137 '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= 138 '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND 139 '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 140 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 141 0)'; 123 $Buffer = 'CZWOW_'.$Column['AddonFileName'].'_count='.$FileIndex.';CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={'; 124 125 $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)'; 142 126 $DbResult2 = $this->Database->query($Query); 143 127 144 128 145 129 if ($this->Database->affected_rows == 0) { 146 $ID = $this->Database->query('SELECT MAX(`VersionEnd`) 147 FROM `'.$Group['TablePrefix'].'`'); 130 $ID = $this->Database->query('SELECT MAX(`VersionEnd`) FROM `'.$Group['TablePrefix'].'`'); 148 131 $BuildNumber_max = $ID->fetch_assoc(); 149 $BuildNumber_max = 150 $BuildNumber_max['MAX(`VersionEnd`)']; 132 $BuildNumber_max = $BuildNumber_max['MAX(`VersionEnd`)']; 151 133 152 $Query = 'SELECT T2.'.$Column['Column'].' AS 153 Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, 154 T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM 155 '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= 156 '.$BuildNumber_max.' AND VersionEnd >= '.$BuildNumber_max.' AND 157 '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 158 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = 159 T3.entry) AND (T3.Language = 0)'; 134 $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$BuildNumber_max.' AND VersionEnd >= '.$BuildNumber_max.' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)'; 160 135 $DbResult2 = $this->Database->query($Query); 161 136 … … 173 148 } 174 149 175 $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then 176 CZWOW_".$Column['AddonFileName']."=0; end; 177 CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n" 150 $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n" 178 151 ; 179 152 … … 184 157 185 158 // Generate file Translates.xml 186 $Buffer = '<Ui xmlns="http://www.blizzard.com/wow/ui/" 187 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 188 xsi:schemaLocation="http://www.blizzard.com/wow/ui/.\FrameXML\UI.xsd"><script 189 file="BookPage_1.lua"/>'."\n"; 159 $Buffer = '<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/.\FrameXML\UI.xsd"><scriptfile="BookPage_1.lua"/>'."\n"; 190 160 foreach($CreatedFileList as $CreatedFile) 191 161 $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n"; … … 201 171 $this->LoadFilters(); 202 172 203 $Buffer = "local f=function(name, en, cz) CzWoW_interface[name]=cz; 204 CzWoW_interface_entoname[en]=name; end; CzWoW_interface={ 205 };CzWoW_interface_entoname={ };\n"; 173 $Buffer = "local f=function(name, en, cz) CzWoW_interface[name]=cz;CzWoW_interface_entoname[en]=name; end; CzWoW_interface={};CzWoW_interface_entoname={ };\n"; 206 174 $Group = $TranslationTree[14]; // client table 207 175 $Column['Column'] = 'Text'; 208 $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, 209 T3.'.$Column['Column'].' as Original, T3.ShortCut FROM (SELECT T1.entry, 210 T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM 211 '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= 212 '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= 213 '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND 214 '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 215 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 216 0)'; 176 $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original, T3.ShortCut FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)'; 217 177 $DbResult = $this->Database->query($Query); 218 178 while($Line = $DbResult->fetch_array()) … … 225 185 $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated); 226 186 } 227 $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", 228 "'.$Translated.'");'."\n"; 187 $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'","'.$Translated.'");'."\n"; 229 188 } 230 189 231 if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 232 0777, true); 190 if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true); 233 191 file_put_contents($this->TempDir.'CzWoW/LocalizationStrings.lua', $Buffer); 234 192 } … … 244 202 function MakeReadme() 245 203 { 246 $DbResult = $this->Database->query('SELECT * FROM verseclient ORDER BY DATE 247 DESC'); 204 $DbResult = $this->Database->query('SELECT * FROM verseclient ORDER BY DATE DESC'); 248 205 $Line = $DbResult->fetch_assoc(); 249 206
Note:
See TracChangeset
for help on using the changeset viewer.