Fixed some coding inconcistencies

This commit is contained in:
Loïc Chapeaux
2001-08-03 13:59:05 +00:00
parent 2bcac2ef74
commit ed04c1e6b0
9 changed files with 154 additions and 154 deletions

View File

@@ -129,11 +129,12 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
</td>
<?php
echo "\n";
$mergetable=false;
if (isset($sts_data['Type']) && $sts_data['Type']=="MRG_MyISAM") $mergetable=true;
if (isset($sts_data['Rows']))
{
if ($mergetable == false){
$mergetable = FALSE;
if (isset($sts_data['Type']) && $sts_data['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
}
if (isset($sts_data['Rows'])) {
if ($mergetable == FALSE) {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize;
$sum_entries += $sts_data['Rows'];
@@ -143,28 +144,29 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
}
}
else if ($mergetable == true) // MyISAM MERGE Table
{
$formated_size="&nbsp;-&nbsp;";
$unit="";
// MyISAM MERGE Table
else if ($mergetable == TRUE) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
else
{
$formated_size="unknown";
$unit="";
else {
$formated_size = 'unknown';
$unit = '';
}
?>
<td align="right">
<?php
if ($mergetable == true) echo "<i>";
echo number_format($sts_data['Rows'], 0, $number_decimal_separator,
$number_thousands_separator) . "\n";
if ($mergetable == true) echo "</i>";
echo "\n";
if ($mergetable == TRUE) {
echo '<i>' . number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . '</i>' . "\n";
} else {
echo number_format($sts_data['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n";
}
?>
</td>
<td align="right" nowrap="nowrap">
&nbsp;&nbsp;
<a href="tbl_properties.php3?<?php echo $url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
<a href="tbl_properties.php3?<?php echo $url_query; ?>>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
</td>
<?php
} else {

View File

@@ -7,15 +7,14 @@
*/
require('./lib.inc.php3');
require('./ob_lib.inc.php3');
if ($cfgOBGzip)
{
if ($cfgOBGzip) {
$ob_mode = out_buffer_mode_get();
if ($ob_mode) {
out_buffer_pre($ob_mode);
}
}
/**
* Sends http headers
*/

View File

@@ -134,14 +134,10 @@ if ($server > 0
// find, in most cases it's probably the one he just dropped :)
// (Note: we only get here after a browser reload, I don't know why)
if (!$create) {
if (empty($cfgServer['port'])) {
$userlink = mysql_connect($cfgServer['host'], $cfgServer['user'],
$cfgServer['password']) or mysql_die();
$userlink = mysql_connect($cfgServer['host'], $cfgServer['user'], $cfgServer['password']) or mysql_die();
} else {
$userlink = mysql_connect($cfgServer['host'].":".
$cfgServer['port'], $cfgServer['user'],
$cfgServer['password']) or mysql_die();
$userlink = mysql_connect($cfgServer['host'] . ':' . $cfgServer['port'], $cfgServer['user'], $cfgServer['password']) or mysql_die();
}
$rs_usr = mysql_query('SELECT Db FROM mysql.db WHERE User = \'' . sql_addslashes($cfgServer['user']) . '\'', $stdlink);
while ($row = mysql_fetch_array($rs_usr)) {
@@ -228,7 +224,7 @@ if ($server > 0
echo "\n";
} // end of 2.1 (AdvAuth case)
// 2.2. No authentification
// 2.2. No authentication
else
{
?>

View File

@@ -1,10 +1,10 @@
<?php
/* $Id$ */
if (!defined('__OB_LIB_INC__')) {
define('__OB_LIB_INC__', 1);
# Output buffer functions for phpMyAdmin
# Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
@@ -80,6 +80,6 @@
return $retval;
}
} // INC
} // $__OB_LIB_INC__
?>

View File

@@ -1,5 +1,5 @@
<?php
/* $Id$ */
/* $Id: tbl_change.php3,v 1.26 2001/08/03 12:22:16 lem9 Exp */
/**
@@ -117,12 +117,12 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
// Change by Bernard M. Piller <bernard@bmpsystems.com>
// We don't want binary data to be destroyed
// Note: from the MySQL manual: "BINARY doesn't affect how the column
// is stored or retrieved" so it does not mean that the contents
// is binary
// Note: from the MySQL manual: "BINARY doesn't affect how the column is
// stored or retrieved" so it does not mean that the contents is
// binary
//if ((strstr($row_table_def['Type'], 'blob') || strstr($row_table_def['Type'], 'binary'))
//if (strstr($row_table_def['Type'], 'blob')
// && !empty($data)) {
if (strstr($row_table_def['True_Type'], 'blob')
&& !empty($data)
&& $cfgProtectBlob == TRUE) {
@@ -130,7 +130,8 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
} else {
?>
<td>
<select name="funcs[<?php echo $field; ?>]"> <option>
<select name="funcs[<?php echo $field; ?>]">
<option></option>
<?php
echo "\n";
if (!$first_timestamp) {
@@ -190,7 +191,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|| ($data == ''
&& isset($row_table_def['Default'])
&& $set[$j] == $row_table_def['Default'])) {
echo ' selected';
echo ' selected="selected"';
}
echo '>' . htmlspecialchars($set[$j]) . '</option>' . "\n";
} // end for
@@ -267,8 +268,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
}
// Change by Bernard M. Piller <bernard@bmpsystems.com>
// We don't want binary data destroyed
else if (strstr($row_table_def['Type'], 'blob')
&& !empty($data)) {
else if (strstr($row_table_def['Type'], 'blob') && !empty($data)) {
if ($cfgProtectBlob == TRUE) {
echo "\n";
?>
@@ -276,15 +276,16 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
<?php echo $strBinaryDoNotEdit . "\n"; ?>
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" />
</td>
<?php }
else {
<?php
} else {
echo "\n";
?>
<td>
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>"><?php if (!empty($special_chars)) echo $special_chars . "\n"; ?></textarea>
</td>
<?php
}
}
} // end if...else
} // end else if
else {
$fieldsize = (($len > 40) ? 40 : $len);
echo "\n";

View File

@@ -266,14 +266,16 @@ if ($index_count > 0) {
?>
<?php
// BEGIN - Calc Table Space - staybyte - 9 June 2001
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type != "INNODB" && isset($showtable)) {
if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type != 'INNODB' && isset($showtable)) {
// Gets some sizes
$mergetable=false;
if (isset($showtable['Type']) && $showtable['Type']=="MRG_MyISAM") $mergetable=true;
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
}
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable==false) list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
if ($mergetable == FALSE) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
}
@@ -304,6 +306,7 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
<td><?php echo $data_unit; ?></td>
</tr>
<?php
echo "\n";
if (isset($index_size)) {
?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>">
@@ -313,8 +316,8 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
</tr>
<?php
}
if (isset($free_size)) {
echo "\n";
if (isset($free_size)) {
?>
<tr bgcolor="<?php echo $cfgBgcolorTwo; ?>" style="color: #bb0000">
<td style="padding-right: 10px"><?php echo ucfirst($strOverhead); ?></td>
@@ -328,8 +331,8 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
</tr>
<?php
}
if (isset($tot_size) && $mergetable == FALSE) {
echo "\n";
if (isset($tot_size) && $mergetable == false) {
?>
<tr bgcolor="<?php echo $cfgBgcolorOne; ?>">
<td style="padding-right: 10px"><?php echo ucfirst($strTotal); ?></td>
@@ -338,7 +341,6 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
</tr>
<?php
}
// Optimize link if overhead
if (isset($free_size) && ($tbl_type == 'MYISAM' || $tbl_type == 'BDB')) {
echo "\n";
@@ -398,7 +400,7 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
?>
<td><?php echo ucfirst($strRows); ?></td>
<td align="right" nowrap="nowrap">
<?php echo number_format($showtable['Rows'], 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])."\n"; ?>
<?php echo number_format($showtable['Rows'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td>
</tr>
<?php
@@ -411,12 +413,12 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
?>
<td><?php echo ucfirst($strRowLength); ?>&nbsp;&oslash;</td>
<td align="right" nowrap="nowrap">
<?php echo number_format($showtable['Avg_row_length'], 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])."\n"; ?>
<?php echo number_format($showtable['Avg_row_length'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td>
</tr>
<?php
}
if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable==false) {
if (isset($showtable['Data_length']) && $showtable['Rows'] > 0 && $mergetable == FALSE) {
echo (++$i%2)
? ' <tr bgcolor="' . $cfgBgcolorTwo . '">'
: ' <tr bgcolor="' . $cfgBgcolorOne . '">';
@@ -437,7 +439,7 @@ if (MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type
?>
<td><?php echo ucfirst($strNext); ?>&nbsp;Autoindex</td>
<td align="right" nowrap="nowrap">
<?php echo number_format($showtable['Auto_increment'], 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator'])."\n"; ?>
<?php echo number_format($showtable['Auto_increment'], 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?>
</td>
</tr>
<?php

View File

@@ -130,7 +130,7 @@ while ($i < mysql_num_rows($tbl_result)) {
$fld[$k++] = backquote($tbl) . '.*';
while ($j < mysql_num_fields($fld_results)) {
$fld[$k] = mysql_field_name($fld_results, $j);
$fld[$k] = backquote($tbl) . '.' . $fld[$k];
$fld[$k] = backquote($tbl) . '.' . backquote($fld[$k]);
$k++;
$j++;
} // end while
@@ -431,8 +431,9 @@ for ($y = 0; $y <= $row; $y++) {
continue;
}
if (isset($AndOrRow[$y])) $curAndOrRow[$w] = $AndOrRow[$y];
if (isset($AndOrRow[$y])) {
$curAndOrRow[$w] = $AndOrRow[$y];
}
if (isset($AndOrRow[$y]) && $AndOrRow[$y] == 'and') {
$chk['and'] = ' checked="checked"';
$chk['or'] = '';
@@ -500,14 +501,17 @@ for ($y = 0; $y <= $row; $y++) {
} else {
$stripped_or = ${$or}[$x];
}
} else {
$stripped_or = '';
}
else $stripped_or="";
?>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<textarea cols="20" rows="2" style="width: <?php echo $widem; ?>" name="Or<?php echo $w . '[' . $z . ']'; ?>"><?php echo htmlspecialchars($stripped_or); ?></textarea>
</td>
<?php
if (isset(${$or}[$x])) ${'cur' . $or}[$z] = ${$or}[$x];
if (isset(${$or}[$x])) {
${'cur' . $or}[$z] = ${$or}[$x];
}
$z++;
} // end for
$w++;
@@ -557,7 +561,9 @@ for ($x = 0; $x < $col; $x++) {
continue;
}
if (isset($AndOrCol[$y])) $curAndOrCol[$z] = $AndOrCol[$y];
if (isset($AndOrCol[$y])) {
$curAndOrCol[$z] = $AndOrCol[$y];
}
if (isset($AndOrCol[$z]) && $AndOrCol[$z] == 'or') {
$chk['or'] = ' checked="checked"';
$chk['and'] = '';

View File

@@ -71,18 +71,13 @@ if (!isset($param) || $param[0] == '') {
echo "\n";
for ($i = 0; $i < $fields_count; $i++) {
$bgcolor = ($i % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo;
$fieldsize = (($fields_len[$i] > 40) ? 40 : $fields_len[$i]);
?>
<tr bgcolor="<?php echo $bgcolor; ?>">
<td><?php echo htmlspecialchars($fields_list[$i]); ?></td>
<td><?php echo $fields_type[$i]; ?></td>
<td>
<?php
$fieldsize = (($fields_len[$i] > 40)
? 40 : $fields_len[$i]);
?>
<input type="text" name="fields[]"
size="<?php echo $fieldsize; ?>"
maxlength="<?php echo $fields_len[$i]; ?>" />
<input type="text" name="fields[]" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $fields_len[$i]; ?>" />
<input type="hidden" name="names[]" value="<?php echo urlencode($fields_list[$i]); ?>" />
<input type="hidden" name="types[]" value="<?php echo $fields_type[$i]; ?>" />
</td>
@@ -152,8 +147,7 @@ else {
$cmp = '';
}
} // end if
$sql_query .= ' AND ' . backquote(urldecode($names[$i]))
. ' ' . "$cmp $quot$fields[$i]$quot";
$sql_query .= ' AND ' . backquote(urldecode($names[$i])) . " $cmp $quot$fields[$i]$quot";
} // end if
} // end for
} // end if