/** * (13) Print the page footer information * @param string $p_file * @return null */ function html_footer($p_file = null) { global $g_queries_array, $g_request_time; # If a user is logged in, update their last visit time. # We do this at the end of the page so that: # 1) we can display the user's last visit time on a page before updating it # 2) we don't invalidate the user cache immediately after fetching it # 3) don't do this on the password verification or update page, as it causes the # verification comparison to fail if (auth_is_user_authenticated() && !current_user_is_anonymous() && !(is_page_name('verify.php') || is_page_name('account_update.php'))) { $t_user_id = auth_get_current_user_id(); user_update_last_visit($t_user_id); } echo "<div id=\"footer\">\n"; echo "\t<hr />\n"; # We don't have a button anymore, so for now we will only show the resized # version of the logo when not on login page. if (!is_page_name('login_page')) { echo "\t<div id=\"powered-by-mantisbt-logo\">\n"; $t_mantisbt_logo_url = helper_mantis_url('images/mantis_logo.png'); echo "\t\t<a href=\"http://www.mantisbt.org\" " . "title=\"Mantis Bug Tracker: a free and open source web based bug tracking system.\">" . "<img src=\"{$t_mantisbt_logo_url}\" width=\"102\" height=\"35\" " . "alt=\"Powered by Mantis Bug Tracker: a free and open source web based bug tracking system.\" />" . "</a>\n"; echo "\t</div>\n"; } # Show optional user-specificed custom copyright statement $t_copyright_statement = config_get('copyright_statement'); if ($t_copyright_statement) { echo "\t<address id=\"user-copyright\">{$t_copyright_statement}</address>\n"; } # Show MantisBT version and copyright statement $t_version_suffix = ''; $t_copyright_years = ''; if (config_get('show_version')) { $t_version_suffix = htmlentities(' ' . MANTIS_VERSION . config_get_global('version_suffix')); $t_copyright_years = ' 2000 - 2012'; } echo "\t<address id=\"mantisbt-copyright\">Powered by <a href=\"http://www.mantisbt.org\" title=\"Mantis Bug Tracker: a free and open source web based bug tracking system.\">Mantis Bug Tracker</a> (MantisBT){$t_version_suffix}. Copyright ©{$t_copyright_years} MantisBT contributors. Licensed under the terms of the <a href=\"http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\" title=\"GNU General Public License (GPL) version 2\">GNU General Public License (GPL) version 2</a> or a later version.</address>\n"; # Show contact information $t_webmaster_contact_information = sprintf(lang_get('webmaster_contact_information'), string_html_specialchars(config_get('webmaster_email'))); echo "\t<address id=\"webmaster-contact-information\">{$t_webmaster_contact_information}</address>\n"; event_signal('EVENT_LAYOUT_PAGE_FOOTER'); # Print horizontal rule if any debugging stats follow if (config_get('show_timer') || config_get('show_memory_usage') || config_get('show_queries_count')) { echo "\t<hr />\n"; } # Print the page execution time if (config_get('show_timer')) { $t_page_execution_time = sprintf(lang_get('page_execution_time'), number_format(microtime(true) - $g_request_time, 4)); echo "\t<p id=\"page-execution-time\">{$t_page_execution_time}</p>\n"; } # Print the page memory usage if (config_get('show_memory_usage')) { $t_page_memory_usage = sprintf(lang_get('memory_usage_in_kb'), number_format(memory_get_peak_usage() / 1024)); echo "\t<p id=\"page-memory-usage\">{$t_page_memory_usage}</p>\n"; } # Determine number of unique queries executed if (config_get('show_queries_count')) { $t_total_queries_count = count($g_queries_array); $t_unique_queries_count = 0; $t_total_query_execution_time = 0; $t_unique_queries = array(); for ($i = 0; $i < $t_total_queries_count; $i++) { if (!in_array($g_queries_array[$i][0], $t_unique_queries)) { $t_unique_queries_count++; $g_queries_array[$i][3] = false; array_push($t_unique_queries, $g_queries_array[$i][0]); } else { $g_queries_array[$i][3] = true; } $t_total_query_execution_time += $g_queries_array[$i][1]; } $t_total_queries_executed = sprintf(lang_get('total_queries_executed'), $t_total_queries_count); echo "\t<p id=\"total-queries-count\">{$t_total_queries_executed}</p>\n"; if (config_get_global('db_log_queries')) { $t_unique_queries_executed = sprintf(lang_get('unique_queries_executed'), $t_unique_queries_count); echo "\t<p id=\"unique-queries-count\">{$t_unique_queries_executed}</p>\n"; } $t_total_query_time = sprintf(lang_get('total_query_execution_time'), $t_total_query_execution_time); echo "\t<p id=\"total-query-execution-time\">{$t_total_query_time}</p>\n"; } # Print table of log events log_print_to_page(); echo "</div>\n"; }
/** * (13) Print the page footer information * @return void */ function html_footer() { global $g_queries_array, $g_request_time; # If a user is logged in, update their last visit time. # We do this at the end of the page so that: # 1) we can display the user's last visit time on a page before updating it # 2) we don't invalidate the user cache immediately after fetching it # 3) don't do this on the password verification or update page, as it causes the # verification comparison to fail if (auth_is_user_authenticated() && !current_user_is_anonymous() && !(is_page_name('verify.php') || is_page_name('account_update.php'))) { $t_user_id = auth_get_current_user_id(); user_update_last_visit($t_user_id); } echo '<div id="footer">' . "\n"; echo '<hr />' . "\n"; # We don't have a button anymore, so for now we will only show the resized # version of the logo when not on login page. if (!is_page_name('login_page')) { echo "\t" . '<div id="powered-by-mantisbt-logo">' . "\n"; $t_mantisbt_logo_url = helper_mantis_url('images/mantis_logo.png'); echo "\t\t" . '<a href="http://www.mantisbt.org" title="Mantis Bug Tracker: a free and open source web based bug tracking system."> <img src="' . $t_mantisbt_logo_url . '" width="102" height="35" alt="Powered by Mantis Bug Tracker: a free and open source web based bug tracking system." /> </a>' . "\n"; echo "\t" . '</div>' . "\n"; } # Show MantisBT version and copyright statement $t_version_suffix = ''; $t_copyright_years = ' 2000 - ' . date('Y'); if (config_get('show_version') == ON) { $t_version_suffix = ' ' . htmlentities(MANTIS_VERSION . config_get_global('version_suffix')); } echo '<address id="mantisbt-copyright">' . "\n"; echo '<address id="version">Powered by <a href="http://www.mantisbt.org" title="bug tracking software">MantisBT ' . $t_version_suffix . "</a></address>\n"; echo 'Copyright ©' . $t_copyright_years . ' MantisBT Team'; # Show optional user-specified custom copyright statement $t_copyright_statement = config_get('copyright_statement'); if ($t_copyright_statement) { echo "\t" . '<address id="user-copyright">' . $t_copyright_statement . '</address>' . "\n"; } echo '</address>' . "\n"; # Show contact information if (!is_page_name('login_page')) { $t_webmaster_email = config_get('webmaster_email'); if (!is_blank($t_webmaster_email)) { $t_webmaster_contact_information = sprintf(lang_get('webmaster_contact_information'), string_html_specialchars($t_webmaster_email)); echo "\t" . '<address id="webmaster-contact-information">' . $t_webmaster_contact_information . '</address>' . "\n"; } } event_signal('EVENT_LAYOUT_PAGE_FOOTER'); # Print horizontal rule if any debugging statistics follow if (config_get('show_timer') || config_get('show_memory_usage') || config_get('show_queries_count')) { echo "\t" . '<hr />' . "\n"; } # Print the page execution time if (config_get('show_timer')) { $t_page_execution_time = sprintf(lang_get('page_execution_time'), number_format(microtime(true) - $g_request_time, 4)); echo "\t" . '<p id="page-execution-time">' . $t_page_execution_time . '</p>' . "\n"; } # Print the page memory usage if (config_get('show_memory_usage')) { $t_page_memory_usage = sprintf(lang_get('memory_usage_in_kb'), number_format(memory_get_peak_usage() / 1024)); echo "\t" . '<p id="page-memory-usage">' . $t_page_memory_usage . '</p>' . "\n"; } # Determine number of unique queries executed if (config_get('show_queries_count')) { $t_total_queries_count = count($g_queries_array); $t_unique_queries_count = 0; $t_total_query_execution_time = 0; $t_unique_queries = array(); for ($i = 0; $i < $t_total_queries_count; $i++) { if (!in_array($g_queries_array[$i][0], $t_unique_queries)) { $t_unique_queries_count++; $g_queries_array[$i][3] = false; array_push($t_unique_queries, $g_queries_array[$i][0]); } else { $g_queries_array[$i][3] = true; } $t_total_query_execution_time += $g_queries_array[$i][1]; } $t_total_queries_executed = sprintf(lang_get('total_queries_executed'), $t_total_queries_count); echo "\t" . '<p id="total-queries-count">' . $t_total_queries_executed . '</p>' . "\n"; if (config_get_global('db_log_queries')) { $t_unique_queries_executed = sprintf(lang_get('unique_queries_executed'), $t_unique_queries_count); echo "\t" . '<p id="unique-queries-count">' . $t_unique_queries_executed . '</p>' . "\n"; } $t_total_query_time = sprintf(lang_get('total_query_execution_time'), $t_total_query_execution_time); echo "\t" . '<p id="total-query-execution-time">' . $t_total_query_time . '</p>' . "\n"; } # Print table of log events log_print_to_page(); echo '</div>' . "\n"; }