Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

October 04, 2022, 10:48:52 AM

Login with username, password and session length
Members
  • Total Members: 3848
  • Latest: rrolle
Stats
  • Total Posts: 193513
  • Total Topics: 21092
  • Online today: 58
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 47
Total: 47

Author Topic: TinyPortal Standalone  (Read 11634 times)

0 Members and 1 Guest are viewing this topic.

Offline tino

  • Developer
  • *
  • Posts: 2615
Re: TinyPortal Standalone
« Reply #20 on: May 29, 2020, 02:57:00 AM »
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

Code: [Select]
$forum_version  = 'SMF 2.0.17';

Offline Maxxim

  • Jr. Member
  • **
  • Posts: 12
Re: TinyPortal Standalone
« Reply #21 on: May 29, 2020, 08:24:06 AM »
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. :(

Offline tino

  • Developer
  • *
  • Posts: 2615
Re: TinyPortal Standalone
« Reply #22 on: May 29, 2020, 09:50:37 AM »
I never tried it with a custom theme. I’ll have a look this weekend and see what’s causing that.

Offline tino

  • Developer
  • *
  • Posts: 2615
Re: TinyPortal Standalone
« Reply #23 on: May 29, 2020, 11:07:29 AM »
Try the below

Code: [Select]
<?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;
}}}

?>


Offline Maxxim

  • Jr. Member
  • **
  • Posts: 12
Re: TinyPortal Standalone
« Reply #24 on: May 29, 2020, 10:46:31 PM »
It seems to work flawlessly now with several custom themes and Pretty URLs enabled.  :D
A triple huzzah for Tino! O0 O0 O0

Offline makuta_iii

  • Newbie
  • *
  • Posts: 3
Re: TinyPortal Standalone
« Reply #25 on: July 05, 2020, 12:43:49 PM »
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.

Offline @rjen

  • Support Team
  • *
  • Posts: 3300
    • FJR-club Nederland
Re: TinyPortal Standalone
« Reply #26 on: December 27, 2021, 03: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?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline tino

  • Developer
  • *
  • Posts: 2615
Re: TinyPortal Standalone
« Reply #27 on: December 27, 2021, 06:33:49 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?

Offline @rjen

  • Support Team
  • *
  • Posts: 3300
    • FJR-club Nederland
Re: TinyPortal Standalone
« Reply #28 on: December 27, 2021, 11:00:50 PM »
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

Offline tino

  • Developer
  • *
  • Posts: 2615
Re: TinyPortal Standalone
« Reply #29 on: December 28, 2021, 05:58:52 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

Code: [Select]
<?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;
}}}

?>