Changeset 880 for trunk/Modules/Export/CreateAddon.php
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/CreateAddon.php
r859 r880 17 17 $string = str_replace('$r', '"..'.$strlower.'(UnitRace("player")).."', $string); 18 18 $Gender = '$G'; 19 while (strpos($string, $Gender) !== false)19 while (strpos($string, $Gender) !== false) 20 20 { 21 21 $Before = substr($string, 0, strpos($string, $Gender)); … … 30 30 } 31 31 $Gender = '$g'; 32 while (strpos($string, $Gender) !== false)32 while (strpos($string, $Gender) !== false) 33 33 { 34 34 $Before = substr($string, 0, strpos($string, $Gender)); … … 46 46 $string = str_replace("\r", '', $string); 47 47 $string = str_replace("\n", '\r\n', $string); 48 return ($string);48 return $string; 49 49 } 50 50 … … 64 64 $string = str_replace('\\n', ' ', $string); 65 65 $string = str_replace(' ', '', $string); 66 // while (strpos($string, ' '))66 // while (strpos($string, ' ')) 67 67 // $string = str_replace(' ', ' ', $string); 68 return ($string);68 return $string; 69 69 } 70 70 … … 75 75 $string = str_replace('$b', '\r\n', $string); 76 76 $string = $this->ReplaceVarInText($string,''); 77 return ($string);77 return $string; 78 78 } 79 79 … … 81 81 { 82 82 //echo (strpos($string,'<html>')); 83 if (strpos($string,'<html>') > -1) return (false);84 else return (true);83 if (strpos($string,'<html>') > -1) return false; 84 else return true; 85 85 } 86 86 … … 98 98 $string = str_replace('\\\\124', '\\124',$string); 99 99 100 return ($string);100 return $string; 101 101 } 102 102 … … 113 113 $CreatedFileListCount = array(); 114 114 115 if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true);115 if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true); 116 116 117 117 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`TablePrefix` != ""'); 118 while ($Group = $DbResult->fetch_assoc())118 while ($Group = $DbResult->fetch_assoc()) 119 119 { 120 120 //získání čísla verze pro export … … 126 126 else $ExportVersion = ''; 127 127 128 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)129 if ($Column['AddonFileName'] != '')128 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 129 if ($Column['AddonFileName'] != '') 130 130 { 131 131 $this->AddProgress(1); 132 if (!isset($CreatedFileListCount[$Column['AddonFileName']]))132 if (!isset($CreatedFileListCount[$Column['AddonFileName']])) 133 133 $CreatedFileListCount[$Column['AddonFileName']] = 0; 134 134 $CreatedFileListCount[$Column['AddonFileName']]++; … … 149 149 $ID = $this->Database->query('SELECT `BuildNumber` FROM `ClientVersion` WHERE '. 150 150 ' `Imported` = 1 AND `BuildNumber` < '.$BuildNumber.' ORDER BY `BuildNumber` DESC LIMIT 1'); 151 if ($ID->num_rows > 0) {151 if ($ID->num_rows > 0) { 152 152 $ExportVersionOld = $ID->fetch_assoc(); 153 153 $ExportVersionOld = $ExportVersionOld['BuildNumber']; 154 154 155 155 $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersionOld)); 156 while ($Line = $DbResult2->fetch_assoc())156 while ($Line = $DbResult2->fetch_assoc()) 157 157 { 158 158 $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']])); 159 159 $cz = $this->ReplaceCzText($Line[$Column['Column']]); 160 if (($en <> '') and ($cz <> '') and ($this->NotCancel($en)))160 if (($en <> '') and ($cz <> '') and ($this->NotCancel($en))) 161 161 { 162 162 $TableTexts[$en] = $cz; … … 167 167 168 168 $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion)); 169 while ($Line = $DbResult2->fetch_assoc())169 while ($Line = $DbResult2->fetch_assoc()) 170 170 { 171 171 $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']])); 172 172 $cz = $this->ReplaceCzText($Line[$Column['Column']]); 173 if (($en <> '') and ($cz <> '') and ($this->NotCancel($en)))173 if (($en <> '') and ($cz <> '') and ($this->NotCancel($en))) 174 174 { 175 175 $TableTexts[$en] = $cz; … … 177 177 } 178 178 179 foreach ($TableTexts as $key => $value) {179 foreach ($TableTexts as $key => $value) { 180 180 $Buffer .= "\n".'["'.$key.'"]="'.$value.'",'; 181 181 $i++; … … 194 194 $CountFiles = 'CountFiles.lua'; 195 195 $Buffer = ''; 196 foreach ($CreatedFileList as $CreatedFile)196 foreach ($CreatedFileList as $CreatedFile) 197 197 $Buffer .= 'CZWOW_'.str_replace('_','_count=',$CreatedFile).';'."\n"; 198 foreach ($TranslationTree as $Group)199 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)198 foreach ($TranslationTree as $Group) 199 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 200 200 if (($Column['AddonFileName'] != '') and (!in_array($Column['AddonFileName'].'_1', $CreatedFileList))) 201 201 { … … 209 209 $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">'."\n"; 210 210 $Buffer .= '<script file="'.$CountFiles.'"/>'."\n"; 211 foreach ($CreatedFileList as $CreatedFile)211 foreach ($CreatedFileList as $CreatedFile) 212 212 $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n"; 213 213 $Buffer .= '</Ui>'; 214 214 file_put_contents($this->TempDir.'CzWoW/Translates.xml', $Buffer); 215 return ($Output);215 return $Output; 216 216 } 217 217 … … 235 235 236 236 $DbResult = $this->Database->query($this->BuildQuery($Group,$CanGenerated)); 237 while ($Line = $DbResult->fetch_array())237 while ($Line = $DbResult->fetch_array()) 238 238 { 239 239 $Original = $this->my_trim($Line['En'.$Column['Column']]); 240 240 $Translated = $this->my_trim($Line[$Column['Column']]); 241 if ($this->ClientVersion['Version'] == '2.4.3')241 if ($this->ClientVersion['Version'] == '2.4.3') 242 242 { 243 243 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original); … … 247 247 } 248 248 249 if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true);249 if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true); 250 250 file_put_contents($this->TempDir.'CzWoW/LocalizationStrings.lua', $Buffer); 251 251 } … … 253 253 function MakeAddon() 254 254 { 255 if (!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);255 if (!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true); 256 256 $Output = $this->MakeLanguageFiles(); 257 257 $Output .= $this->MakeClientStrings(); 258 258 // $Output .= MakeMainScript($Setting); 259 return ($Output);259 return $Output; 260 260 } 261 261 … … 283 283 '; 284 284 $DbResult = $System->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC'); 285 while ($Line = $DbResult->fetch_assoc())285 while ($Line = $DbResult->fetch_assoc()) 286 286 { 287 287 $Buffer .='
Note:
See TracChangeset
for help on using the changeset viewer.