Multi Forums Pro Host for phpBB Install Guide

------------------------
Step 1 of 2 - Setting up
------------------------

1. Create a new database
2. Open up config/multiforums.config.inc.php in a text editor and change the Database Connection Details
3. Upload the phpBB folder with your edited files (see step 2), do not upload config.php, contrib, install. You can skip this step if you using the pre-edited files.
4. If you have uploaded the files above in 2. delete them
5. Make a folder called config and chmod that folder to 777, upload the index.php, multiforums.config.inc.php and settings.sql file and chmod to 777
6. Upload new_forum.php, directory.php, multiforums_default_db.sql and avatars in the root dir
7. CHMOD images/avatars to 777 to allow you users to upload their own avatars
8. Goto to: http://www.your-web-site.com/forums/config
9. Fill out the options
10. Test it: http://www.your-web-site.com/forums/new_forum.php
11. Admin control panel can be access from: http://www.your-web-site.com/forums/config
12. Board Directory can be access from: http://www.your-web-site.com/forums/directory.php

------------------------
Step 2 of 2 - File editing (editing 7 files) <-- You can skip this step if you using the pre-edited files.
------------------------
File 1 of 7 :
common.php
----------------
Find:

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

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

--------
Replace with:

// 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

----------------
File 2 of 7 :
includes/usercp_register.php (code found 3 times)
----------------
Find:

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

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

----------------
File 3 of 7 :
includes/sessions.php
----------------
Find:

global $SID;

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

global $SID, $mforum;

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

----------------
File 4 of 7 :
includes/page_header.php
----------------
Find:

$template->pparse('overall_header');
--------
Replace with:

$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

----------------
File 5 of 7 :
includes/page_tail.php
----------------
Find:

$template->pparse('overall_footer');
--------
Replace with:

$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

----------------
File 6 of 7 :
admin/admin_board.php
----------------

Find:

$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']);
}

--------
Replace with:

$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

----------------
File 7 of 7 :
admin/admin_db_utilities.php
----------------
Find:

function pg_get_sequences($crlf, $backup_type)
{
--------
Replace with:

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");
----------------
Find:

function get_table_def_postgresql($table, $crlf)
{
--------
Replace with:

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");
----------------
Find:

function get_table_def_mysql($table, $crlf)
{
--------
Replace with:

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");
----------------
Find:

function get_table_content_postgresql($table, $handler)
{
--------
Replace with:

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");
----------------
Find:

function get_table_content_mysql($table, $handler)
{
--------
Replace with:

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");
----------------
Find:

if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )
{
--------
Replace with:

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");
----------------
And your done! :) Just re-read all of Step 1 and make sure everything is ok