News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
* *
TinyPortal on Twitter
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 20, 2018, 12:51:30 PM

Login with username, password and session length

Recent

Members
  • Total Members: 3719
  • Latest: Kindred
Stats
  • Total Posts: 184061
  • Total Topics: 20479
  • Online Today: 51
  • Online Ever: 383
  • (January 02, 2015, 05:58:49 AM)
Users Online
Users: 3
Guests: 24
Total: 27

Skinz





amazon.com

Author Topic: TinyPortal Standalone  (Read 66 times)

0 Members and 1 Guest are viewing this topic.

Online tino

  • Developer
  • *
  • Posts: 758
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 »