Topic: SMF with modx from newbie to newbie  (Read 80187 times)

Pages: [1] 2 3 4   Go Down

#1: 19-Apr-2007, 04:15 PM

Brocoli
Posts: 15

  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:
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:
Code:
[[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))
Code:
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:
Code:
$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 ")
Code:
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.  Smiley

* index.template.php.txt (28.91 KB - downloaded 877 times.)
* index_php.txt (16.16 KB - downloaded 1035 times.)
« Last Edit: 5-May-2007, 03:29 PM by Brocoli »

#2: 19-Apr-2007, 04:19 PM

Foundation

rthrash
Posts: 11,282

WWW
Thanks so much for a great overview. Smiley
MODx is a content managmeent framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Please help us help you when asking for assistance and read the wiki. Searching the forums from the top level helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.

#3: 21-Apr-2007, 10:51 AM

Coding Team

pixelchutes
Posts: 885

WWW
  Hi everyone,

Here the way I have installed SMF in order to get it well integrated inside modx website.
...
That's all...

It should work.  Smiley

@Brocoli,

Wow! Thanks for the detailed tutorial. I have tried this before (briefly; not following these directions) and I recall receiving a few errors, sometimes only the first time you log into the forum, etc.

It sounds like, if following these instructions, that this implementation is totally error-free? Can't wait to try it out.

What about session timeouts? I thought I also read somewhere issues pertaining to Web Login session vs. SMF session not being in synch... any insight there?
Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.

#4: 23-Apr-2007, 11:01 AM

shtuck
Posts: 12

my forum is not a subdirectory of my cms folder, but rather a separate folder in my servers root directory

is it still possible for me to get this to work?

#5: 23-Apr-2007, 11:42 AM

Coding Team

pixelchutes
Posts: 885

WWW
my forum is not a subdirectory of my cms folder, but rather a separate folder in my servers root directory

is it still possible for me to get this to work?

@shtuck,

If your "CMS folder" was "yourdomain.com/modx/", pretty sure you could still use this if your forum was "yourdomain.com/forum/". Provided your paths are referenced correctly this should be possible, even though /forum isn't a subdir to /modx.

I would imagine the more common setup would be MODx installed to www root (e.g. yourdomain.com/ ) with /forum installed within.
« Last Edit: 23-Apr-2007, 12:08 PM by pixelchutes »
Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.

#6: 23-Apr-2007, 11:59 AM

shtuck
Posts: 12

thanks, ill keep trying to get it working

#7: 23-Apr-2007, 12:09 PM

Coding Team

pixelchutes
Posts: 885

WWW
thanks, ill keep trying to get it working

Looking at the code, you'll need to modify this much (at least):

<?php
return include_once($modx->config['base_path'] . '/forum/index.php');
?>

... Since your /forum doesn't exist within $modx->config['base_path'], you'll need to modify the path so this include() doesn't fail. IMO, I would consider moving the forum to your www root (same folder as your CMS)...Of course, that is provided you can do so without impacting other processes.
« Last Edit: 23-Apr-2007, 12:11 PM by pixelchutes »
Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.

#8: 23-Apr-2007, 02:51 PM

shtuck
Posts: 12

i have managed to move the forum into my Modx folder and sync all the users, however when i click the link for the forum instead of it appearing in my layout i get the following error

Code:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
 
PHP error debug
  Error: filemtime() [function.filemtime]: open_basedir restriction in effect. File(/Load.php) is not within the allowed path(s): (/home/jackal/:/usr/lib/php:/usr/local/lib/php:/tmp)
  Error type/ Nr.: Warning - 2
  File: /home/jackal/public_html/shtuck/forum/Sources/Load.php
  Line: 2135
  Line 2135 source: $key = md5($boardurl . filemtime($sourcedir . '/Load.php')) . '-SMF-' . $key;

you can view the site here

any help would be greatly appreciated

thanks

#9: 23-Apr-2007, 03:50 PM

Coding Team

pixelchutes
Posts: 885

WWW
Looks like a permissions issue. What are the file permissions (CHMOD) of your /forum and /forum/Sources directories?
Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.

#10: 23-Apr-2007, 05:50 PM

shtuck
Posts: 12

both 755, does that sound about right?

sorry, im not too sure what it should be
« Last Edit: 1-May-2007, 08:17 PM by shtuck »

#11: 24-Apr-2007, 04:39 PM

Brocoli
Posts: 15

Code:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
 
PHP error debug
  Error: filemtime() [function.filemtime]: open_basedir restriction in effect. File(/Load.php) is not within the allowed path(s): (/home/jackal/:/usr/lib/php:/usr/local/lib/php:/tmp)
  Error type/ Nr.: Warning - 2
  File: /home/jackal/public_html/shtuck/forum/Sources/Load.php
  Line: 2135
  Line 2135 source: $key = md5($boardurl . filemtime($sourcedir . '/Load.php')) . '-SMF-' . $key;

I think the variable $sourcedir = '' and it is not OK.

I have noticed that the file "index_php.txt" joined in my first post was empty !  Undecided  I have updated it.

So you need to do the following action specified in my first post :
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).
« Last Edit: 24-Apr-2007, 04:49 PM by Brocoli »

#12: 25-Apr-2007, 08:56 AM

shtuck
Posts: 12

after following those steps i now just get a blank page when i click on my forum link

http://www.shtuck.com

#13: 25-Apr-2007, 12:16 PM

Brocoli
Posts: 15

A blank page means that you have a php error somewhere...

To debug, could you add some "echo 'something'" in the file /forum/index.php in order to see exactly where is the problem coming from ?

Code:
echo 'beginning of the file'
...

echo 'debug1';
require(dirname(__FILE__) . '/Settings.php');
echo 'debug2';
// And important includes.
require_once($sourcedir . '/QueryString.php');
echo 'debug3';
require_once($sourcedir . '/Subs.php');
echo 'debug4';
require_once($sourcedir . '/Errors.php');
echo 'debug5';
require_once($sourcedir . '/Load.php');
echo 'debug6';
require_once($sourcedir . '/Security.php');
echo 'debug7';
...

#14: 25-Apr-2007, 12:28 PM

shtuck
Posts: 12

still getting a blank page with that code in the php file

#15: 25-Apr-2007, 02:15 PM

Brocoli
Posts: 15

Inside modx manager, remove the call to the snippet in the html page named "forum" (if you call it like this).

Retry, you should see an empty page (=just the template).

If not, then the error doesn't come from the forum...

#16: 25-Apr-2007, 05:51 PM

shtuck
Posts: 12

yes, just the template shows up

this means its a problem with my forum?

thanks

#17: 26-Apr-2007, 01:41 AM

Brocoli
Posts: 15

In order to not add too many messages in this post, I propose you to continue this in private mail (I have already sent one to you) and we'll post back here the solution.  Tongue

Thanks

#18: 25-May-2007, 05:37 AM

Newton
Posts: 20

Hello,
i tried the bridge and it worked for a few moments. The SMF standalone works fine, but the integration about the snippet call results an empty page, administration and so on works fine, through modx or alone.

But this is not my question, i could reinstall and that problem should be solved. I want to integrate the forum into my site, but dont want to use short ULRs/ModRewrite.

The Gallery 2 Module works fine and i manage the albums through the modx URL of the gallery page. The gallery is in modx and never kills the layout. SMF showed up in modx, but kills the layout immediatly after clicking something.

Is such an integration possible?

#19: 29-May-2007, 02:34 PM

L.G.S
Posts: 47

I need urgent assistance with this please. I installed the SMF bridge properly, and when I clicked apply module the login box on my forum disappeared and the main front page messed up as well.

My priority is not getting this to work now, but to get my forum back to working order. PLEASE can somebody tell me what SMF files this script modifies? It only happened as soon as I began to use the SMF module.

#20: 19-Jul-2007, 06:41 PM

muskokee
Posts: 31

I too am getting the blank page.  After checking the db event log, i can see that the forum database info is messing with modx's database info.  It is looking for the template in a table within the smf db and not the modx db where the template exists.

I think integrating the smf database tables with modxs tables would solve the problem. But there are similar database table names, so a different prefix must be used.

UPDATE:

I transfered all the smf tables over to my modx db, amended the database settings in smf's Settings.php and all is good!

The forum is actually within my modx page Cheesy

I'll update further if there are any other tricks I figure out.

Sheri

Last update:
I have given up.  After getting as far as I could, it is a exercise in futility.  SMF requires the use of $_GET variables.  Modx is not designed to use those!  A simple link to your forum after integrating the web users is the way to go.
« Last Edit: 19-Jul-2007, 10:35 PM by muskokee »
Pages: [1] 2 3 4   Go Up
0 Members and 1 Guest are viewing this topic.