TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 25, 2024, 08:46:16 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,173
  • Total Topics: 21,219
  • Online today: 319
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 149
  • Total: 150
  • @rjen

How to make a external page with keeping the TP stuff - For TP 1

Started by Megaforum, January 29, 2008, 12:02:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dragooon

A Quick guide by me on how to make a external page outside of TP but keeping TP's blocks
Example - http://gforumx.com being page and http://forum.gforumx.com being my forum with TP/SMF(TP v1).

To start with in a php file add

<?php
// ID of the theme
$ssi_theme 1;

// Exact path to SSI.php
require_once('SSI.php');

global 
$context;

TPortal_init();

// Your page Title
$context['page_title'] = 'Demo Page';

template_main_above();
template_tp_above();

// Here comes all your contents
echo 'SMF/TP Rules baby!';

// And this ends stuff
ssi_shutdown();
?>

Several things are commented, make sure to set the exact path to SSI so that it works correctly.

All your content are added after template_tp_above(); and before ssi_shutdown();

Some more stuff, Would you like to hide some bars?
So here are the ways
The function to hide a TP Panel(Or say bar) is
tp_hidebars('the side');
Its various valid values are:
'all', 'center', 'top', 'left', 'right', 'bottom', 'lower'.
This function has to be added before the function template_main_above
A Example which hides center and right bars
<?php
// ID of the theme
$ssi_theme 1;

// Exact path to SSI.php
require_once('SSI.php');

global 
$context;

TPortal_init();

// Your page Title
$context['page_title'] = 'Demo Page';
// Hide the bars
tp_hidebars('center');
tp_hidebars('right');

template_main_above();
template_tp_above();

// Here comes all your contents
echo 'SMF/TP Rules baby!';

// And this ends stuff
ssi_shutdown();
?>

What can this be used for? Well for integrations and making page outside SMF/TP.

This only works for TP 1 not for TP 0.9.8.
For a guide for TP 0.9.8 see :
http://www.tinyportal.net/index.php?topic=20069.0

You can ask any question here.

Thanks :)

G6Cad


IchBin

You do realize there is a blank page option in TP 1.0 ? Unless I'm not getting the significance of this... lol

Dragooon

There is?
And this is for files completely outside of SMF lol.

IchBin

Yes, when creating an article just make it an external type if I remember right. This gives you the "files outside of SMF" feel. Which is why I suggested it. :) But this is cool anyway. Thanks for figuring it out. :)

Crip

it's like having WP blog in an Iframe within an Article which is a very cool tool..

  I made a rhyme :P
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



bloc

Yes, the "import article" can simply fetch external files..but I think this way the actual adress will be outside(or can be) the forum folder.

Great for those that like to have frontpage - or splash page - on root, while forum in a folder.

Excellent guide :up:

Dragooon

Yup, the actual files can be outside the forum folder itself.

Thank you for your comments and I added the way to hide specific bars in the guide.

Crip

I think I'll try making a splash page leading to
my forum with your code -- if it screws up my
forum at all look out Goony. :P
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Dragooon

There is no way it can screw a forum because it doesn't alter a forum file but I'll find a hideout anyway :P