SimplePortal

Support => English Support => Topic started by: FireDitto on April 13, 2014, 07:16:04 AM

Title: BiB BBC code blocks stretching PHP page
Post by: FireDitto on April 13, 2014, 07:16:04 AM
Okay, please see here (http://katila.second-pass.net/index.php?page=spines) because I'm not sure how to explain it.

It is a PHP page, made up with the BIB code.

It worked fine as a BBC page, but I ran out of room for all the characters so had to split it into blocks... which caused it to explode in all directions.

Help would be appreciated.

Thank you!
Title: Re: BiB BBC code blocks stretching PHP page
Post by: AngelinaBelle on April 14, 2014, 09:49:47 AM
Somewhere, you have set width for these blocks to 11292px

This is what is causing the problem.  I took a quick peek at the page using Chrome's F12 tools, but have not found where you set the width for those blocks.

Do you know how this happened?  What is BIB?
Title: Re: BiB BBC code blocks stretching PHP page
Post by: FireDitto on April 14, 2014, 12:27:54 PM
BIB = block in block.

I'm using the block-in-block code on a PHP page to draw in the blocks that hold the various pieces of information to display.

The only width set is in the BIB code, which is to call it to be '100%'

Code: [Select]
$rows = 4;
$block_ids = array(139,140,141,142);

$block_data = array();
foreach ($block_ids as $block)
{
   $block_data[$block] = current(getBlockInfo(false, $block, false, false));
   $block_data[$block]['style'] = sportal_parse_style('explode', $block_data[$block]['style'], true);
}

echo '
<table style="width: 100%;">
   <tr>';

$counter = 0;
foreach ($block_data as $data)
{
   if ($counter != 0 && $counter % $columns == 0)
   {
      echo '
   </tr>
   <tr>';
   }

   echo '
      <td style="width: 100%; vertical-align: top;">
         ', template_block($data), '
      </td>';

   $counter++;
}

echo '
   </tr>
</table>';
Title: Re: BiB BBC code blocks stretching PHP page
Post by: AngelinaBelle on April 14, 2014, 01:25:33 PM
I cannot figure it out at all. Sorry.

Have you tested each of these blocks, individually, added to one of the pages on your site (rather than the one giving you problems at the moment)?

The trouble APPEARS to begin with the table .. width=100%.
Before that, there appears to be a block # 84 that closes OK.
But there are a TON of HTML validation errors on that page -- 229.  Many of them seem to be related to simple HTML vs XHTML errors. I would imagine they are related to some kind of mod?  Or did you make manual changes to your template files?  For example <meta name="twitter:app:id:ipad" content="307880732">  should end in />.  Eventually, the validator gets really confused and cannot seem to recognize when it is supposed to be in the middle of a script tag pair.

If I were creating a text-heavy page and hit the #-of-characters limit on the field where the page text is stored, instead of using blocks-in-blocks, I would probably try:
Code: [Select]
global $boarddir;
$FileName=$boarddir . '/explanation.txt';
if ( $filearray=file($FileName) )
{
//   foreach ($filearray as $value ) echo doUBBC ($value);
   $fulltext = implode($filearray,'');
   echo parse_bbc($fulltext);
}
else echo "Could not open file <b>$FileName</b>. <br /> \n";
Either that, or I would find out how to increase the maximum size of the field that stores custom page text values.
Title: Re: BiB BBC code blocks stretching PHP page
Post by: [SiNaN] on April 14, 2014, 02:02:33 PM
In your block code:

Code: (Find) [Select]
<table style="width: 100%;">
Code: (Replace) [Select]
<table style="width: 100%; table-layout: fixed;">
Title: Re: BiB BBC code blocks stretching PHP page
Post by: FireDitto on April 14, 2014, 02:19:25 PM
Beautiful, thank you very much!

:D
Title: Re: BiB BBC code blocks stretching PHP page
Post by: [SiNaN] on April 14, 2014, 02:56:50 PM
You're welcome. ;)
Title: Re: BiB BBC code blocks stretching PHP page
Post by: AngelinaBelle on April 14, 2014, 03:23:45 PM
Thanks, [SiNaN].  I never would have thought of that.
I thought the table width should have been limited by its container.

I'll know to look for that in the future.
SimplePortal 2.3.8 © 2008-2024, SimplePortal