Development > Feature Requests

Make it Optional

(1/2) > >>

Nabil:
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

 

???1031:
With the display option you can change the style settings of the block.
I think it's

--- Code: ---padding: 0px 0px 0px 0px;

--- End code ---
or

--- Code: ---margin: 0px 0px 0px 0px;

--- End code ---
but i'm not sure ;).

Nabil:
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.

[SiNaN]:
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.

Nabil:
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: ---
<?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>';
}
?>

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version