TinyPortal

Development => Support => Topic started by: m771401 on April 07, 2010, 02:09:37 PM

Title: How to disable Tinyportal for a specific theme?
Post by: m771401 on April 07, 2010, 02:09:37 PM
I just updated my site to RC3 and TP1.b5.

I would like to use the smf4iphone mod. Problem is that when I do the smfiphone theme doesn't render correctly because of the panels, etc...

Is there a way I can disable TP for specific theme use?
Title: Re: How to disable Tinyportal for a specific theme?
Post by: IchBin on April 07, 2010, 04:01:36 PM
Have no idea how that mod works. Does it add anything to the URL. Does it only change the theme?
Title: Re: How to disable Tinyportal for a specific theme?
Post by: m771401 on April 07, 2010, 04:53:24 PM
I'm assuming it has to change the url but not plainly visible. It does browser detection and redirects to an iphone theme.
I think I can make it work if I can figure out how to disable TP for a specific theme.

I'm not sure if I can use the "Do not display panels for action" option in TP.
I don't know what text TP expects in this field.
Title: Re: How to disable Tinyportal for a specific theme?
Post by: m771401 on April 09, 2010, 05:04:34 PM
Is there anyone that could help me create a custom action that would render the forum in standalone or without panels?
Title: Re: How to disable Tinyportal for a specific theme?
Post by: bloc on April 09, 2010, 06:52:26 PM
If you want a specific theme to NOT show the panels just open index.template.php of that theme and - assuming it has a template_html_above() function - add this AFTER the "global $..." line inside the function template_html_above():


tp_hidebars('all');


It will hide all the panels at once. If you also require the "home" button to be gone from the theme(in other words, the link to the TP frontpage) you need to add after that line above:

  unset($context['menu_buttons']['home']);
Title: Re: How to disable Tinyportal for a specific theme?
Post by: IchBin on April 09, 2010, 07:09:08 PM
I swear that I tried using hidebar() in the template once, and it didn't work for me.... That's why I didn't suggest it. lol Just tested it again, and it works just fine. Thanks Bloc! :)
Title: Re: How to disable Tinyportal for a specific theme?
Post by: m771401 on April 09, 2010, 07:54:31 PM
Thank you so much Bloc.
This is actually pretty funny... This was already in the index.template except... the dev. had it under
function template_init()

So I just moved and now it works. Most excellent... :)


// Version: 2.0 RC3; Index

$linguaggio = $settings['theme_dir'].'/languages/iPhone.language.' . $context['user']['language'] . '.php';
if (file_exists($linguaggio))
require($settings['theme_dir'].'/languages/iPhone.language.' . $context['user']['language'] . '.php');
else
require($settings['theme_dir'].'/languages/iPhone.language.english.php');


global $txt;

function template_init()
{
global $context, $settings, $options, $txt;

$settings['theme_version'] = '1.0';

// Portal disabling mafia
// SimplePortal
$settings['disable_sp'] = true;

// PortaMX
$_SESSION['pmx_paneloff'] = array('head', 'top', 'left', 'right', 'bottom', 'foot', 'front', 'pages' => 'Pages');
}

function template_html_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// TinyPortal
if (function_exists('tp_hidebars'))
tp_hidebars(all);
Title: Re: How to disable Tinyportal for a specific theme?
Post by: bloc on April 09, 2010, 09:04:03 PM
Yes, template_init() won't work because its run before any of the TP variables are loaded. When you get back to the template_html_above() the variables are fully loaded. And as html/body layers always comes before the TP layer, you can then intercept TP within them.
Title: Re: How to disable Tinyportal for a specific theme?
Post by: m771401 on April 10, 2010, 04:21:50 PM
So this is working mostly. Except there is, from I've been told a table being injected into the template and is causing the board index to render without any formatting.


<table cellpadding="0" cellspacing="0" width="100%" style="margin: 0; padding: 0; table-layout: fixed; clear: both;">
<tr>
<td align="left" valign="top">
<div id="tpcontentHeader">


I've searched thru the tp files looking for another function I could exclude but this is outside my realm of knowledge.

A little more help would be appreciated. Thanks,
I'm almost there...
Title: Re: How to disable Tinyportal for a specific theme?
Post by: bloc on April 10, 2010, 09:42:35 PM
Hm, it might be easier then to just change the TPblockLayout.template.php file. Just use the attached inside your theme.

You can then remove the other code if you like.
Title: Re: How to disable Tinyportal for a specific theme?
Post by: m771401 on April 10, 2010, 10:11:23 PM
Thanks!

That did the trick  O0

I removed the previous index.template edits and copied the file into the theme's directory.

Thanks again Bloc  :)
Title: Re: How to disable Tinyportal for a specific theme?
Post by: tintal on October 08, 2011, 07:12:26 AM
so,you can change theme.

Title: Re: How to disable Tinyportal for a specific theme?
Post by: apochalypse on November 18, 2011, 10:09:30 AM
Tell, me, would this be possible to achieve today with the current layout and for SMF 2.0 ?
I've tried the above suggestions but it doesn't seem to work for me i'm afraid.
I'm guessing it's the way smf 2.0 works with it always having the layout etc loaded in the default theme folder.
Title: Re: How to disable Tinyportal for a specific theme?
Post by: IchBin on November 19, 2011, 05:18:43 AM
I just tried what Bloc posted on the first page here and it worked just fine in SMF2.
http://www.tinyportal.net/index.php?topic=32327.msg259934#msg259934
Title: Re: How to disable Tinyportal for a specific theme?
Post by: apochalypse on November 20, 2011, 08:10:23 PM
Quote from: IchBinâ,,¢ on November 19, 2011, 05:18:43 AM
I just tried what Bloc posted on the first page here and it worked just fine in SMF2.
http://www.tinyportal.net/index.php?topic=32327.msg259934#msg259934
weird.
I tried that, but it still used the TP frontpage.. :S
guess I have to try it again..
Title: Re: How to disable Tinyportal for a specific theme?
Post by: apochalypse on November 21, 2011, 10:46:25 AM
aha, now I see.
It does work, somewhat. ^^

It does indeed hide all the bars, but the frontpage is still = the frontpage.
Thus when using the smf4iphone theme it still redirects you to the frontpage when going to http://www.fenimo.com.

so would that be doable to change? so that it instead shows the forum. Or rather, www.fenimo.com/index.php?action=forum
Or is that something I have to code in to the theme?

what I've currently have for TP in the index.template.php is:


function template_html_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// TinyPortal
if (function_exists('tp_hidebars'))
tp_hidebars(all);
  unset($context['menu_buttons']['home']);
Title: Re: How to disable Tinyportal for a specific theme?
Post by: IchBin on November 21, 2011, 09:36:12 PM
Maybe you should explain what you are trying to achieve. I don't quite get what you are trying to do...

If you don't want a TP front page, then set in your front page settings to tell TP to go directly to the forum instead.
Title: Re: How to disable Tinyportal for a specific theme?
Post by: apochalypse on November 22, 2011, 11:17:13 AM
Quote from: IchBinâ,,¢ on November 21, 2011, 09:36:12 PM
Maybe you should explain what you are trying to achieve. I don't quite get what you are trying to do...

If you don't want a TP front page, then set in your front page settings to tell TP to go directly to the forum instead.
Ok,
well, I use TP and a theme from Dziner Studio normally for my site when you access it.
And it works great.
But I want to make it easier and less loading needed for users who access it using a wireless devices. (phones, (both using wap and smartphones), tablets etc)

Therefor I've added the smf4iPhone theme, curve mobile theme, and mobile theme. Together with an addon that auto detects mobile devices and changes the theme used for that visit.
And to simplify it even more, I want the standard for those themes only. To redirect to the forum, and thus ignoring the frontpage.
But for my standard theme, when accessing the site with a PC, it still use the frontpage.

But then again, I might be satisfied with the way it is now. Now that the frontpage at least doesn't have any panels or such things. :) 
Title: Re: How to disable Tinyportal for a specific theme?
Post by: IchBin on November 22, 2011, 05:19:00 PM
Well, with those mods I have no idea how they work so you are a little out of luck if you want my to figure out if TP can be turned off for them.
Title: Re: How to disable Tinyportal for a specific theme?
Post by: webby on August 26, 2012, 01:42:05 AM
My solution was to hide the to panels I didn't want to show by placing 'left between the brackets.  I repeated the line with 'right' between the brackets as it was late and I couldn't remember how to list both panels.