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,004
  • Total Topics: 21,330
  • Online today: 500
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 101
  • Total: 101

Add the blocks to a page

Started by gelsbern, August 23, 2005, 06:28:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gelsbern

I have a page that I want to include in my site, and I want to have it load all the blocks like the front page, is there an easy way to do this?ÃÆ'ââ,¬Å¡Ãƒâ€šÃ,  It is php and I have it running through index.php with the action=,  and it shows the top bar just fine but for some reason I cannot find where to tell it to display the left and right blocks.ÃÆ'ââ,¬Å¡Ãƒâ€šÃ, 

gelsbern

Here's my template.   It shows the top but not the centerbar or right or left bars, and really I just want the right an left bars so what do I need to add to my template. 

<?php



function template_main()
{
        global $modSettings, $scripturl, $context, $settings, $options, $txt;
        $local_settingvar = "htmlpage_Content" . $_REQUEST['htmlpage'];
        $local_htmlContent = $modSettings[$local_settingvar];

        // Display the content
        if (!empty($local_htmlContent)) {
                                echo eval('?' . '>'. $local_htmlContent);
       
        }
}

?>

IchBin

I'm no php expert, but you can look at the tportal.mod file in the tiny portal mod and you can see what is added to the index.template.php file. I believe those are the lines you'll need to include the columns. But, as I said I'm no expert coder. :) Hopefully that will change with time.

Bjørn

you need 2 things. first to include the block template and then to call the left/right/center finction. Including is done like this:

           loadtemplate('TPortalBlocks');

Which must be put before any html out put, before the echo statement.

Then you need to call the bars to start render themselves...this basically needs a table, so they will go on either side..if we use your example it should be like this(i haven't tested this ):
function template_main()
{
        global $modSettings, $scripturl, $context, $settings, $options, $txt;
        $local_settingvar = "htmlpage_Content" . $_REQUEST['htmlpage'];
        $local_htmlContent = $modSettings[$local_settingvar];

         require_once('SSI.php');
         loadtemplate('TPortalBlocks');

     // The main content should go here.  A table is used because IE 6 just can't handle a div.
        echo '<div id="bodyarea" style="padding: 10px 8px 0px 8px;">
            <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';
          if($context['TPortal']['leftbar'])
          {
              echo '<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px; background-color: #D4D4D4; 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>';
          }
        echo '<td width="100%" align="left" valign="top" style="padding-top: 10px; padding-bottom: 10px;" id="bodyarea">';
        if($context['TPortal']['centerbar'])
                    echo '<div>' , TPortal_sidebar('center') , '</div> ';

        // Display the content
        if (!empty($local_htmlContent)) {
                                echo eval('?' . '>'. $local_htmlContent);

        }


        echo '</td>';

        if($context['TPortal']['rightbar']){
              echo '<td style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px; background-color: #D4D4D4; padding-top: 4px;" valign="top" align="right">
                 <div id="rightbarHeader"', empty($options['collapse_rightbar']) ? '' : ' style="display: none;"', ' style="width: ' ,$context['TPortal']['rightbar_width'], 'px; text-align: left; padding-top: 5px;">';
              TPortal_sidebar('right');
              echo '</div></td>';
        }
        echo '</tr></table></div>';
}

This website is proudly hosted on Crocweb Cloud Website Hosting.