cloudy

Author Topic: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!  (Read 11618 times)

0 Members and 1 Guest are viewing this topic.

Offline tman1991

  • Posts: 604
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 11.0
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #195 on: April 23, 2012, 01:27:39 AM »
where is your testtags with path?

Offline AM1234

  • Posts: 375
  • Beamsville, Ontario, Canada
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • MS IE 8.0
    • Beamsville Weather Station
Ann-Marie
Beamsville, Ontario, Canada

Online gwwilk

  • Posts: 427
  • Lincoln, NE
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 18.0.1025.162
    • Southeast Lincoln Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #197 on: April 23, 2012, 12:54:41 PM »
where is your testtags with path?

Mine is here: http://http://www.gwwilkins.org/WeatherDisplay/testtags.php?sce=view

The $WXtags variable in cell-ajax-dashboard.php should be overridden by the 'if (isset($SITE['WXtags']))    {$WXtags = $SITE['WXtags'];}' statement which points to Settings.php's './WeatherDisplay/testtags.php' variable.  I'm at a loss here, TMan.
« Last Edit: April 23, 2012, 01:07:07 PM by gwwilk »

Offline tman1991

  • Posts: 604
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 11.0
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #198 on: April 23, 2012, 01:07:57 PM »
I've seen this before with the moon stuff not working.  Let me dig a bit to see what the fix was.  It was a testtag variable I think or something. 

Online gwwilk

  • Posts: 427
  • Lincoln, NE
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 18.0.1025.162
    • Southeast Lincoln Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #199 on: April 23, 2012, 01:57:02 PM »
Meanwhile, I've made some modifications to the cell.php system.

I've made it possible to use an absolute scale for Solar Index rather than the default percentage of theoretical maximum for the station's  lat-long location as determined by WD.  The code uses inline javascript and substitutes
Code: [Select]
<?php if ($haveSolar) {  // Have a Solar Sensor  show current values ?>
  <?php if ($dayornight == 'Night'){ ?>
<td colspan="3" <?php if ($haveUV) { ?> rowspan="2" <?php ?> style="white-space:nowrap; text-align: center; font-size:12px;border: 1px solid black;">
<?php if ($time_hour 12) { // Display Summary if in the evening ?>
<?php langtrans('High Today'); ?>:&nbsp; <?php echo $highsolar?><br />
&nbsp;@&nbsp;<?php echo $highsolartime?><br />
<?php } else { ?>
<?php langtrans('High Yest'); ?>:&nbsp;&nbsp; <?php echo $highsolaryest?><br />
&nbsp;@&nbsp;<?php echo $highsolaryesttime?><br />
<?php ?>
<?php langtrans('Today'); ?>:&nbsp;<?php echo $sunshinehourstodateday?><?php  langtrans('Hrs'); ?> <br />
<?php langtrans('Month'); ?>:&nbsp;<?php echo $sunshinehourstodatemonth?> <?php  langtrans('Hrs'); ?>
</td>
  <?php ?>
  <?php if ($dayornight == 'Day') { ?>
               <td align="center" width="35%" nowrap="nowrap" class="data2" style="text-align: center; font-size: 9px;">
<span class="ajax" id="toggleSI">
   <script type="text/javascript">
function toggle_SI(){
if (document.getElementById("ajaxSIWm2").style.display == 'none') {
    document.getElementById("ajaxSIWm2").style.display = 'inline'
    document.getElementById("ajaxSIimgWm2").style.display = 'inline'
    document.getElementById("ajaxSISolarp").style.display = 'none'
    document.getElementById("ajaxSIimgSolarp").style.display = 'none'
} else {
    document.getElementById("ajaxSIWm2").style.display = 'none'
    document.getElementById("ajaxSIimgWm2").style.display = 'none'
    document.getElementById("ajaxSISolarp").style.display = 'inline'
    document.getElementById("ajaxSIimgSolarp").style.display = 'inline'
}
};
   </script>
               </span>
                  <span class="ajax" id="ajaxsolar" style="font-size: 14px;"><?php echo $VPsolar?></span> W/m<sup>2</sup><br/>
                  <span class="ajax" id="ajaxsolarpct"><?php echo strip_units($currentsolarpercent); ?>
                   </span>%<br/>
                  <span class="ajax" id="ajaxSIWm2" style="display:inline; font-size: 8px;" onclick="javascript:toggle_SI()">W/m<sup>2</sup> <b>&rArr;</b> SI</span>
                  <span class="ajax" id="ajaxSISolarp" style="display:none; font-size: 8px;" onclick="javascript:toggle_SI()">Solar % <b>&rArr;</b> SI</span>
               </td>
               <td width="30%" align="center">
                  <span class="ajax" id="ajaxSIimgWm2" style="display:inline"
                  onclick="javascript:toggle_SI()">
                  <img src="ajax-images/SI<?php echo round(($VPsolar*10)/(round($recordhighsolar,0)),0);?>.gif" height="65" width="34"
                        alt="" id="ajaxsiimg" title="Current WM2 Solar Index"/></span>
                  <span class="ajax" id="ajaxSIimgSolarp" style="display:none"
                  onclick="javascript:toggle_SI()">
                     <img src="ajax-images/SI<?php echo floor(strip_units($currentsolarpercent)*0.1);?>.gif" height="65" width="34"
                        alt="" id ="ajaxsiimg2" title="Current Solar% Solar Index"/></span>
               </td>
   <td align="center" style="white-space:nowrap; text-align:center; font-size: 9px;border-bottom: 1px solid black;">
<?php langtrans('Highest'); ?>:<br />
<?php echo $highsolartime?><br />
<span style="font-size: 14px;"><?php echo $highsolar?></span>
</td>
  <?php ?>
<?php } else { // don't have solar  show info instead ?>
<td colspan="3" <?php if ($haveUV) { ?> rowspan="2" <?php ?> style="text-align: center; white-space:nowrap;border-left: 1px solid black; border-bottom: 1px solid black;" >
<?php langtrans('Sunrise is at'); ?>: <?php echo $sunrise?><br />
<?php langtrans('Solar Noon'); ?>: <?php echo $solarnoon?><br />
<?php langtrans('Sunset is at'); ?>: <?php echo $sunset?><br />
</td>
<?php // end $haveSolar  ?>

for
Code: [Select]
<?php if ($haveSolar) {  // Have a Solar Sensor  show current values ?>
  <?php if ($dayornight == 'Night'){ ?>
<td colspan="3" <?php if ($haveUV) { ?> rowspan="2" <?php ?> style="white-space:nowrap; text-align: center; font-size:12px;border: 1px solid black;">
<?php if ($time_hour 12) { // Display Summary if in the evening ?>
<?php langtrans('High Today'); ?>:&nbsp; <?php echo $highsolar?><br />
&nbsp;@&nbsp;<?php echo $highsolartime?><br />
<?php } else { ?>
<?php langtrans('High Yest'); ?>:&nbsp;&nbsp; <?php echo $highsolaryest?><br />
&nbsp;@&nbsp;<?php echo $highsolaryesttime?><br />
<?php ?>
<?php langtrans('Today'); ?>:&nbsp;<?php echo $sunshinehourstodateday?><?php  langtrans('Hrs'); ?> <br />
<?php langtrans('Month'); ?>:&nbsp;<?php echo $sunshinehourstodatemonth?> <?php  langtrans('Hrs'); ?>
</td>
  <?php ?>
  <?php if ($dayornight == 'Day') { ?>
<td align="center" style="white-space:nowrap; text-align: center; font-size: 9px; border-left: 1px solid black; border-bottom: 1px solid black;">
<span class="ajax" id="ajaxsolar" style="font-size: 14px;"><?php echo $VPsolar?></span><br />W/m<span style="vertical-align:super">2</span><br />
<span class="ajax" id="ajaxsolarpct"><?php echo strip_units($currentsolarpercent); ?></span>%
</td>
<td align="center" style="border-bottom: 1px solid black;">
<span class="ajax" id="ajaxSIimg">
<img src="ajax-images/SI<?php echo get_SIrange($currentsolarpercent); ?>.gif" height="65" width="34" alt="" title="Current Solar Index" />
</span>
</td>
<td align="center" style="white-space:nowrap; text-align:center; font-size: 9px;border-bottom: 1px solid black;">
<?php langtrans('Highest'); ?>:<br />
<?php echo $highsolartime?><br />
<span style="font-size: 14px;"><?php echo $highsolar?></span>
</td>
  <?php ?>
<?php } else { // don't have solar  show info instead ?>
<td colspan="3" <?php if ($haveUV) { ?> rowspan="2" <?php ?> style="text-align: center; white-space:nowrap;border-left: 1px solid black; border-bottom: 1px solid black;" >
<?php langtrans('Sunrise is at'); ?>: <?php echo $sunrise?><br />
<?php langtrans('Solar Noon'); ?>: <?php echo $solarnoon?><br />
<?php langtrans('Sunset is at'); ?>: <?php echo $sunset?><br />
</td>
<?php // end $haveSolar  ?>
The SI Icon and index derivation indicator are clickable to switch between an SI based on an absolute scale (referencing the station's maximum W/m2) and the original SI based on percent of theoretical maximum derived from the station's lat-long location.  The greatest discrepancies between these two indices occur when the sun is closer to the horizon.  Solar percent is needed in order to determine possible cloud cover, but as an index it's somewhat misleading vis-a-vis the UV index.  Hence the optional modification.

I've also added a StormVue Last Hour's Lightning graph
Code: [Select]
        <td style="text-align:center;">
        <img src="./lightning/strikes105-all.php" id="myPull3" height="105" width="117" alt="Last Hr. Strikes" align="middle"/>
        </td>
    <span class="ajax" id="imagereLoader">
<script type="text/javascript"><!--
//<![CDATA[
function reloadImage() {
var now = new Date();
if (document.images && (ajaxUpdates < update.maxupdates)) {
document.images.myPull3.src = './lightning/strikes105-all.php?' + now.getTime();
}
setTimeout('reloadImage()',15000);
}
setTimeout('reloadImage()',15000);
//]]>
-->
</script>
        </span>
here
Code: [Select]
</td>
(NEW CODE GOES HERE!)
<td style="text-align: center; border: none;border-left: 1px solid black;">
<?php langtrans(moonphase($moonage)); ?> <br /><img src="<?php echo $imagesDir .'moon/w/' $moonHemisphere .'-moon'str_pad($moonagedays2"0"STR_PAD_LEFT?>.gif"
with an autorefresh routine and with an appropriate header modification
Code: [Select]
  <tr>
        <td class="datahead2" style="width:50%; text-align:center"><?php langtrans('Almanac'); ?></td>
        <td class="datahead2" style="width:25%; text-align:center"><?php langtrans('Lightning'); ?></td>
        <td class="datahead2" style="width:25%; text-align:center"><?php langtrans('Moon'); ?></td>
  </tr>
.

Lastly, I've modified the cell-cam.php page to autorefresh when new images are uploaded and included the update-refresh routine.  The code is attached and would require some customization of image names, but should otherwise be usable.

Offline tman1991

  • Posts: 604
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 11.0
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #200 on: April 23, 2012, 04:45:35 PM »
are you guys using the common.php provided?  I'm wondering if the moon routines are not being called correctly.

PS Jerry - looks like a lot of good work.  Need to study it in action.. !

Online gwwilk

  • Posts: 427
  • Lincoln, NE
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 18.0.1025.162
    • Southeast Lincoln Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #201 on: April 23, 2012, 04:52:49 PM »
are you guys using the common.php provided?  I'm wondering if the moon routines are not being called correctly.

PS Jerry - looks like a lot of good work.  Need to study it in action.. !

Bingo! #-o  Good catch, and many thanks TMAN.  All is now well with cell.php and its pages.
« Last Edit: April 23, 2012, 04:54:35 PM by gwwilk »

Offline AM1234

  • Posts: 375
  • Beamsville, Ontario, Canada
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • MS IE 8.0
    • Beamsville Weather Station
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #202 on: April 23, 2012, 07:01:38 PM »
That did it, tman, thanks!
Ann-Marie
Beamsville, Ontario, Canada

Online gwwilk

  • Posts: 427
  • Lincoln, NE
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 18.0.1025.162
    • Southeast Lincoln Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #203 on: April 23, 2012, 07:03:49 PM »
The W3C Validator choked on my modified cell-ajax-dashboard.php in several spots. :oops:  I've corrected the errors, and the attached dashboard successfully passes validation.

Offline Bunty

  • Posts: 137
  • Stillwater, OK
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • MS IE 9.0
    • Stillwater Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #204 on: June 23, 2012, 06:04:00 AM »
I have it on my site now.  It's pretty cool.  My thanks go out to everyone who had a part in making it happen.
http://stillwaterweather.com/wx/cell.php

Offline Bunty

  • Posts: 137
  • Stillwater, OK
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 13.0.1
    • Stillwater Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #205 on: June 27, 2012, 05:19:18 AM »
Problem here.  On the advisories page the Heat Advisory box is spilling well into the black background.  I haven't been able to find where in one of the files to correct the width measurement.  http://stillwaterweather.com/wx/cell-advisories.php

Offline tman1991

  • Posts: 604
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 13.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #206 on: June 27, 2012, 03:08:18 PM »
can you post your cell-advisories.php files?

are u using atom-advisory2.php? if so can u post that also?

Offline Bunty

  • Posts: 137
  • Stillwater, OK
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 10.0
    • Stillwater Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #207 on: June 27, 2012, 04:58:24 PM »
can you post your cell-advisories.php files?

are u using atom-advisory2.php? if so can u post that also?

Thanks, but I solved the problem concerning the advisories page. However, another problem has been discovered.  It's on the home page in which details to the heat advisory is wrongly being directed to the full version page. http://stillwaterweather.com/wx/cell.php

Offline tman1991

  • Posts: 604
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 13.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #208 on: June 27, 2012, 05:07:46 PM »
post your cell.php please if you can.  I think you need to make sure its calling atom-advisory2.php, not atom-top-warning.php.

check the logic, $useTopWarning should be false if i recall

Offline Bunty

  • Posts: 137
  • Stillwater, OK
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 10.0
    • Stillwater Weather
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #209 on: June 27, 2012, 05:30:42 PM »
post your cell.php please if you can.  I think you need to make sure its calling atom-advisory2.php, not atom-top-warning.php.

check the logic, $useTopWarning should be false if i recall

Thanks for your concern.  Problem solved.  $useTopWarning was set to true.  Now set to false.

 

cumulus