Mantis Logo
Mantis Manual
Manual
Modifications

Phorum
phpWebSite
Anonymous Reports
Daily Reports


Partner Links


Phorum
Last Modified: May 24, 2002 21:05PM
(Manits 0.17.3, Phorum 3.3.2b3)
Description

Phorum is a simple to use but fairly powerful forum system. It's useful as a discussion forum or a place to store knowledge. This file details the steps needed to allow Phorum to be smoothly integrated into Mantis.

Table of Contents
  • Required Packages
  • Step 0: Mantis is Working
  • Step 1: Install Phorum
  • Step 2: Configure Phorum
  • Step 3: Add Phorum Link to the Menu
  • Step 4: Integrate with Mantis
  • Step 4a: Header
  • Step 4b: Footer
  • Step 5: Auto Filling Posting Data
  • Finished

    Required Packages

  • Mantis 0.17.3 or later
  • Phorum 3.3.2b3

    Step 0: Mantis is Working

    Mantis is installed and running properly. Download Phorum and store it on the
    server.

    We will proceed assuming the following setup:

  • Your web root is /usr/local/apache/htdocs/

    On a windows box it would look something like this
    C:/apache/htdocs/mantis/ instead. Adapt to reflect your setup.
  • 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.

  • User Contributed Notes
    Phorum
    Add Notes About Notes
    arensw@hotmail.com
    28-Sep-2003 22:14
    #12
    Unfortunately this does not work with the current version of Mantis.
    Core_html_api.php is now mantis/core/html_api.php. While that's not a show stopper in itself the fact that line 355 "print_menu()" doesn't use the same method for generating the page menu. The list goes on. I am sure what's currently written is close Mantis 0.18 is different enough to make this integration less then trivial. If someone figures it out I'd love to know.
    Add Notes About Notes
    Last updated: Sat, 13 Mar 2010 - 17:39:27

    Mantis @ SourceForge