= to this value $heat_index_threshold = '70'; // CURRENT CONDITIONS ICON: include a current conditions icon on the graphic // NOTE! currently only supported if you are using Weather Display // clientraw.txt or VWS for your data file. // if $curr_cond_icon is set to any value other than "yes" the icon will not // be included. $curr_cond_icon = 'yes'; /***** ICON PLACEMENT: this section defines where the current *****/ /***** conditions/forecast icon will be placed if you are using it *****/ // $sticker_icon_x: x coordinate on sticker of the upper left most pixel of icon // $sticker_icon_y: y coordinate on sticker of the upper left most pixel of icon $sticker_icon_x = '12'; $sticker_icon_y = '56'; // $banner_icon_x: x coordinate on banner of the upper left most pixel of icon // $banner_icon_y: y coordinate on banner of the upper left most pixel of icon $banner_icon_x = '2'; $banner_icon_y = '2'; // $banner_big_icon_x: x coordinate on banner_big of the upper left most pixel of icon // $banner_big_icon_y: y coordinate on banner_big of the upper left most pixel of icon //$banner_big_icon_x = '2'; //$banner_big_icon_y = '2'; // $avatar_icon_x: x coordinate on avatar of the upper left most pixel of icon // $avatar_icon_y: y coordinate on avatar of the upper left most pixel of icon $avatar_icon_x = '5'; $avatar_icon_y = '37'; /****************************************************************************/ /************ Weather Display clientraw.txt Specific Parameters *************/ /****************************************************************************/ // These parameters only apply if you are using Weather Display's // // clientraw.txt file as your datafile. If you are not using clientraw.txt // // these parameters will have no affect so you may ignore them. // /****************************************************************************/ // TIME FORMAT // for AM/PM use $time_format = 'AMPM'; // for 24 hour use $time_format = '24HR'; $time_format = 'AMPM'; // TEMP CONVERSION: // temperature conversion units // For Farenheight use $temp_conv = 'F'; // For Celcius use $temp_conv = 'C'; $temp_conv = 'F'; // temp conversion precision // determines the number of decimal places // if "$temp_conv = 'C'" above, $temp_prec will only be effective at 1 or 0 // see README.txt for a detailed explanation $temp_prec = '1'; // WIND CONVERSION: // wind conversion units // For miles/hour use $wind_conv = 'MPH'; // For kilometers/hour use $wind_conv = 'KPH'; // For knots use $wind_conv = 'KTS'; $wind_conv = 'MPH'; // wind conversion precision // determines the number of decimal places // if "$wind_conv = 'KTS'" above, $wind_prec will only be effective at 1 or 0 // see README.txt for a detailed explanation $wind_prec = '1'; // BAROMETRIC PRESSURE CONVERSION: // barometric pressure conversion units // For inHg use $barom_conv = 'INCHES'; // For millbars or hPa use $barom_conv = 'MB'; $barom_conv = 'INCHES'; // barometer conversion precision // determines the number of decimal places // if "$barom_conv = 'MB'" above, $barom_prec will only be effective at 1 or 0 // see README.txt for a detailed explanation $barom_prec = '2'; // RAIN CONVERSION: // rain fall conversion units // For in use $rain_conv = 'INCHES'; // For mm use $barom_conv = 'MM'; $rain_conv = 'INCHES'; // rain conversion precision // determines the number of decimal places // if "$rain_conv = 'MM'" above, $rain_prec will only be effective at 1 or 0 // see README.txt for a detailed explanation $rain_prec = '2'; /****************************************************************************/ /********** End Weather Display clientraw.txt Specific Parameters ***********/ /****************************************************************************/ /****************************************************************************/ /*************************** Color Definitions *****************************/ /****************************************************************************/ // These are the color definitions for the images. // imagecolorallocate(image, red, green, blue); // where: // image = image variable. Will always be "$img". // red = red component 0-255 // green = green component 0-255 // blue = blue component 0-255 function define_colors() { global $img, $color1, $color2, $color3, $color4, $color5, $trans_color, $anti_alias; $color1 = imagecolorallocate($img,132,2,2); // RED $color2 = imagecolorallocate($img,164,130,64); // BROWNISH $color3 = imagecolorallocate($img,0,0,255); // BLUE $color4 = imagecolorallocate($img,255,255,255); // WHITE $color5 = imagecolorallocate($img,0,51,104); // NAVY /***** Transparency settings *****/ // if using a transparent color set it here. the RGB value should match the // color value of your images background, ie the color you want to be // transparent. // This is only supported for gif and png images! // IMPORTANT! don't set the pallete tranparency in your source image with // your image editor! You'll get strange results if you do. // you may want to set $anti_alias to 'off' below to avoid the problems // anti-aliasing can introduce with different background colors. // See README.txt for more info on using transparency $trans_color = imagecolorallocate($img,250,250,250); // TRANSPARENT COLOR // Transparency can be problematic with the anti-aliasing that occurs // by default with TrueType fonts in GD. To help avoid the problems that can // occur with anti-aliasing over different color backgrounds you can turn it // off with this parameter. The tradeoff is that your text will not look as // good. // To turn off TrueType anti-aliasing set "$anti_alias = 'off'; $anti_alias = 'on'; // don't change this line! $trans_color = imagecolortransparent($img,$trans_color); } // end function define_colors /****************************************************************************/ /************************* DATA WRITING FUNCTIONS ***************************/ /****************************************************************************/ // Below are the functions that write the actual data onto the image. I've // broken them out into the config.txt file to make it easier to modify. // write_sticker: writes data onto the sticker // write_banner: writes data onto the banner // // All data is written onto the image using the funcion: // imagecenteredtext($x, $y, $text, $size, $ttfsize, $color, $angle); // where: // $x = x coordinate where the text will be centered // $y = y coordinate where the text will be centered // $text = the text to be written // $size = font size for built-in GD fonts (1,2,3,4, or 5) // $ttfsize = font size for ttf fonts. Use just like you would in a word processor // $color = color as defined in the allocate colors section below // $angle = for ttf fonts, determines the angle for the text. // you must pass all parameters even if you aren't using them. if you are not // using a parameter put '' in its place. /*****************************************************************************/ /***** write_sticker: This function writes your values onto the sticker. *****/ /*****************************************************************************/ function write_sticker() { // let's start by defining some global variables that will be passed between // functions. This is kind of clunky! // NOTE: IF YOU ADD ADDITIONAL COLORS YOU'LL NEED TO ADD THEM HERE TOO! global $color1, $color2, $color3, $color4, $color5, $date, $time, $temp, $degree_units, $winds, $wind_units, $gust, $raintoday, $rain_units, $barom, $barom_units, $baromtrendwords, $dewpt, $humidity, $heatindex, $heat_index_threshold, $windchill, $wind_chill_threshold, $banner_icon_x, $banner_icon_y, $anti_alias; // this section does the heat index and wind chill // it figures out what to show, wind chill, heatindex or nothing // depending upon your settings switch (TRUE){ // if windchill is <= $wind_chill_threshold we'll output it case ($windchill <= $wind_chill_threshold): // $feelslike = "Wind Chill: $windchill$degree_units"; //imagecenteredtext(50, 135, "$feelslike", 2, 7, $color2, 0); break; // if heat index >= $heat_index_threshold we'll output it case ($heatindex >= $heat_index_threshold): // $feelslike = "Heat Idx: $heatindex$degree_units"; // imagecenteredtext(50, 135, "$feelslike", 2, 7, $color2, 0); break; } // end switch // this section controls what is written to the image, where it is written. // see the explanation above for details on what each parameter represents imagecenteredtext(75, 16, "Current Conditions", 4, 9, $color5, 0); imagecenteredtext(75, 30, "$time - $date", 2, 7, $color1, 0); imagecenteredtext(75, 46, "Placerville, California", 3, 9, $color5, 0); imagecenteredtext(89, 66, "$temp$degree_units", 5, 11, $color1, 0); imagecenteredtext(90, 82, "Wind: $winds", 3, 8, $color5, 0); imagecenteredtext(74, 100, "$barom $barom_units", 3, 8, $color5, 0); imagecenteredtext(74, 114, "Humidity: $humidity%", 3, 8, $color1, 0); imagecenteredtext(75, 128, "Rain: $raintoday $rain_units.", 3, 8, $color5, 0); imagecenteredtext(75, 145, "eldoradoweather.com", 2, 7, $color1, 0); } /***** end function write_sticker *****/ /******************************************************************************/ /*** write_banner: This function writes your values onto the 468X60 banner. ***/ /******************************************************************************/ function write_banner() { // let's start by defining some global variables that will be passed between // functions. This is kind of clunky! // NOTE: IF YOU ADD ADDITIONAL COLORS YOU'LL NEED TO ADD THEM HERE TOO! global $color1, $color2, $color3, $color4, $color5, $date, $time, $temp, $degree_units, $winds, $wind_units, $gust, $raintoday, $rain_units, $barom, $barom_units, $baromtrendwords, $dewpt, $humidity, $heatindex, $heat_index_threshold, $windchill, $wind_chill_threshold, $banner_icon_x, $banner_icon_y, $anti_alias; switch (TRUE){ // if windchill is <= $wind_chill_threshold we'll output it case ($windchill <= $wind_chill_threshold): // $feelslike = "Wind Chill: $windchill$degree_units"; // imagecenteredtext(90, 50, "$feelslike", 2, 8, $color3, 0); break; // if heat index >= $heat_index_threshold we'll output it case ($heatindex >= $heat_index_threshold): // $feelslike = "Heat Idx: $heatindex$degree_units"; // imagecenteredtext(90, 50, "$feelslike", 2, 8, $color1, 0); break; } // end switch imagecenteredtext(233, 13, "Gold Country Weather", 5, 10, $color1, 0); imagecenteredtext(236, 26, "Alta, California", 3, 9, $color2, 0); imagecenteredtext(234, 36, "Last Updated: $date $time", 1, 7, $color4, 0); imagecenteredtext( 80, 20, "$temp$degree_units", 11, 12, $color1, 0); imagecenteredtext(407, 42, "Rain: $raintoday", 2, 8, $color4, 0); imagecenteredtext( 70, 42, "Humidity: $humidity%", 2, 8, $color4, 0); imagecenteredtext(407, 54, "Dew Point: $dewpt$degree_units", 2, 8, $color4, 0); imagecenteredtext(234, 48, "Wind: $winds", 2, 8, $color4, 0); imagecenteredtext(70, 54, "Pressure: $barom $barom_units", 2, 8, $color4, 0); imagecenteredtext(235, 57, "www.goldcountryweather.com", 2, 6, $color1, 0); } // end function write_banner /******************************************************************************/ /* write_banner_big: This function writes your values onto the 500X80 banner. */ /******************************************************************************/ function write_banner_big() { // let's start by defining some global variables that will be passed between // functions. This is kind of clunky! // NOTE: IF YOU ADD ADDITIONAL COLORS YOU'LL NEED TO ADD THEM HERE TOO! global $color1, $color2, $color3, $color4, $color5, $date, $time, $temp, $degree_units, $winds, $wind_units, $gust, $raintoday, $rain_units, $barom, $barom_units, $baromtrendwords, $dewpt, $humidity, $heatindex, $heat_index_threshold, $windchill, $wind_chill_threshold, $banner_icon_x, $banner_icon_y, $anti_alias; switch (TRUE){ // if windchill is <= $wind_chill_threshold we'll output it case ($windchill <= $wind_chill_threshold): $feelslike = "$windchill$degree_units"; imagecenteredtext(93, 57, "Feelslike: $feelslike", 2, 8, $color5, 0); break; // if heat index >= $heat_index_threshold we'll output it case ($heatindex >= $heat_index_threshold): $feelslike = "$heatindex$degree_units"; imagecenteredtext(93, 57, "Feelslike: $feelslike", 2, 8, $color5, 0); break; } imagecenteredtext(250, 28, "$date $time", 3, 8, $color1, 0); imagecenteredtext( 70, 22, "$temp$degree_units", 11, 14, $color1, 0); imagecenteredtext( 70, 23, "$temp$degree_units", 11, 14, $color1, 0); imagecenteredtext( 93, 43, "Rain: $raintoday", 2, 14, $color5, 0); imagecenteredtext(210, 43, "Winds: $winds", 2, 11, $color5, 0); imagecenteredtext(351, 43, "Humidity: $humidity%", 2, 11, $color5, 0); imagecenteredtext(482, 43, "Max Temp: $maxtemp$degree_units", 2, 14, $color5, 0); imagecenteredtext(210, 57, "Barometer: $barom$barom_units", 2, 8, $color5, 0); imagecenteredtext(354, 57, "Dew Pt: $dewpt$degree_units", 2, 11, $color5, 0); imagecenteredtext(482, 57, "Min Temp: $mintemp$degree_units", 2, 14, $color5, 0); } /***** end function write_banner_big *****/ /*****************************************************************************/ /***** write_avatar: This function writes your values onto the sticker. *****/ /*****************************************************************************/ function write_avatar() { // let's start by defining some global variables that will be passed between // functions. This is kind of clunky! // NOTE: IF YOU ADD ADDITIONAL COLORS YOU'LL NEED TO ADD THEM HERE TOO! global $color1, $color2, $color3, $color4, $color5, $date, $time, $temp, $degree_units, $winds, $wind_units, $gust, $raintoday, $rain_units, $barom, $barom_units, $baromtrendwords, $dewpt, $humidity, $heatindex, $heat_index_threshold, $windchill, $wind_chill_threshold, $banner_icon_x, $banner_icon_y, $anti_alias; // this section does the heat index and wind chill // it figures out what to show, wind chill, heatindex or nothing // depending upon your settings switch (TRUE){ // if windchill is <= $wind_chill_threshold we'll output it case ($windchill <= $wind_chill_threshold): $feelslike = "WindCh: $windchill$degree_units"; //imagecenteredtext(49, 49, "$feelslike", 1, 7, $color2, 0); break; // if heat index >= $heat_index_threshold we'll output it case ($heatindex >= $heat_index_threshold): $feelslike = "HeatIdx: $heatindex$degree_units"; //imagecenteredtext(50, 50, "$feelslike", 1, 7, $color1, 0); break; } // end switch // this section does the heat index and wind chill // it figures out what to show, wind chill, heatindex or nothing // depending upon your settings switch (TRUE){ // if windchill is <= $wind_chill_threshold we'll output it case ($windchill <= $wind_chill_threshold): $feelslike = "WindCh: $windchill$degree_units"; //imagecenteredtext(49, 49, "$feelslike", 1, 7, $color2, 0); break; // if heat index >= $heat_index_threshold we'll output it case ($heatindex >= $heat_index_threshold): $feelslike = "HeatIdx: $heatindex$degree_units"; //imagecenteredtext(50, 50, "$feelslike", 1, 7, $color1, 0); break; } // end switch imagecenteredtext(50, 12, "Placerville CA.", 2, 8, $color5, 0); imagecenteredtext(49, 22, "Live Weather", 2, 7, $color1, 0); imagecenteredtext(50, 32, "$date $time", 2, 6, $color5, 0); imagecenteredtext(62, 55, "$temp$degree_units", 9, 10, $color1, 0); imagecenteredtext(49, 72, "$barom $barom_units", 2, 7, $color5, 0); imagecenteredtext(49, 84, "Humidity: $humidity%", 2, 7, $color1, 0); imagecenteredtext(49, 96, "Rain: $raintoday $rain_units.", 2, 7, $color5, 0); } /***** end function write_avatar *****/ /************************* END WRITING FUNCTIONS ******************************/ /******************************************************/ /************ End of User Configuration ***************/ /******************************************************/ ?>