1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category modules
|
5
|
* @package output_filter
|
6
|
* @author Christian Sommer, WB-Project, Werner v.d. Decken
|
7
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.2
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: upgrade.php 1538 2011-12-10 15:06:15Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/tags/2.8.3/wb/modules/output_filter/upgrade.php $
|
14
|
* @lastmodified $Date: 2011-12-10 16:06:15 +0100 (Sat, 10 Dec 2011) $
|
15
|
*
|
16
|
*/
|
17
|
// Must include code to stop this file being access directly
|
18
|
/* -------------------------------------------------------- */
|
19
|
if(defined('WB_PATH') == false)
|
20
|
{
|
21
|
// Stop this file being access directly
|
22
|
die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
|
23
|
}
|
24
|
/* -------------------------------------------------------- */
|
25
|
|
26
|
$msg = '';
|
27
|
$sTable = TABLE_PREFIX.'mod_output_filter';
|
28
|
if(($sOldType = $database->getTableEngine($sTable))) {
|
29
|
if(('myisam' != strtolower($sOldType))) {
|
30
|
if(!$database->query('ALTER TABLE `'.$sTable.'` Engine = \'MyISAM\' ')) {
|
31
|
$msg = $database->get_error();
|
32
|
}
|
33
|
}
|
34
|
} else {
|
35
|
$msg = $database->get_error();
|
36
|
}
|
37
|
// ------------------------------------global $i;
|
38
|
$table_name = TABLE_PREFIX .'mod_output_filter';
|
39
|
$field_name = 'sys_rel';
|
40
|
$i = (!isset($i) ? 1 : $i);
|
41
|
print "<div style=\"margin:1em auto;font-size:1.1em;\">";
|
42
|
print "<h4>Step $i: Updating Output Filter</h4>\n";
|
43
|
$i++;
|
44
|
$OK = "<span class=\"ok\">OK</span>";
|
45
|
$FAIL = "<span class=\"error\">FAILED</span>";
|
46
|
if ( ($database->field_exists($table_name,$field_name) )) {
|
47
|
print "<br /><strong>'Output Filter already updated'</strong> $OK<br />\n";
|
48
|
} else {
|
49
|
$description = 'INT NOT NULL DEFAULT \'0\' FIRST';
|
50
|
if( ($database->field_add($table_name,$field_name,$description )) ) {
|
51
|
print "<br /><strong>Updating Output Filter</strong> $OK<br />\n";
|
52
|
} else {
|
53
|
print "<br /><strong>Updating Output Filter</strong> $FAIL<br />\n";
|
54
|
}
|
55
|
}
|
56
|
print "</div>";
|