SimplePortal

Development => Feature Requests => Topic started by: Nabil on May 19, 2009, 03:35:00 AM

Title: Make it Optional
Post by: Nabil on May 19, 2009, 03:35:00 AM
Hi ,
The 4 or 5 px between the Border of a Block and its contents I think it'll be better if you make it optional, this can be done in the form of checkbox within the block edit, see the 2 images , in this particular case this 4 or 5px distance is not wanted there

the distance is there even after deactivating the body of a block

 
Title: Re: Make it Optional
Post by: ???1031 on May 19, 2009, 04:41:28 AM
With the display option you can change the style settings of the block.
I think it's
Code: [Select]
padding: 0px 0px 0px 0px;
or
Code: [Select]
margin: 0px 0px 0px 0px;
but i'm not sure ;).
Title: Re: Make it Optional
Post by: Nabil on May 24, 2009, 04:51:37 PM
well I did try : style="margin-top:-5px" , it works , also with style="margin-left:-5px" and bottom too, only with margin-right not , so I kept it with  margin-top:-5px only and deleted left,right and bottom.

Title: Re: Make it Optional
Post by: [SiNaN] on May 25, 2009, 06:22:44 AM
margin: 0; padding: 0;

will do it. You can also just remove the sp_regular_padding class from the template_block() sub template in SPortalBlocks(1-1|2).template.php file.

However, I don't think this is important to be an option itself. You can easily change it as you like.
Title: Re: Make it Optional
Post by: Nabil on May 25, 2009, 01:29:46 PM
this is the Code I'm talking about , it's the news Fader Code with a little change , I took it and placed it in a block to have more freedom in the placement of it , in case you'd like to see if in a way or another getting rid of the distance from all sides between the block borders and the table borders inside , the margin:0 methode doesn't seem to work , but the -5px works except for the right side of the table 
Code: [Select]

<?php
global $context$settings$options$txt$scripturl$modSettings;

// Show the news fader?  (assuming there are things to show...)
if (!empty($context['fader_news_lines']))
{
echo '
<table border="0"  width="100%"  style="margin: 0px; padding: 0px" class="tborder" cellspacing="' 
, ($context['browser']['is_ie'] || $context['browser']['is_opera6']) ? '1' '0' '" cellpadding="4" style="margin-bottom: 0ex;">
<tr>
<td class="titlebg" align="center"> Announcements</td>
</tr>
<tr>
<td valign="middle" align="center" height="110">'
;

// Prepare all the javascript settings.
echo '
<div  id="smfFadeScroller" style="width: 90%; padding: 2px;">'
$context['news_lines'][0], '</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// The fading delay (in ms.)
var smfFadeDelay = '
, empty($settings['newsfader_time']) ? 5000 $settings['newsfader_time'], ';
// Fade from... what text color? To which background color?
var smfFadeFrom = {"r": 0, "g": 0, "b": 0}, smfFadeTo = {"r": 255, "g": 255, "b": 255};
// Surround each item with... anything special?
var smfFadeBefore = "<b>", smfFadeAfter = "</b>";

var foreColor, backEl, backColor;

if (typeof(document.getElementById(\'smfFadeScroller\').currentStyle) != "undefined")
{
foreColor = document.getElementById(\'smfFadeScroller\').currentStyle.color.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (backEl.currentStyle.backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined")
backEl = backEl.parentNode;

backColor = backEl.currentStyle.backgroundColor.match(/#([\da-f][\da-f])([\da-f][\da-f])([\da-f][\da-f])/);
smfFadeTo = {"r": eval("0x" + backColor[1]), "g": eval("0x" + backColor[2]), "b": eval("0x" + backColor[3])};
}
else if (typeof(window.opera) == "undefined" && typeof(document.defaultView) != "undefined")
{
foreColor = document.defaultView.getComputedStyle(document.getElementById(\'smfFadeScroller\'), null).color.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeFrom = {"r": parseInt(foreColor[1]), "g": parseInt(foreColor[2]), "b": parseInt(foreColor[3])};

backEl = document.getElementById(\'smfFadeScroller\');
while (document.defaultView.getComputedStyle(backEl, null).backgroundColor == "transparent" && typeof(backEl.parentNode) != "undefined" && typeof(backEl.parentNode.tagName) != "undefined")
backEl = backEl.parentNode;

backColor = document.defaultView.getComputedStyle(backEl, null).backgroundColor.match(/rgb\((\d+), (\d+), (\d+)\)/);
smfFadeTo = {"r": parseInt(backColor[1]), "g": parseInt(backColor[2]), "b": parseInt(backColor[3])};
}

// List all the lines of the news for display.
var smfFadeContent = new Array(
"'
implode('",
"'
$context['fader_news_lines']), '"
);
// ]]></script>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/fader.js"></script>
</td>
</tr>
</table>'
;
}
?>

Title: Re: Make it Optional
Post by: [SiNaN] on May 25, 2009, 01:35:49 PM
Where did you add margin: 0; padding: 0; codes? It needs to go into the Custom Body Style field in block edit page.
Title: Re: Make it Optional
Post by: Nabil on May 25, 2009, 01:45:32 PM
Quote
Where did you add margin: 0; padding: 0; codes? It needs to go into the Custom Body Style field in block edit page.
I see what you mean , ok I did that and it works , thanks
SimplePortal 2.3.8 © 2008-2024, SimplePortal