Navigation Menu

Skip to content

Commit

Permalink
merge branch 1.5 r1010:1011 into BSF:
Browse files Browse the repository at this point in the history
- bug 268 fixed: display debug content correctly

git-svn-id: http://piwigo.org/svn/trunk@1012 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
nikrou committed Jan 21, 2006
1 parent 0b28c9d commit 02f08d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/functions.inc.php
Expand Up @@ -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");
Expand All @@ -452,12 +452,12 @@ function pwg_query($query)
$output.= '<pre>['.$page['count_queries'].'] ';
$output.= "\n".$query;
$output.= "\n".'(this query time : ';
$output.= number_format($time, 3, '.', ' ').' s)</b>';
$output.= '<b>'.number_format($time, 3, '.', ' ').' s)</b>';
$output.= "\n".'(total SQL time : ';
$output.= number_format($page['queries_time'], 3, '.', ' ').' s)';
$output.= '</pre>';
$output.= "</pre>\n";

echo $output;
$debug .= $output;
}

return $result;
Expand All @@ -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 .= '<p>';
$debug.= '['.$time.', ';
$debug.= $count_queries.' queries] : '.$string;
$debug.= "\n";
$debug.= "</p>\n";
}

/**
Expand Down
8 changes: 8 additions & 0 deletions include/page_tail.php
Expand Up @@ -54,6 +54,14 @@
'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'])
Expand Down
3 changes: 3 additions & 0 deletions template/yoga/footer.tpl
Expand Up @@ -17,5 +17,8 @@
</div> <!-- copyright -->
</div> <!-- the_page -->

<!-- BEGIN debug -->
{debug.QUERIES_LIST}
<!-- END debug -->
</body>
</html>

0 comments on commit 02f08d3

Please sign in to comment.