Project

General

Profile

1 1475 Luisehahne
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         output_filter
6 1520 darkviper
 * @author          Christian Sommer, WB-Project, Werner v.d. Decken
7 1475 Luisehahne
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10 1520 darkviper
 * @platform        WebsiteBaker 2.8.2
11 1475 Luisehahne
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id$
13
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15
 *
16
 */
17 1538 Luisehahne
// Must include code to stop this file being access directly
18 1520 darkviper
/* -------------------------------------------------------- */
19 1538 Luisehahne
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 1520 darkviper
/* -------------------------------------------------------- */
25 1538 Luisehahne
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 1475 Luisehahne
$table_name = TABLE_PREFIX .'mod_output_filter';
39
$field_name = 'sys_rel';
40 1477 Luisehahne
$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 1520 darkviper
	$description = 'INT NOT NULL DEFAULT \'0\' FIRST';
50 1477 Luisehahne
	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 1475 Luisehahne
}
56 1477 Luisehahne
print "</div>";