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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 692
  • Total: 692

Are there TP functions available?

Started by kmccann, October 11, 2008, 10:52:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kmccann

I was wondering if there are TP functions available that would allow me to display chunks of content, similar to the way SSI.php and its functions operate.

I have a complex custom app that I want to embed within my SMF/TP site  (1.1.6 and 1.0.5 respectively) and I can do some things with SSI.php such as checking user info. But I'd love to be able to do something like:

myapp.php:

<?

include("SSI.php")
include("TP.php");

tp_header();
tp_leftblocks();

... do my stuff ...

tp_rightblocks();
tp_footer();

?>

Do such functions exist?

Thanks,
Kevin

G6Cad

You can make php pages with your own content with articles.

kmccann

Quote from: G6 on October 11, 2008, 11:14:38 PM
You can make php pages with your own content with articles.

I realize that, but that won't work because it is an existing, standalone  application. Many links within it essentially point to itself:

stats.php?op=showmatches&did=3&mid=67
stats.php?op=showteamstandings&did=3&sort=pf
stats.php?op=showmembers...
etc.

Way too big (over 100 scripts "included" by the main stats.php) to use php pages and recreate the links (besides, php pages get assigned id numbers ... no can do).

That's why I was hoping for functions to grab specific content. I actually hacked something together to get left and right script blocks and display them. Maybe I'll just follow down that path. But it sure would have been glorious had the examples I gave been available.  ;)

Unless I hear different from someone else I will assume the answer to the original question is no.

Thanks,
Kevin





kmccann


Almost perfect. Just need to figure out why my left-hand blocks are not showing up. There should be the user block and two scriptbox blocks below. Any ideas?

The relevant code is pretty much what was given in the thread:

<?php

$ssi_theme = 1;
global $context;

include('SSI.php');
$userid = $context['user']['id'];
$username = $context['user']['username'];
$useremail = $context['user']['email'];

TPortal_init();
template_main_above();
tp_hidebars('right');   //    I do want to hide the right blocks

include("stats/index.php");   // my custom app, which works fine

ssi_shutdown();
?>


Thanks,
Kevin

G6Cad

Panels, how have you set the panels to show, witout panels, no block will show as they depend on the panel settings

kmccann

#7
Quote from: G6 on October 12, 2008, 11:07:43 AM
Panels, how have you set the panels to show, witout panels, no block will show as they depend on the panel settings

Thanks for your reply.

If I go into configure Panels and Blocks, the only Panel options I see are to hide them in certain functions. I only have them hiding while in Admin (and tested without doing so, same result).

Everything looks normal in the Blocks (I have the left blocks set to "Display on all pages and sections"), and you can see that the left panel of blocks shows fine in the test site homepage:

(snip)

But they don't show up when pointing to a script with the code shown earlier in this thread:

(snip)

I just can't figure it out. I wonder if it's a bug introduced in TP 1.0.5? I wonder if anyone is doing this kind of thing with SMF 1.1.6 and TP 1.0.5. Or maybe there is something else I'm missing ... but I can't see what.

Thanks,
Kevin

G6Cad

I dont know coding that much to give you a straight answer, but the functions for the blocks and panels are something like

"check if panel is active and if so, where and if active the block show in the panel"

If you miss the panelcheck, the block will not show eather, so i guess you need to have some sort of check to where and if the panel are to show or not.

kmccann

#9
Well, everything seems OK in the config options. And, as you can see, the left blocks show up when viewing the homepage. Or a specific page, for that matter:

(snip)

So it seems like there might be something going on with the "template_main_above();" function. Maybe I'll do some digging there, although I'm reluctant to make any changes to it.

Thanks,
Kevin

This website is proudly hosted on Crocweb Cloud Website Hosting.