Хостване на много форуми

Един от най-задаваните въпроси - как да направим система за хостване на форуми...еми, не е много трудно. Сваляте си този файл и...

...следвайте стъпките

------------------------
Стъпка 1 от 2 - Какво да направим
------------------------

1. Създайте нова база данни
2. Отворете config/multiforums.config.inc.php в някой текстов редактор и променете настройките за свързване с ДБ
3. Качете папката с phpBB форума с променени файлове (виж стапка 2), Не качвай config.php, contrib, install ! Можете да пропуснете преправянето на файловете, ако качите вече преработените.
4. Ако сте качили гореспоменатите файлове - изтрийте ги
5. Направете папка config и нагласете chmod на 777, качете index.php, multiforums.config.inc.php и settings.sql и нагласете chmod на 777
6. Качете new_forum.php, directory.php, multiforums_default_db.sql и аватарите в root dir
7. Нагласете CHMOD на images/avatars на 777 за да позволите на потребителите да качват свои аватари
8. Отидете в: http://www.адреса-на-сайта-ви.com/forums/config
9. Попълнете опциите
10. Тествайте системата: http://www.адреса-на-сайта-ви.com/forums/new_forum.php
11. Админ панела е на адрес: http://www.адреса-на-сайта-ви.com/forums/config
12. Директорията на форумите е на адрес: http://www.адреса-на-сайта-ви.com/forums/directory.php


Ако не искате да използвате вече променените файлове споменати в 1->3, направете следното:

Файл 1 oт 7 :
common.php
----------------
Намерете:


include($phpbb_root_path . 'config.'.$phpEx);

if( !defined("PHPBB_INSTALLED") )
{
header("Location: install/install.$phpEx");
exit;
}

Заменете го с:

// Start Multi-Forums Mod
include $phpbb_root_path . "config/multiforums.config.inc.php";

if ($_GET["mforum"]==true) {
setcookie ("ForumSetCookie", $_GET["mforum"], time()+31536000);
$mforum = $_GET["mforum"];
}
else
{
$mforum = $_COOKIE["ForumSetCookie"];
}

if ($mforum==false) {
header("Location: $multiforums_setting[noforum_error_url]");
exit;
}
else
{
if(is_file($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx))
{
if ($multiforums_setting[master_offline] == "1")
{
header("Location: $multiforums_setting[offline_error_url]");
exit;
}
else
{
$resultlink = mysql_query("SELECT * FROM `multiforums_forums` WHERE 1 AND `access_name` LIKE '$mforum' LIMIT 0 , 1");
if ($forum = mysql_fetch_array($resultlink)) {
if ($forum[bannerless] == "1") {
$this_forum_bannerless = "1";
}
else
{
$this_forum_bannerless = "0";
}

if ($forum[online] == false) {
header("Location: $multiforums_setting[offline_error_url]");
exit;
}
}

include($phpbb_root_path . 'config/'.$mforum.'.'.$phpEx);
}
}
else
{
header("Location: $multiforums_setting[exist_error_url]");
exit;
}
}
// End Multi-Forums Mod

----------------
Файл 2 oт 7 :
includes/usercp_register.php
----------------
Намерете:

'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)

Заменете го с:

'U_ACTIVATE' => $server_url . '?mforum=' . $mforum . '&mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey)

----------------
Файл 3 oт 7 :
includes/sessions.php
----------------
Намерете:

global $SID;

if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}

Заменете го с:

// Start Multi-Forums Mod
global $SID, $mforum;

if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID . "&mforum=$mforum";
}
else
{
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . "mforum=$mforum";
}
// End Multi-Forums Mod

----------------
Файл 4 oт 7 :
includes/page_header.php
----------------
Намерете:

$template->pparse('overall_header');

Заменете го с:

$template->pparse('overall_header');

// Start Multi-Forums Mod
// Get file name
$file_split = explode("/", $_SERVER[PHP_SELF]);
$file_parts = count($file_split);
$file_part_on = $file_parts - 1;
$this_pages_file_name = $file_split[$file_part_on];

// Get banned file names
global $multiforums_setting;
$illegal_file_names = $multiforums_setting[no_adverts];
$illegal_file_names_array = explode(",", $illegal_file_names);
$illegal_file_names_array = array_unique ($illegal_file_names_array);

$illegal_file_names_array_count = 0;
while($check_ban = each($illegal_file_names_array))
{
if ($this_pages_file_name == $illegal_file_names_array[$illegal_file_names_array_count])
{
$page_banned = true;
}
$illegal_file_names_array_count++;
}

if ($page_banned == true)
{
$display_adverts = false;
}
else
{
$display_adverts = true;
}

// Get list of bannerless forums
global $this_forum_bannerless;

if ($this_forum_bannerless == 1 OR $display_adverts == false)
{
$display_adverts = false;
}
else
{
$display_adverts = true;
}

if ($display_adverts == true)
{
echo $multiforums_setting[advert_top];
}
// End Multi-Forums Mod

----------------
Файл 5 oт 7 :
includes/page_tail.php
----------------
Намерете:

$template->pparse('overall_footer');

Заменете го с:

$template->pparse('overall_footer');

// Start Multi-Forums Mod
// Get file name
$file_split = explode("/", $_SERVER[PHP_SELF]);
$file_parts = count($file_split);
$file_part_on = $file_parts - 1;
$this_pages_file_name = $file_split[$file_part_on];

// Get banned file names
global $multiforums_setting;
$illegal_file_names = $multiforums_setting[no_adverts];
$illegal_file_names_array = explode(",", $illegal_file_names);
$illegal_file_names_array = array_unique ($illegal_file_names_array);

$illegal_file_names_array_count = 0;
while($check_ban = each($illegal_file_names_array))
{
if ($this_pages_file_name == $illegal_file_names_array[$illegal_file_names_array_count])
{
$page_banned = true;
}
$illegal_file_names_array_count++;
}

if ($page_banned == true)
{
$display_adverts = false;
}
else
{
$display_adverts = true;
}

// Get list of bannerless forums
global $this_forum_bannerless;

if ($this_forum_bannerless == 1 OR $display_adverts == false)
{
$display_adverts = false;
}
else
{
$display_adverts = true;
}

if ($display_adverts == true)
{
echo $multiforums_setting[advert_bottom];
}
// End Multi-Forums Mod

----------------
Файл 6 oт 7 :
admin/admin_board.php
----------------

Намерете:

$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];

if ($config_name == 'cookie_name')
{
$cookie_name = str_replace('.', '_', $new['cookie_name']);
}


Заменете с:


$new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];

if ($config_name == 'cookie_name')
{
$cookie_name = str_replace('.', '_', $new['cookie_name']);
}

// Start Multi-Forums edit - stopping users from changing server paths etc
$new['server_name'] = $default_config['server_name'];
$new['server_port'] = $default_config['server_port'];
$new['script_path'] = $default_config['script_path'];
$new['cookie_name'] = $default_config['cookie_name'];
$new['smilies_path'] = $default_config['smilies_path'];
$new['avatar_filesize'] = $default_config['avatar_filesize'];
$new['avatar_path'] = $default_config['avatar_path'];
$new['avatar_gallery_path'] = $default_config['avatar_gallery_path'];
// End Multi-Forums edit

----------------
Файл 7 oт 7 :
admin/admin_db_utilities.php
----------------
Намерете:

function pg_get_sequences($crlf, $backup_type)
{

Заменете го с:

function pg_get_sequences($crlf, $backup_type)
{
message_die(GENERAL_ERROR, "This feature has been disabled due to security reasons, please contact the administrator if you want a backup of your forums");

----------------
Намерете:

function get_table_def_postgresql($table, $crlf)
{

Заменете го с:

function get_table_def_postgresql($table, $crlf)
{
message_die(GENERAL_ERROR, "This feature has been disabled due to security reasons, please contact the administrator if you want a backup of your forums");

--------
Намерете:

function get_table_def_mysql($table, $crlf)
{

Заменете го с:

function get_table_def_mysql($table, $crlf)
{
message_die(GENERAL_ERROR, "This feature has been disabled due to security reasons, please contact the administrator if you want a backup of your forums");

-------
Намерете:

function get_table_content_postgresql($table, $handler)
{

Заменете го с:

function get_table_content_postgresql($table, $handler)
{
message_die(GENERAL_ERROR, "This feature has been disabled due to security reasons, please contact the administrator if you want a backup of your forums");

--------
Намерете:

function get_table_content_mysql($table, $handler)
{

Заменете го с:

function get_table_content_mysql($table, $handler)
{
message_die(GENERAL_ERROR, "This feature has been disabled due to security reasons, please contact the administrator if you want a backup of your forums");

--------
Намерете:

if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )
{

Заменете го с:

if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )
{
message_die(GENERAL_ERROR, "This feature has been disabled due to security reasons, please contact the administrator if you want a backup of your forums");


Еми, това е (най накрая...нали :D)

Урокът е подготвен от http://web-tourist.net













/ Трябва да сте регистриран за да напишете коментар /
От: nekafludpich123
12:23 11-09-2010
демо?
От: nekafludpich123
12:24 11-09-2010
и линка не работи
От: nekafludpich123
12:24 11-09-2010
и линка не работи
1