mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Fix a couple of problems, debug option, XHTML compliance
This commit is contained in:
parent
fd2c1c212e
commit
ca8683cdac
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/e107_update.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2007-12-06 21:38:20 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2008-06-16 20:48:47 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -47,7 +47,7 @@ function run_updates($dbupdate)
|
||||
function show_updates($dbupdate)
|
||||
{
|
||||
global $ns;
|
||||
$text = "<form method='POST' action='".e_SELF."'>
|
||||
$text = "<form method='post' action='".e_SELF."'>
|
||||
<div style='width:100%'>
|
||||
<table class='fborder' style='".ADMIN_WIDTH."'>
|
||||
<tr>
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
||||
| $Revision: 1.22 $
|
||||
| $Date: 2008-06-16 20:08:10 $
|
||||
| $Revision: 1.23 $
|
||||
| $Date: 2008-06-16 20:48:47 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -504,6 +504,7 @@ function update_706_to_800($type='')
|
||||
{ // Changes needed
|
||||
if ($just_check) return update_needed("Field changes rqd; table: ".$ct);
|
||||
// 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]);
|
||||
if (E107_DBG_FILLIN8) echo "Update Query used: ".$qry."<br />";
|
||||
mysql_query($qry);
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2008-06-15 09:52:09 $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2008-06-16 20:48:47 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -238,9 +238,30 @@ class db_table_admin
|
||||
elseif ($list1[$i]['type'] == $list2[0]['type'])
|
||||
{ // Worth doing a compare - fields are same type
|
||||
if (strcasecmp($list1[$i]['name'],$list2[0]['name']) != 0)
|
||||
{ // 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 />';
|
||||
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;
|
||||
for ($k = 0; $k < count($list2); $k++)
|
||||
{
|
||||
@ -360,6 +381,20 @@ class db_table_admin
|
||||
if ($stop_on_error) return TRUE; // If doing a simple comparison and we get to here, all matches
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user