Author Topic: Current conditions  (Read 2823 times)

Offline aznetcowboy

  • Full Member
  • ***
  • Posts: 73
    • El Gheko Neighborhood Weather Station
Current conditions
« on: May 08, 2013, 03:18:31 PM »
I would like to add <#currcond> into the Weather Blues V1 template in indexT. How do I code it so I can have a display that looks like "Currently: <#currcond>" and still have it not display if nothing is in <#currcond>?

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Current conditions
« Reply #1 on: May 08, 2013, 06:32:54 PM »
Hi,

For a thing like that we have to do special things.

First of all, put your webtag (ie. <#currentcond>) in a line
without worrying about text. Something like this:

Quote
<p id="My_Magic_ID">Currently: <#currcond></p>

But, since it is not a good way to show something briefly
to hide it after. Then we think other way, we will hide it
at page loading and show it if condition is met (if no current cond).

So, just after the line <head>, insert that:

Quote
<style type="text/css">
   #MyMagic_ID { display: none;}
</style>

That way, the ID MyMagic_ID is not displayed,
but have content of the webtag waiting to be displayed.
To display it, add a piece of javascript right after the #MyMagic_ID
like this:

Quote
<script type="text/javascript">
   curcon = "<#currcond>";
   if (curcon <> "")
       MyMagic_ID.style.visibility = "visible";
</script>

There is many way to do what you want to do,
but that is the solution I think of fastly.

Hope this help,
Jacques
Please, consider supporting this site 

Offline aznetcowboy

  • Full Member
  • ***
  • Posts: 73
    • El Gheko Neighborhood Weather Station
Re: Current conditions
« Reply #2 on: May 09, 2013, 02:26:27 PM »
Jacques,

Here is how I interpreted your instructions, hopefully correctly. In the header I have the following:
Quote
<head>
    <meta http-equiv="content-type" content="text/html; charset=iso8559-1" />
    <title><#location> | Most recent observations</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta http-equiv="refresh" content="300; url=http://www.elgheko.us" />
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
    <script type="text/javascript">
        curcon="<#currcond>";
           if (curcon <> "") MyMagic_ID.style.visibility = "visible";
    </script>

    <script type="text/javascript" src="js/clockt.js"></script>
    <script type="text/javascript" src="js/clockp.js"></script>
</head>

In the body I have the following:
Quote
<b><font color="#FF0000">NOTICE</font>: Take the weather forecast on this page with a grain of salt. Go to the <a href="NWSforecast.php">Forecast</a> page for a more accurate National Weather Service forecast!</b>
                    </p>
                    <br />
                    <h1>Forecast : <span style="color: #000"><#forecast></span></h1><br />
                                                            <!-- WEATHER DATA BEGIN -->
           <b><p id="My_Magic_ID">Current Observations: <#currcond></p></b>
                    <table width="100%"  border="0" cellpadding="0" cellspacing="0" summary="Observations actuelles">
<caption style="text-align: left;"><strong>Conditions at local time <#time></strong></caption>
However, the results are as follows when <#currcond> is blank:


What did I do wrong?

Tom

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Current conditions
« Reply #3 on: May 10, 2013, 05:15:44 AM »
Hi Tom,

Read carefully steps I sent in last post. You have forgot
to insert these lines:


Quote
So, just after the line <head>, insert that:

<style type="text/css">
   #MyMagic_ID { display: none;}
</style>

Regards,
Jacques
Please, consider supporting this site 

Offline aznetcowboy

  • Full Member
  • ***
  • Posts: 73
    • El Gheko Neighborhood Weather Station
Re: Current conditions
« Reply #4 on: May 10, 2013, 05:49:06 PM »
Jacques,

You stated that right after <head> the following gets placed:
 "<style type="text/css">
   
#MyMagic_ID { display: none;}
</style>
".

Then you said:
"That way, the ID MyMagic_ID is not displayed,
but have content of the webtag waiting to be displayed.
To display it, add a piece of javascript right after the #MyMagic_ID
like this:

<script type="text/javascript">
   curcon = "<#currcond>";
   if (curcon <> "")
       
MyMagic_ID.style.visibility = "visible";
</script>
"

Okay, where does the above script statement go? That is what confuses the whole thing. Is it in the <head> or <body>?

Tom

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Current conditions
« Reply #5 on: May 11, 2013, 05:29:35 AM »
Hi Tom,

Sorry, I've made an error, the "style" section goes BEFORE <head>.
and script right after the line you want to conditionally display.

Regards,
Jacques
Please, consider supporting this site 

Offline aznetcowboy

  • Full Member
  • ***
  • Posts: 73
    • El Gheko Neighborhood Weather Station
Re: Current conditions
« Reply #6 on: May 11, 2013, 01:10:36 PM »
Jacques,

That does not work either. Nothing displays now. Maybe I have worded my question very poorly. So let me try again:

Example #1 (with value in #currcond):

            Constant="Current Conditions: "
            #currcond="Street Flooding(#currcond is the Cumulus webtag <#currcond>)

                   The display should be "Current Observations: Street Flooding"


Example #2 (#currcond is blank):

           Constant="Current Conditions: "
           #currcond=""

                     The display should be ""  (blank)



 This would be only in the indexT.htm/index.htm files.

Tom

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Current conditions
« Reply #7 on: May 11, 2013, 02:10:18 PM »
Hi Tom,

Read the description in the Cumulus Webtags carefully:

<#currcond>
"Represents the value entered on the screen within Cumulus for the Current Weather condition, or the value as held in the currentconditions.txt file."

When my station was operational and uploading, I used a new "colspan" (like "Temperature and Humidity" or "Wind" or "Rainfall") on the index page to display "Current Conditions".
I entered the webtag info as described above (on Cumulus Main Screen).

It looked like this:
<tr>
<td colspan="4" class="input_txt2">Current Observations:&nbsp; <#currcond></td>
</tr>

When you don't enter a message it only shows Current Observations.....
Otherwise you can enter whatever you want (I even used it to upload the score during the SuperBowl  :) :)

Hope this will help, let me know,

Cheers,
Arthur
 

Offline aznetcowboy

  • Full Member
  • ***
  • Posts: 73
    • El Gheko Neighborhood Weather Station
Re: Current conditions
« Reply #8 on: May 11, 2013, 02:27:29 PM »
Hi Tom,

Read the description in the Cumulus Webtags carefully:

<#currcond>
"Represents the value entered on the screen within Cumulus for the Current Weather condition, or the value as held in the currentconditions.txt file."

When my station was operational and uploading, I used a new "colspan" (like "Temperature and Humidity" or "Wind" or "Rainfall") on the index page to display "Current Conditions".
I entered the webtag info as described above (on Cumulus Main Screen).

It looked like this:
<tr>
<td colspan="4" class="input_txt2">Current Observations:&nbsp; <#currcond></td>
</tr>

When you don't enter a message it only shows Current Observations.....
Otherwise you can enter whatever you want (I even used it to upload the score during the SuperBowl bebe

Hope this will help, let me know,

Cheers,
Arthur

Arthur,

See, the thing I'd like is to NOT have the "Current Conditions" show if the currcond is blank. And, call it lazy or whatever, I don't what to be entering in "Current Observations: " everytime I make an entry on the Cumulus screen to be display on my weather page. I'd like this to display between the Forecast line and the Conditions line w\here it makes more sense.

Tom

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Current conditions
« Reply #9 on: May 11, 2013, 02:49:59 PM »
Hi Tom,

I assume there are always "Current Conditions" to be observed, 24/7.... :))

When I was away for a few days a simple "Current Conditions: N.A " did the trick.......
That's probably the way it goes when it's supposed to be entered manually on the Cumulus Main Screen....

Cheers,
Arthur

Offline aznetcowboy

  • Full Member
  • ***
  • Posts: 73
    • El Gheko Neighborhood Weather Station
Re: Current conditions
« Reply #10 on: May 11, 2013, 03:46:44 PM »
Hi Tom,

I assume there are always "Current Conditions" to be observed, 24/7.... :))

When I was away for a few days a simple "Current Conditions: N.A " did the trick.......
That's probably the way it goes when it's supposed to be entered manually on the Cumulus Main Screen....

Cheers,
Arthur

Well Arthur, that is in the case of an area where things change. We can go for weeks with nothing to observe except Sunny and dry and not a cloud in the sky. I'd like to use it for passing along information about our desert weather that is out of the normal, like flash flooding is occurring or expected. That is the problem with living in a desert climate.

Tom