diff --git a/ChangeLog b/ChangeLog index 4dced3f52..efe76bd12 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,15 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-07-09 Loïc Chapeaux + * db_details.php3, lines 273-275: vertically center bookmarks options. + * tbl_properties.php3: rewritten the script so it fits XHTML1.0 and PEAR + standards, limit the number of "options" displayed if the is no table + in the db and beautity a bit the display. + * languages files: replaced 'Gzip' by '"gzipped"'. + * Updated both the Czech translation thanks to + Michal Cihar . + 2001-07-09 Marc Delisle * bug 439572, left.php3: added a @ before mysql_list_tables, to try to get rid of a warning (cause: too many tables?) diff --git a/tbl_properties.php3 b/tbl_properties.php3 index b386f9969..7a932be61 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -1,590 +1,822 @@ =3) -{ - if(isset($submitcomment)) - $result = mysql_query("ALTER TABLE $table comment='$comment'") or mysql_die(); - if(isset($submittype)){ - $result = mysql_query("ALTER TABLE $table TYPE=$tbl_type") or mysql_die(); - } - if(isset($submitorderby) && !empty($order_field)){ - $result = mysql_query("ALTER TABLE $table ORDER BY $order_field") or mysql_die(); - } - $result = mysql_query("SHOW TABLE STATUS LIKE '$table'") or mysql_die(); - $showtable = mysql_fetch_array($result); - $show_comment=$showtable['Comment']; +/** + * Gets table informations + */ +// 1. Get table type and comments ('show table' works correct since 3.23.03) +if (MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION) >= 3) { + // Update table type, comment and order if required by the user + if (isset($submitcomment)) { + $result = mysql_query("ALTER TABLE $table COMMENT='$comment'") or mysql_die(); + } + if (isset($submittype)) { + $result = mysql_query("ALTER TABLE $table TYPE=$tbl_type") or mysql_die(); + } + if (isset($submitorderby) && !empty($order_field)) { + $result = mysql_query("ALTER TABLE $table ORDER BY $order_field") or mysql_die(); + } - if (!empty($showtable['Comment'])){ - echo "" . $showtable['Comment'] . "

\n"; - $show_comment=$showtable['Comment']; - } + // Get table type and comments + $result = mysql_query("SHOW TABLE STATUS LIKE '$table'") or mysql_die(); + $showtable = mysql_fetch_array($result); + $tbl_type = strtoupper($showtable['Type']); - $tbl_type=strtoupper($showtable['Type']); + if (!empty($showtable['Comment'])) { + $show_comment = $showtable['Comment']; + ?> + +

+ +

+ -> - - - - - - - - - - - + + + + + +
+ + + + + + + + + + + - - - - - - + $bgcolor = ($i % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo; + $query = "server=$server&lang=$lang&db=$db&table=$table&goto=tbl_properties.php3"; - - - - - - - - + $aryFields[] = $row['Field']; + + if (get_magic_quotes_runtime()) { + $type = stripslashes($row['Type']); + } else { + $type = $row['Type']; + } + // reformat mysql query output - staybyte - 9. June 2001 + $shorttype = substr($type, 0, 3); + if ($shorttype == 'set' || $shorttype == 'enu') { + $type = eregi_replace(',', ', ', $type); + } + $type = eregi_replace('BINARY', '', $type); + $type = eregi_replace('ZEROFILL', '', $type); + $type = eregi_replace('UNSIGNED', '', $type); + if (empty($type)) { + $type = ' '; + } + + $binary = eregi('BINARY', $row['Type'], $test); + $unsigned = eregi('UNSIGNED', $row['Type'], $test); + $zerofill = eregi('ZEROFILL', $row['Type'], $test); + $strAttribute = ' '; + if ($binary) + $strAttribute = 'BINARY'; + if ($unsigned) + $strAttribute = 'UNSIGNED'; + if ($zerofill) + $strAttribute = 'UNSIGNED ZEROFILL'; + + ?> + + + + + + + + + + + + + + +
  - - -   ">&zero_rows=">&zero_rows=">&zero_rows=">&zero_rows=">
     + + + + + + + + + +
-
- +
+ + + + +
0) -{ -echo " + + +3 && $tbl_type!="INNODB" && isset($showtable)){ - if ($indexcount>0) echo "\n"; - echo "\n"; - if (!empty($strSpaceUsage)) echo $strSpaceUsage.":\n"; - echo "
\n"; -if (!empty($strIndexes)) echo $strIndexes.":\n"; -?> -> - - - - - - +$index_count = count($ret_keys); +if ($index_count > 0) { + ?> + \n"; + echo "\n"; + ?> +
+ + + + + + + + "; - if($row["Key_name"] == "PRIMARY") - { - $sql_query = urlencode("ALTER TABLE ".$table." DROP PRIMARY KEY"); - $zero_rows = urlencode($strPrimaryKey." ".$strHasBeenDropped); + for ($i = 0; $i < $index_count; $i++) { + $row = $ret_keys[$i]; + if ($row['Key_name'] == 'PRIMARY') { + $sql_query = urlencode('ALTER TABLE ' . $table . ' DROP PRIMARY KEY'); + $zero_rows = urlencode($strPrimaryKey . ' ' . $strHasBeenDropped); + } else { + $sql_query = urlencode('ALTER TABLE ' . $table . ' DROP INDEX ' . $row['Key_name']); + $zero_rows = urlencode($strIndex . ' ' . $row['Key_name'] . ' ' . $strHasBeenDropped); } - else - { - $sql_query = urlencode("ALTER TABLE ".$table." DROP INDEX ".$row["Key_name"]); - $zero_rows = urlencode($strIndex." ".$row["Key_name"]." ".$strHasBeenDropped); - } - + echo "\n"; ?> - - - - + + + + + + "; } - print "
$strDrop";?>
+ + + + + + + $strDrop\n"; ?> +
\n"; - print show_docu("manual_Performance.html#MySQL_indexes"); - echo "
+ +
 
\n"; - echo ""; - echo '"; +if (MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION) > 3 && $tbl_type != "INNODB" && isset($showtable)) { + // Gets some sizes + list($data_size, $data_unit) = format_byte_down($showtable['Data_length']); + list($index_size, $index_unit) = format_byte_down($showtable['Index_length']); + if (!empty($showtable['Data_free'])) { + list($free_size, $free_unit) = format_byte_down($showtable['Data_free']); + } + list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']); + list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']); - // Data - echo "\n"; - list($size,$unit)=format_byte_down($showtable["Data_length"]); - echo ""; - echo "\n"; - // Index - echo "\n"; - list($size,$unit)=format_byte_down($showtable["Index_length"]); - echo ''; - echo "\n"; - // Overhead - if (isset($showtable["Data_free"]) && $showtable["Data_free"]!=0){ - echo "\n"; - list($size,$unit)=format_byte_down($showtable["Data_free"]); - echo "'; - echo "\n"; - // Effective - echo "\n"; - list($size,$unit)=format_byte_down($showtable["Data_length"]+$showtable["Index_length"]-$showtable["Data_free"]); - echo "'; - echo "\n"; - } - // Total - echo "\n"; - list($size,$unit)=format_byte_down($showtable["Data_length"]+$showtable["Index_length"]); - echo ''; - echo "\n"; + // Displays them + if ($index_count > 0) { + echo ' ' . "\n"; + } + ?> + + - if (!empty($showtable["Data_free"]) - and ($tbl_type=="MYISAM" or $tbl_type=="BDB")){ - echo ""; - echo ""; - echo "\n"; - } - echo "
$strType'; - if (!empty($strUsage)) echo $strUsage; - echo "
"; - if (!empty($strData)) echo UCFirst($strData); - echo "".$size."".$unit."
' . UCFirst($strIndex) . '' . $size . '' . $unit . '
"; - if (!empty($strOverhead)) echo UCFirst($strOverhead); - echo '' . $size . '' . $unit . '
"; - if (!empty($strOverhead)) echo UCFirst($strEffective); - echo '' . $size . '' . $unit . '
' . UCFirst($strTotal) . '' . $size . '' . $unit . '
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ &pos=0&">[] +
+
"; - $query = "server=$server&lang=$lang&db=$db&table=$table&goto=tbl_properties.php3"; - echo "[$strOptimizeTable]"; - echo "
\n"; - echo "\n"; - -// Rows Statistic - echo " \n"; - echo "\n"; - if (!empty($strRowsStatistic)) echo $strRowsStatistic.":\n"; - echo "\n"; - echo ""; - echo '\n"; - - $i=0; - if (isset($showtable["Row_format"])){ - echo (++$i%2)?"\n"; - } - if (isset($showtable["Rows"])){ - echo (++$i%2)?"' . "\n"; - } - if (isset($showtable["Avg_row_length"])){ - echo (++$i%2)?"' . "\n"; - } - if (isset($showtable["Auto_increment"])){ - echo (++$i%2)?"' . "\n"; - } - - echo "
"; - if (!empty($strStatement)) echo $strStatement; - echo "'; - if (!empty($strValue)) echo $strValue; - echo "
":"
\n"; - if (!empty($strFormat)) echo UCFirst($strFormat); - echo ""; - if ($showtable["Row_format"]=="Fixed" && !empty($strFixed)) echo $strFixed; - else if ($showtable["Row_format"]=="Dynamic" && !empty($strDynamic)) echo $strDynamic; - else echo $showtable["Row_format"]; - echo "
":"
\n"; - if (!empty($strRows)) echo UCFirst($strRows); - echo '' . $showtable['Rows'] . '
":"
\n"; - if (!empty($strRowLength)) echo UCFirst($strRowLength); - echo " ø"; - echo '' . $showtable['Avg_row_length'] . '
":"
\n"; - echo UCFirst($strNext) . ' Autoindex'; - echo '' . $showtable['Auto_increment'] . '
\n"; + +   + + + + + + + + ' + : ' '; + echo "\n"; + ?> + + + + ' + : ' '; + echo "\n"; + ?> + + + + ' + : ' '; + echo "\n"; + ?> + + + + ' + : ' '; + echo "\n"; + ?> + + + + +
+ +
+ +
+ +
+ +
+ + - -
-
- - + +
  •  
  • +
    -
  •   -
    - - - - - - -:
    - -
    + + + + +
      + + +
    • + +
    • + + +
    • + + + + + + + +  :
      +
      0) - { - echo "$strOr $strBookmarkQuery:
      \n"; - echo "' . "\n"; + echo ' ' . "\n"; + while (list($key, $value) = each($bookmark_list)) { + echo ' ' . "\n"; } - echo "\n"; - echo "".$strSubmit; - echo "".$strBookmarkView; - echo "".$strDelete; - echo "
      \n"; + echo ' ' . "\n"; + echo ' ' . $strSubmit . "\n"; + echo '  ' . $strBookmarkView . "\n"; + echo '  ' . $strDelete . "\n"; + echo '
      ' . "\n"; } } ?> - -
    • - + + + -
    •   - - -
      - &pos=0&"> -" . $strBrowse. ""; ?> -  - " . $strSelect . ""; ?> -  - " . $strInsert. ""; ?>
    • - -  -
    •   -: -
      - - - - - + +
    • + &pos=0&"> +  -  + +  -  + + +
      +
    • + + +
    • + + + + + +  : + + \n"; ?> - -
    • - -=3.23 && MYSQL_MINOR_VERSION>=34){ ?> -
    •   -: -
      - - - - + + +
      +
    • + \n"; -reset($aryFields); -while(list ($junk,$fieldname) = each($aryFields)) { - echo "\n"; -} -echo "\n"; -?> - - - - - -
    •   - - - -
    •   -

      - - - - - - - - - - \n"; - echo "".$strGzip."\n"; - echo "\n"; - } - ?> - - - - - - - - - - -
      - - - - - -
      - - - -
      - - - -
      - - - - - -
      - - - - - -
      - - -
    •   - - -
      -
      :
      - -
      - - - - - -
      -
      -
        -
      - - - - - - -
      - - - - - -
      -
      - -
      -
      -
      - -=22) -{ -?> - - - -
    •   - - - - - - - - - - - - - - - - - - - - - -
       &display=simple&"> - -   -  - &display=simple&"> - -   -
      &display=simple&"> - -   -  - &display=simple&"> - -   - -
      - - -  - - -
    •   - -
      - - - - -  
      "; +if (MYSQL_MAJOR_VERSION >= 3.23 && MYSQL_MINOR_VERSION >= 34) { ?> - -
    •   - -0){ - while($tmp=mysql_fetch_array($result)){ - if (isset($tmp["Variable_name"])) switch ($tmp["Variable_name"]){ - case 'have_bdb': if (isset($tmp["Variable_name"]) && $tmp["Value"]=='YES') $tbl_bdb=true; break; - case 'have_gemini': if (isset($tmp["Variable_name"]) && $tmp["Value"]=='YES') $tbl_gemini=true; break; - case 'have_innodb': if (isset($tmp["Variable_name"]) && $tmp["Value"]=='YES') $tbl_innodb=true; break; - case 'have_isam': if (isset($tmp["Variable_name"]) && $tmp["Value"]=='YES') $tbl_isam=true; break; - } - } - } -?> -
      - - - - -  
      - - +
    • +
      + + + + +  : + + +   +
      +
    • + -
    •   -&display=simple&"> - -   - + + +
    • + +
    • + + +
    • +
      + + + + +
      + + + + + + + + + + + +
      + +    + + + +
      + +    + + + +
      + +    + + onclick="if (!document.forms['tbl_dump'].elements['asfile'].checked) document.forms['tbl_dump'].elements['gzip'].checked = false" /> + + () + -
      + + + + + +  ->  +   + +   + + + + + + + + + +
      +
    • + + +
    • + + + + + + +
      +
      + + + + + + + + + + + + + + + +
      +  : +
      + +
      + +
      +
      +
        +
      + + + + + + + + + + + + + + + + +
      +  : +
      + +
      + +   
      + +    +
      + +
      +
      +
      +
    • + "; -require("./footer.inc.php3"); +if (MYSQL_MAJOR_VERSION == '3.23' && intval(MYSQL_MINOR_VERSION) >= 22) { + if ($tbl_type == 'MYISAM' or $tbl_type == 'BDB') { + ?> + +
    • + + + + + + + + + + + + + + + + + + + +
       :  + &display=simple&"> +   + +  -  + &display=simple&"> +   + +
        + &display=simple&"> +   + +  -  + &display=simple&"> +   + +

      +
    • + + + +
    • +
      + + + + +  :  +   + +
      +
    • + + + 0) { + while ($tmp = mysql_fetch_array($result)) { + if (isset($tmp['Variable_name'])) { + switch ($tmp['Variable_name']) { + case 'have_bdb': + if ($tmp['Value'] == 'YES') { + $tbl_bdb = true; + } + break; + case 'have_gemini': + if ($tmp['Value'] == 'YES') { + $tbl_gemini = true; + } + break; + case 'have_innodb': + if ($tmp['Value'] == 'YES') { + $tbl_innodb = true; + } + break; + case 'have_isam': + if ($tmp['Value'] == 'YES') { + $tbl_isam = true; + } + break; + } // end switch + } // end if isset($tmp['Variable_name']) + } // end while + } // end if $result + echo "\n"; + ?> +
    • +
      + + + + +  :  +   + +
      +
    • + = 3.23 + +else { // MySQL < 3.23 + // FIXME: find a way to know the table type, then let OPTIMIZE if MYISAM or + // BDB + ?> + +
    • +  :  + &display=simple&"> +   + +
    • + + +
    + + + + + + \ No newline at end of file