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 ofhttp://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'] .= "<center><a href="".XOOPS_URL."/modules/$moduledir/change.php">";
                        
$block['content'] .= "<small>"._CHNGSET."</small></A></center>n";
                    }
                    
$block['content'] .= "<center><table><tr><td align="center">n";
                    
$block['content'] .="<small><b>"._CURCOND."</b></small>n";
                    
$block['content'] .="<table cellspacing="2" cellpadding="2">n";
                    
$block['content'] .="<tr><td align="center" valign="top"><small>" .$v_ConText"</small>n";
                    
$block['content'] .="<br/><br/><small>" ._WIND":</small>n";
                    
$block['content'] .="</td><td align="center" valign="top"><a href="".XOOPS_URL."/modules/$moduledir/index.php"><img src="".XOOPS_URL."/modules/$moduledir/images/$bgifdir/".$v_CIcon."" border="0"></a>n";
                    
$block['content'] .="</td><td align="center" valign="top"><small> " ConvTemp($v_Temp$tpc) ."</small>n";
//                    if ( strlen($v_ConText) > 6 ) {
//                        $block['content'] .= "<br/>";
//                    }
                    
$block['content'] .= "<br/><br/><small> $v_WindD </small>";
                    if (
$v_WindS 0) {
                        
$block['content'] .= "<small>" ConvSpeed($v_WindS$tps) . "</small>";
                    }
                    
$block['content'] .="n</td></tr><tr><td align="center" colspan="3">n";
                    
$block['content'] .="<small>" ._REFE" " ConvReal($v_Real$tpc) . "</small>n";
                    
$block['content'] .="</td></tr></table>n";
                    
$block['content'] .="</td></tr><tr>n";
                    
$block['content'] .="<td align="center"><a href="".XOOPS_URL."/modules/$moduledir/index.php">" ._WDETAILED"...</a>n";
                    
$block['content'] .="</td></tr><tr><td align="center"><small>" ._LASTUP" " .$v_LastUp"</small>n";
                    
$block['content'] .="</td></tr></table>n";
                    
$block['content'] .="</center>n";
                    
fputs($fpwrite$block['content']);
                    
// show block cache debug hit/miss message
                    
if ($options[4] == 1) {
                        
$block['content'] .="<small>Cache-Miss tpc = $tpc tps = $tps</small>";


and add <font color="#FFFFFF"></font> 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:
"<small>"._CHNGSET."</small></A></center>\n";

Change To:
Quote:
"<small><font color="#FFFFFF">"._CHNGSET."</font></small></A></center>\n";


eg2: Not sure if this will work or not, but try it first.
Change the snippet above to:
Quote:
"<small><font color="#FFFFFF">"._CHNGSET."</small></A></center>\n";

Scroll down and find the following line:
$block['content'] .="</td></tr><tr><td align="center"><small>" ._LASTUP" " .$v_LastUp"</small>n";

Change it to:
$block['content'] .="</td></tr><tr><td align="center"><small>" ._LASTUP" " .$v_LastUp"</font></small>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:
"<small><font color="#FFFFFF">"._CHNGSET."</font></small></A></center>\n";
would end up as:
Quote:
"<small><font color=\"#FFFFFF\">"._CHNGSET."</font></small></A></center>\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

177 user(s) are online (121 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

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

Latest GitHub Commits