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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,019
  • Total Topics: 21,332
  • Online today: 1,062
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 422
  • Total: 422

Please help

Started by gfxindia, July 01, 2006, 07:06:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gfxindia

          if($context['TPortal']['leftbar'])
          {
              echo '<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px;  padding-top: 4px;" valign="top">
                 <div id="leftbarHeader"', empty($options['collapse_leftbar']) ? '' : ' style="display: none;"', ' style="padding-top: 5px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
                 TPortal_sidebar('left');
              echo '</div></td>';

          }
When i place this in my custom page.
I don't see the Left Bar.
Instead i get an error saying TPortal_sidebar('left'); is an undefined function.
How to define it in my custom page. Or should i link to some other file.
Please Help.

agridoc

#1
Hello Darkman

This code is used in theme's index.template.php.

function TPortal_sidebar($side) is defined in TPortalBlocks.template.php.

I didn't understand what you mean by "custom page".
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF

gfxindia

I made a file called home.php
http://gfxindia.com/home.php
I used the code in that page.

Nokonium

Could I suggest a different approach. Put what you want on your 'Home' page into an article.

"Tiny Portal - Settings -  What to show on frontpage:  Single page"

My South Gwent site (see sig) is set up as a welcome page and is the same version as yours.

gfxindia

I could very well do that.
But what i said could also be possible. Just want to know what i am doing wrong.
Why does that code work in a theme's template, but not in a stand-alone file in the same directory ?

agridoc

I see now.

With TP 0.8.6 it will need quite some work and 0.8.6 is to be soon replaced. The best way is what nokonium suggested.

It will be quite easier with TP 0.9.x it is not far away and you have access in alpha version. So, I think it' s better to go this way. Bloc is aware of these needs and has included the necessary options.

By selecting a different theme and the new frontpage block and article options you can have what you want for home.

QuoteWhy does that code work in a theme's template, but not in a stand-alone file in the same directory ?

You are overriding index.php

  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF

G6Cad

Agridoc, Darkman have TP V95 on his forums i think ?

gfxindia

I am using 0.8.6 on my live site.
Quote from: agridoc on July 01, 2006, 08:55:34 AM
Bloc is aware of these needs and has included the necessary options.
I know that.
even i if i'll not be using this code now, i may use it in future.
So asking for Learning purpose and not else.
Please Teach me :D

IchBin

Darkman, I think it's because all the proper files/variables aren't loaded. You'll notice since 0.86 I think Bloc added the TP initialization to the Load.php file. He used to do it from index.template.php I think. In order for you to be able to call TinyPortal functions TP has to be loaded. So if you're just trying to call TPortal_sidebar('left'); it doesn't know where to find it because those settings haven't been put in the php's memory for you to use. I know that's how it works, I just don't know how to load everything or what needs to be loaded for it to work. :)

gfxindia

If i load the Load.php, will the Blocks show ?

This website is proudly hosted on Crocweb Cloud Website Hosting.