Updated. Add Custom Error Page.
For this create new page, for example name - 404.php:
<?php
if (!defined('FORUM_ROOT'))
define('FORUM_ROOT', './');
require FORUM_ROOT.'include/common.php';
if ($forum_user['g_read_board'] == '0')
message($lang_common['No view']);
// Load the index.php language file
require FORUM_ROOT.'lang/'.$forum_user['language'].'/index.php';
// Setup main heading
$forum_page['main_title'] = forum_htmlencode($forum_config['o_board_title']);
define('FORUM_ALLOW_INDEX', 1);
define('FORUM_PAGE', 'index');
require FORUM_ROOT.'header.php';
// START SUBST - <!-- forum_main -->
ob_start();
?>
<div class="main-head">
<h2 class="hn"><span>Ошибка - 404</span></h2>
</div>
<div class="main-content main-message">
<p>Такой страницы не существует. </p>
<p>Возможно вас заинтересуют следующие темы.</p>
<p>здесь можно вывести самые горячие темы форума или другую полезную и интересную информацию. На некоторых сайтах, я заметил, многие пользователи выводят карту сайта.</p>
</div>
<?php
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
// START SUBST - <!-- forum_info -->
ob_start();
if (file_exists(FORUM_CACHE_DIR.'cache_stats.php'))
include FORUM_CACHE_DIR.'cache_stats.php';
// Regenerate cache only if the cache is more than 30 minutes old
if (!defined('FORUM_STATS_LOADED') || $forum_stats['cached'] < (time() - 1800))
{
if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
require FORUM_ROOT.'include/cache.php';
generate_stats_cache();
require FORUM_CACHE_DIR.'cache_stats.php';
}
$stats_list['no_of_users'] = '<li class="st-users"><span>'.sprintf($lang_index['No of users'], '<strong>'.forum_number_format($forum_stats['total_users']).'</strong>').'</span></li>';
$stats_list['newest_user'] = '<li class="st-users"><span>'.sprintf($lang_index['Newest user'], '<strong>'.($forum_user['g_view_users'] == '1' ? '<a href="'.forum_link($forum_url['user'], $forum_stats['last_user']['id']).'">'.forum_htmlencode($forum_stats['last_user']['username']).'</a>' : forum_htmlencode($forum_stats['last_user']['username'])).'</strong>').'</span></li>';
$stats_list['no_of_topics'] = '<li class="st-activity"><span>'.sprintf($lang_index['No of topics'], '<strong>'.forum_number_format($forum_stats['total_topics']).'</strong>').'</span></li>';
$stats_list['no_of_posts'] = '<li class="st-activity"><span>'.sprintf($lang_index['No of posts'], '<strong>'.forum_number_format($forum_stats['total_posts']).'</strong>').'</span></li>';
?>
<div id="brd-stats" class="gen-content">
<h2 class="hn"><span><?php echo $lang_index['Statistics'] ?></span></h2>
<ul>
<?php echo implode("\n\t\t", $stats_list)."\n" ?>
</ul>
</div>
<?php
if ($forum_config['o_users_online'] == '1')
{
// Fetch users online info and generate strings for output
$query = array(
'SELECT' => 'o.user_id, o.ident',
'FROM' => 'online AS o',
'WHERE' => 'o.idle=0',
'ORDER BY' => 'o.ident'
);
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_page['num_guests'] = $forum_page['num_users'] = 0;
$users = array();
while ($forum_user_online = $forum_db->fetch_assoc($result))
{
if ($forum_user_online['user_id'] > 1)
{
$users[] = ($forum_user['g_view_users'] == '1') ? '<a href="'.forum_link($forum_url['user'], $forum_user_online['user_id']).'">'.forum_htmlencode($forum_user_online['ident']).'</a>' : forum_htmlencode($forum_user_online['ident']);
++$forum_page['num_users'];
}
else
++$forum_page['num_guests'];
}
$forum_page['online_info'] = array();
$forum_page['online_info']['guests'] = ($forum_page['num_guests'] == 0) ? $lang_index['Guests none'] : sprintf((($forum_page['num_guests'] == 1) ? $lang_index['Guests single'] : $lang_index['Guests plural']), forum_number_format($forum_page['num_guests']));
$forum_page['online_info']['users'] = ($forum_page['num_users'] == 0) ? $lang_index['Users none'] : sprintf((($forum_page['num_users'] == 1) ? $lang_index['Users single'] : $lang_index['Users plural']), forum_number_format($forum_page['num_users']));
//Кто онлайн сегодня - добавлено из расширения
$online_today_query = array(
'SELECT' => 'id, username',
'FROM' => 'users',
'WHERE' => 'last_visit>'.strtotime(gmdate("M d Y")),
'ORDER BY' => 'username'
);
$online_today_result = $forum_db->query_build($online_today_query);
$online_today = array();
while(list($ot_id, $ot_username) = $forum_db->fetch_row($online_today_result))
$online_today[] = '<a href="'.forum_link($forum_url['user'], $ot_id).'">'.$ot_username.'</a>';
?>
<div id="brd-online" class="gen-content">
<h3 class="hn"><span><?php printf($lang_index['Currently online'], implode($lang_index['Online stats separator'], $forum_page['online_info'])) ?></span></h3>
<?php if (!empty($users)): ?>
<p><?php echo implode($lang_index['Online list separator'], $users) ?></p>
<?php if(!empty($online_today)) echo '<h3 class="hn"><span> Сегодня нас посетили: '.implode(', ', $online_today).'</span></h3>'; ?>
<?php endif; ($hook = get_hook('in_new_online_data')) ? eval($hook) : null; ?>
</div>
<?php
}
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_info -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_info -->
require FORUM_ROOT.'footer.php';
Rename the file .HTACCES.DICT on .htaccess
Go to options of SEO and set in field URL of file 404.php