News: TinyPortal Release Schedule. Please read this update for More Info.

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

June 16, 2019, 04:58:19 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188435
  • Total Topics: 20727
  • Online Today: 50
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 1
Guests: 15
Total: 16

Author Topic: TinyPortal Standalone  (Read 697 times)

0 Members and 1 Guest are viewing this topic.

Offline tino

  • Developer
  • *
  • Posts: 1567
TinyPortal Standalone
« on: June 09, 2018, 11:34:35 AM »
Not sure where this should go...

If you want to have your TinyPortal index on a different page/url to the main forum then you can do the following.

Code: [Select]
<?php

$ssi_path       
'/path/to/SSI.php';
$forum_path     '/forum';

require_once(
$ssi_path);

ob_start('tp_url_rewrite');

loadTheme();

TPortal_init();
writeLog();

call_user_func(whichTPAction());

obExit(true);

function 
tp_url_rewrite($buffer)
{
        global 
$forum_path;
        if (!empty(
$buffer) && stripos($buffer$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']) !== false) {
                
$buffer str_replace($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'], $_SERVER['SERVER_NAME'].$forum_path.$_SERVER['REQUEST_URI'], $buffer);
        }       
        
        return 
$buffer;
}       

?>


I couldn't work out why the menu url etc was set to where I was rather than the path of the forum... so I just rewrote it. A bit of a hack but it works... assumes that you are using index.php on the main page.
« Last Edit: June 09, 2018, 12:07:20 PM by tino »