Advertisement:

Author Topic: Can I use SSI this way...?  (Read 4262 times)

Offline Daktyl198

  • Semi-Newbie
  • *
  • Posts: 57
Can I use SSI this way...?
« 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?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,104
  • Gender: Male
    • Kindred-999 on GitHub
Re: Can I use SSI this way...?
« Reply #1 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()
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Daktyl198

  • Semi-Newbie
  • *
  • Posts: 57
Re: Can I use SSI this way...?
« Reply #2 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...

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,104
  • Gender: Male
    • Kindred-999 on GitHub
Re: Can I use SSI this way...?
« Reply #3 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()
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Daktyl198

  • Semi-Newbie
  • *
  • Posts: 57
Re: Can I use SSI this way...?
« Reply #4 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 :/

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,104
  • Gender: Male
    • Kindred-999 on GitHub
Re: Can I use SSI this way...?
« Reply #5 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

Code: [Select]
<?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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Daktyl198

  • Semi-Newbie
  • *
  • Posts: 57
Re: Can I use SSI this way...?
« Reply #6 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.

Offline Kill Em All

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,144
  • Gender: Male
  • Something has to go wrong. Just has to.
    • KEAGaming
Re: Can I use SSI this way...?
« Reply #7 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. :)
My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

Offline Daktyl198

  • Semi-Newbie
  • *
  • Posts: 57
Re: Can I use SSI this way...?
« Reply #8 on: November 07, 2012, 11:02:48 PM »
Oh thanks, I was just about to do that >.<