News: October 15th, 2018, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.0! GET IT NOW!!!

Login  |  Register
* *
TinyPortal on Twitter
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 22, 2018, 01:32:12 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 185658
  • Total Topics: 20562
  • Online Today: 31
  • Online Ever: 383
  • (January 02, 2015, 05:58:49 AM)
Users Online
Users: 0
Guests: 19
Total: 19

Skinz





amazon.com

Author Topic: TinyPortal Standalone  (Read 221 times)

0 Members and 1 Guest are viewing this topic.

Offline tino

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