SimplePortal

Support => English Support => Topic started by: Nick on July 29, 2010, 07:24:03 PM

Title: Rounded blocks, gone?
Post by: Nick on July 29, 2010, 07:24:03 PM
SMF Version: 2.0RC3
SP Version: 2.3.2

Most, if not all of my blocks had the rounded feature by using the Default Body Class of Windowbg2, Now there square... I think it was around the time i added this;

http://simpleportal.net/index.php?topic=5332

I want to keep the blocks in blocks but i also want rounded corners. I'm not 100% sure it was the blocks in blocks that did this but i noticed it when i added it. Heres my blocks in blocks code;

Code: [Select]
$block = current(getBlockInfo(false, 49, false, false));  // Load block info$block['style'] = sportal_parse_style('explode', $block['style'], true);  //Parse block style parameters.template_block($block); // Output the block.

$columns = 2;$block_ids = array(17);$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 '<center><table style="width: 60%;">   <tr>';$counter = 0;foreach ($block_data as $data){   if ($counter != 0 && $counter % $columns == 0)   {      echo '   </tr>   <tr>';   }   echo '      <td style="width: ', ceil((100 / $columns)), '%; vertical-align: top;"></center>         ', template_block($data), '      </td>';   $counter++;}echo '   </tr></table>';

Added via "Custom php block". As i said though, may not be an issue with this coding.
Title: Re: Rounded blocks, gone?
Post by: deansmar on July 30, 2010, 05:28:07 AM
have you also changed to a different theme ??

the rounded corners of the blocks come from the theme you are using.

for example;
the SMF Default Theme - Core uses the image main_block.png to create the rounded corners of the blocks this image can be found in \Themes\default\images\theme
Title: Re: Rounded blocks, gone?
Post by: Nick on July 30, 2010, 06:17:37 AM
No the theme is the same and the rounded corners still work with my pages. It's just the home page that stopped working.
Title: Re: Rounded blocks, gone?
Post by: AngelinaBelle on August 03, 2010, 09:35:36 AM
Use of blocks in blocks should not change windowbg. 
If you change the style for a block, that would change the block's style.
 
Is the code you posted the code you are using?
It looks like lots of essential stuff has gotten stuck in the comments (everything after the "//").
 
You might take a look at the generated code for the blocks and see if "windowbg" is used with them.
 
 
Title: Re: Rounded blocks, gone?
Post by: Nick on August 03, 2010, 11:15:20 AM
All my blocks on my portal use the rounded feature. They worked fine before until obviously they stopped so i know that my theme supports the effect.

http://www.profifaleagues.net/index.php

If you take a look at the search bar under the login box it should be rounded, heres the current settings;

Style Options: No title
Default Body Class: Windowbg2

There is no custom coding entered and No body is NOT ticked.

However if you take a look at one of my custom pages created via simpleportal the feature works fine i also have the rounded feature in posts like you do here.

http://www.profifaleagues.net/index.php?page=premiership
Title: Re: Rounded blocks, gone?
Post by: AngelinaBelle on August 05, 2010, 05:04:01 PM
I would like to find out if the problem comes from the "blocks within blocks" code you used.
The sample you supplied has everything run into one line, with lots of stuff lost in the comments.
 
I'd like to know if that is really the code you are using, or if it got messed up during posting.
 
 
Title: Re: Rounded blocks, gone?
Post by: Nick on August 06, 2010, 11:06:17 AM
I'm using 3 of the block in blocks codes so i can center each block and have it a smaller size than the default width.

All codes are using the same coding except they just define different block ID's.

Heres the codes taken directly from the php blocks;

Code: [Select]
$block = current(getBlockInfo(false, 49, false, false));  // Load block info$block['style'] = sportal_parse_style('explode', $block['style'], true);  //Parse block style parameters.template_block($block); // Output the block.

$columns = 2;$block_ids = array(17);$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 '<center><table style="width: 60%;">   <tr>';$counter = 0;foreach ($block_data as $data){   if ($counter != 0 && $counter % $columns == 0)   {      echo '   </tr>   <tr>';   }   echo '      <td style="width: ', ceil((100 / $columns)), '%; vertical-align: top;"></center>         ', template_block($data), '      </td>';   $counter++;}echo '   </tr></table>';

Code: [Select]
$block = current(getBlockInfo(false, 49, false, false));  // Load block info$block['style'] = sportal_parse_style('explode', $block['style'], true);  //Parse block style parameters.template_block($block); // Output the block.

$columns = 2;$block_ids = array(39);$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 '<center><table style="width: 30%;">   <tr>';$counter = 0;foreach ($block_data as $data){   if ($counter != 0 && $counter % $columns == 0)   {      echo '   </tr>   <tr>';   }   echo '      <td style="width: ', ceil((100 / $columns)), '%; vertical-align: top;"></center>         ', template_block($data), '      </td>';   $counter++;}echo '   </tr></table></H1>';

Code: [Select]
$block = current(getBlockInfo(false, 49, false, false));  // Load block info$block['style'] = sportal_parse_style('explode', $block['style'], true);  //Parse block style parameters.template_block($block); // Output the block.

$columns = 2;$block_ids = array(41);$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 '<center><table style="width: 30%;">   <tr>';$counter = 0;foreach ($block_data as $data){   if ($counter != 0 && $counter % $columns == 0)   {      echo '   </tr>   <tr>';   }   echo '      <td style="width: ', ceil((100 / $columns)), '%; vertical-align: top;"></center>         ', template_block($data), '      </td>';   $counter++;}echo '   </tr></table></H1>';

As you can see they pull from blocks, 17, 39 and 41.
Title: Re: Rounded blocks, gone?
Post by: AngelinaBelle on August 06, 2010, 01:44:43 PM
Youhave squashed lots of stuff onto one line.
In php, anything after a // is a comment.
 
In your code,
Code: [Select]
$block = current(getBlockInfo(false, 49, false, false));  // Load block info$block['style'] = sportal_parse_style('explode', $block['style'], true);  //Parse block style parameters.template_block($block); // Output the block.
Everything after the first "//" is ignored.
 
You need to put these lines of code on different lines in your file or php block.
Code: [Select]
$block = current(getBlockInfo(false, 49, false, false)); 
// Load block
info$block['style'] = sportal_parse_style('explode', $block['style'], true); 
//Parse block style
parameters.template_block($block);
// Output the block.

And similarly for the rest of your code.
 
 
You might find the php manual at php.net, or the php tutorial at w3schools.com helpful in understanding the php code you are working with.
Title: Re: Rounded blocks, gone?
Post by: Nick on August 06, 2010, 03:55:28 PM
Hmm, Ok thankyou.
SimplePortal 2.3.8 © 2008-2024, SimplePortal