Simple Machines Forum Integration

Description

Simple Machines Forum (SMF) is professional, free software that allows you to set up your own online community. It is designed to provide you with the powerful but simple, easy to use tools and options. Each feature should also ensure the performance and the security.

If you want to take advantage of this forum solution, you need to use SMF plug-in to create online community for your Vivvo website.

SMF plug-in will easily integrate this forum software into your Vivvo system. After you install Simple Machines Forum, you will have full-featured forum completely integrated with your system, user profiles and comment management.

How to Install?

Prior to installing the plug-in itself, you need to make few modifications to SMF original code that will allow Vivvo to integrate login/logout procedures.

Go to SMF_ROOT/Sources/LogInOut.php file of your SMF installation and search for the function Login2() (around line 91). After this code:

global $txt, $db_prefix, $scripturl, $user_info, $user_settings;
global $cookiename, $maintenance, $ID_MEMBER, $modSettings, $context, $sc;
global $sourcedir;

place the following code:

if ($_REQUEST['login_url']){
preg_match('/^http:\/\/([^\/]+)/',$_REQUEST['login_url'], $login_url_domain);	
preg_match('/^http:\/\/www\.([^\/]+)/',$_REQUEST['login_url'], $login_url_domain1);
if (($_SERVER['SERVER_NAME'] == $login_url_domain[1]) or (($_SERVER['SERVER_NAME'] == $login_url_domain1[1]))){
     $_SESSION['login_url'] = $_REQUEST['login_url'];
     }
}

Then you should find function Logout() (around line 440) and after the code line shown below:

global $db_prefix, $sourcedir, $ID_MEMBER, $user_info, $user_settings, $context, $modSettings;

insert the following code:

if ($_REQUEST['logout_url']){
preg_match('/^http:\/\/([^\/]+)/',$_REQUEST['logout_url'], $logout_url_domain);
preg_match('/^http:\/\/www\.([^\/]+)/',$_REQUEST['logout_url'], $logout_url_domain1);
if (($_SERVER['SERVER_NAME'] == $logout_url_domain[1]) or (($_SERVER['SERVER_NAME'] == $logout_url_domain1[1]))){
     $_SESSION['logout_url'] = $_REQUEST['logout_url'];
     $internal = true;
     }
}

Integration code we added is valid up to version 1.1.4

In case your forum is installed in Vivvo directory, it is necessary to place .htaccess into this folder in order to make forum functional.

.htaccess content:

<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>

Please note that if you apply those changes, you will be taken to the start page automatically after you have been logged in.

After you have completed this pre-installation step, you can install the plug-in.

Access the Plug-ins section. Click on Plug-ins link which is located in the Main menu at the top of your administration panel.

menu

A list of all plug-ins currently registered to the system is displayed on the right hand side of the screen.

right menu

To install SMF plug-in you need to click on the install icon on the right side of the plug-ins name.

Simple Machines Forum install

This will take you to the page with the following fields. Just fill-in the values of corresponding parameters:

Simple Machines Forum install step 1

SMF url

You should enter the full URL address of your website, www.example.com/smf/ ('http://' prefix and slash are mandatory)

SMF FS root

In this box you should place a local path on your server where SMF is installed (/home/user/smf/).

Do not go any further in the installation until you have both the URL and root added. After you enter these required fields, press the Next button to proceed with the installation.

In the next step, you need to add few parameters in the form shown below:

Simple Machines Forum install step 2

SMF User id

This is ID of the first registered user in Forum that should be the Administrator. The user with this ID will act like a BOT that automatically creates a thread. The title of that thread will correspond to respective article title and the thread will have a back link to actual article.

SMF Forum id

This is the board ID that stores all auto-created threads. Threads will be placed in this board after they have automatically been created. For example, after you install SMF, there is a board called General with id=1. You can simply create the board in Forum and the board ID will be system-generated.

Simple Machines Forum install step 2a

Select admin groups

Use this field to select an appropriate SMF group to match Vivvo admin group

Simple Machines Forum install step 2b

Select editor groups

Use this field to select an appropriate SMF group to match Vivvo editor group

Simple Machines Forum install step 2c

Select trusted writer groups

Use this field to select an appropriate SMF group to match Vivvo trusted writer group

Simple Machines Forum install step 2d

Select writer groups

Use this field to select an appropriate SMF group to match Vivvo writer group

Simple Machines Forum install step 2e

Select premium member groups

Use this field to select an appropriate SMF group to match Vivvo premium member group

Simple Machines Forum install step 2f

Select member groups

Use this field to select appropriate SMF group to match Vivvo member group

If you did everything correctly, you will be informed that the plug-in was successfully installed and configured. Also, you will be notified that the SMF plug-in has taken over the user/comments of the system:

Simple Machines Forum install step 3

The system will redirect you to the corresponding start page, or if it fails you will be taken to SMF login page.

This plug-in requires editing one code line in the template file. In order to add this functionality and activate SMF module you should make the required change:

Open /xhtml/article/default.tpl file and instead of this code line (around line 47):

<vte:include file="{VIVVO_TEMPLATE_DIR}box/comments.tpl" />

place the following:

<vte:include file="{VIVVO_TEMPLATE_DIR}box/smf_comments.tpl" />

If SMF comments are not displayed please be sure to the following option is disabled: Preferences -> Layout & modules -> Enable Vivvo comments

How to Uninstall?

To uninstall SMF integration plug-in you need to click on the uninstall icon on the right side of the plug-in name.

Simple Machines Forum uninstall

This will take you to the page with the link for uninstall: Click here to Uninstall the plug-in

Simple Machines Forum uninstall step 1

You will be informed that the plug-in was successfully uninstalled. After clicking on a logout link Click here to logout, you will be taken back to the main login screen. From this point on you can login into Vivvo only by using your Vivvo credentials.

Simple Machines Forum uninstall step 2

To complete the uninstall procedure you need to edit one code line in the template file.

Open /xhtml/article/default.tpl file and instead of this code line (around line 47):

<vte:include file="{VIVVO_TEMPLATE_DIR}box/comments.tpl" />

place the following:

<vte:include file="{VIVVO_TEMPLATE_DIR}box/ comments.tpl" />

If Vivvo comments are not displayed please be sure to the following option is enabled: Preferences -> Layout & modules -> Enable Vivvo comments

Access

Once you have installed the SMF forum it will be run automatically.

User level

This plug-in can be accessed only by users with administrator-level privileges.

Actions

Simple Machines Forum log in

You need to log in through the frontend via Log in form, with your username and password. If the user credentials are right, you will pass the validation and this will redirect you to the frontend page. After this you’ll be logged to both systems.

Simple Machines Forum logged in

You may also log in to the backend via Log in form. If you pass the validation you will be taken to the backend.

If the validation fails you will be redirected to the SMF login page.

To log out from the system through the frontend use the Log out form. This will take effect on the site as well as on the forums.

You may also log out through the backend using the Log out form.

Auto-generated threads

Registration form – this will redirect you to SMF registration form.