Home arrow Developers arrow Developer arrow Modify an SMF theme for Joomla and Mambo
 
Modify an SMF theme for Joomla and Mambo - Intro Print E-mail
Article Index
Intro
Removing excess tags
Removing extra theme info
Removing conflicting CSS
Conclusion

Removing extra theme information

Next, we want to remove the logo, login box, and key stats box, as these would be more appropriate as part of Joomla or Mambo.

Find the part that reads (we're not doing this any earlier, because we want to keep some of the stuff in here, namely the search box and main menu):
Code:
   // This part is the logo and forum name.  You should be able to change this to whatever you want...

If you're following along, it should be line 150.  Before that, insert our handy dandy code:
Code:
    // check to see if the forum is running wrapped in mambo or standalone...
    if (empty($_REQUEST['option'])){

OK, we're cutting out code down through the logo and forum name, and the user info boxes.  So, after line 249, we will put in the cloing for our If statement:
Code:
    } // end of check if forum is wrapped
However, we also need to change line 249 to close it's echo statement:
Code:
</div>';
And then, start that echo statement up again on the next line - change line 251 to read (currently a blank line):
Code:
echo '

Feel free to save it, upload it, and test it now.  The logo and user info box should be gone.

Next, we'll remove the random news item and key stats boxes.  Before line 269, add in our code:
Code:
    // check to see if the forum is running wrapped in mambo or standalone...
    if (empty($_REQUEST['option'])){

This is in the middle of an echo statement once again, so we'll need to add in to change line 268 to close out the echo:
Code:
</td>';

And line 271 we'll need to start an echo statement again:
Code:
echo ' <td style="width: 262px; ', !$context['right_to_left'] ? 'padding-left' : 'padding-right', ': 6px;" valign="top">';

OK, we are removing the code down through the key stats box's code, so after line 291 we can add in our closing code:
Code:
    } // end of check if forum is wrapped

Last, we'll get rid of the header upshrink button.  That's this piece of code, which should be on line 299:
Code:
<a href="javascript:void(0);" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 2ex 2px 0;" border="0" /></a>';

Before it, we put:
Code:
        // check to see if the forum is running wrapped in mambo or standalone...
        if (empty($_REQUEST['option'])){

This one is a little tricker.  Again, it's in an echo statement, so we need to go back and modify line 297 to close the echo statement:
Code:
</table>';

This time, the end of the echo statement is inside of the part we edited, so we will need to change that line (now line 301) to start the echo statement:
Code:
echo '<a href="javascript:void(0);" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 2ex 2px 0;" border="0" /></a>';


And after that line, we put:
Code:
        } // end of check if forum is wrapped

There we go!  Save, upload, and test.  Try it wrapped in Joomla or Mambo, then try it stand alone.  It should work both ways.


 
 
© 2008 technoadvice.com
Joomla! is Free Software released under the GNU/GPL License.