TinyPortal

Development => Resources => Topic started by: tino on June 09, 2018, 11:34:35 AM

Title: TinyPortal Standalone
Post by: tino 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.
Title: Re: TinyPortal Standalone
Post by: bigguy on August 17, 2019, 07:11:07 AM
Would this work for 2.1 ? How is it used exactly. Do I need to make a file named index.php and put this in it. ??
Title: Re: TinyPortal Standalone
Post by: bigguy on August 17, 2019, 07:37:33 AM
It does work, lol. Cool.
Title: Re: TinyPortal Standalone
Post by: lurkalot on August 17, 2019, 07:53:36 AM
It does work, lol. Cool.

Yes t should work.  I haven't tested or tried it myself, I was hoping tino would see this and answer for you as he wrote it for us. But glad you worked it out.

So where did you test this, got an example BG?
Title: Re: TinyPortal Standalone
Post by: bigguy on August 17, 2019, 08:06:03 AM
Here check the url out. If you try to use it without the /index.php it seems as though the style does not load, also there is no forum button but it does show up.
Link removed as this is a test site. (Lurkalot knows it though)
Title: Re: TinyPortal Standalone
Post by: bigguy on August 17, 2019, 08:06:45 AM
Well, I guess there is a forum button but it says home.
Title: Re: TinyPortal Standalone
Post by: bigguy on August 17, 2019, 08:10:03 AM
And I can't login on that page either.
Title: Re: TinyPortal Standalone
Post by: lurkalot on August 17, 2019, 08:17:11 AM
I don't have any answers for you atm.  I'm wondering what would happen if you had your portal front page settings set to, "Go directly to forum index"
Title: Re: TinyPortal Standalone
Post by: bigguy on August 17, 2019, 08:19:59 AM
They are on "Redirect to forum".
Title: Re: TinyPortal Standalone
Post by: bigguy on August 19, 2019, 03:38:30 AM
OK, it was my cookie settings. This works fine now.