mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fix a couple of problems, debug option, XHTML compliance
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/e107_update.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/e107_update.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2007-12-06 21:38:20 $
|
| $Date: 2008-06-16 20:48:47 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -47,7 +47,7 @@ function run_updates($dbupdate)
|
|||||||
function show_updates($dbupdate)
|
function show_updates($dbupdate)
|
||||||
{
|
{
|
||||||
global $ns;
|
global $ns;
|
||||||
$text = "<form method='POST' action='".e_SELF."'>
|
$text = "<form method='post' action='".e_SELF."'>
|
||||||
<div style='width:100%'>
|
<div style='width:100%'>
|
||||||
<table class='fborder' style='".ADMIN_WIDTH."'>
|
<table class='fborder' style='".ADMIN_WIDTH."'>
|
||||||
<tr>
|
<tr>
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
||||||
| $Revision: 1.22 $
|
| $Revision: 1.23 $
|
||||||
| $Date: 2008-06-16 20:08:10 $
|
| $Date: 2008-06-16 20:48:47 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -504,6 +504,7 @@ function update_706_to_800($type='')
|
|||||||
{ // Changes needed
|
{ // Changes needed
|
||||||
if ($just_check) return update_needed("Field changes rqd; table: ".$ct);
|
if ($just_check) return update_needed("Field changes rqd; table: ".$ct);
|
||||||
// Do the changes here
|
// Do the changes here
|
||||||
|
if (E107_DBG_FILLIN8) echo "List of changes found:<br />".$db_parser->make_changes_list($diffs);
|
||||||
$qry = 'ALTER TABLE '.MPREFIX.$ct.' '.implode(', ',$diffs[1]);
|
$qry = 'ALTER TABLE '.MPREFIX.$ct.' '.implode(', ',$diffs[1]);
|
||||||
if (E107_DBG_FILLIN8) echo "Update Query used: ".$qry."<br />";
|
if (E107_DBG_FILLIN8) echo "Update Query used: ".$qry."<br />";
|
||||||
mysql_query($qry);
|
mysql_query($qry);
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2008-06-15 09:52:09 $
|
| $Date: 2008-06-16 20:48:47 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -241,6 +241,27 @@ class db_table_admin
|
|||||||
{ // Names differ, so need to add or subtract a field.
|
{ // Names differ, so need to add or subtract a field.
|
||||||
// echo $i.': names differ - '.$list1[$i]['name'].', '.$list2[0]['name'].'<br />';
|
// echo $i.': names differ - '.$list1[$i]['name'].', '.$list2[0]['name'].'<br />';
|
||||||
if ($stop_on_error) return FALSE;
|
if ($stop_on_error) return FALSE;
|
||||||
|
$found = FALSE;
|
||||||
|
for ($k = $i+1; $k < count($list1); $k++)
|
||||||
|
{
|
||||||
|
// echo "Compare ".$list1[$k]['name'].' with '.$list2[0]['name'];
|
||||||
|
if (strcasecmp($list1[$k]['name'],$list2[0]['name']) == 0)
|
||||||
|
{ // Field in list2 found later in list1; do nothing
|
||||||
|
// echo " - match<br />";
|
||||||
|
$found = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// echo " - no match<br />";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$found)
|
||||||
|
{ // Field in existing DB no longer required
|
||||||
|
$error_list[] = 'Obsolete field: '.$list2[0]['name'];
|
||||||
|
$change_list[] = 'DROP '.($list2[0]['type'] == 'field' ? '' : 'INDEX ').$list2[0]['name'];
|
||||||
|
array_shift($list2);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$found = FALSE;
|
$found = FALSE;
|
||||||
for ($k = 0; $k < count($list2); $k++)
|
for ($k = 0; $k < count($list2); $k++)
|
||||||
{
|
{
|
||||||
@@ -361,6 +382,20 @@ class db_table_admin
|
|||||||
return array($error_list, $change_list);
|
return array($error_list, $change_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function make_changes_list($result)
|
||||||
|
{
|
||||||
|
if (!is_array($result)) return "Not an array<br />";
|
||||||
|
$text = "<table>";
|
||||||
|
for ($i = 0; $i < count($result[0]); $i++)
|
||||||
|
{
|
||||||
|
$text .= "<tr><td>{$result[0][$i]}</td>";
|
||||||
|
$text .= "<td>{$result[1][$i]}</td>";
|
||||||
|
$text .= "</tr>\n";
|
||||||
|
}
|
||||||
|
$text .= "</table><br /><br />";
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return a table of info from the output of get_table_def
|
// Return a table of info from the output of get_table_def
|
||||||
function make_table_list($result)
|
function make_table_list($result)
|
||||||
|
Reference in New Issue
Block a user