Adding page within the SMF system?

Started by RaalF, June 10, 2008, 08:54:56 AM

Previous topic - Next topic

RaalF

Help, I like the way my SMF Forum has been setup and everything has been working.
I want a new Forum Page created within the SMF system, I mean - I want to have
"home", "help", "search", "Admin", "Profile", etc and still have my personal HTML.

Thanks!

N3RVE

Hi s_m_f,
With SMF's unique SSI function, this won't be a problem.
Create two new php files, `header.php` & `footer.php`.

Copy and Paste the following code into the newly created 'header.php' file.

Change $ssi_theme = 1; to your actual theme ID.
For SMF Core Default, use 1, For Classic YaBB Se, use 2. Babylon = 3 and so on.
If a wrong value is used, SSI automatically uses the overall Forum default.
Therefore, Line 4 - 5 can be skipped.


<?php
error_reporting
(E_ALL);

// Which Theme are we using?
$ssi_theme 1;
// Layers to be utilized
$ssi_layers = array('main');
// Change "true" to "false" to disable Gzip if not supported on your server
$ssi_gzip true;
//This is the SSI.php file in the Board dir.
require('SSI.php');

?>


That's all for the header
*******************

Let's have this code  in `footer.php`


<?php
//Let's murder SSI for now
ssi_shutdown();
//[n3rve] thinks this should do.
?>


Thats all for the footer.

Now create a new php file. (let's use test.php)
We'll use this;


<?php 
//Require header.php
require('header.php'); 
?>


<br />
<b>
<marquee><font size="10">What would Gaz, ooops! Gary do if The Simpsons were no more?</font></marquee>
<br /><font size="5">-[n3rve]</font>
</b><br />

<?php 
//Require Footer,php
require('footer.php'); 
?>



That's simple and straight forward I guess.
Have all three files stored in the Board dir.
And point your browser to http://your-forum-url.com/test.php
You can rename test.php and set things up the way you want
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

RaalF

 :) n3rve  :-* Thank You SO MUCH for the fast reply . . . . 8)

I just copied your code into the files respectively, and tested it on my local forum,
Everything worked like magic :D

LOL, who is Gaz? or Gary?

N3RVE

#3
Glad it worked ;)

Quote from: s_m_f on June 10, 2008, 09:05:18 AM
LOL, who is Gaz? or Gary?

Dark Gazmanafc He is an SMF team member, a Customizer.
The Greatest Simpsons Fan I've ever known.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

popomovies


N3RVE

Create two new PHP files, 3 actually :)
  • header.php
  • footer.php
  • test.php

Put this into header.php

<?php
error_reporting
(E_ALL);

// Which Theme are we using?
$ssi_theme 1;
// Layers to be utilized
$ssi_layers = array('main');
// Change "true" to "false" to disable Gzip if not supported on your server
$ssi_gzip true;
//This is the SSI.php file in the Board dir.
require('SSI.php');

?>



Put this into footer.php

<?php
//Let's murder SSI for now
ssi_shutdown();
//[n3rve] thinks this should do.
?>



In the test.php put

<?php 
//Require header.php
require('header.php'); 
?>


<br />
<b>
<marquee><font size="10">What would Gaz, ooops! Gary do if The Simpsons were no more?</font></marquee>
<br /><font size="5">-[n3rve]</font>
</b><br />

<?php 
//Require Footer,php
require('footer.php'); 
?>



Quote from: popomovies on July 03, 2008, 08:49:24 PM
Do i add this to themes folder?

Quote from:  My previous post
$boarddir: Have all three files stored in the Board dir.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

N3RVE

Quote from: [SiNaN] on July 04, 2008, 04:58:03 AM
This mod could also help: Custom Action Mod.

Tested the mod :)
Indeed, that would serve right - You can even select the content's coding language. BBC, PHP or HTML.
Nice mod :)

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

SNAFU0185

ok it didnt work i got the following

Unable to load the 'main_above' template.

what did i do wrong maybe it doesnt work with smf 2

N3RVE

You should reverse the changes. Those instructions are for 1.1.x
How about installing the mod? It should work with 2.x or I can rewrite the guide to work with 2.0.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

[SiNaN]

This edit will make it work with SMF 2.0:

header.php
Find:
array('main');
Replace:
array('html', 'body');
Former SMF Core Developer | My Mods | SimplePortal

hetrp

Can we add button on top for this test page where it says "home" "admin" "profile" ?

If this is possible please let me know how to do it ?

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

SNAFU0185

#13
thanks guys it doesnt work on my old theme but on the new theme for the new site it works many thanks again
well im at it which smf file do i edit and where to alter buttons displayed

Arantor

To alter buttons being displayed is the theme's index.template.php file.

SNAFU0185

Quote from: Arantor on July 16, 2009, 09:33:30 PM
To alter buttons being displayed is the theme's index.template.php file.
where in that file as i thought it was in the subs.php
And is there a way to display the Forum - Info Center  in the page using [n3rve]s method  just like it is in the forum as ssi displays it quite diferently
ie
Recent Posts
Forum Stats
Users Online

Many thanks in advance

massillon

Ok, I did this to add a custom page to my SMF...  unfortunately it does not appear to play well with tinyportal.

this is what I get...

http://www.massillon.com/template.php

any ideas?

Arantor


massillon

Quote from: Arantor on August 23, 2009, 06:29:33 PM
So how did you do it?

I used the coding above, but I still get the errors you can see on my link.

1MileCrash

You don't need to create all of those extra header and footer files..

Here you go..

<?php

$ssi_theme 
1;
$ssi_layers = array('main');
require_once(
'SSI.php');

?>


Your html here

<?php

ssi_shutdown
();

?>


Just that single file along will give you a page with SMF and "your html here" written where the content usually goes.
The only thing php can't do is tell you how much milk is left in the fridge.



Advertisement: