WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Custom Website Templates => Topic started by: txweather.org on April 21, 2019, 11:45:57 PM

Title: drought page
Post by: txweather.org on April 21, 2019, 11:45:57 PM
I am trying to make the drought page from https://www.gwwilkins.org/wxdrought_maps.php

Work on my site but something is not loading and cant figure out what... I change all the links to https.

https://www.txweather.org/wxdrought.php

Ideas?
Title: Re: drought page
Post by: gwwilk on April 22, 2019, 10:54:15 AM
I am trying to make the drought page from https://www.gwwilkins.org/wxdrought_maps.php

Work on my site but something is not loading and cant figure out what... I change all the links to https.

https://www.txweather.org/wxdrought.php

Ideas?
For reasons unknown to me the page is truncated at a height of around 680px.  I can't figure out where the problem lies.  Sorry... :-(
Title: Re: drought page
Post by: txweather.org on April 22, 2019, 11:12:34 AM
gwwilk,

Thanks for your reply.
Ill try and see whats going on... Ill keep digging.
Title: Re: drought page
Post by: Maumelle Weather on April 22, 2019, 11:23:19 AM
<div id="drought" class="frame_border center" style="width:662.09302325581px; height:496.56976744186px; position:relative">
              <a href="https://droughtmonitor.unl.edu/data/png/current/current_total_trd.png" target="_blank" title="Larger Map"><img src="https://droughtmonitor.unl.edu/data/png/current/current_total_trd.png" alt="" width="680"/>

The above in bold will make the image appear, then you should be able to finish the page out from there.

John
Title: Re: drought page
Post by: txweather.org on April 22, 2019, 12:33:21 PM
Note too sure what to change... Its all in there like what you have except with variables...

I moved the page to https://wxdev.txweather.org/wxdrought.php
Title: Re: drought page
Post by: txweather.org on April 22, 2019, 04:00:20 PM
Found my problem...

I had to change the script:

if (!function_exists('getUniqueImageURL')) {
   function getUniqueImageURL($image_url){
      $timestamp = time();
      if(strpos($image_url, '?')){
         $image_url = str_replace('?', "?$timestamp&", $image_url);
      }
      else{
         $image_url .= "?$timestamp";
      }
      return $image_url;
   }
}


to

function getUniqueImageURL($image_url){
   $timestamp = time();
   if(strpos($image_url, '?')){
      $image_url = str_replace('?', "?$timestamp&", $image_url);
   }
   else{
      $image_url .= "?$timestamp";
   }
   return $image_url;
}
Title: Re: drought page
Post by: gwwilk on April 22, 2019, 04:12:39 PM
Glad you got it sorted out. That has been an issue for some others as well, and obviously I'm not sure why. The function-check prevents a duplicate function error, but ironically for some it causes an error instead. Sorry...
Title: Re: drought page
Post by: txweather.org on April 22, 2019, 04:22:45 PM
Glad you got it sorted out. That has been an issue for some others as well, and obviously I'm not sure why. The function-check prevents a duplicate function error, but ironically for some it causes an error instead. Sorry...

Nothing to be sorry about, Thank you for your awesome work!