Merged patch #455484 ("Smart" order) thanks to Jakub Wilk

This commit is contained in:
Loïc Chapeaux
2001-08-27 16:24:52 +00:00
parent b1c32efa70
commit 4e5b85c29b
3 changed files with 39 additions and 31 deletions

View File

@@ -279,9 +279,10 @@
<dt><b>$cfgServers[n]['connect_type']</b> string</dt>
<dd>
What type connection to use with the MySQL server. Your options are 'socket' &amp;
'tcp'. It defaults to 'tcp' as that is nearly guarenteed to be available on all MySQL
servers, while sockets are not supported on some platforms.
What type connection to use with the MySQL server. Your options are
'socket' &amp; 'tcp'. It defaults to 'tcp' as that is nearly guarenteed
to be available on all MySQL servers, while sockets are not supported
on some platforms.
<br /><br />
</dd>
@@ -314,7 +315,8 @@
</ul>
Advanced authentication is secure as the standard user needs just
read-only-access to the mysql database.<br /><br />
read-only-access to the mysql database.
<br /><br />
All you have to provide in config.inc is a standard user which can
connect to MySQL and read the mysql user/db table
@@ -470,11 +472,12 @@
<br /><br />
</dd>
<dt><b>$cfgOrder </b>string [<tt>"DESC"</tt>|<tt>"ASC"</tt>]</dt>
<dt><b>$cfgOrder </b>string [<tt>DESC</tt>|<tt>ASC</tt>|<tt>SMART</tt>]</dt>
<dd>
Defines whether fields are displayed in ascending (<tt>"ASC"</tt>)
order or in descending (<tt>"DESC"</tt>) order when you click on the
field-name.
Defines whether fields are displayed in ascending (<tt>ASC</tt>) order,
in descending (<tt>DESC</tt>) order or in a "smart" (<tt>SMART</tt>)
order -ie descending order for fields of type TIME, DATE, DATETIME &
TIMESTAMP, ascending order else- by default.
<br /><br />
</dd>
@@ -746,8 +749,8 @@
If you're running a server which cannot be accessed by other people, it's
sufficient to use the directory protection bundled with your webserver
(with Apache you can use <i>.htaccess</i> files, for example).<br />
If other people have telnet access to your server,
you should use phpMyAdmin's advanced authentication feature.
If other people have telnet access to your server, you should use
phpMyAdmin's advanced authentication feature.
<br /><br />
Suggestions:
</p>
@@ -885,18 +888,17 @@
<p>
<b>I have found a bug. How do I inform developpers?</b>
<br />
Our Bug Tracker is located at <a href="http://sourceforge.net/projects/phpmyadmin">
http://sourceforge.net/projects/phpmyadmin</a>
under the Bugs section.
<br />
<br />
But please first discuss your bug with other users:
Our Bug Tracker is located at <a href="http://sourceforge.net/projects/phpmyadmin">
http://sourceforge.net/projects/phpmyadmin</a> under the Bugs section.
<br /><br />
But please first discuss your bug with other users:
<br />
<a href="http://sourceforge.net/projects/phpmyadmin">
http://sourceforge.net/projects/phpmyadmin</a> (and choose Forums)
http://sourceforge.net/projects/phpmyadmin</a> (and choose Forums)
<br />
<a href="http://www.phpwizard.net/projects/phpMyAdmin">
http://www.phpwizard.net/projects/phpMyAdmin</a> (and choose Support Forum)
http://www.phpwizard.net/projects/phpMyAdmin</a> (and choose Support
Forum)
</p>

View File

@@ -97,14 +97,18 @@ unset($cfgServers[0]);
$cfgConfirm = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE'
$cfgPersistentConnections = FALSE; // use persistent connections to MySQL database
$cfgShowBlob = FALSE; // display blob field contents in browse mode
$cfgProtectBlob = TRUE; // disallow editing of blob fields in edit mode
$cfgProtectBlob = TRUE; // disallow editing of blob fields in edit mode
$cfgAllowUserDropDatabase = FALSE; // disallow users to delete their own database
$cfgShowSQL = TRUE; // show SQL queries as run
$cfgSkipLockedTables = FALSE; // mark used tables, make possible to show
// locked tables (since MySQL 3.23.30)
$cfgMaxRows = 30; // maximum number of rows to display in browse mode
$cfgOrder = 'ASC'; // default for 'ORDER BY' clause
$cfgOBGzip = TRUE; // GZIP output buffering
$cfgOrder = 'ASC'; // default for 'ORDER BY' clause (valid
// values are 'ASC', 'DESC' or 'SMART' -ie
// descending order for fields of type
// TIME, DATE, DATETIME & TIMESTAMP,
// ascending order else-)
$cfgOBGzip = TRUE; // GZIP output buffering
$cfgGZipDump = TRUE; // Allow the use of gzip/bzip compression
$cfgBZipDump = TRUE; // for dump files

View File

@@ -146,25 +146,22 @@ if (!defined('__LIB_INC__')){
}
echo '<b>'. $GLOBALS['strError'] . '</b>' . "\n";
if (!empty($the_query)) {
// if the config password is wrong, or the MySQL server does not
// respond, do not show the query that would reveal the
// username/password
if (!empty($the_query) && !strstr($the_query, 'connect')) {
$query_base = htmlspecialchars($the_query);
$query_base = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $query_base);
echo '<p>' . "\n";
// if the config password is wrong, or the MySQL server does not respond,
// do not show the query that would reveal the username/password
if (!strstr($query_base,"connect")) {
echo ' ' . $GLOBALS['strSQLQuery'] . '&nbsp;:&nbsp;' . "\n";
if ($is_modify_link) {
echo ' ['
. '<a href="db_details.php3?lang=' . $GLOBALS['lang'] . '&server=' . urlencode($GLOBALS['server']) . '&db=' . urlencode($GLOBALS['db']) . '&sql_query=' . urlencode($the_query) . '&show_query=y">' . $GLOBALS['strEdit'] . '</a>'
. ']' . "\n";
}
} // end if
echo '<pre>' . "\n" . $query_base . "\n" . '</pre>' . "\n";
echo '</p>' . "\n";
}
}
} // end if
if (!empty($error_message)) {
$error_message = htmlspecialchars($error_message);
$error_message = ereg_replace("((\015\012)|(\015)|(\012)){3,}", "\n\n", $error_message);
@@ -1079,7 +1076,12 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
}
// 3. Do define the sorting url
if (!$is_in_sort) {
$sort_order = ' ORDER BY ' . backquote($field->name) . ' ' . $GLOBALS['cfgOrder'];
// loic1: patch #455484 ("Smart" order)
$cfgOrder = strtoupper($GLOBALS['cfgOrder']);
if ($cfgOrder == 'SMART') {
$cfgOrder = (eregi('time|date', $field->type)) ? 'DESC' : 'ASC';
}
$sort_order = ' ORDER BY ' . backquote($field->name) . ' ' . $cfgOrder;
$order_img = '';
}
else if (substr($sql_order, -3) == 'ASC' && $is_in_sort) {