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

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 01:22:32 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 167
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 135
  • Total: 135

How to disable Tinyportal for a specific theme?

Started by m771401, April 07, 2010, 02:09:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

m771401

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?

IchBin

Have no idea how that mod works. Does it add anything to the URL. Does it only change the theme?

m771401

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.

m771401

Is there anyone that could help me create a custom action that would render the forum in standalone or without panels?

bloc

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']);

IchBin

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! :)

m771401

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);

bloc

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.

m771401

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

bloc

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.