 |
| Шаблон или страница для ошибки 404 на DLE
| 29 января 2012 |
|
 |
|
|
|
|
Делаем шаблон для ошибки 404 в DataLife Engine.
В файле "engine/modules/functions.php" ищем:
function msgbox($title, $text) { global $tpl;
Заменяем на:
function msgbox($title, $text) { global $tpl, $lang; if( in_array('HTTP/1.0 404 Not Found', headers_list()) || $text == $lang['news_err_27'] ) { $tplName = '404.tpl'; }else{ $tplName = 'info.tpl'; }
Ищем:
$tpl_2->load_template( 'info.tpl' ); $tpl_2->set( '{error}', $text ); $tpl_2->set( '{title}', $title ); $tpl_2->compile( 'info' ); $tpl_2->clear();
Заменяем на:
$tpl_2->load_template( $tplName ); $tpl_2->set( '{error}', $text ); $tpl_2->set( '{title}', $title ); $tpl_2->compile( 'info' ); $tpl_2->clear();
Готово. Не забудьте создать шаблон 404.tpl.
Делаем отдельную страницу "/index.php?do=404" для ошибки 404 на DataLife Engine.
В файле "engine/modules/functions.php" ищем
function msgbox($title, $text) { global $tpl;
Заменяем на:
function msgbox($title, $text) { global $tpl, $lang; if( (in_array('HTTP/1.0 404 Not Found', headers_list()) || $text == $lang['news_err_27']) && $_GET['do'] != '404' ) { header("Location: /index.php?do=404"); exit(); }
В файле "engine/engine.php" ищем:
switch ( $do ) {
Вставляем ниже:
case '404': $tpl->load_template( '404.tpl' ); $tpl->compile( 'content' ); break;
Готово. Опять же, не забудьте создать шаблон 404.tpl.
|
|
|
|
 |
Информация |
 |
|
|
Посетители, находящиеся в группе Гости, не могут оставлять комментарии в данной новости.
|
|