Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Daktyl198 on November 06, 2012, 01:09:07 PM

Title: Can I use SSI this way...?
Post by: Daktyl198 on November 06, 2012, 01:09:07 PM
I swear that I've seen an answer to this somewhere before, but I tried searching and nothing came up.

Basically: I have php code where the only styling is to the text. I tried making/integrating this page using SimplePortal's page functions as I have made several HTML pages using it just fine, but when I click submit on the form, I get redirected to the home page (despite the variable ?page=pagetitle still being set).

So I was wondering if I could use SSI code to give the page the same header, background, and footer as my forum but have the content in the middle be my PHP code?
Title: Re: Can I use SSI this way...?
Post by: Kindred on November 07, 2012, 10:57:20 AM
Have you looked at this?
http://wiki.simplemachines.org/smf/Add_a_custom_action_using_integration_hooks


Although that wiki page seems to be missing references to template_main_above() and template_main_below()
Title: Re: Can I use SSI this way...?
Post by: Daktyl198 on November 07, 2012, 11:06:32 AM
Hmm... I think you're misunderstanding something.
I don't want to add the file to my forums as an action: I just want the page to LOOK like my forums.

That link is focused on adding a function to the forums via integration hooks...
Title: Re: Can I use SSI this way...?
Post by: Kindred on November 07, 2012, 11:08:15 AM
yes, I know... it seemed to be the easiest way to do what you are asking...

as I said, though, check out using template_main_above() and template_main_below()
Title: Re: Can I use SSI this way...?
Post by: Daktyl198 on November 07, 2012, 11:12:30 AM
oh.... hmm...

The last time I saw this brought up, I didn't have a need for it v.v

On that thread it said that you just had to add a specific SSI call above and below your code in your file and it would get the needed stuff :/
Title: Re: Can I use SSI this way...?
Post by: Kindred on November 07, 2012, 11:44:34 AM
no... I don't think that there was ever an SSI call for header and footer...

This seems to work for me


<?php
 
require_once('SSI.php');
 
template_html_above();
  
template_body_above();
  
 echo 
'
   <hr />
   This would be the content sections of the page
   <hr />
   '
;
  
   
template_body_below();
  
template_html_below();
    
 
?>


http://test.turtleshellprod.com/test_page.php
Title: Re: Can I use SSI this way...?
Post by: Daktyl198 on November 07, 2012, 11:56:28 AM
That certainly worked. Unfortunately, I'm having the same issue as before. I'll create a separate thread for that though, because it doesn't seem to be limited to this file.
Title: Re: Can I use SSI this way...?
Post by: Kill Em All on November 07, 2012, 10:48:41 PM
I'll mark this topic solved then. Feel free to mark it unsolved if you have any further questions. :)
Title: Re: Can I use SSI this way...?
Post by: Daktyl198 on November 07, 2012, 11:02:48 PM
Oh thanks, I was just about to do that >.<