SSI custom page -> wrapping forums

Started by Kiphaas7, January 03, 2008, 07:21:37 AM

Previous topic - Next topic

Kiphaas7

Hi there. :)

I've been developing a custom front page for our forums, using pretty much the ssi functions which, by the way, totally rock.

But I now stumbled upon a problem; I want to include the forums in my page and like so:

///////////////////////////////////////////////////////////
////////////Custom Header//////////////////////////////
//////////////////////////////////////////////////////////
*******-----------------------------------------
*******---------------Content-----------------
*******-----------------------------------------
**Nav**-----------------------------------------
**Bar***-----------------------------------------
*******-----------------------------------------
*******-----------------------------------------
*******-----------------------------------------
*******-----------------------------------------


The content section being the place where I want to show our forum.

Offcourse, a simple
<?php include ('smf/index.php'); ?>
does the job, but not quite the way I want it, because it obviously outputs the whole page, including doctype and all the other things I already have defined.

So, I don't want the header and footer of my smf forum, just my forumlist body, maybe the personal menu.

Again, the easy solution would have been to make a copy of the default template, strip it of the footer and header and set it as default. That's also undesirable because I want the forum function normally outside the custom page (unwrapped). If I stripped the footer and header from the template, set that template as default, then the unwrapped forum wouldn't have a header and footer!

Reading through the forums I found that SSI has the layersystem, where you can call template_main_above() and template_main_below(), but those are actually the ones I don't want. I tried template_main, but that returns a Fatal error: Call to undefined function template_main(), so that doesn't work, I think.

So I was hoping the experts here would have a solution :)

TIA!

Kiphaas7

anyone? If this would be a dumb question please tell me.  :)

Kays

I'm trying to figure some of this out myself. What does this do for you?


include($sourcedir . '/BoardIndex.php');
BoardIndex();

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

niko

Do custom template for forum which includes custom header + footer. (and use that thru SSI in your site). Use $ssi_theme and $ssi_layers to get SSI to do theme.

See http://www.simplemachines.org/community/index.php?topic=163770.5 for more information
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

spottedhog

I will throw this out at ya....  ;)

look at this site I am about finished modifying for a client:

http://dangerousmindz.com/forum/index.php

As you can maybe see, I have put Google Adsense to the left side of the BoardIndex, Display, and Message temple files.  You could switch Google for your navbar.  All I did was to create a new table with 2 table cells and put Google in one, the rest of the SMF template in the other.

I took the default theme and removed what I did not want in the header and also made 2 horizontal navbars. 

I know it uses the SMF theme system, but with that you can use SSI.php in several places.

...just another way. 

Kiphaas7

Quote from: Niko on January 04, 2008, 12:09:14 PM
Do custom template for forum which includes custom header + footer. (and use that thru SSI in your site). Use $ssi_theme and $ssi_layers to get SSI to do theme.

See http://www.simplemachines.org/community/index.php?topic=163770.5 for more information


Most helpfull that link! I particulary took interest in the first option, with the integrate.php, and I got it working too (not that difficult with everything spelled out :) ). However, I did get a "out of memory at line:404" alert in IE (6&7).

I think I tracked it down to the following code in index.template.php

<?php
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers']
?>



after removing that it worked. However, this shouldn't be happening offcourse, and frankly I don't know how important those HTML headers are.....

What I did:

  • created an integrate.php exactly following the topic given above.
  • made a copy of the core theme, added a SiteTools.template.php (blank), added function template_menubar_above() {} and
    function template_menubar_below() {} in index.template.php. All this after getting errors about those not existing offcourse.
  • created a test php file exactly like the about index page on this site (as explained in the topic)

I didn't want to use the second example because that one seems to load A LOT slower than the first method.

Advertisement: