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

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 12:21:42 PM

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

TinyPortal Standalone

Started by tino, June 09, 2018, 06:34:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tino

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.


<?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.

bigguy

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. ??

bigguy


lurkalot

Quote from: bigguy on August 17, 2019, 02:37:33 PM
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?

bigguy

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)

bigguy

Well, I guess there is a forum button but it says home.

bigguy

And I can't login on that page either.

lurkalot

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"

bigguy

They are on "Redirect to forum".

bigguy

OK, it was my cookie settings. This works fine now.