source: trunk/Modules/Download/Download.php@ 816

Last change on this file since 816 was 816, checked in by chronos, 10 years ago
  • Modified: Tabs converted to spaces.
  • Modified: Remove spaces from end of lines.
  • Added: Code format script.
File size: 8.3 KB
Line 
1<?php
2
3class ModuleDownload extends AppModule
4{
5 function __construct($System)
6 {
7 parent::__construct($System);
8 $this->Name = 'Download';
9 $this->Version = '1.0';
10 $this->Creator = 'Maron';
11 $this->License = 'GNU/GPL';
12 $this->Description = 'Show list of selected export and link to static files';
13 $this->Dependencies = array();
14 }
15
16 function Start()
17 {
18 $this->System->RegisterPage('download', 'PageDownload');
19 $this->System->RegisterMenuItem(array(
20 'Title' => T('Download'),
21 'Hint' => T('List of czech to download'),
22 'Link' => $this->System->Link('/download/'),
23 'Permission' => LICENCE_ANONYMOUS,
24 'Icon' => '',
25 ), 1);
26 }
27}
28
29class PageDownload extends Page
30{
31 function ShowFiles()
32 {
33 $fileslink = $this->System->Link('/files');
34$Output = '<h3>'.T('Accessories for client').'</h3>'.
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.').' '.
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.').' '.
37 '<br /><br/>'.
38 '<strong>WowLua</strong> - '.T('Specific modified version of WoW.exe for free servers with support for translation Lua files').'<br/>'.
39 'enGB a enUS: '.
40 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.5a.exe">3.3.5a</a>'.
41 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.3a.exe">3.3.3a</a>'.
42 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.2.exe">3.3.2</a>'.
43 ' <a href="'.$fileslink.'/WowLua/WowLua_3.3.0a.exe">3.3.0a</a>'.
44 ' <a href="'.$fileslink.'/WowLua/WowLua_2.4.3.exe">2.4.3</a>'.
45 ' <a href="'.$fileslink.'/WowLua/WowLua_1.12.1.exe">1.12.1</a>'.
46 '<br/><br/>'.
47 '<strong>WoWMe</strong> - '.T('Edited files wow.exe with support of translation dbc files').':<br/>'.
48 '<a href="'.$fileslink.'/WoWMe/WoWMe_4.3.4.zip">4.3.4</a> '.
49 '<a href="'.$fileslink.'/WoWMe/WoWMe_3.2.0.rar">3.2.0</a> '.
50 '<a href="'.$fileslink.'/WoWMe/WoWMe_3.1.3.rar">3.1.3</a> '.
51 '<a href="'.$fileslink.'/WoWMe/WoWMe_3.0.3.zip">3.0.3</a> '.
52 '<a href="'.$fileslink.'/WoWMe/WoWMe_2.4.3.zip">2.4.3</a> '.
53 '<br/><br/>'.
54 '<strong>CzechWoW</strong> - '.T('Czech for client with edited client files (old)').'<br/>';
55
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/>'.
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/>'.
58 '<a href="'.$fileslink.'/CzechWoW/Instalace_CzechWoW_3.3.2_2010-04-12.exe">Instalace CzechWoW 3.3.2 2010-04-12.exe</a><br/>'.
59 '<br/>'.
60 '<strong>'.T('Other add-ons').':</strong><br/>'.
61 '<a href="'.$fileslink.'/ceske_fonty_do_wow.zip">'.T('Czech fonts for game').'</a> - '.T('original fonts from game with added czech symbols.').'<br />'.
62 '<a href="http://jenicko.savana.cz/wow/forum/viewtopic.php?id=218&amp;action=all">'.T('Czech shouts from W3').'</a> - '.T('sound files taken from Warcraft 3 and used in wow.').'<br />
63 <br />'.
64 '<h3>'.T('Add-ons for server').':</h3>'.
65
66 '<a href="http://mangos.cjb.net/forums/index.php?showforum=15">'.T('Czech to Minimanager').'</a><br />
67 <a href="http://mangos.cjb.net/forums/index.php?showtopic=359">'.T('Czech for AoWoW').'</a> <a href="'.$fileslink.'/AoWoW.zip">'.T('Czech for AoWoW').' (zip)</a> - '.T('Web viewer database for emulator mangos like wowhead.com').'<br />
68 <br />';
69
70 $Output .= '<h3>'.T('Tools for help').':</h3>'.
71 '<a href="http://zezula.net/download/mpqediten32.zip">Ladik\'s MPQ Editor</a> <a href="http://zezula.net/">'.T('Author page').'</a><br />'.
72 '<a href="'.$fileslink.'/mpq.exe">mpq.exe</a> '.T('command line program for adding files to MPQ archives, created by Maron').'<br />'.
73 '<a href="'.$fileslink.'/wowsig.exe">WoWsig.exe</a> addon signature generator by wad (2005)<br />'.
74 '<a href="'.$fileslink.'/DBCtoCSV.exe">DBCtoCSV</a> - '.T('tool for transform DBC files to CSV').'<br />'.
75 '<a href="'.$fileslink.'/ClientDBExtractor.exe">ClientDBExtractor.exe</a> - '.T('tool for exporting dbc files from game client').'<br />';
76 return($Output);
77 }
78
79 function ShowDownload()
80 {
81 $Output = '<h3>'.T('Download czech').'</h3><br />';
82
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 />';
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 />';
85 $Output .= T('The following files are generated every day, if needed. That means if is added new translation to database. Therefore, if you translate a translation or correct the mistake, tomorrow you can download the new patched version. Or you can rebuild and download for a few minutes the repaired file.').'<br />';
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 />';
87 $Output .= '<br /><br />';
88
89 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `Featured`=1');
90 $DbRow = $DbResult->fetch_row();
91 $PageList = GetPageList($DbRow[0]);
92
93 $Output .= $PageList['Output'];
94 $TableColumns = array(
95 array('Name' => 'Version', 'Title' => T('Download')),
96 array('Name' => 'Title', 'Title' => T('Name2'),),
97 array('Name' => 'TimeCreate', 'Title' => T('Creation date')),
98 array('Name' => 'Description', 'Title' => T('Description')),
99 );
100 $Order = GetOrderTableHeader($TableColumns, 'Id', 1);
101 $Output .= '<table class="BaseTable">'.
102 $Order['Output'];
103 $DbRows = $this->Database->query('SELECT `ClientVersion`.`Version` AS `Version`, '.
104 '`Export`.`Id`, `Export`.`ClientVersion`, `Export`.`OutputType`, `Export`.`Title`, '.
105 '`Export`.`Description` FROM `Export` '.
106 'JOIN `ClientVersion` as `ClientVersion` ON `ClientVersion`.`Id`=`Export`.`ClientVersion` '.
107 'WHERE `Featured`=1 '.$Order['SQL'].$PageList['SQLLimit']);
108 while ($DbExport = $DbRows->fetch_assoc())
109 {
110 $ExportId = $DbExport['Id'];
111
112 if ($DbExport['OutputType'] == 10)
113 $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'Instalace_CzechWoW_'.$DbExport['Version'].'.exe';
114 if ($DbExport['OutputType'] == 7)
115 $filename = $this->System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'CzWoW_Addon-'.$DbExport['Version'].'.zip';
116
117 if ($DbExport['OutputType'] == 10)
118 $Output .= '<tr><td><a href="'.$this->System->Link('/'.$filename).
119 '">CzechWoW_'.$DbExport['Version'].'.exe</a><br /> <a href="'.
120 $this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
121 else
122 if ($DbExport['OutputType'] == 7)
123 $Output .= '<tr><td><a href="'.$this->System->Link('/'.$filename).
124 '">CzWoW_Addon-'.$DbExport['Version'].'.zip</a><br /> <a href="'.
125 $this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
126 else
127 $Output .= '<tr><td><a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.
128 $ExportId.'&amp;Tab=7').'">'.T('Make export').'</a><br /> <a href="'.
129 $this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
130
131 $Output .= '<td>'.$DbExport['Title'].'</td>'; //.'<td>'.$DbExport['ClientVersion'].'</td>';
132
133 if ((($DbExport['OutputType'] == 10) or ($DbExport['OutputType'] == 7)) and (file_exists($filename)))
134 $Output .= '<td>'.date('d.m.y H:i',filemtime($filename)).'</td>';
135 else
136 $Output .= '<td>&nbsp;</td>';
137
138 $Output .=
139 '<td>'.str_replace("\n", '<br />',$DbExport['Description']).'</td>'.
140 '</tr>';
141 }
142 $Output .= '</table>'.
143 $PageList['Output'];
144
145 return($Output);
146 }
147
148 function Show()
149 {
150 $this->Title = T('Download');
151 $Output = '';
152 if (isset($_GET['Files'])) $Output .= $this->ShowFiles();
153 else $Output .= $this->ShowDownload();
154
155 return($Output);
156 }
157}
Note: See TracBrowser for help on using the repository browser.