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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 12:03:45 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 212
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 55
  • Total: 55

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

I just tried the one packaged in with TinyPortal 1.6.x with SMF 2.0 and it works ok if I add the $forum_version into the script (otherwise TPShout has a issue)

The one on Github for TinyPortal 2.0.0 also works as expected without any modifications.

The one on the opening post here is out of date.

This is what is needed for TinyPortal 1.6.x

https://github.com/Tinyportal/TinyPortal/blob/1.6.x/TPStandalone.php

Adding the SMF Version before the loadTheme line

$forum_version  = 'SMF 2.0.17';


Maxxim

Thank you, Tino, that seems to work now! :)

However... Either I'm doing something wrong here or it doesn't play nice with custom themes (even with Curve derivatives like Ant's Mutant Curve). It does load the theme I specify in loadTheme(), but it totally mangles the linktree area and the footer. :(

tino

I never tried it with a custom theme. I'll have a look this weekend and see what's causing that.

tino

Try the below


<?php
/**
 * TPStandalone.php
 *
 * @package TinyPortal
 * @version 1.6.7
 * @author tinoest - http://www.tinyportal.net
 * @founder Bloc
 * @license MPL 2.0
 *
 * The contents of this file are subject to the Mozilla Public License Version 2.0
 * (the "License"); you may not use this package except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Copyright (C) 2020 - The TinyPortal Team
 *
 */
ob_start('tp_url_rewrite');
global 
$boardurl$context$txt;

$txt['tp-tphelp']   = 'TinyPortal';

$forum_version      'SMF 2.0.17';
$forum_path         '/var/www/html/forum/';

require_once(
$forum_path '/Settings.php');

$context['TPortal'] = array();
$actual_boardurl    $boardurl;

require_once(
$forum_path '/SSI.php');

TPortal_init();

writeLog();

call_user_func(whichTPAction());

obExit(true);

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

    return 
$buffer;
}}}

?>


Maxxim

It seems to work flawlessly now with several custom themes and Pretty URLs enabled.  :D
A triple huzzah for Tino! O0 O0 O0

makuta_iii

Hi.
Is such a solution possible (of course, if you make the necessary changes) to display the main page of the portal on a separate page, if you put this code in the file portal.php? My forum is located at forum.wabisabi.by and i would like to see the portal Frontpage with articles at link forum.wabisabi.by/portal. This is now implemented on this forum, but not using your portal, unfortunately.
Sorry if I repeat my question, but this is the only problem that I can not solve to install your portal on my forum.

Thanks.

@rjen

Just tried to get Tpstandalone working but failed miserably. I wanted to see if I can add this to the documentation site.

Can anyone give me a few pointers how to use it?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on December 27, 2021, 10:11:58 PM
Just tried to get Tpstandalone working but failed miserably. I wanted to see if I can add this to the documentation site.

Can anyone give me a few pointers how to use it?

It may be that the current one no longer works. Are you using the one from this thread or the one included with TinyPortal?

@rjen

I tried both on SMF 2.0.19 but I am getting 500 errors
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on December 28, 2021, 06:00:50 AM
I tried both on SMF 2.0.19 but I am getting 500 errors

What is showing in the Apache/nginx/lighttpd error log?

Also what version of SMF please.

Below is a version which requires fewer code edits. Should be none if you put it in the same directory as SSI.php

<?php
/**
 * TPStandalone.php
 *
 * @package TinyPortal
 * @version 2.1.0
 * @author tinoest - http://www.tinyportal.net
 * @founder Bloc
 * @license MPL 2.0
 *
 * The contents of this file are subject to the Mozilla Public License Version 2.0
 * (the "License"); you may not use this package except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Copyright (C) - The TinyPortal Team
 *
 */
ob_start('tp_url_rewrite');


global 
$boardurl$context$sourcedir;

require_once(
dirname(__FILE__) . '/Settings.php');

$actual_boardurl    $boardurl;

require_once(
dirname(__FILE__) . '/SSI.php');
require_once(
$sourcedir '/TPortal.php');

TPortal_init();

$context['TPortal']['front_type'] = 'forum_articles';
doTPfrontpage();

writeLog();

TPortalMain();

obExit(true);

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

    return 
$buffer;
}}}

?>