News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Combined Readme Thread for the SMF-Mambo bridge [1.1.2 Stable and 2.0beta1]

Started by Kindred, October 10, 2007, 06:05:25 PM

Previous topic - Next topic

Kindred

This thread now covers the bridge for SMF 1.1.x and Mambo 4.6.x
The bridge for SMF 1.1.x is 1.1.2 Stable here.
The bridge for SMF 2.x is 2.0beta1 here.



Please note: I have not yet verified all of the statements in this list against 2.0beta1. They SHOULD be the same, but I make no promises until I have time to review....



If you are using SMF RC1 or prior (including 1.0.x) you will need to upgrade your SMF installation.

If you are using mambo 4.5.x or prior, you will need to upgrade your Mambo installation (You should be using Mambo 4.6 or higher.


If you are using Joomla, then please go over to the support area dedicated to the joomla bridge (but, be aware, the joomla bridge has been discontinued).

I have tried to split this thread into distinct sections. If you are confused, please read the whole thing before asking questions!

Please also be sure to read the Mambo bridge FAQ


In addition, this is a tutorial on modifying your SMF theme to be properly used in a bridged (wrapped) forum.
http://www.technoadvice.com/advanced/developer/modify_an_smf_theme_for_joomla_and_mambo.html



Installation of the bridge with Mambo
Width of Themes pages in SMF?
Modifications for Additional Functions and Code Hacks
THEMES!
OTHER MODULES/BOTS
MODULES & BOTS for bridged sites
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

#1
THIS message specifically pertains to SMF 1.1.x in combination with Mambo version 4.6.2.

There is now a system mambot that automatically inserts the code that you were previously required to add, by hand, into the mambo template. If you have previously modified mambo templates, you MUST remove this code from the <head> section of that template!

It should be noted, before you start with this bridge...
Everything in these instructions assumes that you already have Mambo (4.6.2) and SMF (1.1.x) installed and working as stand-alone utilities.

For simplicity, if you don't know exactly what you are doing:
- SMF should be installed in a "sub level" directory. (i.e. www.yoursite.com/forum or something like that)
- Mambo can be installed in a "sub level" directory or at the top level itself.

The bridge is available HERE

START:

First, DO NOT extract the contents of the Bridge ZIP file.

For new installs:

Open the ZIP package, read the readme.html, and then install the bridge ZIP archive file in the Mambo Universal Installer.

For upgrades from bridges 1.1.2 or 1.1.3:

Uninstall the bridge component, the bridge registration component, and the mod_smf_login module.  Remove the code from your Mambo template.

For upgrades from bridges 1.1.4 through 1.1.7:

Uninstall the bridge component, the bridge registration component, the mod_smf_login module, and the smf_header_include mambot.

Open the ZIP package, read the readme.html, and then install the bridge ZIP archive file in the Mambo Universal Installer.


INSTALLATION INSTRUCTIONS:

Now that you have the archive ready to load, you can log in to your
server and start installation.

This README has a detailed instructions, but the new one-step design makes things
fairly easy and straight-forward. Make sure you read the README.HTML file first!

1 ) Make sure that the mambots/system directory and the mambots/authenticator directory are chmod 777 (they may not be, by default).

2 ) Install the Simple Machines Forum component.
      2a) Using Mambo Admin > Installers > Universal
      2b) Choose Upload File Package and Browse to the into which you extracted
             the bridge and choose the bridge ZIP file that you downloaded.
      2c) This now automatically installs the bridge, including the regsitration component,
             the mod_smf_login module and the SMF_header_include mambo as well
             as several other authenticator mambots.

3 ) Configure the SMF component in Mambo Admin.
      3a) Using the Mambo Admin, choose Components > SMF Bridge > Configuration

     CONFIGURATION TAB
      3b) Set the Path to SMF. This is NOT a URL! This is the absolute path to your SMF
            Installation.
            (Usually this will be something similar to /home/username/public_html/forum)
      3c) Choose if you want your Forum wrapped or unwrapped.
 
            It should be noted that there are essentially three formats to display your Mambo
            to Forum integration:
      Wrapped:         You are using SMF through the Mambo bridge. The Forum appears
                           "wrapped" in the Mambo template.
      Unwrapped:      You are still using SMF through Mambo, but it doesn't have the
                           look of a wrapped forum. It looks stand-alone, but it is actually
                           loading through Mambo.
                           This is set in the Mambo config for the component.

     REGISTRATION TAB
      3d) Choose what registration method you want to use:
            - The bridge registration looks like mambo's registration method...
              (please remember to UNPUBLISH the smf_register mambot)
            - The mambo registration uses Mambo's registration routine...
              (please remember to PUBLISH the smf_register mambot)
            - The SMF registration uses SMF's registration routine...
              (please remember to UNPUBLISH the smf_register mambot)
            - The Community Builder registration uses the CB registration component...
              (please remember to PUBLISH the smf_register mambot)
            - The MamboCharge registration uses the MamboCharge registration
               component... 
            but all options will still result in the users being added to both databases (eventually).
      3e) Require Registration Agreement? Display the agreement.txt from SMF's directory and
           require "I agree" to be checked?
      3f) Ask for ICQ, AIM, YIM, MSN? At registration time, as for the IM info?
      3g) Send a SMF PM to the user on registration?
      3h) Use real name or username as display? For SMF, is the Mambo NAME
            (aka realname) used as their display name or is the Mambo USERNAME
            (login name) used for both the username AND display name fields?
      3i) Also register into Community Builder?
           (You must have Community Builder already installed, and be using Bridge Registration)

     GROUPS TAB
      3j) Associate the SMF groups with the Mambo Groups here. This is ONE WAY, SMF to Mambo!
           It will not make a Mambo admin into an SMF admin!

     SYNC TAB
      3k) This should be self-explanatory.

4 ) Other Configuration notes
      4a) You will probably want to start SMF off with default settings...
      4b) If you make the Mambo menu item (for the SMF - Bridge component) available to
            registered users only, the login and registration may not function correctly.
      4c) Activation emails should be handled by Mambo (for mambo or Bridge Registration)
            or in SMF (for SMF registration)
      4d) Decide how you want to handle login/logout.
            Do you want to use the basic Mambo login module (mod_login)? [skip to 6, below]
            or
            do you want to use the bridge login module (mod_smf_login)? [read 5, below, skip 6]

5) Using the Bridge login module:
      5a) Configure the Login Form (mod_smf_login)
            Choose what options you want displayed in your Login box...
      5b) Even if you do not change any options, click SAVE!
            It is a known issue in Mambo that modules must sometimes be "saved" at least
            once in order to be fully activated.
      5c) Make sure that the following mambots are UNPUBLISHED:
            SMF_login
            SMF_logout
      5d) In Mambo Admin > Menu > User Menu : Remove the link for the Mambo Logout.

6) Using the Mambo login module:
      6a) Configure the Login Form (mod_login)
      6b) Make sure that the following mambots are PUBLISHED:
            SMF_login
            SMF_logout

7 ) Mambots
     7a) Make sure that the other smf authenticator mambots are published.
         This will enable changes in the Mambo user profile to be mirrored to the SMF user profile.

8 ) In Mambo Admin > Menu > Main Menu
     8a) Add a new Component Menu item for the SMF- Bridge Component.
           (this is not a link - URL!)
     8b) If you want to add the forum link to any other menu, use Link - Component
           AFTER you have added the original Component to the main menu.

9 ) In SMF Admin:
     9a) Server Settings > Feature Configuration > "Use subdomain independent cookies" turned ON
     9b) Server Settings > Feature Configuration > "Enable local storage of cookies" turned OFF
     9c) Server Settings > Feature Configuration > "Enable Compressed Output" turned OFF
     9d) Features & Options > "Search engine friendly URLs" turned OFF
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

If you are having troubles with the width of the theme setup page in any version of SMF 1.1 while it is wrapped:

In the core theme, in Themes.template.php, find this (3 instances, on lines 100, 108, and 117):

<td style="padding-left: 20%;">

replace with this:

<td style="padding-left: 20ex;">

I also came across a similar issue with the "find and fix errors" link in the Admin section.
If your board is large enough that it has to do the find/fix in slices, there is a "percent complete" bar that gets filled in. The page with this bar has the same extreme width issue and has the same fix. in Admin.template.php, change the 20% to 20ex.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

#3
ADDITIONAL FUNCTIONS:




REDIRECT USERS FROM ACCESSING THE FORUM DIRECT URL

Inserting the code below into smf's index.php will redirect any users who access the forum URL directly into the mambo wrapped forum URL.
Orstio made the original hack and exrace modified it...


// Redirect users who try to access /forum directly
if (strpos($_SERVER['QUERY_STRING'], 'dlattach') === false && strpos($_SERVER['QUERY_STRING'], 'verificationcode') === false)
{
        if(!defined('_VALID_MOS')){ header("Location: /index.php?option=com_smf&Itemid=yourItemidNum&".$_SERVER['QUERY_STRING']); }
}





REDIRECT ON LOGIN (from Mambo - on an unwrapped, bridged forum)

Orstio has posted this code to allow a forum that is set to unwrapped, and is using the mod_smf_login module to still redirect as expected when logging in.

global $configuration, $params;
if ($params->get('login') == '2' && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'login') && (!isset($_REQUEST['option']) || $_REQUEST['option'] != 'com_smf_registration'))
$_SESSION['return'] = $configuration->get('mosConfig_sef')=='1' ? sefReltoAbs('index.php?' . $_SERVER['QUERY_STRING']) : $configuration->get('mosConfig_live_site')  . '/index.php?' . $_SERVER['QUERY_STRING'];


Keep in mind that there is Mambo-specific code in there, and that may result in errors if you access the stand alone forum.






MULTIPLE FORUMS!

GooseMoose has come up with another amazing hack.
This one allows you to run multiple forums (with completely separate message boards) sharing the same mambo login. In other words, access to the site gives you access to all the separate forums.
CODE HACK AND DISCUSSION




SEARCH SMF, COPPERMINE and MAMBO

To add a search function of SMF (and Coppermine) to your mambo search box, check out
THIS thread by bmwheaven
(This is different from the searchbot!)




ADD COPPERMINE LINK TO THE USER DATA DISPLAYED IN POSTS

to add the coppermine link to your user's posts (or anywhere else) and still open it
wrapped in mambo, Goosemoose has come up with the following modification:

First, insert the following code before the words "// auto height control" in wrapper.php in your wrapper components folder.

// pass all except Mambo specific parameters to the wrapper
    $allparams = '?';
             
    if (isset( $_GET['option'] ))
      $workarray = $_GET;
    if (isset( $_POST['option'] ))
      $workarray = $_POST;
             
    reset($workarray);

    while (list($key, $val) = each($workarray)) {
    if (($key != 'option') && ($key != 'Itemid'))
        $allparams = $allparams . $key . '=' . $val . '&';
    }
    $row->url = $row->url . $allparams;


Now open your display.template.php in your SMF theme and add the following code after where you want the gallery link to occur, I placed mine below the personal text which you can find by searching for:
// Show their personal text?


// Add for personal gallery
      echo '
', '<a href="' . $mosConfig_live_site . 'index.php?option=com_wrapper&Itemid=66&cat=', $message['member']['id']+10000, '"/><img border="0" src="' . $settings['images_url'] . '/gallery.gif" width="75" height="35" alt="" /></a><br />';


and finally, the code to make coppermine's wrapped page return to the top when you click on a link.
In mambo's file, wrapper.html.php, insert the following twice into the function iFrameHeight:
parent.scrollTo(0,0);

so your function looks like this:

function iFrameHeight() {
var h = 0;
if ( !document.all ) {
h = document.getElementById('blockrandom').contentDocument.height;
document.getElementById('blockrandom').style.height = h + 60 + 'px';
parent.scrollTo(0,0);
} else if( document.all ) {
h = document.frames('blockrandom').document.body.scrollHeight;
document.all.blockrandom.style.height = h + 20 + 'px';
parent.scrollTo(0,0);
}
}


How this is going to work (this is for the info of those who want to use this elsewhere):
Now anytime you call a wrapper from smf or anywhere else anything that you add to the end of the link with &putparamatershere will get added on to the actual wrapped page. For example if you want to link to a user gallery the address is usually http://www.yoursite.com/coppermine/index.php?cat=15031 but your coppermine wrapper is actually something like http://www.yoursite.com/index.php?option=com_wrapper&Itemid=66, and it wraps http://www.yoursite.com/coppermine/index.php. Now that we have edited wrapper.php if you call the wrapped item by saying http://www.yoursite.com/index.php?option=com_wrapper&Itemid=66&cat=10001 the &cat=10001 will become ?cat=10001 and get appended to the http://www.yoursite.com/coppermine/index.php and become a link to that users gallery, http://www.yoursite.com/coppermine/index.php?cat=10001.




FIXING LINKS IN SMF MESSAGES FROM PRE-BRIDGED FORUMS

(thanks to Goosemoose for this)
If you were running a forum prior to bridging it with mambo, there will be links in
messages that point to the unbridged forum location. You can change these by going
into phpMyAdmin and running a simple SQL command on the smf_messages table.

The format is:


UPDATE smf_messages SET `body` = replace(`body`,"http://www.yoursite.com/forum/index.php?","http://www.yoursite.com/mambo/index.php?option=com_smf&Itemid=##&")


where smf_messages is your actual table (change the smf_ if you are using a different
prefix, obviously)
where http://www.yoursite.com/forum/index.php is the actual URL of your previous
(unbridged) SMF index.php.
where http://www.yoursite.com/mambo/index.php is the actual location of your MAMBO/JOOMLA
index.php
where Itemid=## is your actual SMF component Itemid

so, an example, (as provided by Goosemoose)


UPDATE rfc_messages SET `body` = replace(`body`,"http://www.goosemoose.com/rfc/index.php?topic=","http://www.goosemoose.com/index.php?option=com_smf&Itemid=70&topic=")


He used rfc_ as his SMF database table prefix and rfc was the SMF directory.
note that his mambo is installed in the root directory...




Audible alert on new PM
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

THEMING:

Changing the SMF doc_type from xhtml to html will handle many of the basic "super large font" issues.
The can be done by changing the line near the top of index.template.php in your SMF Theme directory.
However, some of the Mambo templates and SMF themes do not play well together.

In the Mambo Template, fixed width templates of less than 500 pixels width are difficult for SMF to "fit in".
You have two main options.
The first is to increase the basic width of the Mambo Template.
-> In MAMBO/templates/TEMPLATE_NAME/index.php, change the width call of the main table to something larger...

The second option, which may require some tweaking, is the change the Mambo Template into a variable width template.
-> In MAMBO/templates/TEMPLATE_NAME/index.php, change the width call of the main table 100%...

In addition to the width issues, there are some overlaps in the CSS entires between Mambo and SMF.
The CSS files for Mambo and SMF have some duplicate values that may conflict.
A proper design of the bridged site will include personalized templates/themes for Mambo/Joomla and SMF that will avoid this situation. This may take some time (and effort), however. You can make a "quick and dirty" merge of the CSS files by doing the following:

Open the MAMBO/templates/TEMPLATE_NAME/css/template_css.css file
Open the SMF/Themes/THEME_NAME/style.css file

Copy all of the SMF Theme file into the Mambo template file.
Remove the Duplicate entries from the newly copied portion.
(In other words, if the CSS entry exists in the Mambo template, delete the entry in the newly created SMF section)
Now save it, and then remove the same "duplicate" entries in the style.css file in your SMF theme directory.

In addition, Jen Smith has found a CSS Integrator that does a nice job:
Quote from: Jen Smith on March 26, 2007, 10:26:05 AM
I started working on another Joomla/SMF integrated web site for a friend of mine, and I came across this nifty little page called the CSS Integrator.  This thing saved me a lot of time getting the SMF and Joomla templates to play nicely together.

It's pretty simple.  First, you send the script your SMF theme's CSS file.  It processes it and sends back a modified version of it.  All it's really doing is making a "child class" of your CSS entries with the name you specify.

After that's done, you need to change your template's index.template.php file a tad.

First, where it's calling the template's CSS file, you need to change that to the name of the new CSS file.

Then, you have to add two bits to the file.

After the <body> tag, add:

<table width=100%>
    <tr>
        <td class="mainCell">


(Adjust the name of the class for whatever you specified when you ran the integrator script.)

Then, right before the </body> tag, add:

        </td>
    </tr>
</table>


And that's it.  The SMF template will now render perfectly inside of your CMS without messing up the CMS's theme in any way.

Granted, technically you're not done.  For XHTML validation you'll need to rip out the headers out of the SMF template, and move the CSS call into the CMS's theme and so on. (Not required but recommended) But that part's the easy part, and there's good documentation here in the forums for that if needed.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

#5
OTHER MODULES/BOTS:

DiscussBot
There is a Mambot utility that allows a "discussion link" to be inserted
into Mambo/Joomla News items.
This link will create a new topic, if one does not already exist. If a topic linked
to this News item does exist,
the link will add a reply from the current user.
Chadness has taken over most of the work on this Bot, HERE
(note: Currently the joomla discussbot in that thread does not work in mambo. Please see below for a working discussbot)

SEARCHBOT
This Bot will add SMF locations into your standard Mambo search function.
RJPrince has made an excellent utility: a searchbot to integrate the SMF forums into Mambo's general search feature. Be sure to read the readme file to make necessary changes to index.php.
also avilable by link at the Princeclan site

NOTE: I don't know if the searchbot works correctly with the new Mambo bridge.

AUTHORBOT
This bot will associate the author of Mambo Content Items to the user's SMF Profile. Written by Benson, Orstio (and Kindred) have made a few corrections and the modified version is available in the post below.

MISCELLANEOUS MODULES

There are various modules that use SSI functions to display SMF
information in the Mambo framework.
These can all be loaded directly into Mambo Admin > Install > Universal.

mod_related_topics:
  This module displays links to SMF topics that are related to the Item currently displayed.
  These are based on the keywords Metadata. All the keywords of the current Content Item are
  searched against the titles of topics. For example, you may have an Item on 'Breeding Cockatoos'
  and you may have a discussion entitled 'Hand Raising Parrots'. If you include the keyword
  'parrot' in the Metadata of the item, then the Related Topics module will list the
  'Hand Raising Parrots' Topic when viewing 'Breeding Cockatoos'.

mod_smf_RecentEvents:
  This module uses the SSI function to display the Upcoming (5 days) Events, in a simple list.

mod_smf_RecentPosts:
  This module uses the SSI function to display the last 5 posts made in the SMF Forum.

mod_smf_RecentTopics:
  This module uses the SSI function to display the last 5 Topics posted to in the SMF Forum.

mod_smf_NewTopics:
  This module uses the SSI function to display the last 5 NEW Topics posted in the SMF Forum.

mod_smf_topTopicsReplies.zip
  This module uses the SSI function to display the top 5 Topics posted to in the SMF Forum.

mod_smf_whosOnline
  This module uses the SSI function to display the users currently online.
  (The Mambo Who's Online module is buggy when working with the bridge. This file
  actually is also a bit buggy...&nbsp; I recommend using the online2 module listed next)

mod_smf_online2.zip
  This module has been modified by Kindred and then spruced up (alot) by mic. Mic has
  done a great job and there are many parameters you can set to get the display that
  you want. This, by default, displays the number of Guests and Users online and then
  a bulleted list of the users. The exact text, and the format of the list of users
  (bulleted or comma separated) is defined in the module configuration.

mod_smf_topPosters.zip
  This module has been designed from the original SSI function by Kindred. It will list
  the top X posters along with their current post count (all defineable as parameters)

mod_smf_events.zip
  This module has been modified from the original SSI function by Kindred. It will list
(configurable) the holidays, birthdays and events form the SMF calendar.

mod_smf_showcal.zip
  This module has been modified from White Rabbit's original attempt at the bridge
  and SSI functions by Kindred. It is fairly configurable and will show the SMF calendar
  in minitaure, to fir in the module (usually side-bar) space. A mouse-over of days with
  events will show a pop-up with the event, holiday and/or birthday information from
  the SMF calendar.

mod_smf_keystats2.zip
  This module by xenovanis displays certain statistics about your SMF forum.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

#6
Attached to this message are versions of the modules & bots that will work with v1.1 Stable and higher of the bridge.

The Discussbot can be gotten from this link... Although Orstio has modified the discussbot from Chadness to work with Mambo 4.6.2 (see attached file, below)

NOTE: I have not confirmed that the authorbot or searchbot work correctly with the mambo bridge v1.1 Stable.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: