Revision 944
Added by Matthias almost 16 years ago
upgrade-script.php | ||
---|---|---|
52 | 52 |
|
53 | 53 |
#container { |
54 | 54 |
width:85%; |
55 |
background: #A8BCCB url(<?php echo ADMIN_URL;?>/interface/background.png) repeat-x;
|
|
55 |
background: #A8BCCB url(<?php echo THEME_URL;?>/images/background.png) repeat-x;
|
|
56 | 56 |
border:1px solid #000; |
57 | 57 |
color:#000; |
58 | 58 |
margin:2em auto; |
... | ... | |
90 | 90 |
</head> |
91 | 91 |
<body> |
92 | 92 |
<div id="container"> |
93 |
<img src="<?php echo ADMIN_URL;?>/interface/logo.png" alt="Website Baker Logo" />
|
|
93 |
<img src="<?php echo THEME_URL;?>/images/logo.png" alt="Website Baker Logo" />
|
|
94 | 94 |
|
95 | 95 |
<h1>Website Baker Upgrade</h1> |
96 | 96 |
|
... | ... | |
127 | 127 |
// function to add a new field into a table |
128 | 128 |
function db_add_field($field, $table, $desc) { |
129 | 129 |
global $database; global $OK; global $FAIL; |
130 |
echo "<u>Adding field '$field' to table '$table'</u><br />"; |
|
131 | 130 |
$table = TABLE_PREFIX.$table; |
132 | 131 |
$query = $database->query("DESCRIBE $table '$field'"); |
133 | 132 |
if($query->numRows() == 0) { // add field |
... | ... | |
149 | 148 |
/********************************************************** |
150 | 149 |
* - Adding field sec_anchor to settings table |
151 | 150 |
*/ |
152 |
echo "<br />Adding key sec_anchor to settings table<br />";
|
|
151 |
echo "<br />Adding sec_anchor to settings table<br />"; |
|
153 | 152 |
$cfg = array( |
154 | 153 |
'sec_anchor' => 'wb_' |
155 | 154 |
); |
... | ... | |
157 | 156 |
db_add_key_value($key, $value); |
158 | 157 |
} |
159 | 158 |
|
159 |
|
|
160 | 160 |
/********************************************************** |
161 |
* - Adding field default_theme to settings table |
|
162 |
*/ |
|
163 |
echo "<br />Adding default_theme to settings table<br />"; |
|
164 |
$cfg = array( |
|
165 |
'default_theme' => 'wb_theme' |
|
166 |
); |
|
167 |
foreach($cfg as $key=>$value) { |
|
168 |
db_add_key_value($key, $value); |
|
169 |
} |
|
170 |
|
|
171 |
|
|
172 |
/********************************************************** |
|
161 | 173 |
* - Adding redirect timer to settings table |
162 | 174 |
*/ |
163 | 175 |
echo "<br />Adding redirect timer to settings table<br />"; |
... | ... | |
168 | 180 |
db_add_key_value($key, $value); |
169 | 181 |
} |
170 | 182 |
|
183 |
|
|
171 | 184 |
/********************************************************** |
172 | 185 |
* - Add field "redirect_type" to table "mod_menu_link" |
173 | 186 |
*/ |
... | ... | |
185 | 198 |
$database->query($sql); |
186 | 199 |
echo ($database->query($sql)) ? " $OK<br />" : " $FAIL<br />"; |
187 | 200 |
|
201 |
|
|
188 | 202 |
/********************************************************** |
203 |
* - Set Version to WB 2.8 BETA |
|
204 |
*/ |
|
205 |
echo "<br />Update database version number to 2.8 BETA : "; |
|
206 |
$version = '2.8 BETA'; |
|
207 |
echo ($database->query("UPDATE `".TABLE_PREFIX."settings` SET `value` = '$version' WHERE `name` = 'wb_version'")) ? " $OK<br />" : " $FAIL<br />"; |
|
208 |
|
|
209 |
|
|
210 |
/********************************************************** |
|
211 |
* - Reload all addons |
|
212 |
*/ |
|
213 |
|
|
214 |
//delete modules |
|
215 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'module'"); |
|
216 |
// Load all modules |
|
217 |
if($handle = opendir(WB_PATH.'/modules/')) { |
|
218 |
while(false !== ($file = readdir($handle))) { |
|
219 |
if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'admin.php' AND $file != 'index.php') { |
|
220 |
load_module(WB_PATH.'/modules/'.$file); |
|
221 |
} |
|
222 |
} |
|
223 |
closedir($handle); |
|
224 |
} |
|
225 |
echo '<br />Modules reloaded<br />'; |
|
226 |
|
|
227 |
//delete templates |
|
228 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'template'"); |
|
229 |
// Load all templates |
|
230 |
if($handle = opendir(WB_PATH.'/templates/')) { |
|
231 |
while(false !== ($file = readdir($handle))) { |
|
232 |
if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'index.php') { |
|
233 |
load_template(WB_PATH.'/templates/'.$file); |
|
234 |
} |
|
235 |
} |
|
236 |
closedir($handle); |
|
237 |
} |
|
238 |
echo '<br />Templates reloaded<br />'; |
|
239 |
|
|
240 |
//delete languages |
|
241 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'language'"); |
|
242 |
// Load all languages |
|
243 |
if($handle = opendir(WB_PATH.'/languages/')) { |
|
244 |
while(false !== ($file = readdir($handle))) { |
|
245 |
if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'index.php') { |
|
246 |
load_language(WB_PATH.'/languages/'.$file); |
|
247 |
} |
|
248 |
} |
|
249 |
closedir($handle); |
|
250 |
} |
|
251 |
echo '<br />Languages reloaded<br />'; |
|
252 |
|
|
253 |
|
|
254 |
/********************************************************** |
|
189 | 255 |
* - End of upgrade script |
190 | 256 |
*/ |
191 | 257 |
echo '<p style="font-size:120%;"><strong>Congratulations: The upgrade script is finished ...</strong></p>'; |
Also available in: Unified diff
added skinable Admin Interface