Creating own HTML page between SMF header and footer ??

Started by Mick., August 27, 2009, 06:28:07 PM

Previous topic - Next topic

Mick.

Ive seen this somewhere here.  I searched and looked in tips and tricks but came up empty.


I thought there was a way of using SMF header and footer and able to add HTML in between.

Please post the link if you happen to know where this link is?   

...also,can it be used as:

mysite.com/mypage  instead of index.php?=action     ???


Thanx,
Mick.

vbgamer45

You can do that using SSI.php
I do a call to template_header(); and template_footer(); with my php/html code in between. Like my example site at http://www.themezone.net which is based on SMF using SSI
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Mick.

Thanx for the reply.

I was hoping to avoid the use of .php

I wonder if I could use something like .html at the end.

Like:

mysite.com/whatever.html

and even add a folder:

mysite.com/folder/whatever.html

but again, using the forums header and footer.

Arantor

You cannot do it using .html since SMF is written in PHP - and unless you simply copy/paste the code from a page in the browser, you'll have to use .php.

Kays

if you can edit your .htaccess file, then it might be possible to get the server to parse html pages as php

Add the folowing to your .htaccess file.

AddHandler application/x-httpd-php .html

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

Mick.

Heres what im shooting for...

i got a wordpress page:

http://chevyavalancheclub.com/specs/

I would like to somehow integrate SMF header and footer on it.

No more no less.  Not looking to add same registered users or nothing like that. 

I used iframes and custom action but it didnt cut the cake for me.

Can it be done?

Arantor

In your theme, include SSI.php as the very first line.

Then, call template_header() and template_footer() in the theme in the places you want them to be.

That's the only way it can be done.

Mick.

Ok.   I created a test folder/page in PHP

http://www.chevyavalancheclub.com/chevyavalanche/index.php


Ive been picking my brain on this one.   My forum is set at 100% but why this test page is in narrow?

Any ideas?


Im using this code:

<?php require("/home/**********/public_html/SSI.php"); ?>
<?php template_header(); ?>

TEST

<?php template_footer(); ?>

Arantor

Because that's how the theme makes the page, just like it does in the forum and other pages.

Mick.

Quote from: Arantor on September 01, 2009, 10:17:12 PM
Because that's how the theme makes the page, just like it does in the forum and other pages.

Yeah but i changed the forum to 100% in the .css file.

See,...i use 2 themes (same ones).

One for the front page to keep it narrow and the other wide for the forums and all pages.

Arantor

If you mean the table is 100%... it's 100% of its parent - which is limited in the theme.

Mick.

Quote from: Arantor on September 01, 2009, 10:25:00 PM
If you mean the table is 100%... it's 100% of its parent - which is limited in the theme.

Well that sucks lol.    I love the wide look.

Arantor

The only way around it is to modify the parent's CSS - which means altering the rest of the theme code.

toobeus4u

Hi Guys,

first I'll have to blow the dust away for a bit.  ;)

The code:
<?php require("/home/**********/public_html/SSI.php"); ?>
<?php template_header(); ?>

TEST

<?php template_footer(); ?>


Works great for me.

However, I want the page to be viewed only bij logged in users.
Guest should get the login page.

Can I add a simple line of code, like the header and footer?

The page I want to call is http://www.mydomain.com/forum/news.php [nofollow]

Thanks and sorry for the big kick  ;D




Arantor

Actually, yeah you can.

Simply add the following line after the SSI.php statement.

<?php is_not_guest(); ?>

You can be cleaner by not having so many multiple <?php blocks:
<?php
require("/home/**********/public_html/SSI.php");
is_not_guest();
template_header();
?>


test

<?php template_footer(); ?>

toobeus4u


Mick.

You can also add a page title to it...

SMF 2.0
$context['page_title_html_safe'] = 'title of the page goes here';

SMF 1.1.x
$context['page_title']= 'title of the page goes here';

Advertisement: