Location: PHPKode > projects > SowiBB > SowiBB3/Upgrading/RC 2 PRE to RC 2/upgrade.php
<?php

/******************* // SowiBB 3 \\ *******************
 *  SowiBB 3 RC 2 PRE RELEASE
 *
 *  Webpage: http://sowibb.sf.net
 *  E-mail: hide@address.com
 *  Licence: http://sowibb.sf.net/index.php?p=licence
 *
 *  Someonewhois - hide@address.com
 *  Copyright (c) 2002 SowiBB
 *  http://sowibb.sf.net
 *****************************************************
 * You must leave this intact at the top of every page.
 * You can modify the files if you wish to, however you can not state it's yours.
 * All files Copyright (c) 2002 SowiBB, and in no way can you state it's yours.
 * Even if it's greatly modified, it is still part of SowiBB.
 *
 * All Rights Reserved.
 *****************************************************
 *
 *  -> Written By Someonewhois
 *  -> Date Started: December 6, 2002
 *  -> Date Finished: December 6, 2002
 *  -> Last Modified: December 6, 2002
 *
 *  -> This is the page in which shows the list of members that are registered.
 *     -> You can choose which group you want to see members from,
       -> and you can chose how many to view per page.
 *
 *  -> Made For Version: SowiBB 3 RC 2 PRE RELEASE
 *****************************************************/

	if (empty($SowiBB))
	{
		include("class.php");
	}

?><html><head><title>SowiBB Upgrader</title></head><body bgcolor="ffffff">
<center>
<font face="Verdana, Arial, Helvetica"><h1>Welcome To SowiBB's Upgrader!</h1></font>
<table bgcolor="d7b183" width="80%" border="1" bordercolor="000000">
<td bgcolor="ffcf90" border="1" bordercolor="000000">
<center><font face="Verdana, Arial, Helvetica"><?php
if ($_GET['act'] == "proceed"){
$sql = mysql_query("ALTER TABLE polls
ADD option6 VARCHAR(100) NOT NULL AFTER option5,
ADD option7 VARCHAR(100) NOT NULL AFTER option6,
ADD option8 VARCHAR(100) NOT NULL AFTER option7,
ADD option9 VARCHAR(100) NOT NULL AFTER option8,
ADD option10 VARCHAR(100) NOT NULL AFTER option9");

$sql = mysql_query("ALTER TABLE polls
ADD result6 int(11) NOT NULL AFTER result5,
ADD result7 int(11) NOT NULL AFTER result6,
ADD result8 int(11) NOT NULL AFTER result7,
ADD result9 int(11) NOT NULL AFTER result8,
ADD result10 int(11) NOT NULL AFTER result9");

$sql = mysql_query("ALTER TABLE user
ADD points int(11) NOT NULL AFTER threads");

$sql = mysql_query("UPDATE groups SET pips=''");
$sql = mysql_query("UPDATE groups SET pips='skins/DEFAULT/images/admins.gif' WHERE id='2'");
$sql = mysql_query("UPDATE groups SET pips='skins/DEFAULT/images/moderator.gif' WHERE id='3'");

$sql = mysql_query("INSERT INTO points SET what='Signup', howmany='5'");
if ($_POST['viewPosts'] == "yes")
{
$sql = mysql_query("DELETE FROM template WHERE tpl_name='viewPosts Post' OR tpl_name='viewPosts Reply'");

$sql = mysql_query("INSERT INTO template VALUES ('', 'viewPosts Reply', '<tr bgcolor=\"#779EC5\">\r\n<td width=\"20%\">\r\n<span class=\"postinfo\">Date: {DATE}</span></td>\r\n    <td width=\"80%\">\r\n<span class=\"postinfo\">{ICON} <a name=\"{ID}\"><b>Subject: {SUBJECT}</b></span>\r\n    </td>\r\n  </tr>\r\n<tr valign=\"top\">\r\n<td width=\"20%\" id=\"postuserinfo\">\r\n\r\n<center><B><font face=\"verdana\"><u><a href=\"profile.php?userid={USERID}\"><font color=\"{COLOUR}\">{USERID}</font></a></u></font></b></center>\r\n<BR><center>{PIPS}</center><BR>\r\n<B>Posts: {POSTS} </b><BR>\r\n\r\n{STATUS}<BR>\r\n\r\n<B><i>{MTITLE}</i></b><BR>\r\n<B>Group:</b> <a href=\"viewgroups.php?act=view&page={GROUPNAME}\">{GROUPNAME}</a><BR>\r\n<B>Location:</b> {LOCATION}<BR>\r\n<B>Mood:</b> {MOOD}<BR>\r\n<center><BR>{AVATAR}<br><BR><BR>\r\n\r\n<span class=\"main\">{IP}</span><BR></center>\r\n\r\n<BR></td>\r\n<td colspan=\"2\" id=\"{ALTERNATE_COLOUR}\"><p>\r\n{IF_NOT_CLOSED}\r\n<div align=\"right\"><a href=\"quote.php?id={ID}\"><img src=\"{QUOTE_IMAGE}\" border=\"0\"></a>\r\n{IF_HAS_PERM}\r\n&nbsp;&nbsp;&nbsp;&nbsp;\r\n<a href=\"moderator.php?&act=edit&page=reply&id={ID}\"><img src=\"{EDIT_IMAGE}\" border=\"0\"></a> &nbsp;&nbsp;&nbsp;&nbsp;<a href=\"moderator.php?act=delete&page=reply&id={ID}\"><img src=\"{DELETE_IMAGE}\" border=\"0\"></a>\r\n{END_IF_HAS_PERM}\r\n{END_IF_NOT_CLOSED}\r\n</div>\r\n<BR><BR>\r\n{POST}\r\n{IF_EDITED}\r\n<BR><BR><i>Post edited {WHATTIME} by {WHO}.</i>\r\n{END_IF_EDITED}\r\n<BR>\r\n<left>\r\n<BR><BR>\r\n{IF_HAS_SIG}\r\n<table border=\"1\" cellspacing=\"0\" cellpading=\"0\" bgcolor=\"ffffff\">\r\n<tr border=\"0\"><td border=\"0\"><span class=\"sig\">\r\n{SIGNATURE}</span>\r\n</td></tr></table><BR>\r\n{END_IF_HAS_SIG}\r\n<BR>\r\n</left>\r\n</td>\r\n  </tr>\r\n', 'DEFAULT', '')");
$sql = mysql_query("INSERT INTO template VALUES ('', 'viewPosts Post', '<tr bgcolor=\"#779EC5\">\r\n<td width=\"20%\">\r\n<span class=\"postinfo\">Date: {DATE}</span></td>\r\n    <td width=\"80%\">\r\n<span class=\"postinfo\">{ICON} <b>Subject: {SUBJECT}</b>\r\n{IF_DESCRIPTION}\r\n<i>({DESCRIPTION})</i>\r\n{END_IF_DESCRIPTION}</span>\r\n    </td>\r\n  </tr>\r\n<tr valign=\"top\">\r\n<td width=\"20%\" id=\"postuserinfo\">\r\n\r\n<center><B><font face=\"verdana\"><u><a href=\"profile.php?userid={USERID}\"><font color=\"{COLOUR}\">{USERID}</font></a></u></font></b></center>\r\n<BR><center>{PIPS}</center><BR>\r\n<B>Posts: {POSTS} </b><BR>\r\n\r\n{STATUS}<BR>\r\n\r\n<B><i>{MTITLE}</i></b><BR>\r\n<B>Group:</b> <a href=\"viewgroups.php?act=view&page={GROUPNAME}\">{GROUPNAME}</a><BR>\r\n<B>Location:</b> {LOCATION}<BR>\r\n<B>Mood:</b> {MOOD}<BR>\r\n<center><BR>{AVATAR}<br><BR><BR>\r\n\r\n<span class=\"main\">{IP}</span><BR></center>\r\n\r\n<BR></td>\r\n <td colspan=\"2\" id=\"postsdark\"><p>\r\n{IF_NOT_CLOSED}\r\n{IF_HAS_PERM}\r\n<div align=\"right\" valign=\"top\">\r\n<a href=\"moderator.php?&act=edit&page=posts&id={ID}\"><img src=\"{EDIT_IMAGE}\" border=\"0\"></a> &nbsp;&nbsp;&nbsp;&nbsp;<a href=\"moderator.php?act=delete&page=posts&id={ID}\"><img src=\"{DELETE_IMAGE}\" border=\"0\"></a>\r\n</div>\r\n{END_IF_HAS_PERM}\r\n{END_IF_NOT_CLOSED}\r\n{SHOW_POLL}\r\n<BR>\r\n{POST}\r\n<BR>\r\n{IF_EDITED}\r\n<BR><BR><BR><i>Post edited {WHATTIME} by {BYWHO}.</i>\r\n{END_IF_EDITED}\r\n<BR>\r\n<left>\r\n<BR><BR>\r\n{IF_HAS_SIG}\r\n<table border=\"1\" cellspacing=\"0\" cellpading=\"0\" bgcolor=\"ffffff\">\r\n<tr border=\"0\"><td border=\"0\"><span class=\"sig\">\r\n{SIGNATURE}</span>\r\n</td></tr></table><BR>\r\n<BR>\r\n{END_IF_HAS_SIG}\r\n\r\n{IF_ATTACHMENT}\r\n<i>Attachement: <a href=\"downloads.php?act=view&page={DOWNLOAD_URL}\">{DOWNLOAD_NAME}</a> ({NUM_DOWNLOADS})</i><br><BR>\r\n<BR>\r\n{END_IF_ATTACHMENT}\r\n</left>\r\n</td>\r\n  </tr>\r\n', 'DEFAULT', '')");

}
if ($_POST['Polls'] == "yes")
{
$sql = mysql_query("DELETE FROM template WHERE tpl_name='Poll showForm' OR tpl_name='Poll Results'");
$sql = mysql_query("INSERT INTO template VALUES ('', 'Poll showForm', '<BR><form action=\"{PHP_SELF}?act=vote\" method=\"post\">\r\n{IF_OPTION1}\r\n{OPTION1} <input type=\"radio\" name=\"vote\" value=\"1\"><BR>\r\n{END_IF_OPTION1}\r\n{IF_OPTION2}\r\n{OPTION2} <input type=\"radio\" name=\"vote\" value=\"2\"><BR>\r\n{END_IF_OPTION2}\r\n{IF_OPTION3}\r\n{OPTION3} <input type=\"radio\" name=\"vote\" value=\"3\"><BR>\r\n{END_IF_OPTION3}\r\n{IF_OPTION4}\r\n{OPTION4} <input type=\"radio\" name=\"vote\" value=\"4\"><BR>\r\n{END_IF_OPTION4}\r\n{IF_OPTION5}\r\n{OPTION5} <input type=\"radio\" name=\"vote\" value=\"5\"><BR>\r\n{END_IF_OPTION5}\r\n{IF_OPTION6}\r\n{OPTION6} <input type=\"radio\" name=\"vote\" value=\"6\"><BR>\r\n{END_IF_OPTION6}\r\n{IF_OPTION7}\r\n{OPTION7} <input type=\"radio\" name=\"vote\" value=\"7\"><BR>\r\n{END_IF_OPTION7}\r\n{IF_OPTION8}\r\n{OPTION8} <input type=\"radio\" name=\"vote\" value=\"8\"><BR>\r\n{END_IF_OPTION8}\r\n{IF_OPTION9}\r\n{OPTION9} <input type=\"radio\" name=\"vote\" value=\"9\"><BR>\r\n{END_IF_OPTION9}\r\n{IF_OPTION10}\r\n{OPTION10} <input type=\"radio\" name=\"vote\" value=\"10\"><BR>\r\n{END_IF_OPTION10}\r\n\r\n\r\n<input type=\"hidden\" name=\"pollid\" value=\"{POLL_ID}\">\r\n<input type=\"hidden\" name=\"oldpostid\" value=\"{POST_ID}\">\r\n<BR>\r\n<input type=\"submit\" value=\"Vote\">\r\n<BR>\r\n</form>\r\n<BR>', 'DEFAULT', '')");

$sql = mysql_query("INSERT INTO template VALUES ('', 'Poll Results', '<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">\r\n\r\n{IF_OPTION1}\r\n<tr><td> <span class=\"regular\"><B>{OPTION1}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH1}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT1}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES1})</span></td></tr>\r\n{END_IF_OPTION1}\r\n{IF_OPTION2}\r\n<tr><td> <span class=\"regular\"><B>{OPTION2}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH1}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT2}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES2})</span></td></tr>\r\n{END_IF_OPTION2}\r\n{IF_OPTION3}\r\n<tr><td> <span class=\"regular\"><B>{OPTION3}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH1}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT3}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES3})</span></td></tr>\r\n{END_IF_OPTION3}\r\n{IF_OPTION4}\r\n<tr><td> <span class=\"regular\"><B>{OPTION4}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH1}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT4}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES4})</span></td></tr>\r\n{END_IF_OPTION4}\r\n{IF_OPTION5}\r\n<tr><td> <span class=\"regular\"><B>{OPTION5}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH5}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT5}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES5})</span></td></tr>\r\n{END_IF_OPTION6}\r\n{IF_OPTION5}\r\n<tr><td> <span class=\"regular\"><B>{OPTION6}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH6}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT6}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES6})</span></td></tr>\r\n{END_IF_OPTION6}\r\n{IF_OPTION7}\r\n<tr><td> <span class=\"regular\"><B>{OPTION7}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH7}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT7}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES7})</span></td></tr>\r\n{END_IF_OPTION7}\r\n{IF_OPTION8}\r\n<tr><td> <span class=\"regular\"><B>{OPTION8}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH8}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT8}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES8})</span></td></tr>\r\n{END_IF_OPTION8}\r\n{IF_OPTION9}\r\n<tr><td> <span class=\"regular\"><B>{OPTION9}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH9}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT9}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES9})</span></td></tr>\r\n{END_IF_OPTION9}\r\n{IF_OPTION10}\r\n<tr><td> <span class=\"regular\"><B>{OPTION10}</b></span></td>\r\n<td><img height=\"9\" src=\"{VOTE_LEFT_IMAGE}\"><img height=\"9\" width=\"{WIDTH10}\" src=\"{VOTE_CENTER_IMAGE}\"><img height=\"9\" src=\"{VOTE_RIGHT_IMAGE}\"> <span class=\"regular\"><B>{PERCENT10}%</b></span> </td>\r\n<td><span class=\"main\">({VOTES10})</span></td></tr>\r\n{END_IF_OPTION10}\r\n\r\n</table>', 'DEFAULT', '')"); 
}
if ($_POST['icon'] == "yes")
{
	$sql = mysql_query("SELECT * FROM template WHERE tpl_name='viewPosts Reply'");
	while($reply = mysql_fetch_object($sql))
	{
		$new_template = $reply->template;
	}
	$new = str_replace("<img src=\"{NEWURL}images/posts/{ICON}.gif\">", "{ICON}", $new_template);

	$sql = mysql_query("UPDATE template SET template='$new' WHERE tpl_name='viewPosts Reply'");
}
echo "Upgrade successful! You should now delete this file, or others will be able to overwrite your skin to default at any point in time.";
}
else
{
?><B>Please select which type of upgrade you want:</b>
<form action="<?=$_SERVER['PHP_SELF']?>?act=proceed" method="post">
<input type="checkbox" name="viewPosts" value="yes"> By checking this, your viewPost layouts will be wiped out. This part of the upgrade only adds the "Points: {POINTS}" part to your post layouts, which can be done manually.<BR><BR>

<input type="checkbox" name="Polls" value="yes" checked> (Strongly Reccomended) If you don't check this, you will not be able to make use of all 10 options in polls, and you will may get some errors.<BR><BR>

<input type="checkbox" name="icon" value="yes" checked> (Reccomended) This one will fix a bug in your reply templates. It doesn't delete your old template, it simply takes your old one, and deletes the bug, leaving your old layout the same, without the bug.<BR><BR>
<input type="submit" value="Proceed with Upgrade!">
<?php
}

?>
</font>
</center>
</td>
</table>
<font face="Verdana, Arial, Helvetica"><B>Copyright &copy; SowiBB<BR>All Rights Reserved</b></font>
</font>
</center>
</body>
</html>
Return current item: SowiBB