From 1d46a96621b794778e352b6e1649f9cc461feea3 Mon Sep 17 00:00:00 2001 From: nikrou Date: Sat, 21 Jan 2006 20:32:09 +0000 Subject: bug 268 fixed: display debug content correctly git-svn-id: http://piwigo.org/svn/branches/branch-1_5@1011 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions.inc.php | 11 ++++++----- include/page_tail.php | 8 ++++++++ template/yoga/footer.tpl | 3 +++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/functions.inc.php b/include/functions.inc.php index 261260b16..999980259 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -430,7 +430,7 @@ function format_date($date, $type = 'us', $show_time = false) function pwg_query($query) { - global $conf,$page; + global $conf,$page,$debug; $start = get_moment(); $result = mysql_query($query) or my_error($query."\n"); @@ -452,12 +452,12 @@ function pwg_query($query) $output.= '
['.$page['count_queries'].'] ';
     $output.= "\n".$query;
     $output.= "\n".'(this query time : ';
-    $output.= number_format($time, 3, '.', ' ').' s)';
+    $output.= ''.number_format($time, 3, '.', ' ').' s)';
     $output.= "\n".'(total SQL time  : ';
     $output.= number_format($page['queries_time'], 3, '.', ' ').' s)';
-    $output.= '
'; + $output.= "\n"; - echo $output; + $debug .= $output; } return $result; @@ -471,9 +471,10 @@ function pwg_debug( $string ) $now2 = explode( '.', $now[0] ); $now2 = $now[1].'.'.$now2[1]; $time = number_format( $now2 - $t2, 3, '.', ' ').' s'; + $debug .= '

'; $debug.= '['.$time.', '; $debug.= $count_queries.' queries] : '.$string; - $debug.= "\n"; + $debug.= "

\n"; } /** diff --git a/include/page_tail.php b/include/page_tail.php index be6336359..89a771df0 100644 --- a/include/page_tail.php +++ b/include/page_tail.php @@ -54,6 +54,14 @@ if ($conf['show_gt']) 'SQL_TIME' => number_format($page['queries_time'],3,'.',' ').' s')); } +if ($conf['show_queries']) +{ + $template->assign_block_vars( + 'debug', + array('QUERIES_LIST' => $debug) + ); +} + //--------------------------------------------------------------------- contact if (!$user['is_the_guest']) diff --git a/template/yoga/footer.tpl b/template/yoga/footer.tpl index d4c18aff8..9638ba422 100644 --- a/template/yoga/footer.tpl +++ b/template/yoga/footer.tpl @@ -17,5 +17,8 @@ + + {debug.QUERIES_LIST} + -- cgit v1.2.3