1. Создайте поддомен forum.site.ru на папку основного домена или псевдоним основного домена. Так чтобы на поддомене открывался основной сайт.
2. Откройте файл index.php
После:
define ( 'DATALIFEENGINE', true );
Добавьте:
if (stristr($_SERVER['HTTP_HOST'], 'forum')) { $main_tpl = 'main_forum.tpl'; define('FORUM_SUB_DOMAIN_URL', true); $_REQUEST['do'] = 'forum'; } else { $main_tpl = 'main.tpl'; }
Найдите:
$tpl->load_template ( 'main.tpl' );
Замените на:
$tpl->load_template ( $main_tpl );
3. Откройте файл engine/forum/sources/components/init.php
Найдите:
if (!defined('FORUM_SUB_DOMAIN'))
Замените на:
if (!defined('FORUM_SUB_DOMAIN_URL'))
4. Откройте файл .htaccess
Добавьте (или замените записи для форума если форум будет использоваться только на поддомене):
# DLE Forum (sub domain) RewriteRule ^category_([0-9]+)(/?)+$ index.php?do=forum&category=$1 [L] RewriteRule ^forum_([0-9]+)(/?)+$ index.php?do=forum&showforum=$1 [L] RewriteRule ^forum_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showforum=$1&cstart=$2 [L] RewriteRule ^topic_([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1 [L] RewriteRule ^topic_([0-9]+)/last(/?)+$ index.php?do=forum&showtopic=$1&lastpost=1 [L] RewriteRule ^topic_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1&cstart=$2 [L] RewriteRule ^topic_([0-9]+)/reply(/?)+$ index.php?do=forum&act=_topic&code=reply&tid=$1 [L] RewriteRule ^forum_([0-9]+)/add(/?)+$ index.php?do=forum&act=add_topic&forum_id=$1 [L] RewriteRule ^search(/?)+$ index.php?do=forum&act=search [L] RewriteRule ^search/([^/]+)/([0-9]+)(/?)+$ index.php?do=forum&act=search&search_text=$1&cstart=$2 [L] RewriteRule ^subscription(/?)+$ index.php?do=forum&act=subscription [L] RewriteRule ^getnew(/?)+$ index.php?do=forum&act=getnew [L] RewriteRule ^getnew/([0-9]+)(/?)+$ index.php?do=forum&act=getnew&cstart=$1 [L] RewriteRule ^warn/([^/]*)(/?)+$ index.php?do=forum&act=warn&user=$1 [L] RewriteRule ^warn/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=warn&user=$1&cstart=$2 [L] RewriteRule ^reputation/([^/]*)(/?)+$ index.php?do=forum&act=reputation&user=$1 [L] RewriteRule ^reputation/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=reputation&user=$1&cstart=$2 [L]
5. Создайте шаблон сайта main_forum.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
Наш сайт не предоставляет ссылки на скачивание
"> <html xmlns="
Наш сайт не предоставляет ссылки на скачивание
">
<head> {headers} <style type="text/css" media="all">@import url({THEME}/css/style.css);</style> <style type="text/css" media="all">@import url({THEME}/css/engine.css);</style> </head>
<body> {AJAX} </body> <br /> {info}{content} </html>
Шаблон можно отредактировать как необходимо, в нем поддерживаются все теги что и в main.tpl