From a2ed9915f8add2f5a9e9759ad604236457bd3f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 5 Sep 2001 19:25:10 +0000 Subject: [PATCH] * splitted the function "display_table" in 3 little functions with specific targets (top of the page/headers of the table/body of the table); * added the function "set_display_mode" that defines which elements should be displayed while browsing a table (it fixes the bugs #458462 -Full texts botton disapear- and #444767 -Other cases for display=simple-). Marc Delisle drawed the buttons used to expand/collapase text/blob fields; * fixed the empty page bug with php 3.0.9 thanks to the help of Graziano "Radio head" ; * fixed a bug in the csv export function. --- images/fulltext.png | Bin 0 -> 224 bytes images/partialtext.png | Bin 0 -> 225 bytes lib.inc.php3 | 858 ++++++++++++++++++++++++++++------------- main.php3 | 11 +- 4 files changed, 591 insertions(+), 278 deletions(-) create mode 100644 images/fulltext.png create mode 100644 images/partialtext.png diff --git a/images/fulltext.png b/images/fulltext.png new file mode 100644 index 0000000000000000000000000000000000000000..cd4691d92abfe03ea4e7b9555848830f769ac595 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0y~yU@&4}U=ZP8V_;x7e=2Vl0|UcyPZ!6KiaBqmofK?P z;9)Rymaow{@Ne}32Dw`tznmodc%+UT*x?^=LnUUi*=s#EhJ9iyT9@!`IMelIznOHX zBge<^CrqbTtPWedCYdLAqK3e$S@pB$$WN&`(mO>xVeTBx+SFAWO;$wB{*fs(J#sGJ zCC;DCTP;#+-kq8Lxg{i-zhz%TX_4wvN!k5(nos`htycVY%Aj$Ae6NJ=_vk{`HMPOb geuWALY6Rt`y*IfYdRUs1fq{X+)78&qol`;+0Otc)+W-In literal 0 HcmV?d00001 diff --git a/images/partialtext.png b/images/partialtext.png new file mode 100644 index 0000000000000000000000000000000000000000..c2a35a9b62bf8c675970a68df51180ccea2e430e GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0y~yU@&4}U=ZP8V_;x7e=2Vl0|UbfPZ!6KiaBq?HVQT< z@bt)4Uoc?!?SGI#WD`eJVU?K7L*b_v-fR4L@^eB8XW{KkrZxHM3argS73m9qE2^2W zD*ckR46MHRXxf$4*A04=a};09zwqc?k&83WshhD;laf?+@Hjo0+iL&G*35jm(ES+x zI|qdBY8+8H1d`PaZCdT!aV*Bc@}`qXyY!*IcN;CVmI*TH_nO*l)DbhWp0qhl%3@aQ enr88bjHlX7t}~S|Y+ztuVDNPHb6Mw<&;$U))K=vH literal 0 HcmV?d00001 diff --git a/lib.inc.php3 b/lib.inc.php3 index b9a9331d4..15455d6c1 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -112,18 +112,19 @@ if (!defined('__LIB_INC__')){ * Loads the mysql extensions if it is not loaded yet * staybyte - 26. June 2001 */ - if (PHP_INT_VERSION >= 30009) { - if (PMA_WINDOWS) { - $suffix = '.dll'; - } else { - $suffix = '.so'; - } + if (PHP_INT_VERSION > 30009 + && (!@get_cfg_var('safe_mode') && @function_exists('dl'))) { if (PHP_INT_VERSION < 40000) { $extension = 'MySQL'; } else { $extension = 'mysql'; } - if (!@extension_loaded($extension) && !@get_cfg_var('safe_mode') && @function_exists('dl')) { + if (PMA_WINDOWS) { + $suffix = '.dll'; + } else { + $suffix = '.so'; + } + if (!@extension_loaded($extension)) { @dl($extension.$suffix); } if (!@extension_loaded($extension)) { @@ -847,45 +848,189 @@ window.parent.frames['nav'].location.replace(''); /* ----- Functions used to display records returned by a sql query ----- */ + /** + * Defines the display mode to use for the results of a sql query + * + * It uses a syntetic string that contains all the required informations. + * In this string: + * - the first two characters stand for the the action to do while + * clicking on the "edit" link (eg 'ur' for update a row, 'nn' for no + * edit link...); + * - the next two characters stand for the the action to do while + * clicking on the "delete" link (eg 'kp' for kill a process, 'nn' for + * no delete link...); + * - the next characters are boolean values (1/0) and respectively stand + * for sorting links, navigation bar, "insert a new row" link, the + * bookmark feature and the expand/collapse text/blob fields button. + * Of course '0'/'1' means the feature won't/will be enabled. + * + * @param string the synthetic value for display_mode (see §1 a few + * lines below for explanations) + * @global integer the total number of rows returned by the sql query + * without any programmatically appended "LIMIT" clause + * that may be computed inside this function + * + * @return array an array with explicit indexes for all the display + * elements + * + * @global string the database name + * @global string the table name + * @global integer the total number of rows returned by the sql query + * without any programmatically appended "LIMIT" clause + * @global array the properties of the fields returned by the query + * + * @access private + * + * @see display_table() + */ + function set_display_mode(&$the_disp_mode, &$the_total) + { + global $db, $table; + global $unlim_num_rows, $fields_meta; + + // 1. Initializes the $do_display array + $do_display = array(); + $do_display['edit_lnk'] = $the_disp_mode[0] . $the_disp_mode[1]; + $do_display['del_lnk'] = $the_disp_mode[2] . $the_disp_mode[3]; + $do_display['sort_lnk'] = (string) $the_disp_mode[4]; + $do_display['nav_bar'] = (string) $the_disp_mode[5]; + $do_display['ins_row'] = (string) $the_disp_mode[6]; + $do_display['bkm_form'] = (string) $the_disp_mode[7]; + $do_display['text_btn'] = (string) $the_disp_mode[8]; + + // 2. Display mode is not "false for all elements" -> updates the + // display mode + if ($the_disp_mode != 'nnnn00000') { + // 2.1 Statement is a "SELECT COUNT", + // "CHECK/ANALYZE/REPAIR/OPTIMIZE" or an "EXPLAIN" + if ($GLOBALS['is_count'] || $GLOBALS['is_maint'] || $GLOBALS['is_explain']) { + $do_display['edit_lnk'] = 'nn'; // no edit link + $do_display['del_lnk'] = 'nn'; // no delete link + $do_display['sort_lnk'] = (string) '0'; + $do_display['nav_bar'] = (string) '0'; + $do_display['ins_row'] = (string) '0'; + $do_display['bkm_form'] = (string) '1'; + $do_display['text_btn'] = (string) '0'; + } + // 2.2 Statement is a "SHOW..." + else if ($GLOBALS['is_show']) { + // 2.2.1 TODO : defines edit/delete links depending on show statement + $tmp = eregi('^SHOW[[:space:]]+(VARIABLES|PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS)', $GLOBALS['sql_query'], $which); + if (strtoupper($which[1]) == 'PROCESSLIST') { + $do_display['edit_lnk'] = 'nn'; // no edit link + $do_display['del_lnk'] = 'kp'; // "kill process" type edit link + } + else { + // Default case -> no links + $do_display['edit_lnk'] = 'nn'; // no edit link + $do_display['del_lnk'] = 'nn'; // no delete link + } + // 2.2.2 Other settings + $do_display['sort_lnk'] = (string) '0'; + $do_display['nav_bar'] = (string) '0'; + $do_display['ins_row'] = (string) '0'; + $do_display['bkm_form'] = (string) '1'; + $do_display['text_btn'] = (string) '0'; + } + // 2.3 Other statements (ie "SELECT" ones) -> updates + // $do_display['edit_lnk'], $do_display['del_lnk'] and + // $do_display['text_btn'] (keeps other default values) + else { + $prev_table = $fields_meta[0]->table; + for ($i = 0; $i < $GLOBALS['fields_cnt']; $i++) { + $is_link = ($do_display['edit_lnk'] != 'nn' + || $do_display['del_lnk'] != 'nn' + || $do_display['sort_lnk'] != '0' + || $do_display['ins_row'] != '0'); + // 2.3.1 Displays text cut/expand button? + if ($do_display['text_btn'] == '0' && eregi('BLOB', $fields_meta[$i]->type)) { + $do_display['text_btn'] = (string) '1'; + if (!$is_link) { + break; + } + } // end if (2.3.1) + // 2.3.2 Displays edit/delete/sort/insert links? + if ($is_link + && ($fields_meta[$i]->table == '' || $fields_meta[$i]->table != $prev_table)) { + $do_display['edit_lnk'] = 'nn'; // don't display links + $do_display['del_lnk'] = 'nn'; + // TODO: May be problematic with same fields names in + // two joined table. + // $do_display['sort_lnk'] = (string) '0'; + $do_display['ins_row'] = (string) '0'; + if ($do_display['text_btn'] == '1') { + break; + } + } // end if (2.3.2) + $prev_table = $fields_meta[$i]->table; + } // end for + } // end if..elseif...else (2.1 -> 2.3) + } // end if (2) + + // 3. Gets the total number of rows if it is unknown + if (isset($unlim_num_rows) && $unlim_num_rows != '') { + $the_total = $unlim_num_rows; + } + else if (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1') + && (!empty($db) && !empty($table))) { + $local_query = 'SELECT COUNT(*) AS total FROM ' . backquote($db) . '.' . backquote($table); + $result = mysql_query($local_query) or mysql_die('', $local_query); + $the_total = mysql_result($result, 0, 'total'); + } + + // 4. If navigation bar or sorting fields names urls should be + // displayed but there is only one row, change these settings to + // false + if ($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1') { + if (isset($unlim_num_rows) && $unlim_num_rows < 2) { + $do_display['nav_bar'] = (string) '0'; + $do_display['sort_lnk'] = (string) '0'; + } + } // end if (3) + + // 5. Updates the synthetic var + $the_disp_mode = join('', $do_display); + + return $do_display; + } // end of the 'set_display_mode()' function + + /** * Displays a navigation bar to browse among the results of a sql query * * @param integer the offset for the "next" page * @param integer the offset for the "previous" page - * @param array the result of the query + * @param string the url-encoded query * * @global string the current language * @global integer the server to use (refers to the number in the * configuration file) * @global string the database name * @global string the table name - * @global string the current sql query - * @global integer the current position in results * @global string the url to go back in case of errors - * @global boolean whether to limit the number of displayed charcaters of - * text type fields or not - * @global integer the maximum number of rows per page * @global integer the total number of rows returned by the sql query + * @global integer the total number of rows returned by the sql query + * without any programmatically appended "LIMIT" clause + * @global integer the current position in results + * @global integer the maximum number of rows per page + * @global boolean whether to limit the number of displayed characters of + * text type fields or not + * + * @access private + * + * @see display_table() */ - function show_table_navigation($pos_next, $pos_prev, $dt_result) + function display_table_navigation($pos_next, $pos_prev, $encoded_query) { global $lang, $server, $db, $table; - global $sql_query, $pos, $goto, $dontlimitchars; - global $sessionMaxRows, $SelectNumRows; - - // $sql_query will be stripslashed in 'sql.php3' if the - // 'magic_quotes_gpc' directive is set to 'on' - if (get_magic_quotes_gpc()) { - $encoded_sql_query = urlencode(addslashes($sql_query)); - } else { - $encoded_sql_query = urlencode($sql_query); - } + global $goto; + global $num_rows, $unlim_num_rows, $pos, $sessionMaxRows; + global $dontlimitchars; ?> - + - 0) { @@ -896,7 +1041,7 @@ window.parent.frames['nav'].location.replace(''); - + @@ -910,7 +1055,7 @@ window.parent.frames['nav'].location.replace(''); - + @@ -927,18 +1072,18 @@ window.parent.frames['nav'].location.replace(''); = $sessionMaxRows) { + if (($pos + $sessionMaxRows < $unlim_num_rows) && $num_rows >= $sessionMaxRows) { ?> - - - - -
+ onsubmit="return (checkFormElementInRange(this, 'sessionMaxRows', 1) && checkFormElementInRange(this, 'pos', 0, ))"> - + - +
@@ -946,7 +1091,7 @@ window.parent.frames['nav'].location.replace('');
@@ -954,7 +1099,7 @@ window.parent.frames['nav'].location.replace(''); - + @@ -964,13 +1109,13 @@ window.parent.frames['nav'].location.replace('');
+ onsubmit="return = $sessionMaxRows) ? 'true' : 'false'); ?>"> - - + + @@ -979,148 +1124,112 @@ window.parent.frames['nav'].location.replace(''); -     - - - - - - - - - - - - - -
1 && isset($pos_next)) { - if (isset($SelectNumRows) && $SelectNumRows != $total) { - $selectstring = ', ' . $SelectNumRows . ' ' . $GLOBALS['strSelectNumRows']; - } else { - $selectstring = ''; - } - $lastShownRec = ($pos_next > $total) ? $total : $pos_next; - show_message($GLOBALS['strShowingRecords'] . " $pos - $lastShownRec ($total " . $GLOBALS['strTotal'] . $selectstring . ')'); - } else { - show_message($GLOBALS['strSQLQuery']); - } - - // 2.2 Displays the navigation bars - if (!isset($table) || strlen(trim($table)) == 0) { - $table = $fields_meta[0]->table; - } - if (!$is_simple - && (!isset($SelectNumRows) || $SelectNumRows > 1)) { - show_table_navigation($pos_next, $pos_prev, $dt_result); - } else { - echo "\n" . '

' . "\n"; - } - - // 3. ----- Displays the results table head ----- - - $is_show_processlist = eregi("^[ \n\r]*show[ \n\r]*processlist[ \n\r]*$", $sql_query); ?> - - - +'; + echo "\n"; + + // 1. Displays the full/partial text button (part 1)... + $colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') + ? ' colspan="2"' + : ''; + $text_url = 'sql.php3' + . '?lang=' . $lang + . '&server=' . $server + . '&db=' . urlencode($db) + . '&table=' . urlencode($table) + . '&sql_query=' . $encoded_query + . '&pos=' . $pos + . '&sessionMaxRows=' . $sessionMaxRows + . '&pos=' . $pos + . '&goto=' . $goto + . '&dontlimitchars=' . (($dontlimitchars) ? 0 : 1); + + // ... before the result table + if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn') + && $is_display['text_btn'] == '1') { + ?> + + + + + + " align="center"> + + <?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?> + + + > + 1) - && !$is_simple) { + + // 2.1 Results can be sorted + if ($is_display['sort_lnk'] == '1') { // Defines the url used to append/modify a sorting order - // 3.2.1 Checks if an hard coded 'order by' clause exists + // 2.1.1 Checks if an hard coded 'order by' clause exists if (eregi('(.*)( ORDER BY (.*))', $sql_query, $regs1)) { if (eregi('((.*)( ASC| DESC)( |$))(.*)', $regs1[2], $regs2)) { $unsorted_sql_query = trim($regs1[1] . ' ' . $regs2[5]); @@ -1136,14 +1245,14 @@ window.parent.frames['nav'].location.replace(''); } else { $unsorted_sql_query = $sql_query; } - // 3.2.2 Checks if the current column is used to sort the + // 2.1.2 Checks if the current column is used to sort the // results if (empty($sql_order)) { $is_in_sort = FALSE; } else { $is_in_sort = eregi(' (`?)' . str_replace('\\', '\\\\', $fields_meta[$i]->name) . '(`?)[ ,$]', $sql_order); } - // 3.2.3 Do define the sorting url + // 2.1.3 Do define the sorting url if (!$is_in_sort) { // loic1: patch #455484 ("Smart" order) $cfgOrder = strtoupper($GLOBALS['cfgOrder']); @@ -1171,16 +1280,19 @@ window.parent.frames['nav'].location.replace(''); . '&db=' . urlencode($db) . '&table=' . urlencode($table) . '&pos=' . $pos + . '&sessionMaxRows=' . $sessionMaxRows + . '&dontlimitchars' . $dontlimitchars . '&sql_query=' . urlencode($sorted_sql_query); + // 2.1.4 Displays the sorting url ?> @@ -1188,23 +1300,78 @@ window.parent.frames['nav'].location.replace(''); name) . "\n"; ?> '; + && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') + && $is_display['text_btn'] == '1') { + echo "\n"; + ?> + " align="center"> + + <?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?> + + '; } echo "\n"; ?> - + + '); // delete/edit options correctly for tables without keys. while ($row = mysql_fetch_row($dt_result)) { - - // 4.1 Prepares the row (gets primary keys to use) - $primary_key = ''; - $uva_nonprimary_condition = ''; $bgcolor = ($foo % 2) ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo']; ?> name) . ' '; - if (!isset($row[$i])) { - $row[$i] = ''; - $condition .= 'IS NULL AND'; - } else { - $condition .= '= \'' . sql_addslashes($row[$i]) . '\' AND'; - } - if ($primary->numeric == 1) { - if ($is_show_processlist) { - $Id = $row[$i]; + + // 1. Prepares the row (gets primary keys to use) + if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') { + $primary_key = ''; + $uva_nonprimary_condition = ''; + + // 1.1 Results from a "SELECT" statement -> builds the + // the "primary" key to use in links + if ($is_display['edit_lnk'] == 'ur' /* || $is_display['edit_lnk'] == 'dr' */) { + for ($i = 0; $i < $fields_cnt; ++$i) { + $primary = $fields_meta[$i]; + $condition = ' ' . backquote($primary->name) . ' '; + if (!isset($row[$i])) { + $row[$i] = ''; + $condition .= 'IS NULL AND'; + } else { + $condition .= '= \'' . sql_addslashes($row[$i]) . '\' AND'; + } + if ($primary->primary_key > 0) { + $primary_key .= $condition; + } + $uva_nonprimary_condition .= $condition; + } // end for + + // Correction uva 19991216: prefer primary keys for + // condition, but use conjunction of all values if no + // primary key + if ($primary_key) { + $uva_condition = $primary_key; + } else { + $uva_condition = $uva_nonprimary_condition; } + $uva_condition = urlencode(ereg_replace(' ?AND$', '', $uva_condition)); + } // end if (1.1) + + // 1.2 Results from a "SHOW PROCESSLIST" statement -> gets the + // process id + else if ($is_display['del_lnk'] == 'kp') { + $pma_pid = $row[0]; } - if ($primary->primary_key > 0) { - $primary_key .= $condition; - } - $uva_nonprimary_condition .= $condition; - } // end for - // Correction uva 19991216: prefer primary keys for condition, but - // use conjunction of all values if no primary key - if ($primary_key) { - $uva_condition = $primary_key; - } else { - $uva_condition = $uva_nonprimary_condition; - } - $uva_condition = urlencode(ereg_replace(' ?AND$', '', $uva_condition)); + // 1.2 Defines the urls for the modify/delete link(s) + $url_query = 'lang=' . $lang + . '&server=' . $server + . '&db=' . urlencode($db) + . '&table=' . urlencode($table) + . '&pos=' . $pos + . '&sessionMaxRow=' . $sessionMaxRow + . '&dontlimitchars=' . $dontlimitchars; - // 4.2 Defines the urls for the modify/delete link(s) and displays - // them at the left column if required - $url_query = 'lang=' . $lang - . '&server=' . $server - . '&db=' . urlencode($db) - . '&table=' . urlencode($table) - . '&pos=' . $pos; + // 1.2.1 Modify link(s) + if ($is_display['edit_lnk'] == 'ur') { // update row case + if (!empty($goto) + && empty($GLOBALS['QUERY_STRING']) + && (empty($GLOBALS['HTTP_SERVER_VARS']) || empty($GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']))) { + // void + } else { + $goto = 'sql.php3'; + } + $edit_url = 'tbl_change.php3' + . '?' . $url_query + . '&primary_key=' . $uva_condition + . '&sql_query=' . urlencode($sql_query) + . '&goto=' . urlencode($goto); + $edit_str = $GLOBALS['strEdit']; + } // end if (1.2.1) - $goto = (!empty($goto) && empty($GLOBALS['QUERY_STRING'])) ? $goto : 'sql.php3'; - $edit_url = 'tbl_change.php3' - . '?' . $url_query - . '&primary_key=' . $uva_condition - . '&sql_query=' . urlencode($sql_query) - . '&goto=' . urlencode($goto); + // 1.2.2 Delete/Kill link(s) + if ($is_display['del_lnk'] == 'dr') { // delete row case + $goto = 'sql.php3' + . '?' . $url_query + . '&sql_query=' . urlencode($sql_query) + . '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted'])) + . '&goto=tbl_properties.php3'; + $del_url = 'sql.php3' + . '?' . $url_query + . '&sql_query=' . urlencode('DELETE FROM ' . backquote($table) . ' WHERE') . $uva_condition . urlencode(' LIMIT 1') + . '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted'])) + . '&goto=' . urlencode($goto); + $js_conf = 'DELETE FROM ' . js_format($table) + . ' WHERE ' . trim(js_format(urldecode($uva_condition), FALSE)) . ' LIMIT 1'; + $del_str = $GLOBALS['strDelete']; + } else if ($is_display['del_lnk'] == 'kp') { // kill process case + $del_url = 'sql.php3' + . '?lang=' . $lang + . '&server=' . $server + . '&db=mysql' + . '&sql_query=' . urlencode('KILL ' . $pma_pid) + . '&goto=main.php3'; + $js_conf = 'KILL ' . $pma_pid; + $del_str = $GLOBALS['strKill']; + } // end if (1.2.1) - $goto = 'sql.php3' - . '?' . $url_query - . '&sql_query=' . urlencode($sql_query) - . '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted'])) - . '&goto=tbl_properties.php3'; - $delete_url = 'sql.php3' - . '?' . $url_query - . '&sql_query=' . urlencode('DELETE FROM ' . backquote($table) . ' WHERE') . $uva_condition . urlencode(' LIMIT 1') - . '&zero_rows=' . urlencode(htmlspecialchars($GLOBALS['strDeleted'])) - . '&goto=' . urlencode($goto); - - if ($GLOBALS['cfgModifyDeleteAtLeft'] && !$is_simple) { - ?> + // 1.2.3 Displays the links at left if required + if ($GLOBALS['cfgModifyDeleteAtLeft']) { + if (!empty($edit_url)) { + ?> + - - - '); echo ' ' . "\n"; } } - } // end for + } // end for (2) - // 4.4 Displays the modify/delete links on the right if required - if ($GLOBALS['cfgModifyDeleteAtRight'] && !$is_simple) { - ?> + // 3. Displays the modify/delete links on the right if required + if ($GLOBALS['cfgModifyDeleteAtRight']) { + if (!empty($edit_url)) { + ?> + - - - $total) ? $total : $pos_next; + show_message($GLOBALS['strShowingRecords'] . " $pos - $last_shown_rec ($total " . $GLOBALS['strTotal'] . $selectstring . ')'); + } else { + show_message($GLOBALS['strSQLQuery']); + } + + // 2.3 Displays the navigation bars + if (!isset($table) || strlen(trim($table)) == 0) { + $table = $fields_meta[0]->table; + } + if ($is_display['nav_bar'] == '1') { + display_table_navigation($pos_next, $pos_prev, $encoded_sql_query); + echo "\n"; + } else { + echo "\n" . '

' . "\n"; + } + + // 3. ----- Displays the results table ----- + + ?> + +
+ + <?php echo (($dontlimitchars) ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']); ?> +
name); ?>
- + - - + > + - - -   - + - - + > + - - -
+

- 1)) { - show_table_navigation($pos_next, $pos_prev, $dt_result); + + // 4. ----- Displays the navigation bar at the bottom if required ----- + + if ($is_display['nav_bar'] == '1') { + display_table_navigation($pos_next, $pos_prev, $dt_result, $encoded_sql_query); } else { echo "\n" . '
' . "\n"; } @@ -1802,32 +2113,31 @@ window.parent.frames['nav'].location.replace(''); global $what; // Handles the "separator" and the optionnal "enclosed by" characters - if (empty($sep) || $what == 'excel') { + if ($what == 'excel') { $sep = ';'; - } - else { + } else if (!isset($sep)) { + $sep = ''; + } else { if (get_magic_quotes_gpc()) { $sep = stripslashes($sep); } $sep = str_replace('\\t', "\011", $sep); } - if (empty($enc_by) || $what == 'excel') { - $enc_by = '"'; + if ($what == 'excel') { + $enc_by = '"'; + } else if (!isset($enc_by)) { + $enc_by = ''; + } else if (get_magic_quotes_gpc()) { + $enc_by = stripslashes($enc_by); } - else { - if (get_magic_quotes_gpc()) { - $enc_by = stripslashes($enc_by); - } - $enc_by = str_replace('"', '"', $enc_by); - } - if (empty($esc_by) || $what == 'excel') { + if ($what == 'excel' + || (empty($esc_by) && $enc_by != '')) { // double the "enclosed by" character - $esc_by = $enc_by; - } - else { - if (get_magic_quotes_gpc()) { - $esc_by = stripslashes($esc_by); - } + $esc_by = $enc_by; + } else if (!isset($esc_by)) { + $esc_by = ''; + } else if (get_magic_quotes_gpc()) { + $esc_by = stripslashes($esc_by); } // Defines the offsets to use diff --git a/main.php3 b/main.php3 index df8afcc21..6856c1207 100755 --- a/main.php3 +++ b/main.php3 @@ -5,7 +5,10 @@ /** * Gets some core libraries and displays a top message if required */ +// Gets the language to use and put it in a cookie that will expire in 30 +// days require('./grab_globals.inc.php3'); +setcookie('lang', $lang, time() + 60*60*24*30); // Handles some variables that may have been sent by the calling script if (isset($db)) { unset($db); @@ -231,7 +234,7 @@ if ($server > 0 item - +   @@ -239,7 +242,7 @@ if ($server > 0 item - +   @@ -252,7 +255,7 @@ if ($server > 0 item - +   @@ -456,7 +459,7 @@ if (empty($cfgLang)) { } ?> - +