_my_texts/wsUserSettings.php SettingsFiles should pe password protected - dated: 05-06-2020 17:42
1 | <?php
2 | $pageName = 'wsUserSettings.php';
3 | if (!isset($SITE)){echo "<h3>invalid call to script $pageName</h3>";exit;}
4 | $pageVersion = '3.10 2015-01-27';
5 | $SITE['wsModules'][$pageName] = 'version: ' . $pageVersion;
6 | $pageFile = basename(__FILE__); // check to see this is the real script
7 | if ($pageFile <> $pageName) {
8 | $SITE['wsModules'][$pageFile] = 'this file loaded instead of '.$pageName;
9 | }
10 | if (!isset($pathString)) {$pathString='';}
11 | $pathString .= '<!-- module '.$pageFile.' ==== '.$SITE['wsModules'][$pageFile].' -->'.PHP_EOL;
12 | #
13 | #---------------------------------------------------------------------------
14 | # 3.10 2015-01-27 beta version look for #### to find those lines which can / should be changed first #####
15 | #---------------------------------------------------------------------------
16 | #
17 | $SITE['wsDebug'] = true; // #####
18 | #$SITE['wsDebug'] = false; // remove comment mark at position 1 when you are fully satisfied with your site.
19 | #
20 | $SITE["topfolder"] = 'meteo/'; // ##### normally this is weather??/ the foldername with the template in the root of your website
21 | #
22 | #---------------------------------------------------------------------------
23 | # IMPORTANT Select the region you are in or choose other
24 | #---------------------------------------------------------------------------
25 | $SITE['region'] = 'america'; // #####
26 | #$SITE['region'] = 'canada'; // #####
27 | $SITE['region'] = 'europe'; // #####
28 | #$SITE['region'] = 'other'; // #####
29 | #
30 | #---------------------------------------------------------------------------
31 | # IMPORTANT choose your weatherprogram
32 | #---------------------------------------------------------------------------
33 | #$SITE['WXsoftware'] = 'CU'; // ##### Cumulus
34 | #$SITE['WXsoftware'] = 'CW'; // ##### consolewd = WeatherDisplay for raspberryPI
35 | #$SITE['WXsoftware'] = 'MB'; // ##### Meteobridge
36 | $SITE['WXsoftware'] = 'MH'; // ##### Meteohub
37 | #$SITE['WXsoftware'] = 'VW'; // ##### vws
38 | #$SITE['WXsoftware'] = 'WC'; // ##### WeatherCat
39 | #$SITE['WXsoftware'] = 'WD'; // ##### WeatherDisplay
40 | #$SITE['WXsoftware'] = 'WL'; // ##### WeatherLink
41 | #$SITE['WXsoftware'] = 'WS'; // ##### wswin
42 | #$SITE['WXsoftware'] = 'WV'; // ##### wview
43 | #
44 | # for weatherlink.com users --------------------
45 | #$SITE['WXsoftware'] = 'DW'; // ##### Davis WeatherLink.Com ONLY uncomment after setting the id and password
46 | $SITE['wlink_key'] = 'xyz'; // ##### Your weatherlink.com user id
47 | $SITE['wlink_pw'] = 'xyz'; // ##### and password.
48 | # ---- end of wl.com users ---------------------
49 | #
50 | #---------------------------------------------------------------------------
51 | # IMPORTANT General settings such as station location, identity
52 | #---------------------------------------------------------------------------
53 | $SITE['organ'] = 'Belinux'; // ##### short name used a.o. in heading, forecast pages
54 | $SITE['yourArea'] = 'Belgium'; // ##### the area your city is in
55 | $SITE['contactName'] = 'your name'; // ##### Webmaster naam or simply webmaster
56 | $SITE['contactEmail'] = 'noreply@yourstation.com'; // ##### Webmaster E-mail from
57 | $SITE['contactEmailTo'] = 'contact@yourstation.com'; // ##### contact E-mail goes to THIS email adress, so it MUST be a real one
58 | #---------------------------------------------------------------------------
59 | # IMPORTANT After ready with debug this password protect your settings and other snesitive data
60 | #---------------------------------------------------------------------------
61 | $SITE['password'] = ''; // #####
62 | #---------------------------------------------------------------------------
63 | # STANDARD These should be correct in most cases
64 | #---------------------------------------------------------------------------
65 | $SITE['noChoice'] = '10'; // visitors go to this page at first time visit, 10 = home/startpage
66 | $SITE['statsCode'] = './_widgets/histats.txt'; // set your own visitors code or set to false
67 | $SITE['floatTop'] = './_widgets/float_top.php'; // used for long pages
68 | $SITE['skipTop'] = true; // go to detail-part of page automatically
69 | #---------------------------------------------------------------------------
70 | # which world-wide available forecast will be used. Can be overridden when you select your region below
71 | # the following forecasts need some extra settings
72 | $SITE['fctOrg'] = 'yahoo'; // you need to find later the correct yahoo place id;
73 | #$SITE['fctOrg'] = 'wu'; // you need a special WU key for this forecast
74 | #$SITE['fctOrg'] = 'wxsim'; // you need the (paid) wxsim program on a pc for this forecast
75 | #$SITE['fctOrg'] = 'yrno'; // you need to find the correct yrno city description later
76 |
77 | # the next forecasts need only latitude and longitude
78 | #$SITE['fctOrg'] = 'yowindow'; // default lat lon is used
79 | #$SITE['fctOrg'] = 'metno'; // based on lat-lon - choose which information will be displayed in wsDashMetno.php
80 | #---------------------------------------------------------------------------
81 | if ($SITE['region'] == 'america') {
82 | #---------------------------------------------------------------------------
83 | # here we define specific settings for the U S A
84 | # ALL existing values are example and must be checked for your place
85 | #---------------------------------------------------------------------------
86 | $SITE['latitude'] = '50.711103'; // ##### North=positive, South=negative decimal degrees
87 | $SITE['longitude'] = '5.024400'; // ##### East=positive, West=negative decimal degrees
88 | $SITE['warnArea'] = 'BE004'; // ##### area where this weatherstation is located
89 | $SITE['tz'] = 'America/New_York'; // ##### time zone for the whole of western europe, leave it if you do not know your EXACT timezone description
90 | $SITE['METAR'] = 'KHVN'; // ##### nearby METAR for current conditions retrieval and yowindow dynamic on main page
91 | $SITE['yaPlaceID'] = '2368213'; // ##### https://weather.yahoo.com find your city and copy the number, check for Leuven and you find 973505
92 | $SITE['radarStation'] = 'MHX'; // ##### nearest WU radar station
93 | # How to get your nearest WU radar station:
94 | # Go to http://www.wunderground.com/weather-radar/united-states/
95 | # Select your area by clicking on the map, do not use the animate button at this time
96 | # example you arrive at page http://www.wunderground.com/weather-radar/united-states-regional/nc/charlotte
97 | # move to one of the radars (blue round area's) example at jacksonville and a round area
98 | # with the name of the station (Morehead) and the three letter code (MHX for this example) appears
99 | #
100 | $SITE['WUregion'] = 'sw'; // ##### Wunderground regional maps
101 | # 'sw'=SouthWest, 'nw'=NorthWest, 'mw'=Midwest, 'sp'=South Central, 'ne'=North East, 'se'=South East
102 | $SITE['noaaPage'] = true; // ##### noaa weather forecast page in menu
103 | $SITE['cwopPage'] = true; // ##### CWOP page is menu if member of CWOP
104 | $SITE['noaaIconsOwn'] = true; // use noaa icons (true) or our template icons (false)
105 | $SITE['lang'] = 'en'; // ##### default language you want to use use
106 | $SITE['useCurly'] = false; // ##### default = use template/noaa script. If set to true curly's script is used. Needs inside script seup!
107 | #
108 | # select your default forecast organisation or set as comment when using other worldwide forecasts
109 | $SITE['fctOrg'] = 'noaa'; //
110 | #
111 | # this is a list of nearby airports or interesting cities as used by forecasts and airport pages and cities dashboard item USING lat_lon
112 | $SITE['select_lat_lon'] = '_my_texts/lat_lon_us.txt';
113 | #---------------------------------------------------------------------------
114 | } elseif ($SITE['region'] == 'canada') {
115 | #---------------------------------------------------------------------------
116 | # here we define specific settings for C A N A D A
117 | # ALL existing values are example and must be checked for your place
118 | #---------------------------------------------------------------------------
119 | $SITE['latitude'] = '51.112243'; // ##### North=positive, South=negative decimal degrees
120 | $SITE['longitude'] = '-113.956438'; // ##### East=positive, West=negative decimal degrees
121 | $SITE['tz'] = 'America/Edmonton'; // ##### time zone
122 | $SITE['caProvince'] = 'NB'; // ##### http://dd.weather.gc.ca/citypage_weather/docs/site_list_en.csv
123 | $SITE['caCityCode'] = 's0000654'; // ##### http://dd.weather.gc.ca/citypage_weather/docs/site_list_en.csv
124 | $SITE['METAR'] = 'CYYC'; // ##### nearby METAR for current conditions retrieval and yowindow dynamic on main page
125 | $SITE['yaPlaceID'] = '3796'; // ##### https://weather.yahoo.com find your city and copy the number, check for Leuven and you find 973505
126 | $SITE['radarStation'] = 'XMB';
127 | $SITE['ecPage'] = true; // ##### Environment Canada forecasts
128 | $SITE['cwopPage'] = true; // ##### CWOP page is menu if member of CWOP
129 | $SITE['aqhiArea'] = 'Bathurst'; // #####
130 | $SITE['aqhiArea-f'] = 'Bathurst'; // #####
131 | $SITE['caAQHI'] = true; // #####
132 | $SITE['lang'] = 'en'; // ##### default language you want to use use
133 | #
134 | # select your default forecast organisation
135 | $SITE['fctOrg'] = 'ec'; // Environment canada
136 | #
137 | # this is a list of nearby airports or interesting cities as used by forecasts and airport pages and cities dashboard item
138 | $SITE['select_lat_lon'] = '_my_texts/lat_lon_ca.txt'; // using lat-lon
139 | $SITE['select_ec'] = '_my_texts/ec_area.txt'; // '_my_texts/ec_area.txt'
140 | #---------------------------------------------------------------------------
141 | } elseif ($SITE['region'] == 'europe') {
142 | #---------------------------------------------------------------------------
143 | # here we define specific settings for E U R O P E
144 | #---------------------------------------------------------------------------
145 | $SITE['latitude'] = '50.85000'; // ##### North=positive, South=negative decimal degrees
146 | $SITE['longitude'] = '4.34000'; // ##### East=positive, West=negative decimal degrees
147 | $SITE['warnArea'] = 'BE004'; // ##### area where this weatherstation is located BE004 = Vlaams Brabant, NL012 = nl limburg.
148 | $SITE['lang'] = 'fr'; // ##### default language you want to use use
149 | $SITE['tz'] = 'Europe/Brussels'; // ##### time zone for the whole of western europe, leave it if you do not know your EXACT timezone description
150 | $SITE['METAR'] = 'EBBR'; // ##### nearby METAR for current conditions retrieval and yowindow dynamic on main page
151 | $SITE['yaPlaceID'] = '973540'; // ##### https://weather.yahoo.com find your city and copy the number, check for Leuven and you find 973505
152 | $SITE['commaDecimal'] = true; // default use comma and not a decimal point in all vvalues
153 | $SITE['belgium'] = true; // ##### if not in the country set to false
154 | $SITE['netherlands'] = true; // ##### this is for country specific information
155 | #
156 | # select your default forecast organisation
157 | # $SITE['fctOrg'] = 'hwa'; // only for members of HetWeerActueel, needs a key and id
158 | #
159 | # this is a list of nearby airports or interesting cities as used by forecasts and airport pages and cities dashboard item
160 | $SITE['select_lat_lon'] = '_my_texts/lat_lon_eu.txt';
161 | #---------------------------------------------------------------------------
162 | } else { // region = other
163 | #---------------------------------------------------------------------------
164 | # here we define specific settings for rest of the world
165 | #---------------------------------------------------------------------------
166 | $SITE['latitude'] = '-44.405617'; // ##### North=positive, South=negative decimal degrees
167 | $SITE['longitude'] = '169.075343'; // ##### East=positive, West=negative decimal degrees
168 | $SITE['tz'] = 'Pacific/Auckland'; // ##### time zone for the whole of western europe, leave it if you do not know your EXACT timezone description
169 | $SITE['METAR'] = 'NZCH'; // ##### nearby METAR for current conditions retrieval and yowindow dynamic on main page
170 | $SITE['yaPlaceID'] = '22739330'; // ##### https://weather.yahoo.com find your city and copy the number, check for Leuven and you find 973505
171 | $SITE['lang'] = 'en'; // ##### default language you want to use use
172 | #
173 | # this is a list of nearby airports or interesting cities as used by forecasts and airport pages and cities dashboard item
174 | $SITE['select_lat_lon'] = '_my_texts/lat_lon_eu.txt';
175 | #---------------------------------------------------------------------------
176 | }
177 | #
178 | #---------------------------------------------------------------------------
179 | # STANDARD C U R R E N T C O N D I T I O N S from which source do we get them
180 | #---------------------------------------------------------------------------
181 | #$SITE['curCondFrom'] = 'wd'; // if you are using WeatherDisplay AND have set WD correctly
182 | #$SITE['curCondFrom'] = 'yahoo'; // if you use Yahoo also for the forecast on the startpage no other forecast
183 | $SITE['curCondFrom'] = 'metar'; // default, mostly best choice
184 | #
185 | #---------------------------------------------------------------------------
186 | # CHECK General site settings, valid for all pages
187 | #---------------------------------------------------------------------------
188 | $SITE['header'] = '3'; // ##### normal header = 2. 1=small header with less information, 3 = with gauges
189 | $SITE['colorNumber'] = '0'; // ##### this number is the default key which color and style your website will be using
190 | # 0=weather adapted, 1=green, 2=blue, 3=pastel, 4=red, 5=orange, 6=none, 7=ws_clouds, 8=ws_cloudsn, 9=ws_mist,
191 | #10=ws_moon, 11=ws_pclouds, 12=ws_rain, 13ws_snow, 14= ws_storm, 15=ws_sun, 16=ws_thunder
192 | #
193 | # WARNING During debug phase this will be overridden with code 3 = pastel
194 | #
195 | $SITE['sideDisplay'] = true; // ##### will be displayed if true. if set to false it will still be displayed when $SITE['menuPlace'] = V =vertical menu is choosen
196 | $SITE['bottomDysplay'] = true; // ##### show which equipment & software you use and also also which organizations you are a member of
197 | $SITE['showVisitors'] = true; // ##### show number of visitors in footer
198 | $SITE['pages_visited'] = false; // ##### count visited pages which can be shown in a separate page
199 | #
200 | # STANDARD Normally you do not want to change here
201 | #
202 | $SITE['ajaxGizmoShow'] = true; // show ajaxgizmo in header rotating/changing weather items, selectable for every page in menu file
203 | #
204 | $SITE['stripAll'] = false; // to have only menu, no headers for including template in joomla sites etc
205 | $SITE['stripMenu'] = false; // to have no menu, f.i. when using joomla
206 | $SITE['autoRefresh'] = 0; // the page is automatically refreshed after *** seconds, set to 0 if you do not want this "feature"
207 | $SITE['cookieSupport'] = true; // use cookies to store user choices. The system asks the user if he allows the use of cookies
208 | $SITE['charset'] = 'UTF-8'; // default character set for webpages
209 | #$SITE['charset'] = 'windows-1252'; // ONLY if most of your pages use old character sets.
210 | #
211 | $SITE['wsAjaxDataTime'] = 30; // wait time between refresh data on Ajax based pages in seconds
212 | $SITE['tempSimple'] = false; // true = blue/red color for temp; false = large color range
213 | $SITE['textLowerCase'] = false; // all text to lowercase = true or leave all texts as they are supplied (false)
214 | $SITE['pageWidth'] = '1200'; // 1200 = optimal for most screens and pages
215 | $SITE['menuWidth'] = '140'; // 140 = default width of Vertical menu
216 | $SITE['menuPlace'] = 'V'; // menu is placed Vertical (default) or Horizontal
217 | #
218 | #---------------------------------------------------------------------------
219 | # IMPORTANT side colomn and bottom area on all pages
220 | #---------------------------------------------------------------------------
221 | $SITE['partners'] = 'B'; // ##### show other websites (partners) with your weatherdata side('V') or bottom('B') or not ('')
222 | $SITE['equipment'] = 'B'; // ##### show links about the equipment / provider we use: V or B or ''
223 | $SITE['otherWS'] = 'V'; // ##### show links to other weatherstations in side column: V ''
224 | #
225 | #---------------------------------------------------------------------------
226 | # IMPORTANT webcam can only be shown in side area. there is also a optionasl separate page in the menu
227 | #---------------------------------------------------------------------------
228 | $SITE['webcamPage'] = true; // ##### do we want a webcam page
229 | $SITE['webcamSide'] = true; // ##### show webcam in side column
230 | #
231 | $SITE['webcamName'][1] = 'My webcam';
232 | $SITE['webcamImg'][1] = 'http://wiri.be/image.jpg'; // these are for demonstration only, replace with yours
233 | $SITE['webcamImgNight'][1] = './img/webcam_night.png'; // default "no broadcast" image for night time. Set to ''; if you do not want a night image
234 |
235 | #$SITE['webcamName'][2] = 'webcam facing north';
236 | #$SITE['webcamImg'][2] = 'http://komzoli.hu/cam_3.jpg'; // these are for demonstration only, replace with yours
237 | #$SITE['webcamImgNight'][2] = './img/webcam_night.png'; // set to ''; if you do not have a night image
238 |
239 | #$SITE['webcamImg'][1] = 'switch_webcam.php'; // example script for complex day-night switch
240 | #
241 | #---------------------------------------------------------------------------
242 | # IMPORTANT social site support can be shown in sidecolom below menu or in header below the language select
243 | #---------------------------------------------------------------------------
244 | $SITE['socialSiteSupport'] = 'V'; // ##### '' no support; "H"orizontal or "V"ertical display of facebook icons and others
245 | $SITE['socialSiteKey'] = "ra-4fd8a66b72fa8566";// your key from http://www.addthis.com/ free service
246 | $SITE['socialSiteCode'] = './_widgets/social_buttons.txt';
247 | #
248 | #---------------------------------------------------------------------------
249 | # STANDARD small radars in the side column only default: the radars will only be shown when there is a warning for heavy rain or thunnder
250 | #---------------------------------------------------------------------------
251 | $SITE['wrnRain'] = true; // set to true is always have a small map with rain in side area, will slow down page load
252 | $SITE['wrnLightning'] = true; // same for rain radar
253 | #
254 | #---------------------------------------------------------------------------
255 | # OPRTIONAL donate button
256 | #---------------------------------------------------------------------------
257 | $SITE['donateButton'] = false; // to include a donate button, see WiKi
258 | $SITE['donateCode'] = './_widgets/donateButton.php';
259 | #---------------------------------------------------------------------------
260 | # IMPORTANT show (optional) meteo warnings on every page
261 | #---------------------------------------------------------------------------
262 | $SITE['warnings'] = true; // #####
263 | $SITE['warningInside'] = false; // true = warning after headers and menu in data area, otherwise outside everything and displayed first
264 | $SITE['warningGreen'] = false; // true = always display warning, even when no warning in effect
265 | $SITE['warningsXtnd'] = true; // false = one line per warning, true = also the long text description = DO NOT USE IN BELGIUM
266 | $SITE['warningDetail'] = 1; // number of individual warnings before warnings are combined
267 | $SITE['warn1Box'] = false; // true = put all separate warnings in one box; false = one separate box for every separate warning
268 | #
269 | # separate warningspage
270 | $SITE['warnPage'] = true; // true = default our own page - false go directly to alarm site
271 | #---------------------------------------------------------------------------
272 | # STANDARD your own yellow message box. This extra box can be used for messages about maintenance etc.
273 | # When you first start implementing the template a message about building a new website is displayed
274 | #---------------------------------------------------------------------------
275 | $SITE['maintenanceShow'] = false; //##### display this file always (true) when it exists
276 | $SITE['maintenanceTxt'] = './_my_texts/maintenance.txt'; // you can modify this text as you want or link to another file
277 | #
278 | #-----------------------------------------------------------------------------------------
279 | # IMPORTANT Banners for ads and other extra's, one on top, one at the bottom
280 | #-----------------------------------------------------------------------------------------
281 | $SITE['banners'] = true; //#####
282 | $SITE['bannerTop'] = true; //#####
283 | $SITE['bannerBottom'] = true; //#####
284 | $SITE['bannerTopTxt'] = './_my_texts/banner.txt'; // can be .txt - .html file or .php
285 | $SITE['bannerBottomTxt'] = './_my_texts/banner.txt';
286 | #
287 | #---------------------------------------------------------------------------
288 | # CHECK Only change if you understand what the reason is, normally it is correct
289 | #---------------------------------------------------------------------------
290 | $SITE['nightDayBefore'] = true; // needed a.o. for the default MetNo forecast
291 | // if the start hour of a forecast period is between => different only for the last period
292 | // 06:00 - 12:00 12:00 - 18:00 18:00 - 24:00 24:00 - 06:00
293 | // the descriptions for these period is translated to based on this setting
294 | // false: sunday morning sunday aftyernoon sunday evening sunday night <= this last one
295 | // true: sunday morning sunday aftyernoon sunday evening monday night <= this last one
296 | #
297 | #---------------------------------------------------------------------------
298 | # STANDARD show extra information about visitors in footer
299 | #---------------------------------------------------------------------------
300 | # if you want to include a flag and extra info about the visitor you need geolookup. This version of the template only suppportsa paid subscription http://www.ipgp.net
301 | # I personally do not think it is worth its money for a weatherwebsite but give it a try, the first 3 days are free
302 | #
303 | $SITE['geoKey'] = ''; // your key for use in inc/geoip: http://www.ipgp.net/api/xml/ $ip / $SITE['geoKey']
304 | $SITE['visitorsFile'] = 'wolExported.str'; // ip info about visitors is kept in this file (in cache directory), if not present it is created
305 | #
306 | #---------------------------------------------------------------------------
307 | # CHECK contact info
308 | #---------------------------------------------------------------------------
309 | $SITE['contactPage'] = false; // ##### do we want a contact page
310 | $SITE['contactDir'] = 'contact/';
311 | $SITE['contactScript'] = $SITE['contactDir'].'incContact.php';
312 | #
313 | #---------------------------------------------------------------------------
314 | # CHECK contact mobile site available
315 | #---------------------------------------------------------------------------
316 | $SITE['useMobile'] = true; // ##### allow use of small mobile site site for phones and so on
317 | #
318 | #---------------------------------------------------------------------------
319 | # IMPORTANT W X S I M - extra (paid) program to be run on a PC
320 | #---------------------------------------------------------------------------
321 | #
322 | $SITE['wxsimPage'] = false; // #####
323 | $SITE['wxsimData'] = '../'; // root folder ##### Were do lasteret.txt plaintext.txt and or latest.csv are uploaded to
324 | # normaly leave rest as is
325 | $SITE['wxsim_file'] = 'latest.csv'; // either latest.csv (all availabler fields) or lastret.txt can be used
326 | #$SITE['wxsim_file'] = 'lastret.txt';
327 | $SITE['wxsimIconsOwn'] = false; // use wxsim icons (true) or our template icons (false)
328 | $SITE['wxsimDir'] = './wsWxsim/';
329 | $SITE['wxsimIconsDir'] = $SITE['iconsDir'].'yrno_icons/';
330 | $SITE['wxsimIconsSml'] = $SITE['iconsDir'].'yrno_icons_small/';
331 | #
332 | #---------------------------------------------------------------------------
333 | # IMPORTANT
334 | #---------------------------------------------------------------------------
335 | # All forecast which you want to use are specified here
336 | #
337 | $SITE['multi_forecast'] = true; // ##### make forecast available for multiple city's in your area
338 | #
339 | #---------------------------------------------------------------------------
340 | # IMPORTANT WU settings for forecast only as a separate page
341 | #---------------------------------------------------------------------------
342 | #
343 | $SITE['wuPage'] = true; // ##### WU forecastpage in menu
344 | # if set to false or 'no' do not bother with other $SITE["wu ...] settings as they are not used than
345 | $SITE['wuKey'] = '2161467e2aff4016a1467e2affb01630'; // ##### set to your (free) Wunderground API key to retreive weatherinfo in xml
346 | #
347 | # normaly leave rest as is
348 | $SITE['wuIconsCache'] = true; // use wu icons from our cache (true) or our wu icons from wu url (false)
349 | $SITE['wuIconsDir'] = $SITE['iconsDir'].'wu_icons/';
350 | $SITE['wuIconsOwn'] = false; // use wu icons (true) or our template icons (false)
351 | #
352 | #---------------------------------------------------------------------------
353 | # IMPORTANT MET.no settings used for the forecasts
354 | #---------------------------------------------------------------------------
355 | #
356 | $SITE['metnoPage'] = true; // ##### metno forecast page in menu
357 | #
358 | # normaly leave rest as is
359 | $SITE['yrnoIconsOwn'] = false; // use yrno icons (true) or our template icons (false)
360 | $SITE['yrnoIconsDir'] = 'wsyrnofct/img/yrno_icons/'; // location of the icons
361 | #
362 | #---------------------------------------------------------------------------
363 | # IMPORTANT YR.no settings used for the forecasts for main-site -
364 | #
365 | # WARNING ALSO used for forecast for mobile site
366 | #---------------------------------------------------------------------------
367 | #
368 | $SITE['yrnoPage'] = true; // ##### yrno forecast page in menu this is the one-page forecast with meteogram only
369 | $SITE['yrnoID'] = 'Belgium/Wallonia/Lincent/'; // ##### generic adres for .png forecast
370 | #$SITE['yrnoID'] = 'Sverige/Skåne/Råå/'; // example for sewdisch city
371 | #
372 | # normaly leave rest as is
373 | $SITE['yrnoFcst'] = 'wsyrnofct/startMobi.php'; // forecast script location used in mobile site
374 | $SITE['select_yrno'] = '_my_texts/yrno_areas.txt';
375 | #
376 | #---------------------------------------------------------------------------
377 | # IMPORTANT HWA Het Weer Actueel settings Settings used for the HWA forecast page and (graphical) forecast display on mainpage
378 | # used ONLY in Belgium and the Netherlands - needs a KEY and an ID
379 | #---------------------------------------------------------------------------
380 | #
381 | $SITE['hwaPage'] = false; // ##### hwa forecast page in menu
382 | #
383 | $SITE['hwaXmlId'] = '000'; // ##### your Het Weer Actueel ID and key to retreive xml info
384 | $SITE['hwaXmlKey'] = '926337353b7962f533d78c762373b3318';
385 | #
386 | # normaly leave rest as is
387 | $SITE['hwaIconsOwn'] = false; // use hwa icons from cache (true) or our template icons (false)
388 | $SITE['hwaIconsDir'] = 'wsHwa/hwa_icons/';
389 | #
390 | #---------------------------------------------------------------------------
391 | # IMPORTANT Yahoo settings can be used for
392 | # 1. the current conditions
393 | # 2. forecast on mainpage and
394 | # 3. a separate page with the forecast
395 | #---------------------------------------------------------------------------
396 | #
397 | $SITE['yahooPage'] = true; // ##### here you specify if you want a separate page
398 | #
399 | # normaly leave rest as is
400 | $SITE['yahooIconsOwn'] = false; // use yahoo icons (true) or our template icons (false)
401 | #
402 | #---------------------------------------------------------------------------
403 | # IMPORTANT World Weather settings World Weather can be used for a small separate forecast page
404 | #---------------------------------------------------------------------------
405 | #
406 | $SITE['worldPage'] = false; ##### world weather forecast page in menu
407 | # if set to false or 'no' do not bother with other $SITE["world ...] settings as they are not used
408 | $SITE['worldKey'] = '1egdt5rnspg8ypk8zuwpnnbw8'; ##### Version 1 key set your own key request a (free) key if you want to use their forecast
409 | $SITE['worldKey2'] = '275eab62b3e5296f0a77bc926af808'; ##### Version 2 key
410 | # 275eab62b3e5296f0a77bc926af808 24a3e73ef230d5b4fa2d8e27ae390 25eab62b3e5296f0a77bc926af808
411 | $SITE['worldAPI'] = 2; ##### Set to 1 if you use the api version 1 key
412 | # normaly leave rest as is
413 | $SITE['worldID'] = trim($SITE['latitude']).','.trim($SITE['longitude']);
414 | $SITE['worldIconsOwn'] = false; // use worldweather icons (true) or our template icons (false)
415 | #
416 | #---------------------------------------------------------------------------
417 | # IMPORTANT Partner information:
418 | #---------------------------------------------------------------------------
419 | # your id's for weather sites, mostly used to display logo and make a link to your weatherdata on their site
420 | # set to false if you do not cooperate with them
421 | #
422 | # WU settings for your data at wunderground site IVLAAMSG47
423 | #
424 | $SITE['wuId'] = false;
425 | $SITE['wuId'] = 'IRGIONWA31'; // ##### the ID of your personal weather station at the Wunderground site or false if you are not a member
426 | $SITE['wuStart'] = '01-01-2013'; // ##### Stations first day of operation at wunderground format dd-mm-yyyy for wu history pages
427 | #
428 | # other sites where your data is shown
429 | #
430 | $SITE['hwaID'] = false; // ##### Example $SITE[hwaID'] = 'abcdefg';
431 | $SITE['wowID'] = false; //9761581; // ##### Example $SITE['wowID'] = 1234567;
432 | $SITE['awekasID'] = false; //8506; // ##### Example $SITE['awekasID'] = 1234;
433 | $SITE['wcloud'] =false; // 'd1686817653'; // example $SITE['wcloud'] = 'd1686817653';
434 | $SITE['anWeID'] = false; // ##### Example $SITE['anWeID'] = '1234567';
435 | $SITE['pwsID'] = 'IRWAL55'; // ##### Example $SITE['pwsID'] = 'abcd99';
436 | $SITE['cwopId'] = 'EW1953'; // ##### Example $SITE['cwopId'] = 'C6440';
437 | $SITE['weatherlinkID'] =false; // 'EW1953'; // ##### Example $SITE['weatherlinkID']= 'abcdefgh';
438 | $SITE['wp24ID'] = true; // ##### true or false
439 | $SITE['uswg'] = false; // ##### true or false
440 | #---------------------------------------------------------------------------
441 | # IMPORTANT Mesonet id's and names
442 | #---------------------------------------------------------------------------
443 | $SITE['mesoID'] = ''; // ##### 'WCWN'; 'BNLWN'; do not forget the quote's !!!
444 | $SITE['mesoName'] = 'xyz Weather Network'; // ##### 'Benelux Weather Network';
445 | $SITE['mesoLink'] = 'http://www.xyz.com/'; // ##### 'http://www.beneluxweather.net/';
446 | #
447 | $SITE['ewnID'] = true; // #####
448 | #
449 | #
450 | #---------------------------------------------------------------------------
451 | # IMPORTANT Weather Station sensors and options for dashboard
452 | #---------------------------------------------------------------------------
453 | $SITE['UV'] = false; // ##### set to false if no UV sensor
454 | $SITE['SOLAR'] = true; // ##### set to false if no Solar sensor
455 | $SITE['tempInside'] = true; // ##### set to false if no inside temp sensor available or wanted on Ajax page
456 | $SITE['extraTemp1'] = true; // ##### set to false if no extra sensor available or wanted on Ajax page
457 | $SITE['extraTemp2'] = false; // ##### set to false if no extra sensor available or wanted on Ajax page
458 | #---------------------------------------------------------------------------
459 | # IMPORTANT soil moistere + temp & leaf moistere readings
460 | #---------------------------------------------------------------------------
461 | $SITE['soilUsed'] = false; // true = we use soil moistere & temp sensors | false = no soil
462 | $SITE['soilPage'] = false; // set to true if you have soil sensors and want a separate page with soil leaf information
463 | $SITE['soilCount'] = '2'; // 4 = max number of sensors
464 | $SITE['soilDepth'][1] = '10'; // depth in $SITE['uomSnow'] (either cm or inch)
465 | $SITE['soilDepth'][2] = '30'; // sensor1 shallowest sensor4 deepest
466 | $SITE['soilDepth'][3] = '50';
467 | $SITE['soilDepth'][4] = '75';
468 | $SITE['uomMoist'] = ' cb'; // Unit of measure for moisture in soil: cb (default) or Kpa.
469 | $SITE['leafUsed'] = false; // do we use leaf moistere sensors
470 | $SITE['leafCount'] = '1'; // 2 = max numer of leaf sensors
471 | #
472 | #---------------------------------------------------------------------------
473 | # STANDARD upload time for realtime (steelseries) data
474 | #---------------------------------------------------------------------------
475 | $SITE['steelTime'] = 30; // wait time to retrieve new info for steelseries gauges / realtime scripts
476 | #---------------------------------------------------------------------------
477 | # IMPORTANT Are you using a DAVIS Weather Station VP or VUE
478 | #---------------------------------------------------------------------------
479 | $SITE['DavisVP'] = true; // ##### set to false if not a Davis VP or VUE weather station
480 | #---------------------------------------------------------------------------
481 | # IMPORTANT Do you want to show a picture and text of your weather station in sidecolomn or bottom area
482 | #---------------------------------------------------------------------------
483 | $SITE['stationShow'] = true; // ##### set to false if you do not want it
484 | #
485 | $SITE['stationTxt'] = 'Davis VP2';
486 | $SITE['stationJpg'] = 'img/davis_logo.png';
487 | $SITE['stationLink'] = 'http://www.davisnet.com/weather/products/professional-home-weather-stations.asp';
488 | #
489 | # example for Alecto:
490 | #$SITE['stationTxt'] = 'Alecto WS-5000 ECO'; # the brand and name of your station
491 | #$SITE['stationJpg'] = 'img/alecto.jpg'; # a small picture of your station
492 | #$SITE['stationLink'] = 'http://www.alecto.nl/TradePoint/Item_View?itemNo=WS-5000%20ECO';
493 | #---------------------------------------------------------------------------
494 | # IMPORTANT Do you want to show which Website provider you are using
495 | #---------------------------------------------------------------------------
496 | $SITE['providerShow'] = false; // ##### set to false if you do not want it
497 | #
498 | $SITE['providerTxt'] = 'My provider'; // you have to fill in your own information
499 | $SITE['providerJpg'] = 'img/_provider.jpg'; // default picture
500 | $SITE['providerLink'] = 'http://www.provider.xyz/'; // here also
501 | #
502 | #---------------------------------------------------------------------------
503 | # IMPORTANT Do you want to show which computer you are using for your weatherprograms
504 | #---------------------------------------------------------------------------
505 | $SITE['pcShow'] = true; // #####
506 | #
507 | $SITE['pcTxt'] = 'My Computer';
508 | $SITE['pcJpg'] = 'img/_computer.png';
509 | $SITE['pcLink'] = 'http://www.computer.xyz';
510 | # example for consoleWD on a raspberry
511 | #$SITE['pcTxt'] = 'RaspberryPI';
512 | #$SITE['pcJpg'] = 'img/raspi_logo.png';
513 | #$SITE['pcLink'] = 'http://www.raspberrypi.org/';
514 | # and here one for Meteobridge on an Asus router
515 | #$SITE['pcTxt'] = 'Asus WL -330N3G';
516 | #$SITE['pcJpg'] = 'img/asus.png';
517 | #$SITE['pcLink'] = 'http://www.awekas.at/shop/index.php/awekas-bridge-2.html';
518 | #
519 | #---------------------------------------------------------------------------
520 | # IMPORTANT Do you want to show which weatherprogram you are using for your website
521 | #---------------------------------------------------------------------------
522 | $SITE['WXsoftwareShow'] = true;
523 | #---------------------------------------------------------------------------
524 | # COMPATIBILLITY for WeatherDisplay / consoleWD users
525 | # set to true ONLY if it is ABSOLUTELY necessary to use testtags.php from Saratoga or Leuven
526 | #---------------------------------------------------------------------------
527 | $SITE['use_testtags'] = false;
528 | #---------------------------------------------------------------------------
529 | # IMPORTANT will you be uploading to the default upload folder (uploadXX) where xx is the short code for your weather program
530 | #---------------------------------------------------------------------------
531 | #
532 | $SITE['standard_upload']= true;
533 | # If you do not want or are not able to upload to the default folder set the correct upload folder here
534 | #
535 | #$SITE['uploadDir'] = '../'; // ##### example for upload to root
536 | #$SITE['clientrawDir'] = '../';
537 | #$SITE['graphImageDir'] = '../';
538 | #---------------------------------------------------------------------------
539 | # IMPORTANT How are the date/time fields formatted for your weather program.
540 | # Important for WVIEW VWS Weatherlink
541 | #
542 | # set a comment mark for all lines which are not correct
543 | #
544 | #$my_date_format = 'mm-dd-yyyy'; # 03-15-2015 march the 15th, 2015
545 | #$my_date_format = 'mm-dd-yy'; # 03-15-15 march the 15th, 2015 without the century 20
546 | #$my_date_format = 'mm/dd/yyyy'; # 03/15/2015 march the 15th, 2015
547 | #$my_date_format = 'mm/dd/yy'; # 03/15-15 march the 15th, 2015 without the century 20
548 |
549 | #$my_date_format = 'dd/mm/yyyy'; # 15/03/15 15th of march 2015
550 | $my_date_format = 'dd/mm/yy'; # 15/03/15 15th of march 2015 without the century 20
551 | #$my_date_format = 'dd-mm-yyyy'; # 15-03-2015 15th march 2015
552 | #$my_date_format = 'dd-mm-yy'; # 15-03-15 15th march 2015 without the century 20
553 | #
554 | #$my_date_format = 'other'; # set this one uncommented if none of the others is correct
555 | #
556 | # if you selected 'other' What character is used between the three date fields
557 | # $my_char_sep = '/'; # example 12/25/2015
558 | # $my_char_sep = '-'; # example 01-12-2014
559 | # $my_char_sep = ' '; # example 20 3 2015
560 | #
561 | # Now we set the position of the day month and year in the date fields
562 | # example 2015-03-15 the year is first (1) part the month is second (2) part the day is the third (3) part;
563 | # $my_day = 1 ;
564 | # $my_month = 2 ;
565 | # $my_year = 3 ;
566 | #---------------------------------------------------------------------------
567 | # STANDARD Extra weather-programs used
568 | #---------------------------------------------------------------------------
569 | #
570 | $SITE['meteoplug'] = false; // ##### set to true is you have a subscription to the graphing services for Metohub or Meteobridge
571 | $SITE['wd_live'] = true; // ##### set to true if you run WeatherDisplayLive on your webserver (needs clientraw* files and it is a paid program
572 | $SITE['meteoware'] = true; // ##### set to true if you want to use meteoware as a realtime page
573 | #
574 | #-----------------------------------------------------------------------------------------
575 | # IMPORTANT Which areas of the website may be customized by the visitor.
576 | # This info is processed in the first part of index.php
577 | #-----------------------------------------------------------------------------------------
578 | $SITE['userChangeDebug'] = true; // true to let user set debug=Y to use ini_set('display_errors', 'On'); error_reporting(E_ALL);
579 | $SITE['userChangeColors'] = true; // let user select website colors / photos according to $SITE['colorStyles']
580 | $SITE['userChangeMenu'] = true; // user can choose Vertical or Horizontal menus
581 | $SITE['userChangeHeader'] = true; // user can select their own header
582 | $SITE['userChangeChoice'] = true; // user can choose which page to displayed on next visit other than standard page
583 | $SITE['userChangeLang'] = true; // should be on to let user change to one of the supported languages
584 | $SITE['userChangeUOM'] = true; // let user select thier own units of measurement
585 | $SITE['userChangeForecast'] = true; // let user select thier own forecast
586 | #
587 | #---------------------------------------------------------------------------
588 | # STANDARD The units-of-measurement UOM and number of decimals for the correct display of your weatherdata
589 | #
590 | #---------------------------------------------------------------------------
591 | # We set the default number of decimals to be displayed for
592 | #---------------------------------------------------------------------------
593 | $default = 1;
594 | $SITE['decTemp'] = $default;
595 | $SITE['decBaro'] = $default;
596 | $SITE['decWind'] = $default;
597 | $SITE['decPrecip'] = $default;
598 | $SITE['decSnow'] = $default;
599 | #---------------------------------------------------------------------------
600 | if ($SITE['region'] == 'america' ) {
601 | #
602 | # first some decimal changes
603 | $SITE['decBaro'] = 2; // needed for imperial pressure in inches
604 | $SITE['decPrecip'] = 2; // needed for imperial precipitation in inches #####
605 | #---------------------------------------------------------------------------
606 | # here we definethe unit settings for the U S A = imperial
607 | #---------------------------------------------------------------------------
608 | $SITE['uomTemp'] = '°F'; // ='°C', ='°F'
609 | $SITE['uomBaro'] = ' inHg'; // =' hPa', =' mb', =' inHg'
610 | $SITE['uomWind'] = ' mph'; // =' km/h', =' kts', =' m/s', =' mph'
611 | $SITE['uomRain'] = ' in'; // =' mm', =' in'
612 | $SITE['uomSnow'] = ' in'; // ' cm', =' in'
613 | $SITE['uomDistance'] = ' mi'; // ' km' or ' mi' -- used for visibillity Wind Run display
614 | $SITE['uomPerHour'] = '/hr';
615 | $SITE['uomHeight'] = 'ft'; // 'ft' or 'm' cloud height
616 | #
617 | # here we define date time settings for the U S A 12 hours month - date
618 | $SITE['hourDisplay'] = '12'; // use 12 hours (am and pm)
619 | $SITE['timeFormat'] = 'M j Y g:i a'; // M j Y g:i a Dec 31 2013 2:03 pm
620 | $SITE['timeOnlyFormat'] = 'g:i a'; // g:i a 5:54 pm
621 | $SITE['hourOnlyFormat'] = 'ga'; // ga 5pm
622 | $SITE['dateOnlyFormat'] = 'M j Y'; // M j Y Jan 1 2015
623 | $SITE['dateMDFormat'] = 'M-j'; // M-j Dec 5
624 | $SITE['dateLongFormat'] = 'l M j Y'; // l M j Y Friday Jan 22 2015
625 | #
626 | #---------------------------------------------------------------------------
627 | } else { # here we define unit settings for the for the rest of the world = metric
628 | #---------------------------------------------------------------------------
629 | $SITE['uomTemp'] = '°C'; // ='°C', ='°F'
630 | $SITE['uomBaro'] = ' hPa'; // =' hPa', =' mb', =' inHg'
631 | $SITE['uomWind'] = ' km/h'; // =' km/h', =' kts', =' m/s', =' mph'
632 | $SITE['uomRain'] = ' mm'; // =' mm', =' in'
633 | $SITE['uomSnow'] = ' cm'; // ' cm', =' in'
634 | $SITE['uomDistance'] = ' km'; // ' km' or ' mi' -- used for visibillity Wind Run display
635 | $SITE['uomPerHour'] = '/hr';
636 | $SITE['uomHeight'] = 'm'; // 'ft' or 'm' cloud height
637 | #
638 | # here we define date time settings for the rest of the world 24 hours day month
639 | $SITE['hourDisplay'] = '24'; // use 24 hours per day
640 | $SITE['timeFormat'] = 'd-m-Y H:i'; // d-m-Y H:i 31-03-2012 14:03
641 | $SITE['timeOnlyFormat'] = 'H:i'; // H:i 14:20
642 | $SITE['hourOnlyFormat'] = 'H'; // H 14
643 | $SITE['dateOnlyFormat'] = 'd-m-Y'; // d-m-Y 31-03-2008
644 | $SITE['dateMDFormat'] = 'd-m'; // d-m
645 | $SITE['dateLongFormat'] = 'l d F Y'; // Vrijdag, 5 februari 2013
646 | #
647 | #---------------------------------------------------------------------------
648 | }
649 | #---------------------------------------------------------------------------
650 | # STANDARD Multi-language support
651 | #---------------------------------------------------------------------------
652 | #
653 | $SITE['langFlags'] = true; // true=show flags
654 | #
655 | # If you add an language add the new language to this array
656 | $SITE['installedLanguages'] = array (
657 | 'nl' => 'Nederlands',
658 | 'en' => 'English',
659 | 'fr' => 'Français',
660 | 'de' => 'Deutsch',
661 | );
wsLoadSettings.php SettingsFiles should pe password protected - dated: 16-08-2015 10:11
1 | <?php ini_set('display_errors', 'On'); error_reporting(E_ALL);
2 | if (isset($_REQUEST['sce']) && strtolower($_REQUEST['sce']) == 'view' ) {
3 | $filenameReal = __FILE__; # display source of script if requested so
4 | $download_size = filesize($filenameReal);
5 | header('Pragma: public');
6 | header('Cache-Control: private');
7 | header('Cache-Control: no-cache, must-revalidate');
8 | header("Content-type: text/plain");
9 | header("Accept-Ranges: bytes");
10 | header("Content-Length: $download_size");
11 | header('Connection: close');
12 | readfile($filenameReal);
13 | exit;
14 | }
15 | $pageName = 'wsLoadSettings.php';
16 | $pageVersion = '3.14 2015-06-07';
17 | #
18 | if (!isset($SITE)){echo "<h3>invalid call to script $pageName</h3>";exit;}
19 | $SITE['wsModules'][$pageName] = 'version: ' . $pageVersion;
20 | $pageFile = basename(__FILE__); // check to see this is the real script
21 | if ($pageFile <> $pageName) { $SITE['wsModules'][$pageFile] = 'this file loaded instead of '.$pageName; }
22 | if (!isset($pathString)) {$pathString='';}
23 | $pathString .= '<!-- module '.$pageFile.' ==== '.$SITE['wsModules'][$pageFile].' -->'.PHP_EOL;
24 | #---------------------------------------------------------------------------
25 | # '3.14 2015-06-07 release 2.7 version + CCN WD and CW
26 | #---------------------------------------------------------------------------
27 | $ws_arr_supp_wx = array ('CU', 'CW', 'DW', 'MB', 'MH', 'VW','WC', 'WD', 'WL', 'WS', 'WV');
28 | # Set all defaults
29 | $SITE['noaaPage'] = $SITE['ecPage'] = $SITE['cwopPage'] = 'no'; // set to default / no values
30 | $SITE['canada'] = $SITE['europe'] = $SITE['america'] = $SITE['other'] = false;
31 | $SITE['belgium'] = $SITE['netherlands'] = $SITE['warnArea'] = false; // set to default / no values
32 | #
33 | $SITE['wdPage'] = $SITE['cwPage'] = $SITE['wdlPage'] = $SITE['wlPage'] = 'no';
34 | $SITE['wcPage'] = $SITE['cuPage'] = $SITE['mhPage'] = $SITE['mbPage'] = 'no';
35 | $SITE['MeteoplugPage'] =$SITE['cltrPage'] = $SITE['trendPage'] = $SITE['mwPage'] = 'no';
36 | $SITE['graphsPage'] = $SITE['wsYTags'] = 'no';
37 |
38 | $SITE['cookieName'] = 'weatherv4';
39 |
40 | $SITE['colorStyles'] = array ('weather adapted', 'green','blue','pastel','red','orange','none','ws_clouds','ws_cloudsn','ws_mist','ws_moon','ws_pclouds','ws_rain','ws_snow','ws_storm','ws_sun','ws_thunder');
41 | if (!defined('ENT_HTML5')) {define ('ENT_HTML5' , (16|32) );}
42 | $SITE['htmlVersion'] = ENT_HTML5; // html version of this template
43 | $SITE['commaDecimal'] = false; // most europeans use a comma for a decimal point. others a point
44 | $SITE['curlFollow'] = 'false'; // for sites using safe mode
45 | #---------------------------------------------------------------------------
46 | $SITE['imgDir'] = 'img/'; // directory under topfolder used for general images
47 | $SITE['cacheDir'] = 'cache/'; // directory to cache files
48 | $SITE['metarDir'] = 'metar/'; // directory for metar scripts
49 | $SITE['javascriptsDir'] = 'javaScripts/'; // all general javascripts
50 | $SITE['forecastsDir'] = 'forecasts/'; //
51 | $SITE['iconsDir'] = 'wsIcons/';
52 | $SITE['defaultIconsDir']= $SITE['iconsDir'].'default_icons/';
53 | $SITE['defaultIconsSml']= $SITE['iconsDir'].'default_icons_small/';
54 | $SITE['windIcons'] = $SITE['iconsDir'].'windIcons/';
55 | $SITE['windIconsSmall'] = $SITE['iconsDir'].'windIconsSmall/';
56 | #---------------------------------------------------------------------------
57 | # load user settings
58 | #---------------------------------------------------------------------------
59 | include '_my_texts/wsUserSettings.php';
60 | #
61 | if (isset($_REQUEST['debug']) || $SITE['wsDebug'] == true) {
62 | $SITE['wsDebug'] = true;
63 | $wsDebug = true;
64 | ini_set('display_errors', 'On'); error_reporting(E_ALL);
65 | $pathString.= '<!-- debug is switched on by wsLoadSettings.php because of user request - error reporting ALL -->'.PHP_EOL;
66 | $SITE['colorNumber'] = '3';
67 | }
68 | else { $SITE['wsDebug'] = false;
69 | ini_set('display_errors', NULL); error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
70 | $wsDebug = false;
71 | }
72 | if ($SITE['region'] <> 'europe') {$SITE['ewnID'] = false;} // ewn only works in europe
73 | #
74 | if (isset($_REQUEST['wp'])) {
75 | $wp = substr(strtoupper($_REQUEST['wp']).$SITE['WXsoftware'],0,2);
76 | if (in_array ($wp, $ws_arr_supp_wx )) {
77 | $SITE['switch_wp'] = $SITE['WXsoftware'] = $wp;
78 | $pathString .= '<!-- user switches the weatherprogram to '.$SITE['WXsoftware'].' -->'.PHP_EOL;
79 | $extraP ='&wp='.$SITE['WXsoftware'];
80 | }
81 | }
82 | if (!isset ($SITE['WXsoftware']) ) {
83 | $SITE['WXsoftware'] = 'CU';
84 | ws_print_warning( 'WARNING - Please set your weather_program. Defaulted to '.$SITE['WXsoftware']);
85 | }
86 | if ($SITE['sideDisplay'] == false && $SITE['menuPlace'] == 'V') {$SITE['sideDisplay'] = true; };
87 | #
88 | if (!isset ($SITE['curCondFrom'])) {
89 | $SITE['curCondFrom'] = 'metar';
90 | ws_print_warning( 'WARNING - Please set your current conddition source. Defaulted to '.$SITE['curCondFrom']);
91 | }
92 | if ($SITE['curCondFrom'] == 'wd' && ($SITE['WXsoftware'] <> 'WD' && $SITE['WXsoftware'] <> 'CW')) {$SITE['curCondFrom'] = 'metar';}
93 | #
94 | if ($SITE['skipTop']) {$skiptopText = '#data-area';} else {$skiptopText = '';}
95 | #
96 | #---------------------------------------------------------------------------
97 | # W A R N I N G S
98 | #---------------------------------------------------------------------------
99 | $SITE['warningsEuro'] = $SITE['warningsNOAA'] = $SITE['warningsNWS'] = $SITE['warningsec'] = false;
100 | $SITE['warnImg'] = false; // set all default no
101 | #---------------------------------------------------------------------------
102 | #
103 | if ($SITE['region'] == 'america') { # U S A
104 | $SITE['america'] = true;
105 | if ($SITE['useCurly']) {
106 | $SITE['warningScript'] = './usa/nws-alerts/wsnws-alerts.php';
107 | $SITE['warningsNWS'] = true;
108 | } else {
109 | $SITE['warningScript'] = './usa/noaa_warn/noaaWarning.php';
110 | $SITE['warningsNOAA'] = $SITE['warnings'] ;
111 | $SITE['warnImg'] = './wsIcons/NOAA_Icons_small/';
112 | }
113 | } elseif ($SITE['region'] == 'canada') { # C A N A D A
114 | $SITE['canada'] = true;
115 | $SITE['warningScript'] = './canada/ec_warning.php';
116 | $SITE['warningsec'] = $SITE['warnings'];
117 | } elseif ($SITE['region'] == 'europe') { # E U R O P E
118 | $SITE['europe'] = true;
119 | $SITE['warningScript'] = './europe/wrnWarningv3.php'; // Euro
120 | $SITE['warningsEuro'] = $SITE['warnPage'];
121 | $SITE['warnImg'] = './img/wrnImages/warn_';
122 | } else { // region = other
123 | $SITE['other'] = true;
124 | $SITE['warningsMenu'] = false;
125 | $SITE['warnings'] = false;
126 | $SITE['warnPage'] = false;
127 | $SITE['warningScript'] = './other/warning.php';
128 | }
129 | # // for more detailed info when there is a warning displayed
130 | $SITE['noaawarningURL'] = 'http://alerts.weather.gov/cap/wwaatmget.php?x='.$SITE['warnArea'].'&y=1';
131 | $SITE['EUwarningURL'] = 'http://www.meteoalarm.eu/index3.php?area='.$SITE['warnArea'].'&day=0&lang=ne_NL';
132 | #
133 | #---------------------------------------------------------------------------
134 | # mobile site
135 | # detection which mobile device is used is done in index.php by loading mobi/ws_check_mobi.php
136 | #---------------------------------------------------------------------------
137 | $SITE['mobileDir'] = 'mobi/';
138 | $SITE['mobileSite'] = $SITE['mobileDir'].'mobi.php'; // for switching to mobile site; set to "" when no mobile support is needed
139 | #---------------------------------------------------------------------------
140 | # Ajax
141 | #---------------------------------------------------------------------------
142 | $SITE['imgAjaxDir'] = 'ajaxImages/'; // directory for ajaxImages with trailing slash
143 | $SITE['wsAjaxScript'] = $SITE['javascriptsDir'].'ajax.js'; // for AJAX enabled display
144 | $SITE['wsAjaxDataLoad'] = 'wsAjaxDataLoad_v3.php'; // load fresh data for ajax page at users site
145 | $SITE['ajaxGizmojs'] = $SITE['javascriptsDir'].'ajaxgizmo.js'; // rotate gizmo info
146 | $SITE['ajaxGizmo'] = 'wsAjaxGizmo.php'; // default Giozmo
147 | #---------------------------------------------------------------------------
148 | # Which scripts to use to process the supplied data
149 | #---------------------------------------------------------------------------
150 | $SITE['functions'] = 'wsFunctions.php'; // weather functions, override
151 | $SITE['langFunc'] = 'wsLangFunctions.php'; // general functions for languages
152 | $SITE['menuXml'] = 'wsMenuData.xml'; // menu processes 'incMenuDataWilsele.xml';
153 | $SITE['menuLoad'] = 'wsMenuLoad.php';
154 | $SITE['spidersTxt'] = 'spiders.txt';
155 | $SITE['uvScript'] = 'uvforecastv3.php'; // worldwide forecast script for UV Index
156 | $SITE['sideInc'] = 'wsSideColom.php';
157 | $SITE['bottomInc'] = 'wsBottom.php';
158 | $SITE['footer'] = 'wsFooter.php';
159 | #---------------------------------------------------------------------------
160 | # script names for conversion of weatherprogram data to website/ajax data
161 | #---------------------------------------------------------------------------
162 | $SITE['getData'] = 'wsDataGet.php'; // data from ws tags to intermidiate array
163 | $SITE['loadData'] = 'wsDataLoad.php'; // load data into variables (mostly ajax)
164 | #---------------------------------------------------------------------------
165 | # Website CSS files
166 | #---------------------------------------------------------------------------
167 | $SITE['CSSscreen'] = 'styleMain30.css'; // general stylesheet all pages
168 | $SITE['CSSprint'] = 'stylePrint20.css'; // general stylesheet all pages for printing
169 | $SITE['CSStable'] = 'styleTable20.css'; // general stylesheet all tables
170 | $SITE['CSSmenuHor'] = 'styleMenuDrop20.css'; // stylesheet horizontal drop down menus
171 | $SITE['CSSmenuVer'] = 'styleMenuVert20x.css'; // stylesheet vertical fly-out menus
172 | $SITE['CSSmood'] = 'styleMood20.css'; // stylesheet for adapting colors based on current weathercondition
173 |
174 | $SITE['noChoiceBackup'] = $SITE['noChoice'];
175 | $SITE['menuPlaceBackup']= $SITE['menuPlace'];
176 | $SITE['colorBackup'] = $SITE['colorNumber'];
177 | $SITE['headerBackup'] = $SITE['header'];
178 | $SITE['langBackup'] = $SITE['lang'];
179 |
180 | if (isset($_REQUEST['ipad']) ) { // modify standard settings if page formatting ipad is requested
181 | $SITE['ipad'] = true;
182 | $SITE['sideDisplay'] = false;
183 | $SITE['bottomDysplay'] = false;
184 | $SITE['stripAll'] = true;
185 | $SITE['stripMenu'] = true;
186 | $SITE['banners'] = false;
187 | $SITE['warnings'] = false;
188 | $SITE['warningTxt'] = false;
189 | } else {$SITE['ipad'] = false;}
190 | #
191 | $SITE['supported_regions'] = array ('america','canada','europe','other');
192 | if (!in_array($SITE['region'], $SITE['supported_regions']) ) {$SITE['region'] = 'europe';}
193 | #
194 | $SITE['supportedUnits'] = array ();
195 | $SITE['supportedUnits'] ['temp'] = array('°C', '°F');
196 | $SITE['supportedUnits'] ['baro'] = array(' hPa', ' inHg',' mb' );
197 | $SITE['supportedUnits'] ['wind'] = array(' km/h', ' mph', ' kts', ' m/s', );
198 | $SITE['supportedUnits'] ['rain'] = array(' mm', ' in' );
199 | $SITE['supportedUnits'] ['snow'] = array(' cm', ' in' );
200 | #
201 | if (!in_array($SITE['uomTemp'], $SITE['supportedUnits'] ['temp']) ){
202 | if ($region == 'europe')
203 | {$SITE['uomTemp'] = $SITE['supportedUnits']['temp'][0];
204 | } else {$SITE['uomTemp'] = $SITE['supportedUnits']['temp'][1];}
205 | }
206 | if (!in_array($SITE['uomBaro'], $SITE['supportedUnits'] ['baro']) ){
207 | if ($region == 'europe')
208 | {$SITE['uomBaro'] = $SITE['supportedUnits']['baro'][0];
209 | } else {$SITE['uomBaro'] = $SITE['supportedUnits']['baro'][1];}
210 | }
211 | if (!in_array($SITE['uomWind'], $SITE['supportedUnits'] ['wind']) ){
212 | if ($region == 'europe')
213 | {$SITE['uomWind'] = $SITE['supportedUnits']['wind'][0];
214 | } else {$SITE['uomWind'] = $SITE['supportedUnits']['wind'][1];}
215 | }
216 | if (!in_array($SITE['uomRain'], $SITE['supportedUnits'] ['rain']) ){
217 | if ($region == 'europe')
218 | {$SITE['uomRain'] = $SITE['supportedUnits']['rain'][0];
219 | } else {$SITE['uomRain'] = $SITE['supportedUnits']['rain'][1];}
220 | }
221 | if (!in_array($SITE['uomSnow'], $SITE['supportedUnits'] ['snow']) ){
222 | if ($region == 'europe')
223 | {$SITE['uomSnow'] = $SITE['supportedUnits']['snow'][0];
224 | } else {$SITE['uomSnow'] = $SITE['supportedUnits']['snow'][1];}
225 | }
226 | #
227 | # ------------------------ check if we are allowed to set cookie and process all cookies
228 | #
229 | $uomBackup = array ();
230 | $uomBackup['uomTemp'] = $SITE['uomTemp'];
231 | $uomBackup['uomBaro'] = $SITE['uomBaro'];
232 | $uomBackup['uomWind'] = $SITE['uomWind'];
233 | $uomBackup['uomRain'] = $SITE['uomRain'];
234 | $uomBackup['uomSnow'] = $SITE['uomSnow'];
235 | $uomBackup['uomDistance']= $SITE['uomDistance'];
236 | $uomBackup['uomPerHour']= $SITE['uomPerHour'];
237 | $uomBackup['uomHeight'] = $SITE['uomHeight'];
238 |
239 | if (!isset ($SITE['fctOrg'] ) ) { $SITE['fctOrg'] = 'yahoo';}
240 | $SITE['fctOrgBackup'] = $SITE['fctOrg'];
241 |
242 | #
243 | if ($SITE['cookieSupport'] == true) {
244 | include 'wsCookie.php' ;
245 | }
246 | $uomTemp = $SITE['uomTemp'];
247 | $uomBaro = $SITE['uomBaro'];
248 | $uomRain = $SITE['uomRain'];
249 | $uomSnow = $SITE['uomSnow'];
250 | $uomDistance = $SITE['uomDistance'];
251 | $uomWind = $SITE['uomWind'];
252 | $uomPerHour = $SITE['uomPerHour'];
253 | $uomHeight = $SITE['uomHeight'];
254 |
255 | # set the Timezone abbreviation automatically based on $SITE['tz'];
256 | if (!function_exists('date_default_timezone_set')) {
257 | putenv("TZ=" . $SITE['tz']);
258 | } else {
259 | date_default_timezone_set($SITE['tz']);
260 | }
261 | $SITE['tzName'] = date("T",time());
262 | #
263 | #---------------------------------------------------------------------------
264 | # Automatic Info we might need
265 | #---------------------------------------------------------------------------
266 | if(isset($_SERVER['REMOTE_ADDR'])) {$SITE['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];}
267 | if(isset($_SERVER['REMOTE_HOST'])) {$SITE['REMOTE_HOST'] = $_SERVER['REMOTE_HOST'];}
268 | if(isset($_SERVER['DOCUMENT_ROOT'])) {$SITE['WEBROOT'] = $_SERVER['DOCUMENT_ROOT'];}
269 | if(isset($_SERVER['REQUEST_URI'])) {$SITE['REQURI'] = $_SERVER['REQUEST_URI'];}
270 | if(isset($_SERVER['SERVER_NAME'])) {$SITE['SERVERNAME'] = $_SERVER['SERVER_NAME'];}
271 | #---------------------------------------------------------------------------
272 | #
273 | if ($SITE['fctOrg'] == 'yahoo') {$SITE['yahooPage'] = true;}
274 | if ($SITE['fctOrg'] == 'metno') {$SITE['metnoPage'] = true;}
275 | if ($SITE['fctOrg'] == 'wxsim') {$SITE['wxsimPage'] = true;}
276 | if ($SITE['fctOrg'] == 'hwa') {$SITE['hwaPage'] = true;}
277 | if ($SITE['fctOrg'] == 'noaa') {$SITE['noaaPage'] = true;}
278 | if ($SITE['fctOrg'] == 'ec') {$SITE['ecPage'] = true;}
279 | #
280 | if ($SITE['region'] == 'america') {$SITE['hwaPage'] = $SITE['ecPage'] = false; }
281 | if ($SITE['region'] == 'canada') {$SITE['hwaPage'] = $SITE['noaaPage']= false; }
282 | if ($SITE['region'] == 'other') {$SITE['hwaPage'] = $SITE['noaaPage']= $SITE['ecPage'] = false; }
283 | if ($SITE['region'] == 'europe') {$SITE['noaaPage']= $SITE['ecPage'] = false; }
284 | if ($SITE['belgium'] == false && $SITE['netherlands'] == false) {$SITE['hwaPage'] = false;}
285 | #
286 | $string1 = '';
287 | if(isset($_SERVER['HTTP_HOST'])) {$string1 .= $_SERVER['HTTP_HOST'];}
288 | if(isset($_SERVER['PHP_SELF'])) {$string1 .= $_SERVER['PHP_SELF'];}
289 | $SITE['siteUrl']= 'http://'.str_replace ('index.php','',$string1);
290 | #
291 | if (isset ($index) && $index) {check_topfolder ($wsDebug);}
292 | #
293 | if (!isset ($SITE['uploadDir']) ) {$SITE['uploadDir'] = 'upload'.$SITE['WXsoftware'].'/';}
294 | if (!isset ($SITE['clientrawDir']) ) {$SITE['clientrawDir'] = 'upload'.$SITE['WXsoftware'].'/';}
295 | if (!isset ($SITE['graphImageDir']) ) {$SITE['graphImageDir'] = 'upload'.$SITE['WXsoftware'].'/';}
296 |
297 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
298 | if ($SITE['meteoplug']) {$SITE['MeteoplugPage'] = 'yes';}
299 | if ($SITE['wd_live']) {$SITE['wdlPage'] = $SITE['cltrPage'] = 'yes';}
300 | if ($SITE['meteoware']) {$SITE['mwPage'] = 'yes';}
301 | #
302 | if (!isset ($SITE['wuId']) || !$SITE['wuId'] || $SITE['wuId'] == '') { $SITE['wuHistPage'] = 'no'; } else {$SITE['wuHistPage'] = 'yes';}
303 | #
304 | $SITE['meteowareFile'] = './mwlive/mwliveRT.php?wp='.$SITE['WXsoftware'];
305 | $SITE['yrnoXmlName'] = 'yowindowRT.php?wp='.$SITE['WXsoftware'];
306 | $SITE['alltime_values'] = true; // weatherprogram supplies all-time values for temp and so on
307 | #---------------------------------------------------------------------------
308 | $save_to_cache = true;
309 |
310 | $SITE['wp_scripts'] = $SITE['uploadDir'];
311 |
312 | switch ($SITE['WXsoftware']) {
313 |
314 | case 'MH': # required settings for M E T E O H U B
315 | #
316 | $SITE['mhPage'] = 'yes';
317 | $SITE['trendPage'] = 'yes';
318 | $SITE['graphsPage'] = 'yes';
319 | #
320 | $SITE['WXsoftwareURL'] = 'http://wiki.meteohub.de/Main_Page';
321 | $SITE['WXsoftwareLongName']= 'Meteohub';
322 | $SITE['WXsoftwareIcon'] = 'img/meteohub.jpg';
323 |
324 | $SITE['realtime'] = 'cltrw';
325 | $SITE['realtime_file'] = $SITE['clientrawDir'].'clientraw.txt';
326 | $SITE['wp_scripts'] = 'scriptsMH/';
327 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsMH.txt';
328 | $SITE['ydayTags'] = $SITE['uploadDir'].'tagsYdayMH.txt';
329 |
330 | $SITE['process'] = $SITE['wp_scripts'].'tagsMH.php';
331 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.mh.html';
332 | $SITE['wsYTagsSrc'] = $SITE['wp_scripts'].'tagsyday.mh.html';
333 | break;
334 | #---------------------------------------------------------------------------
335 | case 'MB': # required settings for M E T E O B R I D G E
336 | #
337 | $SITE['mbPage'] = 'yes';
338 | $SITE['trendPage'] = 'yes';
339 | $SITE['graphsPage'] = 'yes';
340 | $SITE['cltrPage'] = $SITE['wdlPage'] = 'no';
341 | $SITE['wd_live'] = false;
342 | #
343 | $SITE['WXsoftwareURL'] = 'http://www.meteobridge.com/wiki/index.php/Main_Page';
344 | $SITE['WXsoftwareLongName']= 'Meteobridge';
345 | $SITE['WXsoftwareIcon'] = 'img/meteobridge.jpg';
346 |
347 | $SITE['realtime'] = 'http';
348 | $SITE['realtime_file'] = $SITE['clientrawDir'].'realtime.txt';
349 | $SITE['wp_scripts'] = 'scriptsMB/';
350 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsMB.txt';
351 | $SITE['process'] = $SITE['wp_scripts'].'tagsMB.php';
352 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.mb.txt';
353 | break;
354 | #---------------------------------------------------------------------------
355 | case 'WD': # required settings for W E A T H E R D I S P L A Y
356 | #
357 | $SITE['wdPage'] = 'yes';
358 | $SITE['trendPage'] = 'yes';
359 | $SITE['graphsPage'] = 'yes';
360 | $SITE['MeteoplugPage'] = 'no';
361 | #
362 | $SITE['WXsoftwareURL'] = 'http://www.weather-display.com/';
363 | $SITE['WXsoftwareLongName'] = 'Weather Display';
364 | $SITE['WXsoftwareIcon'] = 'img/wd.jpg';
365 | #
366 | $SITE['realtime'] = 'cltrw';
367 | $SITE['realtime_file'] = $SITE['clientrawDir'].'clientraw.txt';
368 | $SITE['wp_scripts'] = 'scriptsWD/';
369 | if (isset ($SITE['use_testtags']) && $SITE['use_testtags']) {
370 | $SITE['wsTags'] = $SITE['uploadDir'].'testtags.php';
371 | $SITE['process'] = 'ws_testtags.php';
372 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'testtags.txt';
373 | } else {
374 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsWD.txt';
375 | $SITE['process'] = $SITE['wp_scripts'].'tagsWD.php';
376 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.wd.txt';
377 | }
378 | break;
379 | #---------------------------------------------------------------------------
380 | case 'CW': # required settings for C O N S O L E WD (= on raspberryPI)
381 | #
382 | $SITE['cwPage'] = 'yes';
383 | $SITE['trendPage'] = 'yes';
384 | $SITE['wxsimPage'] = 'no';
385 | $SITE['alltime_values'] = false;
386 | $SITE['MeteoplugPage'] = 'no';
387 | #
388 | $SITE['WXsoftwareURL'] = 'http://www.weather-display.com/';
389 | $SITE['WXsoftwareLongName'] = 'consoleWD';
390 | $SITE['WXsoftwareIcon'] = 'img/consolewd.png';
391 | #
392 | $SITE['realtime'] = 'cltrw';
393 | $SITE['realtime_file'] = $SITE['clientrawDir'].'clientraw.txt';
394 | $SITE['wp_scripts'] = 'scriptsCW/';
395 | if (isset ($SITE['use_testtags']) && $SITE['use_testtags']) {
396 | $SITE['wsTags'] = $SITE['uploadDir'].'testtags.php';
397 | $SITE['process'] = 'ws_testtags.php';
398 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'wxlocal-testtags.html';
399 | } else {
400 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsCW.txt';
401 | $SITE['process'] = $SITE['wp_scripts'].'tagsCW.php';
402 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'wxlocal.html';
403 | }
404 | break;
405 | #---------------------------------------------------------------------------
406 | case 'CU': # required settings for C U M U L U S
407 | #
408 | $SITE['cuPage'] = 'yes';
409 | $SITE['trendPage'] = 'yes';
410 | $SITE['graphsPage'] = 'yes';
411 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
412 | $SITE['wd_live'] = $SITE['meteoplug']= false;
413 | #
414 | $SITE['WXsoftwareURL'] = 'http://sandaysoft.com/products/cumulus';
415 | $SITE['WXsoftwareLongName'] = 'Cumulus';
416 | $SITE['WXsoftwareIcon'] = 'img/cumulus.gif';
417 | #
418 | $SITE['realtime'] = 'json';
419 | $SITE['realtime_file'] = $SITE['clientrawDir'].'realtimeTags.txt';
420 |
421 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsCU.txt';
422 | $SITE['wp_scripts'] = 'scriptsCU/';
423 | $SITE['process'] = $SITE['wp_scripts'].'tagsCU.php';
424 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.cu.txt';
425 | break;
426 | #---------------------------------------------------------------------------
427 | case 'WL': # required settings for W E A T H E R L I N K
428 | #
429 | $SITE['wlPage'] = 'yes';
430 | $SITE['graphsPage'] = 'yes';
431 | $SITE['alltime_values'] = false;
432 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
433 | $SITE['wd_live'] = $SITE['meteoplug']= false;
434 | #
435 | $SITE['WXsoftwareURL'] = 'http://www.davisnet.com/index.asp';
436 | $SITE['WXsoftwareLongName'] = 'WeatherLink';
437 | $SITE['WXsoftwareIcon'] = 'img/weatherlink.png';
438 | #
439 | $SITE['realtime'] = 'weatherlink';
440 | $SITE['realtime_file'] = $SITE['clientrawDir'].'realtimev3.txt';
441 | $SITE['wp_scripts'] = 'scriptsWL/';
442 | $SITE['wsTags'] = $SITE['uploadDir'].'tags.wl.txt';
443 | $SITE['ydayTags'] = $SITE['uploadDir'].'tagsyday.wl.txt';
444 | $SITE['moonSet'] = 'inc/astronomy.php'; // to calculate moon set & rise values
445 |
446 | $SITE['process'] = $SITE['wp_scripts'].'tagsWL.php';
447 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.wl.htx';
448 | $SITE['wsYTagsSrc'] = $SITE['wp_scripts'].'tagsyday.wl.htx';
449 |
450 | if (!ws_date_format()) {ws_print_warning( 'WARNING - Please set the date format correct in your settings');}
451 | break;
452 | #---------------------------------------------------------------------------
453 | case 'WC': # required settings for W E A T H E R C A T (for Mac)
454 | #
455 | $SITE['wcPage'] = 'yes';
456 | $SITE['graphsPage'] = 'yes';
457 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
458 | $SITE['wd_live'] = $SITE['meteoplug']= false;
459 | #
460 | $SITE['WXsoftwareURL'] = 'http://trixology.com/weathercat/';
461 | $SITE['WXsoftwareLongName'] = 'WeatherCat';
462 | $SITE['WXsoftwareIcon'] = 'img/weathercat.png';
463 | #
464 | $SITE['realtime'] = 'json';
465 | $SITE['realtime_file'] = $SITE['clientrawDir'].'realtime.wc.txt';
466 | $SITE['wp_scripts'] = 'scriptsWC/';
467 | $SITE['wsTags'] = $SITE['uploadDir'].'tags.wc.txt';
468 | $SITE['moonSet'] = 'inc/astronomy.php'; // to calculate moon set & rise values
469 | $SITE['process'] = $SITE['wp_scripts'].'tagsWC.php';
470 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.wc.txt';
471 | break;
472 | #---------------------------------------------------------------------------
473 | case 'DW': # required settings for WeatherLink.com
474 | #---------------------------------------------------------------------------
475 | #
476 | $SITE['DavisVP'] = false; // false as wl.com does not support Davis forecast text in xml
477 | #
478 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
479 | $SITE['wd_live'] = $SITE['meteoplug']= false;
480 | $SITE['alltime_values'] = false;
481 | #
482 | $SITE['WXsoftwareURL'] = 'http://www.weatherlink.com/user/'.$SITE['wlink_key'].'/index.php';
483 | $SITE['WXsoftwareLongName'] = 'Davis Weatherlink.Com';
484 | $SITE['WXsoftwareIcon'] = 'img/wl_top.png';
485 | #
486 | $SITE['realtime'] = 'none';
487 | $SITE['wp_scripts'] = 'scriptsDW/';
488 | $SITE['wsTags'] = $SITE['wp_scripts'].'tagsWLCOM.php';
489 | $SITE['ydayTags'] = $SITE['uploadDir'].'tagsydayWLCOM.txt';
490 | $SITE['moonSet'] = 'inc/astronomy.php'; // to calculate moon set & rise values
491 | $SITE['cacheDW'] = 140; // cache time max allowed in seconds
492 | $SITE['process'] = $SITE['wp_scripts'].'tagsWLCOM.php';
493 | $SITE['wsTagsSrc'] = '';
494 | $SITE['wsYTagsSrc'] = $SITE['wp_scripts'].'tagsyday.cron.txt';
495 | $save_to_cache = false;
496 | $SITE['weatherlinkID'] = $SITE['wlink_key'];
497 | break;
498 | #---------------------------------------------------------------------------
499 | case 'WS': # required settings for WSWIN /
500 | #
501 | $SITE['trendPage'] = 'yes'; // trendpage
502 | $SITE['MeteoplugPage'] = $SITE['cltrPage'] = 'no';
503 | $SITE['wd_live'] = $SITE['meteoplug']= false;
504 | $SITE['alltime_values'] = false;
505 | $SITE['WXsoftwareURL'] = 'http://www.pc-wetterstation.de/en1index.html';
506 | $SITE['WXsoftwareLongName'] = 'WSWIN';
507 | $SITE['WXsoftwareIcon'] = 'img/wswin.gif';
508 |
509 | $SITE['realtime'] = 'cltrw';
510 | $SITE['realtime_file'] = $SITE['clientrawDir'].'clientraw.txt';
511 |
512 | $SITE['wp_scripts'] = 'scriptsWS/';
513 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsws.txt';
514 | $SITE['ydayTags'] = $SITE['uploadDir'].'tagsydayWS.txt';
515 |
516 | $SITE['process'] = $SITE['wp_scripts'].'tagsWS.php';
517 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.ws.txt';
518 | $SITE['wsYTagsSrc'] = $SITE['wp_scripts'].'tagsyday.cron.txt';
519 |
520 | break;
521 | #---------------------------------------------------------------------------
522 | case 'WV': # required settings for WVIEW /
523 | #
524 | $SITE['WXsoftwareURL'] = 'http://www.wviewweather.com/';
525 | $SITE['WXsoftwareLongName'] = 'WVIEW';
526 | $SITE['WXsoftwareIcon'] = 'img/wview.png';
527 | $SITE['alltime_values'] = false;
528 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
529 | $SITE['wd_live'] = $SITE['meteoplug']= false;
530 | $SITE['realtime'] = 'none';
531 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsWV.htm';
532 |
533 | # $SITE['wview_day_txt'] = $SITE['uploadDir'].'tags.htm';
534 | # $SITE['wsCronTags'] = $SITE['uploadDir'].'yesterdayTagsWVIEW.php';
535 | $SITE['ydayTags'] = $SITE['uploadDir'].'tagsydayWV.txt';
536 |
537 | $SITE['wp_scripts'] = 'scriptsWV/';
538 | $SITE['process'] = $SITE['wp_scripts'].'tagsWV.php';
539 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tagsWV.htx';
540 | $SITE['wsYTagsSrc'] = $SITE['wp_scripts'].'tagsyday.cron.txt';
541 | #
542 | if (!ws_date_format()) {ws_print_warning( 'WARNING - Please set the date format correct in your settings');}
543 | $SITE['soilUsed'] = false;
544 |
545 | break;
546 | #---------------------------------------------------------------------------
547 | case 'VW': # required settings for VWS /
548 | #
549 | $SITE['alltime_values'] = false;
550 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
551 | $SITE['wd_live'] = $SITE['meteoplug']= false;
552 | $SITE['WXsoftwareURL'] = 'http://www.ambientweather.com/virtualstation.html';
553 | $SITE['WXsoftwareLongName'] = 'VWS';
554 | $SITE['WXsoftwareIcon'] = 'img/vws.gif';
555 |
556 | if (!ws_date_format()) {ws_print_warning( 'WARNING - Please set the date format correct in your settings');}
557 | #
558 | $SITE['wsTags'] = $SITE['uploadDir'].'tagsVW.txt'; // ##### location and name of the uploaded tags file
559 | $SITE['vws_day_txt'] = $SITE['wsTags'];
560 |
561 | $SITE['wp_scripts'] = 'scriptsVW/';
562 | $SITE['process'] = $SITE['wp_scripts'].'tagsVWS.php';
563 | $SITE['wsTagsSrc'] = $SITE['wp_scripts'].'tags.vws.htx';
564 |
565 | # ---- VWS realtime ---------------------------------------------------------
566 | $SITE['realtime'] = 'wflash'; // type of realtime file supported
567 | $SITE['wflash_folder'] = $SITE['clientrawDir']; // location of wflash files => if we started to use wflash
568 | $SITE['realtime_file'] = $SITE['wflash_folder'].'wflash.txt'; // default names of realtime files
569 | $SITE['realtime_file2'] = $SITE['wflash_folder'].'wflash2.txt';
570 | #
571 | $SITE['soilUsed'] = false;
572 | $SITE['clientrawDir'] = false;
573 | $SITE['MeteoplugPage'] = $SITE['wdlPage'] = $SITE['cltrPage'] = 'no';
574 | $SITE['trendPage'] = 'no';
575 | $SITE['wd_live'] = $SITE['meteoplug']= false;
576 |
577 | break;
578 | #---------------------------------------------------------------------------
579 | default:
580 | echo '<H3>Other software not supported (yet)</h3>'.PHP_EOL; exit;
581 | }
582 | #---------------------------------------------------------------------------
583 | $SITE['wsRealTime'] = 1*60+30; // number of seconds before realtime (or clntraw) data is considered obsolete
584 | $SITE['wsNormTime'] = 5*60+30; // number of seconds before (tags) data is considered obsolete
585 | $SITE['wsFtpTime'] = 60*60+30; // number of seconds before all data (graphs) is considered obsolete
586 | $SITE['wsDataTime'] = 5*60+30; // number of seconds before all data (actual internal time) is considered obsolete
587 | #---------------------------------------------------------------------------
588 |
589 | $SITE['langDir'] = 'lang/'; // all language translation files are store here
590 |
591 | return;
592 | # --------------- functions for checking settings --------------------------------------
593 | function ws_print_warning ($message) {
594 | global $SITE;
595 | if ($SITE['wsDebug']) echo $message.'<br />'.PHP_EOL;
596 | }
597 | function ws_check_setting (&$setting) {
598 | global $SITE;
599 | if (!isset ($setting) ) {return false;}
600 | elseif ($setting == false) {return false;}
601 | elseif ($setting === true) {return true;}
602 | elseif ($setting == 'yes') {return true;}
603 | elseif ($setting == '1') {return true;}
604 | else return false;
605 | }
606 | function check_topfolder ($check=true) {
607 | global $SITE;
608 | if ($check <> true) {return true;}
609 |
610 | $docRoot = $_SERVER['DOCUMENT_ROOT'].'/';
611 | # $docRoot = str_replace ('//','/',$docRoot);
612 | $string = $_SERVER['SCRIPT_FILENAME'];
613 | $folders = str_replace($docRoot , '', $string);
614 | $folders = str_replace('\\' , '/', $folders);
615 | $arr = explode ('/', $folders);
616 | $count = count($arr);
617 | $n = $count - 1;
618 | switch ($count) {
619 | case 2:
620 | $FIND['topfolder'] = $arr['0'].'/';
621 | break;
622 | case 1:
623 | $FIND['topfolder'] = './';
624 | break;
625 | default:
626 | $end = $count - 2;
627 | $FIND['topfolder'] = '';
628 | for ($i = 0; $i <= ($end); $i++) { // assemble the topfolder
629 | $FIND['topfolder'] .= $arr[$i].'/';
630 | }
631 | $end++;
632 | }
633 | if ($SITE["topfolder"] <> $FIND['topfolder']) {
634 | ws_print_warning ('WARNING - Change wsUserSettings.php: $SITE["topfolder"] from : '.$SITE["topfolder"].' to: '.$FIND['topfolder']);
635 | }
636 | }
637 | function ws_date_format() {
638 | global $SITE, $my_date_format, $my_char_sep, $my_month, $my_year, $my_day;
639 |
640 | if (!isset ($my_date_format) ) {
641 | $SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/';
642 | $SITE['my_date_format'] = 'dd-mm-yyyy';
643 | return false;
644 | }
645 | else {$SITE['my_date_format'] = $my_date_format;}
646 | #
647 | if ($my_date_format == 'dd-mm-yyyy') {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '-'; return true;}
648 | elseif ($my_date_format == 'dd-mm-yy') {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '-'; return true;}
649 | elseif ($my_date_format == 'dd/mm/yyyy') {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return true;}
650 | elseif ($my_date_format == 'dd/mm/yy') {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return true;}
651 |
652 | elseif ($my_date_format == 'mm-dd-yyyy') {$SITE['tags_ymd'] = array (3,1,2); $SITE['tags_ymd_sep'] = '-'; return true;}
653 | elseif ($my_date_format == 'mm-dd-yy') {$SITE['tags_ymd'] = array (3,1,2); $SITE['tags_ymd_sep'] = '-'; return true;}
654 | elseif ($my_date_format == 'mm/dd/yyyy') {$SITE['tags_ymd'] = array (3,1,2); $SITE['tags_ymd_sep'] = '/'; return true;}
655 | elseif ($my_date_format == 'mm/dd/yy') {$SITE['tags_ymd'] = array (3,1,2); $SITE['tags_ymd_sep'] = '/'; return true;}
656 | # no valid setting found so far
657 | if (!isset ($my_char_sep) ) {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return false;}
658 | $SITE['tags_ymd_sep'] = trim($my_char_sep);
659 | if (strlen ($SITE['tags_ymd_sep']) <> 1) {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return false;}
660 | # the separator is Ok, lets check the yy mm dd
661 | if (!isset ($my_month) || !isset ($my_year) || !isset ($my_day) )
662 | {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return false;}
663 | if (!is_numeric($my_month) || !is_numeric($my_year) || !is_numeric($my_day) )
664 | {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return false;}
665 | $my_month = (int) $my_month;
666 | $my_year = (int) $my_year;
667 | $my_day = (int) $my_day;
668 | $total = $my_month + $my_year + $my_day;
669 | if ($total <> 6) {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return false;}
670 | $error = false;
671 | if ($my_month > 3 || $my_month < 1) {$error = true;}
672 | if ($my_year > 3 || $my_year < 1) {$error = true;}
673 | if ($my_day > 3 || $my_day < 1) {$error = true;}
674 | if ($error) {$SITE['tags_ymd'] = array (3,2,1); $SITE['tags_ymd_sep'] = '/'; return false;}
675 | $SITE['tags_ymd'] = array ($my_year,$my_month,$my_day);
676 | return true;
677 | }