1
Grover
Change block formatting or colour?
  • 2005/4/29 15:30

  • Grover

  • Just popping in

  • Posts: 61

  • Since: 2005/2/13


How would one go about changing either the background colour or text color of a single block? I'm trying out a theme which has a black left sidebar. Menus display properly with reversed text but the content of a couple blocks -- namely XP Weather and Random Quotes -- are blacked out as the text doesn't automatically reverse. Is it possible to change the specs inside the block? You can see what I mean at the bottom left corner of http://whisky-jack.com/bccarfree.

2
tripmon
Re: Change block formatting or colour?
  • 2005/4/30 1:19

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


guess you sorted it, it looks good.

3
Grover
Re: Change block formatting or colour?
  • 2005/4/30 6:32

  • Grover

  • Just popping in

  • Posts: 61

  • Since: 2005/2/13


No, not sorted out at all. Select the text in the weather block and you'll see much info does not display at all. It's still very much an ongoning issue.

4
tripmon
Re: Change block formatting or colour?
  • 2005/4/30 9:32

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


to fix this you need to:
open /modules/xp-weather/blocks/block-XPWeather.php
in an editor.

Scroll down until you see:
// users can change weather settings from block
                    
if ( ( $options[7] == && $options[0] == ) ) {
                        
$block['content'] .= "
/modules/$moduledir/change.php">";
                        
$block['content'] .= ""._CHNGSET."
n"
;
                    }
                    
$block['content'] .= "
center">n";
                    
$block['content'] .=""._CURCOND."n";
                    
$block['content'] .="2" cellpadding="2">n";
                    
$block['content'] .="
center" valign="top">.$v_ConText"n";
                    
$block['content'] .="

._WIND":n";
                    
$block['content'] .="center" valign="top">/modules/$moduledir/index.php">/modules/$moduledir/images/$bgifdir/".$v_CIcon."" border="0">n";
                    
$block['content'] .="center" valign="top"> " ConvTemp($v_Temp$tpc) ."n";
//                    if ( strlen($v_ConText) > 6 ) {
//                        $block['content'] .= "
";
//                    }
                    
$block['content'] .= "

 
$v_WindD "
;
                    if (
$v_WindS 0) {
                        
$block['content'] .= "ConvSpeed($v_WindS$tps) . ""
;
                    }
                    
$block['content'] .="n
center" colspan="3">n";
                    
$block['content'] .="._REFE" " ConvReal($v_Real$tpc) . "n";
                    
$block['content'] .="
n";
                    
$block['content'] .="n";
                    
$block['content'] .="center">/modules/$moduledir/index.php">" ._WDETAILED"...n";
                    
$block['content'] .="center">._LASTUP" " .$v_LastUp"n";
                    
$block['content'] .="n";
                    
$block['content'] .="
n"
;
                    
fputs($fpwrite$block['content']);
                    
// show block cache debug hit/miss message
                    
if ($options[4] == 1) {
                        
$block['content'] .="Cache-Miss tpc = $tpc tps = $tps"
;


and add to each of the variable names. (You may be able to put the font tag in the first statement and close the tag in the last... see example 2 below)

eg1: 1st variable in the code above:
Quote:
""._CHNGSET."\n";

Change To:
Quote:
""._CHNGSET."\n";


eg2: Not sure if this will work or not, but try it first.
Change the snippet above to:
Quote:
""._CHNGSET."\n";

Scroll down and find the following line:
$block['content'] .="center">._LASTUP" " .$v_LastUp"n";

Change it to:
$block['content'] .="center">._LASTUP" " .$v_LastUp"n";


if that does not work, you will need to follow 'eg1' for all of the variables.

Hope that helps.

5
Grover
Re: Change block formatting or colour?
  • 2005/5/1 2:19

  • Grover

  • Just popping in

  • Posts: 61

  • Since: 2005/2/13


Thanks, Tripmon, for your lengthy response. Unfortunately I couldn't get either option to work. Every time I made a change and uploaded it I ended up with a blank screen. I also tried changing the table background colour but that failed too. I was very careful with the syntax so I'm not sure why it won't work.

6
tripmon
Re: Change block formatting or colour?
  • 2005/5/2 7:06

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


did you update the module afterwards? maybe that would make a diff.

7
Grover
Re: Change block formatting or colour?
  • 2005/5/2 23:01

  • Grover

  • Just popping in

  • Posts: 61

  • Since: 2005/2/13


Yeah, I did try that but to no avail. I still get the blank page after making the changes.

When I add the font tags through Crimson Editor the variables [_CHNGSET, _CURCOND, etc] change from Black to Green which seems to suggest they are no longer being read as PHP. Still it seems odd that the whole site would go blank as a result of such a small change.

Thanks for your assistance. I think I might try some other approach like moving the block to the centre or getting rid of it altogether.

8
tripmon
Re: Change block formatting or colour?
  • 2005/5/3 16:57

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


ooop's my bad grover...

I think the var's are being assigned by echoing...

You will need to escape the "

Do this by puting \ in front of " where you don't want to escape PHP...

Quote:
""._CHNGSET."\n";
would end up as:
Quote:
""._CHNGSET."\n";


Try that, bet it does the trick.

9
Grover
Re: Change block formatting or colour?
  • 2005/5/3 20:37

  • Grover

  • Just popping in

  • Posts: 61

  • Since: 2005/2/13


Thanks Tripmon. That did the trick. It took a while to propagate and I thought it wasn't working so I gave up and went to fool around with the theme's CSS. I wasn't getting any better results there when suddenly all the text turned white. Hooray!

I'm certain the changes came from the hacks to the block and not the CSS. I'm not sure why it took so long to propagate. I checked both caches [block and preferences; both off] updated the module a couple times and refreshed my browser frequently but it took about 10 minutes still for the changes to show up. I easily could have missed it if I had reverted the changes. Weird. Once again, thanks you saved my bacon.

10
tripmon
Re: Change block formatting or colour?
  • 2005/5/3 22:19

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


mmmmmmm Bacon...

Glad it worked!

Login

Who's Online

142 user(s) are online (106 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits