В базовой версии форумов 1.x и 2.x скрипт форума всегда возвращает текущую время/дату, что для страниц форума может быть плохо, например, с точки зрения поисковых систем, в частности - для локального поиска.
Для страниц с сообщениями можно возвращать в качестве времени последней модификации время последнего ответа в тему.
Делается это так (для версии 2.0. В версиях 1.x аналогично исправляется один файл - sources\Topics.php).
Открываем файл sources\lib\topic_linear.php
Ищем
code text
//-------------------------------------
// Format and print out the topic list
//-------------------------------------
После этих строк вписываем
code text
$max_time = 0;
Следом идёт
code text
while ( $row = $DB->fetch_row( $oq ) )
{
после них (внутри цикла уже) вписываем
code text
if($row['post_date']>$max_time)
$max_time = $row['post_date'];
Ищем
code text
//-------------------------------------
// Print the footer
//-------------------------------------
перед этими строками вписываем
code text
header ('Last-Modified: '.gmdate('D, d M Y H:i:s',$max_time).' GMT');
Сохраняем изменения.
Открываем lib\topic_threaded.php
Аналогично. Ищем
code text
//-------------------------------------
// Format and print out the topic list
//-------------------------------------
дописываем ниже
code text
$max_time = 0;
дальше идёт
code text
while ( $row = $DB->fetch_row() )
{
дописывем ниже
code text
if($row['post_date']>$max_time)
$max_time = $row['post_date'];
ищем
code text
//--------------------------------------------
// Sort out pagination
//--------------------------------------------
перед этими строками вписываем тоже
code text
header ('Last-Modified: '.gmdate('D, d M Y H:i:s',$max_time).' GMT');
Всё. Теперь форум возвращает корректные Last-Modified:
code text
M:\...ru\all-forums\forums-1.2-balancer\sources>r "http://forums.airbase.ru/index.php?showtopic=1"
--11:05:23-- http://forums.airbase.ru:80/index.php?showtopic=1
=> `index.php?showtopic=1'
Connecting to forums.airbase.ru:80... connected!
HTTP request sent, fetching headers...
1 HTTP/1.1 200 OK
2 Date: Wed, 21 Jul 2004 07:05:22 GMT
3 Server: Apache/2.0.50 (Unix) PHP/4.3.7
4 X-Powered-By: PHP/4.3.7
5 Content-Language: ru, ru
6 Set-Cookie: session_id=378e45e764f2e2847c885f095ee1d463; path=/; domain=.airbase.ru
7 Set-Cookie: modpids=deleted; expires=Tue, 22-Jul-2003 07:05:22 GMT; path=/; domain=.airbase.ru
8 [b]Last-Modified: Mon, 28 Apr 2003 08:45:49 GMT[/b]
9 Cache-Control: no-cache, must-revalidate, max-age=0
10 Expires: Mon, 26 Jul 1997 05:00:00 GMT
11 Pragma: no-cache
12 Connection: close
13 Content-Type: text/html;charset=utf-8
14
200 OK