Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with CSS Formatting

    Hi folks...

    Feel a bit stupid about posting this, as I can usually nut things out, but not this one.
    I have a module which displays the image untitled-1.jpg in the attached zip file (without the red lines & arrows of course).
    I want it to display the image untitled-2.jpg.
    I have attached the code in the file zip file, and also below:

    I would be greatly indebted to anyone who can throw some light on this for me.... and again... apologies for my ignorance!!

    Mike
    [CODE]
    <?php
    // no direct access
    defined( '_JEXEC' ) or die( 'Restricted access' );
    $uniqid = $module->id;
    $layout = $params->get('layout','block');
    $fcast = $params->get('forecast','4');
    $city = $params->get('city',1);
    $condition = $params->get('condition',1);
    $humidity = $params->get('humidity',1);
    $wind = $params->get('wind',1);
    $tempUnit = $params->get('tempUnit','c');
    $separator = $params->get('separator','/');
    ?>
    <div id="weather_sp1_id<?php echo $uniqid; ?>" class="weather_sp1">
    <?php if (isset($weather->error)) { ?>
    <div class="spw_row error"><?php echo $weather->error; ?></div>
    <?php } else { ?>
    <div class="weather_sp1_c">
    <div class="weather_sp1_cleft">
    <img class="spw_icon_big" src="<?php echo $weather->c_icon; ?>" title="<?php echo $weather->c_condition; ?>" alt="<?php echo $weather->c_condition; ?>" />
    <br style="clear:both" />
    <p class="spw_current_temp">
    <?php if ($tempUnit=='f') { ?>
    <?php echo $weather->c_temp_f; ?>&deg;F
    <?php } else { ?>
    <?php echo $weather->c_temp_c; ?>&deg;C
    <?php } ?>
    </p>
    </div>
    <div class="weather_sp1_cright">
    <?php if($city==1) { ?>
    <h2 class="weather_sp1_city"><?php echo $params->get('location','London,UK') ?></h2>
    <?php } ?>
    <?php if($condition==1) { ?>
    <div class="spw_row"><?php echo $weather->c_condition; ?></div>
    <?php } ?>
    <?php if($humidity==1) { ?>
    <div class="spw_row"><?php echo $weather->c_humidity; ?></div>
    <?php } ?>
    <?php if($wind==1) { ?>
    <div class="spw_row"><?php echo $weather->c_wind; ?></div>
    <?php } ?>
    </div>
    <div style="clear:both"></div>
    </div>
    <div style="clear:both"></div>
    <?php if ($fcast!='disabled') { ?>
    <div class="weather_sp1_main">
    <?php for($i = 0; $i < $fcast; $i++) : ?>
    <?php if ($layout=='list') { ?>
    <div class="list_<?php echo ($i%2 ? 'even' : 'odd') ?>">
    <span class="weather_sp1_list_day"><?php echo $weather->forecast[$i]['day_of_week']; ?></span>
    <span class="weather_sp1_list_temp"><?php echo modSPWeatherHelper::convert($weather->forecast[$i]['low'],$weather->unit,$tempUnit) . '&nbsp;' . $separator . '&nbsp;' . modSPWeatherHelper::convert($weather->forecast[$i]['high'],$weather->unit,$tempUnit); ?></span>
    <span class="weather_sp1_list_icon"><img class="spw_icon" src="<?php echo $weather->forecast[$i]['icon']; ?>" align="right" title="<?php echo $weather->forecast[$i]['condition']; ?>" alt="<?php echo $weather->forecast[$i]['condition']; ?>" /></span>
    <div style="clear:both"></div>
    </div>
    <?php } else { ?>
    <div class="block_<?php echo ($i%2 ? 'even' : 'odd') ?>" style="float:left;width:<?php echo round(100/$fcast) ?>%">
    <span class="weather_sp1_day"><?php echo $weather->forecast[$i]['day_of_week']; ?></span>
    <br style="clear:both" />
    <span class="weather_sp1_icon"><img src="<?php echo $weather->forecast[$i]['icon']; ?>" title="<?php echo $weather->forecast[$i]['condition']; ?>" alt="<?php echo $weather->forecast[$i]['condition']; ?>" />
    </span><br style="clear:both" />
    <span class="weather_sp1_temp"><?php echo modSPWeatherHelper::convert($weather->forecast[$i]['low'],$weather->unit,$tempUnit) . '&nbsp;' . $separator . '&nbsp;' . modSPWeatherHelper::convert($weather->forecast[$i]['high'],$weather->unit,$tempUnit); ?></span>
    <br style="clear:both" />
    </div>
    <?php } ?>
    <?php endfor; ?>
    </div>
    <?php } ?>
    <?php } ?>
    <div style="clear:both"></div>
    </div>
    [CODE]
    Attached Files Attached Files
    Last edited by quigley595; 06-30-2012 at 01:07 PM. Reason: add attachment

  • #2
    Regular Coder
    Join Date
    Jun 2012
    Location
    Near Chicago, USA
    Posts
    123
    Thanks
    7
    Thanked 19 Times in 19 Posts
    Had to do some guessing to try to determine which PHP values might hold. The HTML code (browser "view source") would have been better than the PHP source, as it would have shown what the rendered code actually is.

    I think
    Code:
    <br style="clear:both" />
    is too high in your code. It appears to be clearing the float before the temperature is printed. Try removing it or placing it to below the temperature and see what happens.

    The temperature line itself may need to be put into a span tag instead of p. But that would depend on the class spw_current_temp definition applied to the tag.

    Will
    Numerology API for apps - Facebook, iPad, mobile phones. No charge to use API. [info]

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot for your ideas!!!

    I used this as a basis, and fiddled around a bit more, and eventually got it to work... not exactly the way I wanted it, but acceptable.
    Thanks a million again.

    Mike
    Quote Originally Posted by Will Bontrager View Post
    Had to do some guessing to try to determine which PHP values might hold. The HTML code (browser "view source") would have been better than the PHP source, as it would have shown what the rendered code actually is.

    I think
    Code:
    <br style="clear:both" />
    is too high in your code. It appears to be clearing the float before the temperature is printed. Try removing it or placing it to below the temperature and see what happens.

    The temperature line itself may need to be put into a span tag instead of p. But that would depend on the class spw_current_temp definition applied to the tag.

    Will


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •