1
Thought I should add this here too. I hope some people may have better ideas I can learn from? I posted this in the
SMF forum regarding Xoops/SMF integration using the
bridge/module:
Quote:
The intention of this lengthy post is to share my little experience with SMF/Xoops, and I hope to help others with ideas as well as show that this integration can work. I wish that more Xoopsers would use SMF and show enthusiasm so we may see continued help and support from such experts as Orstio, the bridge developer.
*I am using Xoops 2.0.16 and SMF 1.1.2, and I assume most or all of this will remain the same with the update to SMF 1.1.3 after Orstio resolves the sessions issue.
Of course, appropriate backups should be made of files, websites, and databases.
First, let's recap the basic procedures and settings that should apply to most of us when getting the bridge up and running.
• Upload the smf file to the modules folder.
• Go to XOOPS admin, and install like any other module.
• Configure the modules preferences with the path to the smf directory, like /home/name/public_html/SMFdirectory - then,
choose to have the forum wrapped or not.
• In XOOPS admin, configure your blocks. Make the SMF login block visible, and the XOOPS system login block invisible
(logging in MUST take place in the bridge login block to be signed into XOOPS and SMF at the same time).
• In XOOPS admin, configure groups permissions , making sure anonymous users have access to the SMF login block AND access
rights to the SMF module. Do the same with registered users. Admin should be fine by default, but double check.
• In XOOPS admin, system general preferences, be sure you have custom sessions ON.
This should get you close to success, but now you need to check your SMF server settings.
Core Configuration
• Your forum url should be that of the SMF module
• Your path and Sources directory should be the actual stand alone forum
Feature Configuration
• Enable local storage of cookies - unchecked
• Use subdomain independent cookies - CHECKED
• Enable compressed output - unchecked
• Use database driven sessions - CHECKED
Now, with any luck, your bridge is functioning properly! Test it out. Create and register new accounts, and use them in the site. Login, logout, change passwords, etc.
So, what about further integration? I have modified a few things on my XOOPS site and files to help mesh it all. I do not advise you to do the same or claim any of it is necessary for YOU, but you might gain a few new ideas.
I do not have the XOOPS User Menu visible, because those links do not point to SMF, and who wants multiple profiles for users? The links in the User Menu can be changed, but I chose not to use it at all.
Also, I have redirected XOOPS links that are no longer applicable, so users won't accidentally stumble upon them. Here are my redirections:
/userinfo.php --> /modules/smf/index.php?action=profile
/user.php --> /modules/smf/index.php?action=register
/register.php --> /modules/smf/index.php?action=register
/viewpmsg.php --> /modules/smf/index.php?action=pm
/StandAloneDirectory --> /modules/smf
/StandAloneDirectory/ --> /modules/smf
Might consider a redirection for /pmlite.php
Xoops comments include the poster's name and link to the profile, but the links point to the XOOPS profile. To fix this and have the link send you to the poster's SMF profile, I changed code in class/commentrenderer.php on line 340.
Replace:
With this:
*Important: this only works when users have the same XOOPS uid # as SMF u #. Due to some test accounts, my numbers were off, and I had to change a few users' numbers in the database. To be sure the numbers are the same for new registrations, I created a new user, and changed the XOOPS uid to match the SMF, and now the numbers are the same again for new registrations. That being said, this solution might not work effectively for some webmasters if the id numbers are not in sync. When correctly in sync, all is well.
Another issue to resolve or work around is the user avatar and post count, in XOOPS comments. I am sure there must be a way to get these from SMF, but I am not sure how the code should be, so I improvised by simply removing the avatars and post counts. I did so by altering code in /class/commentrenderer.php.
I commented out or deleted:
$poster['avatar'] = $com_poster->getVar('user_avatar');
and:
$poster['postnum'] = $com_poster->getVar('posts');
That removes the information. Then, in /modules/system/templates/system_comment.html the applicable code (pretty straight forward) should be removed so there are no empty spots where the avatar and post counts once existed.
For logging out, the SMF logout works to log users out of the entire site. We don't want users to have to be in the forum to logout though, so SSI comes in handy. I created a new block with this code:
require_once('/home/name/public_html/StandAloneForumDirectory/SSI.php');
global $context, $settings, $scripturl;
if ($context['user']['is_guest'])
{
ssi_login();
}
else
{
ssi_logout();
}
$_SESSION['logout_url'] = 'http://www.mywebsite.com' . $_SERVER['PHP_SELF'];
I am sure that not all of that code is needed to work. We can make this block available to registered users only, or anonymous users can see it and use it as another login location. Alternatively, this code can be placed in the XOOPS theme.html wherever desired. Put the call for SSI.php in the beginning of the theme file, and place the functions wherever you want...
The SSI feature is obviously useful, as we can read elsewhere in this forum, to include recent posts, who's online, and a welcome message.
There are still a few things to work out, but it's a pretty sweet collaboration between SMF and XOOPS if you ask me.
One thing I have played around with recently is the idea to have a wrapped AND unwrapped forum available for users to choose from when they visit. I have succeeded with this in the form of an iframe, but users can navigate out of the forum in the iframe, so that won't do. I don't know if cloning the module would work?
This concludes my rambling. I hope it helps a few people that actually read it. I also hope some people can give ME better suggestions. Hopefully this big post doesn't just get in everyone's way.
I don't know.