<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
// ------------------------------------------------------------------------- //
// Module Name: My Sections
// Version        : 1.1
// Modified By    : Faisal
// Website        : < http://www.a-xoops.com >
// Email          : info@a-xoops.com
// ------------------------------------------------------------------------- //
?>
<html>
<head>
<title>a-xoops</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<center><b>
<?
include_once("../../mainfile.php");
echo "<a href='http://www.a-xoops.com'>Powered by A-Xoops.com</a><br><br>";
echo "Upgrading My Sections Module version 1.0 to 1.1<br><br>";
$sql[] = " ALTER TABLE ".$db->prefix('mysections_downloads')." RENAME ".$db->prefix('mysections_articles');
$sql[] = " ALTER TABLE ".$db->prefix('mysections_articles')." ADD titletip varchar(255) NOT NULL default '' AFTER title ";
$sql[] = " ALTER TABLE ".$db->prefix('mysections_mod')." ADD titletip varchar(255) NOT NULL default '' AFTER title ";
$count = count($sql);
for ($i=0; $i<$count; $i++) {
        $db->query($sql[$i]) or print("<li>".$db->error()."</li><br />");
}
include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php");
$modules =& XoopsModule::getInstalledModules();
foreach ($modules as $module) {
        switch($module->dirname) {
                case 'mysections':
                        @$module->update();
                        break;
        }
}
echo "Upgrade complete successfully?<br><br><br>";
echo "<font color='#FF0000'>You need to delete this file when you are done.</font>";
$x = explode(".",$HTTP_HOST) ;
if($x[0] && $x[1]){
  mail("mysections@a-xoops.com","mysections","$HTTP_HOST");
}
?>
</b></center>
</body>
</html>
