cloudy cloudy

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

0 Members and 2 Guests are viewing this topic.

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« on: January 18, 2012, 05:27:00 AM »
They are just addons to Saratoga. 

Based on the original files from Bashewa and K3JAE, Relayweather and Webster Weather and enhancements from many others..  I dont claim to originate these, I just "moderized" them and added some flair. 


You will need to look at every file.  I made a cell-top (think the merging of top, header and menubar).  I also have a cell-footer.
make sure to check each page -- even header and footer for the links to your website and your website name and location

The main page cell.php calls out cell-ajax.dashboard.php.  Then there are tabs for cell-cam, cell-forecast, cell-radar, cell-advisories. 

note: cell-radar 2nd image has a link to your lat and long and a name that you can put on the image -- change that 2 your location

Note if your NWS center does NOT have a synopsis, the cell-advisories page will look weird..

I cleaned up the css file a bit and even have a background.  But feel free to change any of that..

GRAPHICS not included -- if you need any of them I will let u know where to get them or post them.. All of them were from the forums.

In the 2nd zip is mainly the thermometer file which is from Bashewa with mods from Relayweather

Hope you enjoy.. 

here is what they look like..

http://frogville.us/cell.php

--
cell-template-a.zip updated..

Had extra footer.php in zip and found 2 minor css errors in handheld.css and cell-ajax-dashboard.php  (forgot to validate the css..doh! )

-- 1/20/2012 updated for the UV/Solar issues found the previous day.

To set the width modify the css file look for "max-width" towards the bottom of the file and cell-top the variable $pagewidth

Fire/chandler icons use what ever icons you want just make sure they are called "CBI-Fire0.gif", "CBI-Fire16.gif", "CBI-Fire25.gif", "CBI-Fire31.gif", "CBI-Fire32.gif"  or modifiy the cell-ajax-dashboard.php files to change to whatever you want.

Fire icons from

http://www.burnsvilleweatherlive.com/wxScripts.php
or
http://www.bashewa.com/downloads/bws-icons-fire.zip

Background images in "a" zip are for cell-ajax-dashboard make sure you put them in ajax-images

1-20-2012 v2 fixes

added support for iphone page width.  (transparent to the user).  fixed formatting issues on cell-forecast page.


Note -- if you are using the alt-dashboard js files (from webster weather),  you will need to edit the ajaxWDws.js

Find the //feelslike section and replace it with this..
Code: [Select]
// FeelsLike ... (C)
      ;;;set_ajax_obs('ajaxProgress',rand+'feel','in Feelslike');
      temp = clientraw[4]; // note.. temp in C
//      switch (true) {
//      case (temp<=16.0): feelslike = clientraw[44]; break; // use WindChill
//      case (temp>=27.0): feelslike = clientraw[45]; break; // use Humidex
//      default          : feelslike = temp;                 // use temperature
//      }
        if (temp <= 16.0 ) {
  feelslike = clientraw[44]; //use WindChill
  feelslike1 = clientraw[44]; //use WindChill
} else if (temp >=27.0) {
  feelslike = clientraw[45]; //use Humidex
  feelslike1 = clientraw[45]; //use Humidex
} else {
  feelslike = temp;   // use temperature
  feelslike1 = temp;   // use temperature
}
        feelslike  = Math.round(parseFloat(feelslike).convertTemp());
        feelslike1  = Math.round(parseFloat(feelslike1).convertTemp());
        set_ajax_obs("ajaxfeelslike",feelslike + uom.Temp);
        set_ajax_obs("ajaxfeelslike1",feelslike1 + uom.Temp);

  //Indoor
  indoortemp = (parseFloat(clientraw[12]).convertTemp()).toFixed(1);
  set_ajax_obs("ajaxindoortemp",indoortemp + uom.Temp);

  indoorhumid = clientraw[13];
  set_ajax_obs("ajaxindoorhumid",indoorhumid);

Otherwise just replace the ajaxWDwx.js with the one in the zip if you are using the saratoga..  Note the code for the saratoga ajaxWDwx.js is "slightly" different so ONLY use that code for the webster ajaxWDwx.js.

This is the code for the saratoga templates:

Code: [Select]
// FeelsLike
temp = clientraw[4]; // note.. temp in C
        if (temp <= 16.0 ) {
  feelslike = clientraw[44]; //use WindChill
  feelslike1 = clientraw[44]; //use WindChill
} else if (temp >=27.0) {
  feelslike = clientraw[45]; //use Humidex
  feelslike1 = clientraw[45]; //use Humidex
} else {
  feelslike = temp;   // use temperature
  feelslike1 = temp;   // use temperature
}
var feelslike  = Math.round(convertTemp(feelslike));
var feelslike1  = Math.round(convertTemp(feelslike1));
        set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
        set_ajax_obs("ajaxfeelslike1",feelslike1 + uomTemp);

//Indoor
var indoortemp = convertTemp(clientraw[12]);
set_ajax_obs("ajaxindoortemp",indoortemp.toFixed(1) + uomTemp);
var indoorhumid = clientraw[13];
set_ajax_obs("ajaxindoorhumid",indoorhumid);


Added a zip of UV/Solar Gifs also.

For a background use

http://frogville.us/2.jpg

or anything just call it 2.jpg (or change it in the handheld.css) file.

moon files are from here
http://www.bashewa.com/downloads/bws-icons-moon.zip
it appears Bashewa forgot moon 28.  So i just copied moon 27 to 28 for both b and w formats.

extra moon icons attached

AQ from here (the graphics are from websterweather)

http://www.burnsvilleweatherlive.com/wxScripts.php

1-22-2012 edits.

changed the advisories system so it shows the detailed advisory on the cell-advisory.php page..  (3 files are effected, cell.php, cell-advisory.php and atom-advisory2.php) the last file atom-advisory2.php is a new file.. --- check the settings

updated the cell-dashboard.php to allow non WU users to show stations max/min for current day.

Fixed the spelling error on line 1555 on cell-ajax-dashboard.php
Found a bug in the UV forecast logic in cell-ajax-dashboard.php 

for the atom-advisory images here
www.642weather.com/weather/scripts/noaa-advisory-images.zip

Updated to cell 2.1 version.. Include Beaufort wind markings and alignment with ajax-dashboard function calls.

New common.php, cell-ajax-dashboard.php, a function in ajaxWDwx.js was removed (not needed anymore -- it was added), and removal of clientraw-parser.php (not needed anymore) from zip file.

Updated to 2.11 (minor formatting and variable name usage), nothing major.

NOTE make sure the variable:

$dayornight = '%dayornight%'; // Day or night flag

is IN your testtags.txt

Updated to 2.2

includes curly new NWS script support

Fixed some forecast and US radar issues

added update for cell picts

Thanks to all who help with this!

Put everything in one zip now.

Added indoor temp support, added missing file for forecasts and included modifications to both saratoga js and alt dashboard js scripts. 

10/2/2015
Updated zip with forecast-discussion.php and forecast-summary.php (just Http 1.0 to 1.1 line change)

3/1/2018
updated zip with latest advforecast2.php, forecast-summary.php, forecast-discussion.php (Thanks Ken!!)  Note this is still v4.03 of the advforecast. I havent switched to the new JSON one, I might later..

« Last Edit: March 02, 2018, 04:18:38 AM by tman1991 »

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
  • OS/Browser:
  • Win Vista/Srvr 2008
  • Chrome 17.0.963.33
    • CNYWeather.com
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #1 on: January 18, 2012, 11:36:56 PM »
Very nice. 1 thing. Your update clock doesnt seem to update.
I see the wind change but the clock is static.
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #2 on: January 18, 2012, 11:52:36 PM »
Fixed, plus added ajax to rain..  That wasnt there..

new cell-ajax-dashboard.php attached.
« Last Edit: January 20, 2012, 12:58:36 AM by tman1991 »

Offline Forever

  • Posts: 437
  • Santa Cruz, CA
  • OS/Browser:
  • Win Vista/Srvr 2008
  • MS IE 8.0
    • WeatherCat
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #3 on: January 19, 2012, 03:49:43 AM »
I tried your new script but it no longer opens to the width of my phone like it did before, it now opens like a normal web page would with the page in the middle with black on both sides.

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #4 on: January 19, 2012, 03:55:18 AM »
did you replace the css file? 

Offline Forever

  • Posts: 437
  • Santa Cruz, CA
  • OS/Browser:
  • Win Vista/Srvr 2008
  • MS IE 8.0
    • WeatherCat
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #5 on: January 19, 2012, 04:01:56 AM »
I did. I even checked your page and it opens the same way.

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #6 on: January 19, 2012, 04:05:56 AM »
you must have wide phone?

Offline Forever

  • Posts: 437
  • Santa Cruz, CA
  • OS/Browser:
  • Win Vista/Srvr 2008
  • MS IE 8.0
    • WeatherCat
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #7 on: January 19, 2012, 04:08:24 AM »
I have a HTC Sensation 4g with a screen rez of 540 x 960.

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #8 on: January 19, 2012, 04:10:18 AM »
change this line

@media screen{
#container {
    max-width: 320px;
   }
}

to something bigger

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #9 on: January 19, 2012, 05:18:06 AM »
I have a blackberry and i found I can go up 360..  I can change the forecast synopsis to 50 now also.  So maybe I need to writeup some documentation on some changes for different screens..

Im going back and changing the tables to say width=100% etc to make sure they are scaled..   I do have some graphics that are fixed size, so that will need to be changed.. maybe a variable for all of this?

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #10 on: January 19, 2012, 07:16:33 AM »
I made some changes now.. I added a variable called pagewidth to the css page and to the cell-top page.. I then have all the images scale off that number.  I also made the forecast synopsis parse off that number..

So if you guys like this, I can upload these files..   Let me know..

Offline Forever

  • Posts: 437
  • Santa Cruz, CA
  • OS/Browser:
  • Win Vista/Srvr 2008
  • MS IE 8.0
    • WeatherCat
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #11 on: January 19, 2012, 01:26:05 PM »
That sounds good, with so many diffrent sized screens out there it would be nice to try and fit more than just my own.

Offline atsio

  • Weather at Thessaloniki - Northern Greece.
  • Posts: 419
  • Macedonia is GREECE! Study history!
  • Thessaloniki - Greece
  • OS/Browser:
  • Win XP
  • Firefox 9.0.1
    • Weather conditions at Thessaloniki Historical Center-Central Macedonia-Greece
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #12 on: January 19, 2012, 02:41:45 PM »
Well, I'm trying to implement the script but I have some issues concerning the units.
I use the metric system so I made all necessary modifications in the scripts run in metric.

There are two values that units appear in English system, Current Temperature and Max Monthly
wind gust! All others are fine! Take a look(ignore the translation, I haven't done with it yet):

http://www.meteothes.gr/cell.php

Anyway, thanks for the fine script!

Thanos

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #13 on: January 19, 2012, 06:12:49 PM »
Yeah i've started from 2 year old code or so..  Let me look into the temp and wind thing.. 

Your forecast page and webcam page will need to be updated lol :)


---

let me know if this fixes your unit issue.. 

There is a request for a different fire index I will try to update that later and re upload scripts since I changed the width parameters..

« Last Edit: January 20, 2012, 12:58:50 AM by tman1991 »

Offline tman1991

  • Posts: 703
  • Tucson, AZ (US)
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 9.0.1
    • Countryside Manor
Re: Cellphone/Mobile Scripts (XHTML Mobile 2.3 Certified)!
« Reply #14 on: January 19, 2012, 08:04:10 PM »
Can someone help me out on fire index?  Bashewa put out many different sets of graphics.. 

Right now its hardcoded to use graphics called CBI-Fire0.gif (fire16,fire25, fire31, fire32)..  I figured anyone can use what graphics they want and just rename them to that? 

Also If using Chander then I report the CBI.

But if using FWI, just report the number out of 31??  So use the same graphics code, but just change what is listed as text??  Am I understanding this?

 

cumulus