~swishcms/swishcontent/swishcontent

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?php

/*
    This file is part of SwishCONTENT.

    SwishCONTENT is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License v2 as published by
    the Free Software Foundation.

    SwishCONTENT is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with SwishCONTENT; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
	$IN_SCi = 1;
	$IN_SCu = 1;

	session_start();

	require("../config.php");
	require("../drivers/".$GLOBALS['db_type']."/master.php");

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="../pngfix.js"></script>
<![endif]-->
  <title>SwishCONTENT Upgrade</title>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <style type="text/css">

body {
	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
	margin: 0px;
}

#header {
	background-image: url("logograd.png");
	background-color: #CCCCCC;
	height: 70px;
}

#buttonbox {
	display: inline;
	top: 15px;
	right: 15px;
	position: absolute;
	font-size: xx-large;
	font-weight: bold;
	color: #ffffff;
}

#content {
	padding: 5px;
	background-image: url("headbkg.png");
	background-position: top;
	background-repeat: repeat-x;
	color: #000000;
}

#footer {
	padding: 5px;
	background-image: url("footbkg.png");
	background-position: top;
	background-repeat: repeat-x;
	font-size: 12px;
	color: #666666;
}

#logobox {
	background: #ffffff;
	height: 70px;
	width: 180px;
}

#curve {
	background-image: url("curve.png");
	background-repeat: no-repeat;
	height: 70px;
	width: 40px;
	position: absolute;
	left: 180px;
	top: 0px;
}

.logo {
	padding: 5px;
	left: 4px;
	position: absolute;
}

.button {
	background-color: #FFFFFF;
	border: 1px solid #666666;
	padding: 5px;
}

.button img {
	border: 0;
}

a {
	text-decoration: none;
}

input, textarea {
	border: 1px solid gray;
}
.code {
	border: 1px dashed gray;
	padding: 2px;
	background-color: rgb(255, 255, 204);
	font-family: "Courier New",Courier,monospace;
	font-size: larger;
}
  </style>
   <link rel="shortcut icon" href="../favicon.ico">
</head>
<body>
<div id="header"><div id="curve"> </div><div id="logobox"><img src="logo.png" border="0" alt="SwishCONTENT Upgrade" class="logo"/></div></div>
<div id="buttonbox">Upgrade</div>
<div id="content">
<?php

	if(!isset($_POST['page'])) {
		$_POST['page'] = "";
	}

	switch($_POST['page']) {
		case page1:
			// Upgrade.
			process();
			break;
		case page2:
			// Finish.
			done();
			break;
		case tpl:
			// Template update
			tpl();
			break;
		default:
			// Introduction page.
			info();
			break;
	}
?>
</div>
<div id="footer"><br style="font-size: 7px;" />&copy; 2008 SwishCMS Development Team - <a href="http://swishcms.exclaim-project.org">SwishCMS Homepage</a> - <a href="http://validator.w3.org/check?uri=referer"> Valid HTML</a></div>
<br />
</body>
</html>

<?php

	function info() {
		echo '<h1>Upgrade</h1>Welcome to the SwishCONTENT Upgrade Utility. This tool will update the database for your SwishCONTENT site with all the latest modifications. Your settings will be read from the config file.<h2>Who should use this tool:</h2><ul><li>Users of SwishCONTENT 1.1.x</li><li>Do <b>NOT</b> use this tool to update a test release of 1.5, 1.0x or any bzr release. 1.0.x users must update to 1.1.3 first.</ul></ul>You will have the option to update your template to the new 1.5 series style, though this is not required.<br /><br /><form name="input" action="upgrade.php" method="post"><input type="hidden" name="page" value="page1"><input type="submit" value="Next"></form>Update theme (if you skipped last time - will remove current theme).<form name="input" action="upgrade.php" method="post"><input type="hidden" name="page" value="tpl"><input type="submit" value="Update"></form>';
	}

	function process() {
		echo '<h1>Updating Database</h1> Please wait while the database is upgraded.<br /><br /><b>Upgrade Database:</b> ';
		require("upgrade/".$GLOBALS['db_type'].".php");
		doit();
	}
	
	function tpl() {
		echo '<h1>Updating Theme</h1> Please wait while the new theme is installed.<br /><br /><b>Upgrade Theme:</b> ';
		require("upgrade/".$GLOBALS['db_type'].".php");
		tplupdate();
	}

	function done() {
		echo '<h1>Upgrade Complete</h1> The upgrade has completed. You may now use your site. Below are a set of recommended post-upgrade instructions:<ul><li>Delete the install dir for security.</li><li>Update the template (optional) with the Update button below.</li></ul><h2>Credits</h2><ul><li>lsproc - Project Leader and coding</li><li>Alex Smith - Testing</li><li>Durand - Images</li><li>Elliot Hughes - Testing</li></ul>Update theme, this will remove the current theme.<form name="input" action="upgrade.php" method="post"><input type="hidden" name="page" value="tpl"><input type="submit" value="Update"></form><a href="../'.$GLOBALS['sc_mainfile'].'">Proceed to site</a>.';
	}
?>