Brocoli Reply #1, 5 years, 1 month ago
Hi everyone,
Here the way I have installed SMF in order to get it well integrated inside modx website (Apache needed for Friendly URLs).
Step 1: Downloads You need to download:
- modx 0.9.2 or higher (tested with 0.9.5 below)
- SMF 1.1.1 or higher (tested with 1.1.2 below)
- SMF_Forum_Integration_1.0 connector from modx ressources website ("SMF_module.zip or .tgz" can be downloaded here: http://modxcms.com/forums/index.php/topic,3565.0.html )
Step 2: Installations Install modx in the normal way
Install SMF in the normal way (in "/forum" directory for example)
Install SMF_Forum_Integration_1.0 in the normal way
Step 2.1: Friendly URLs Friendly URLs inside modx must be activated:
In modx manager -> Tools -> Configuration -> Friendly URLs -> Select yes
Rename the file "/ht.access" to ".htaccess"
Step 3: Creation of the forum modx page Inside modx manager, create a new snippet (for exemple 'forumsnippet') with following code:
Then create a new html page named for exemple "Forum" and enter an alias name (for exemple: "forum") that contain the previous snippet:
Step 4: Modifying forum index.php file Replace the file "/forum/index.php" by the one joined in this post: Rename "index_php.txt" to "index.php" and put it in "/forum/" (use diff to see the differences if wanted).
Step 5: Preview When you type in Firefox the url to the forum page (like http://yoursite/forum.html ), you should see the forum inside the template of your web site but not very well displayed.
If not, then you have an error. You need to try again from step 1.
Step 6: Forum template To integrate perfectly the forum inside your website, you should create a template of SMF (see SMF documentation to do it).
When it is done, you need to modify the "index.template.php" file as the one joined in this post (make diff to the "index.template.php" default theme to see the differences):
Then you need to set this new theme as the default one for your forum: In modx manager -> Modules -> SMF Connector -> Administration Center, Go to the forum and then you should see the forum page and the forum menu. Install the new theme (see SMF documentation to do it) and make it the default one.
Step 7: Modifying forum php source code You need to modify some source code of SMF as following:
Directing the link to the forum modx page instead of index.php forum page: In the file "/forum/Sources/QueryString.php", (replace 'index.php' by the alias name of the forum page ('forum.html' for exemple))
In the file '/forum/Settings.php', remove '/forum' at the end of:
Removing the copyright alert message: In the file "/forum/Sources/Subs.php", (do not forget the space character at the end of following "Powered by ")
Step 8: Synchronize users Now add the already modx users to the SMF users by doing:
In modx manager -> Modules -> SMF Connector -> Synchronize Users
Step 9: The end ! That's all...
Do not forget to logout from SMF Connector (In modx manager -> Modules -> SMF Connector -> Logout (at right side)) when you want to test from your website otherwise, you'll see the forum as if you'll be connected as the admin of the forum.
It should work.
Here the way I have installed SMF in order to get it well integrated inside modx website (Apache needed for Friendly URLs).
Step 1: Downloads You need to download:
- modx 0.9.2 or higher (tested with 0.9.5 below)
- SMF 1.1.1 or higher (tested with 1.1.2 below)
- SMF_Forum_Integration_1.0 connector from modx ressources website ("SMF_module.zip or .tgz" can be downloaded here: http://modxcms.com/forums/index.php/topic,3565.0.html )
Step 2: Installations Install modx in the normal way
Install SMF in the normal way (in "/forum" directory for example)
Install SMF_Forum_Integration_1.0 in the normal way
Step 2.1: Friendly URLs Friendly URLs inside modx must be activated:
In modx manager -> Tools -> Configuration -> Friendly URLs -> Select yes
Rename the file "/ht.access" to ".htaccess"
Step 3: Creation of the forum modx page Inside modx manager, create a new snippet (for exemple 'forumsnippet') with following code:
<?php include_once($modx->config['base_path'] . '/forum/index.php'); return ; ?>
Then create a new html page named for exemple "Forum" and enter an alias name (for exemple: "forum") that contain the previous snippet:
[[forumsnippet]]
Step 4: Modifying forum index.php file Replace the file "/forum/index.php" by the one joined in this post: Rename "index_php.txt" to "index.php" and put it in "/forum/" (use diff to see the differences if wanted).
Step 5: Preview When you type in Firefox the url to the forum page (like http://yoursite/forum.html ), you should see the forum inside the template of your web site but not very well displayed.
If not, then you have an error. You need to try again from step 1.
Step 6: Forum template To integrate perfectly the forum inside your website, you should create a template of SMF (see SMF documentation to do it).
When it is done, you need to modify the "index.template.php" file as the one joined in this post (make diff to the "index.template.php" default theme to see the differences):
Then you need to set this new theme as the default one for your forum: In modx manager -> Modules -> SMF Connector -> Administration Center, Go to the forum and then you should see the forum page and the forum menu. Install the new theme (see SMF documentation to do it) and make it the default one.
Step 7: Modifying forum php source code You need to modify some source code of SMF as following:
Directing the link to the forum modx page instead of index.php forum page: In the file "/forum/Sources/QueryString.php", (replace 'index.php' by the alias name of the forum page ('forum.html' for exemple))
function cleanRequest()
{
global $board, $topic, $boardurl, $scripturl, $modSettings;
// Makes it easier to refer to things this way.
// $scripturl = $boardurl . '/index.php';
$scripturl = $boardurl . '/forum.html';
In the file '/forum/Settings.php', remove '/forum' at the end of:
$boardurl = 'http://yoursite'; # URL to your forum's folder. (without the trailing /!)
Removing the copyright alert message: In the file "/forum/Sources/Subs.php", (do not forget the space character at the end of following "Powered by ")
function theme_copyright($get_it = false)
{
...
$forum_copyright = preg_replace('~(<a href="http://www.simplemachines.org/"[^>]+>Powered
by )</a>~', '$1' . $match[1] . '</a>', $forum_copyright);
...
Step 8: Synchronize users Now add the already modx users to the SMF users by doing:
In modx manager -> Modules -> SMF Connector -> Synchronize Users
Step 9: The end ! That's all...
Do not forget to logout from SMF Connector (In modx manager -> Modules -> SMF Connector -> Logout (at right side)) when you want to test from your website otherwise, you'll see the forum as if you'll be connected as the admin of the forum.
It should work.
