Basically nearly starting over on the 'firedangerWD.php' ajax-dashboard ajax-update display: This one does work if you'll patiently watch the Fire Danger Image redraws
here. As the temperature and/or humidity change, the 'firedangerWD.php' image redraws.
Modifications were needed in 'firedangerWD.php', ajaxWDwx3.js, and of course 'ajax-dashboard6.php'. I used the cloud-base reloading code as my model and decided that since the Saratoga template already had an array of clientraw parameters the code to read this into 'firedangerWD.php' could bypass this and the temperature and humidity could be passed to 'firedangerWD.php' on the command line with '$_GET'. Those are the modifications made to this version of '
firedangerWD.php'. (Right-click, choose 'Save as...', and save without the '.txt'.)
The modifications to 'ajaxWDwx3.js' were only half done as initially described, then deleted in a previous post. The first addition, in context:
//------------------------------------------------------------------------------
// FIRE INDEX: optional setting for the fire risk graphic
// tag: "ajaxfdimg"
// e.g. graphic name: "./firedangerWD.php"
var fireImg3 =
{src : "./firedangerWD.php" // path and script for dynamic CBI image
,width : 170 ,height: 135 ,hspace: 0 ,vspace: 0 ,border: 0
,style : ""
,align : ""
,useTag: "ajaxfdimg"
};
//------------------------------------------------------------------------------
// WEBCAM IMAGE: optional setting for the webcam graphic
The second 'ajaxWDwx3.js' modification, also in context, adds this:
set_ajax_obs("ajaxcloudheight",cloudText);
// Fire Risk ... FireDangerWD
;;;set_ajax_obs('ajaxProgress',rand+'fire','in Fire Danger');
temp = clientraw[ 4];
humidity = clientraw[5];
param = '?temp=' + temp +'&humidity=' + humidity;
set_ajax_obs("ajaxfdimg", param
,'<img src="' + fireImg3.src + param
+ '" width="' + fireImg3.width
+ '" height="' + fireImg3.height
+ '" hspace="' + fireImg3.hspace
+ '" vspace="' + fireImg3.vspace
+ '" />');
// Fire Risk ... (FWI)
You don't need to place it exactly where I did, but it seems to fit best right there.
Lastly, the 'ajax-dashboard6.php' modification, again in context:
<?php } // end $useCBI ?>
<?php if ($useFD) { // Show Chandler Buring Index using firedangerWD.php ?>
<tr>
<td colspan ="2" style="text-align: center;">
<a href="<?php echo $fwi_url?>" target="_blank" title="Nebraska Wildfire Danger">
<span class="ajax" id="ajaxfdimg"><img src="firedangerWD.php" height="135" width="170" alt=""/></span></a>
</td>
</tr>
<?php } // end $useFD ?>
The 'title="***"' obviously needs to be modified to reflect the your link in 'AltAjaxDashboardConfig6.php', '$fwi_url'.
Hopefully this project is now finished.
It had been too long since I last played with 'ajaxWDwx3.js' and I had forgotten what I had learned earlier!
Edit 2015 Oct 24: I neglected to include one obvious additional ingredient to complete the above recipe, the relevant section of 'AltAjaxDashboardConfig6.php':
// NOTE if FWI, FD and CBI are false, nothing will display. If two or all are ture, you will have one messed up display!
// Settings for FIRE INDEX & STORM PREDICTION GRAPHIC - TOP ROW UNDER FORECAST (***ONLY ONE OF THE FOLLOWING MUST BE TRUE!!!)
$useFWI = false; // Set to true to display Fire Weather Index
// (MUST BE FALSE IF CHANDLER BURNING INDEX IS ON!!!)
$useCBI = false; // Set to true to display Chandler Burning Index
// (MUST BE FALSE IF FIRE WEATHER INDEX IS ON!!!)
$useFD = true; // Use FiredangerWD.php graphic
// (ONLY ONE OF THESE THREE MAY BE ON (TRUE)!!!)
$fwi_url = "wxnfsfiredanger.php"; // Page to link to when user clicks on FWI Link. See http://www.wxforum.net/index.php?topic=18814.0
//
(This was posted earlier, but the omission here was unintentional.)
Edit 2015 Nov 5: It bothered me that the temperature in 'firedangerWD.php' wasn't switching when the 'METRIC | IMPERIAL' UOM switching was performed. There's a
post below that explains the necessary modifications to achieve UOM switching in 'firedangerWD.php'.