Mantis is installed in /usr/local/apache/htdocs/mantis/
Step 1: Install Phorum
Install Phorum by unzipping it to a directory. We will install it in
/usr/local/apache/htdocs/mantis/phorum/
Step 2: Configure Phorum
Use the same database as Mantis. Follow the rest of the Phorum configuration
steps.
Step 3: Add Phorum Link to the Menu
Open up core_html_API.php and find the print_menu() function declaration (near line 277).
Right at the top of the function chage this line:
global $g_string_cookie_val, $g_project_cookie_val,
to read
global $g_string_cookie_val, $g_project_cookie_val, $g_path,
After the line that reads:
PRINT "<a href=\"$g_summary_page\">$s_summary_link</a> | ";
Place this line:
PRINT "<a href=\"$g_path"."Phorum/\">Phorum</a> | ";
You could wrap it in an if check if
you'd like only users with a certain access level to view the forum link.
if ( access_level_check_greater_or_equal( DEVELOPER ) ) {
PRINT "<a href=\"$g_path"."Phorum/\">Phorum</a> | ";
}
This would only allow DEVELOPERS to see the Phorum link. Note that there is no further security. If a user guesses the url he/she can easily access the forums.
Step 4: Integrate with Mantis
Right now you can get to forum but there are no links with the rest of Mantis.
It's functional but not nicely integrated.
Step 4a: Header
Open up /usr/local/apache/htdocs/mantis/Phorum/include/header.php - You may want to make a backup because we're going to make large modifications.
Replace the entire file with the following lines:
<?php
$g_mantis_path = "/usr/local/www/data/mantis-0.17.3/";
$g_Phorum_path = getcwd();
chdir( $g_mantis_path );
include( $g_mantis_path."core_API.php" );
login_cookie_check();
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );
#check_access( DEVELOPER );
print_html_top();
print_head_top();
print_title( $g_window_title );
print_css( $g_css_include_file );
include( $g_meta_include_file );
?>
<link rel="STYLESHEET" type="text/css" href="<?php echo Phorum_get_file_name("css"); ?>" />
<meta name="Phorum Version" content="<?php echo $Phorumver; ?>" />
<meta name="Phorum DB" content="<?php echo $DB->type; ?>" />
<meta name="PHP Version" content="<?php echo phpversion(); ?>" />
<?php
print_head_bottom();
print_body_top();
print_header( $g_page_title );
print_top_page( $g_top_include_page );
print_login_info();
print_menu();
chdir( $g_Phorum_path );
?>
<div class="PhorumForumTitle"><strong><?php echo $ForumName; ?></strong></div>
<br />
This is pretty much copy+pasted from the normal mantis files with tweaks to
make sure errors are avoided.
For extra security in limiting users from accessing the forum you can place
access level check code right after the db_connect() call. Just uncomment this line:
#check_access( DEVELOPER );
Step 4b: Footer
Replace /usr/local/apache/htdocs/mantis/Phorum/include/footer.php with the
following lines:
<br />
<div align="center"><a href="http://Phorum.org"><img src="images/button.gif" width="90" height="30" alt="Phorum.org" border="0" /></a></div>
<?php
chdir( $g_mantis_path );
print_bottom_page( $g_bottom_include_page );
print_footer( "" );
print_body_bottom();
print_html_bottom();
?>
The show source link is likely to be broken. It shouldn't be important
so we won't try to make it work.
Step 5: Auto Filling Posting Data
At this point everything is functioning acceptably. Only users that are
logged into Mantis can access forum thanks to the login_cookie_check() in
Phorum's header.php.
Now we'll get down to making Phorum a bit easier to work with. One aspect of
Phorum is that it allows anonymous posting because it does not use a user
authentication method. This is one reason why it makes it fairly simple to
integrate with Mantis. The drawback is that you need to type in your username
and email address constantly. To avoid this we'll automatically fill these
fields in by using our Mantis information.
Open up /usr/local/apache/htdocs/mantis/Phorum/include/form.php.
Begin by adding these lines near the end of the first chunk of php code (line 66):
Right after these lines:
$p_author=$author;
$p_email=$email;
Insert:
$p_author = get_current_user_field( "username" );
$p_email = get_current_user_field( "email" );
Now the username and email fields should be automatically filled in each time.
FINISHED!
You're now finished integrating Phorum with Mantis!
If you wish to report any errors, comments, or suggestions please post to the mailing lists or forums.