View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005537 | mantisbt | webpage | public | 2005-04-28 20:50 | 2012-02-05 19:00 |
| Reporter | striker69 | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | new | Resolution | open | ||
| Product Version | 1.0.0a2 | ||||
| Summary | 0005537: Last-Modified date for bug_view*_page | ||||
| Description | I added the functionality to set the last-modified date for the bug_view pages. It is set to the last modified date of the bug. In my case, I want to index mantis using a search software, namely Coveo Enterprise Seach (I work for Coveo) and don't want the pages to be re-indexed when they haven't changed. I also added a meta name "robots", noindex,follow for the view_all_bug_page to prevent indexing those. I have attached the modifications in unidiff format. | ||||
| Tags | patch | ||||
| Attached Files | mantis.txt (4,132 bytes)
diff -U 6 -rN -w C:\TEMP\OldVersion/bug_view_advanced_page.php C:\TEMP\NewVersion/bug_view_advanced_page.php
--- C:\TEMP\OldVersion/bug_view_advanced_page.php 2005-04-28 20:51:06.911307400 -0400
+++ C:\TEMP\NewVersion/bug_view_advanced_page.php 2005-04-28 20:51:07.211790400 -0400
@@ -30,13 +30,15 @@
access_ensure_bug_level( VIEWER, $f_bug_id );
$t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) );
compress_enable();
- html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
+ $modifiedDate = bug_get_field($f_bug_id, 'last_updated');
+ html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ), $modifiedDate );
html_page_top2();
$t_access_level_needed = config_get( 'view_history_threshold' );
$t_can_view_history = access_has_bug_level( $t_access_level_needed, $f_bug_id );
$t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );
diff -U 6 -rN -w C:\TEMP\OldVersion/bug_view_page.php C:\TEMP\NewVersion/bug_view_page.php
--- C:\TEMP\OldVersion/bug_view_page.php 2005-04-28 20:51:02.384030200 -0400
+++ C:\TEMP\NewVersion/bug_view_page.php 2005-04-28 20:51:03.245414800 -0400
@@ -38,13 +38,18 @@
$t_can_view_history = access_has_bug_level( $t_access_level_needed, $f_bug_id );
compress_enable();
$t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );
?>
-<?php html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ) ?>
+<?php
+ $modifiedDate = bug_get_field($f_bug_id, 'last_updated');
+ html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ), $modifiedDate )
+?>
+
<?php html_page_top2() ?>
<br />
<table class="width100" cellspacing="1">
diff -U 6 -rN -w C:\TEMP\OldVersion/html_api.php C:\TEMP\NewVersion/html_api.php
--- C:\TEMP\OldVersion/html_api.php 2005-04-28 20:51:21.895393000 -0400
+++ C:\TEMP\NewVersion/html_api.php 2005-04-28 20:51:22.265988700 -0400
@@ -82,17 +82,19 @@
}
}
# --------------------
# Print the part of the page that comes before meta redirect tags should
# be inserted
- function html_page_top1( $p_page_title = null ) {
+ function html_page_top1( $p_page_title = null, $p_last_modified = null ) {
html_begin();
html_head_begin();
html_css();
html_content_type();
+ html_last_modified($p_last_modified);
include( config_get( 'meta_include_file' ) );
html_rss_link();
html_title( $p_page_title );
html_head_javascript();
}
@@ -188,12 +190,21 @@
# (3) Print the content-type
function html_content_type() {
echo "\t", '<meta http-equiv="Content-type" content="text/html;charset=', lang_get( 'charset' ), '" />', "\n";
}
# --------------------
+ # (3.5) Print the last-modified
+ function html_last_modified( $p_last_modified = null) {
+ if ( $p_last_modified !== null ) {
+ header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s \G\M\T', $p_last_modified ) );
+ }
+ }
+
+ # --------------------
# (4) Print the window title
function html_title( $p_page_title = null ) {
$t_title = config_get( 'window_title' );
echo "\t", '<title>';
if ( $p_page_title === null ) {
echo string_display( $t_title );
diff -U 6 -rN -w C:\TEMP\OldVersion/view_all_bug_page.php C:\TEMP\NewVersion/view_all_bug_page.php
--- C:\TEMP\OldVersion/view_all_bug_page.php 2005-04-28 20:51:18.239516500 -0400
+++ C:\TEMP\NewVersion/view_all_bug_page.php 2005-04-28 20:51:18.650176600 -0400
@@ -41,12 +41,13 @@
gpc_set_cookie( config_get( 'bug_list_cookie' ), implode( ',', $t_bugslist ) );
compress_enable();
html_page_top1( lang_get( 'view_bugs_link' ) );
+ echo "\t<meta name=\"robots\" content=\"noindex,follow\">\n";
if ( current_user_get_pref( 'refresh_delay' ) > 0 ) {
html_meta_redirect( 'view_all_bug_page.php?page_number='.$f_page_number, current_user_get_pref( 'refresh_delay' )*60 );
}
html_page_top2();
| ||||