• English
  • Nederlands

User Tools

Site Tools


en:startpage

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Build your own startpage ====== ===== Which components can you choose from ===== There is an ever growing number of components to choose from to make your own startpage. If you just installed the template you have a modest startpage (p=wsStartpage) and a demo startpage (p=wsStartpageDemo) which shows all components available for your region/country and your weatherprogram. ^component ^remark ^description^ |**The old fashioned "dashboard"** ||| |ajax | JS |Standard 'ajax" dasboard | |**Air quality** ||| |aqhi_map | |"Air-Quality" 4 maps,region 'america' only | |aqhi | |"Air-Quality" diagram, region 'america' only | |AQ | |"Air-Quality" diagram, region 'canada' only | |**"Realtime"** ||| |wdlive | JS, flash |WeatherDisplay-Live uses clientraw*.txt files | |wdliveplug| JS, flash |WeatherDisplay-Live no files needed, needs a subscription at **Meteoplug** | |wulive | JS, flash |WeatherUnderground live | |mwlive | flash |A relative old FLASH dashboard | |meteoplug | |Meteoplug dashboard, needs Meteobridge or a subscription at **Meteoplug** | |steel2rows| JS |Subset of Steelseries page 2 rows gauges | |steel1row | JS |Subset of Steelseries page 1 row gauges | |**radars** || |rain | |Small version of the available rain radars for your region| |radar | |3 small images of rain- thunder- and cloud radar | |**Forecasts** ||| |uv | |UV forecast | |fc | |Condensed version of a forecast | |zam | |Zambretti forecast, not to be taken to seriously! | |davis | |Davis weatherstation text forecast | |knmi | |Netherlands-Dutch only text forecast | |yrno | |Meteogram 2 day YrNo forecast | |yowindow | JS, flash |YoWindow | | **Other** ||| |soil | |Soil temp/moisture is attached sensors are supported by your weatherprogram | |earth | |Night / day view of the earth | |metars | |weather in 5 cities nearby using your nearby metars| |yahoos | |weather in 5 cities nearby using yahoo PROBLEMS as Yahoo upped protection, use with care | |socials | |A componernt to display your twitter and or your facebook information | Remarks: * JS => uses javascriptto retrieve new data every so manu seconds * Flash => less interesting as iPad and latest Android or Windows tablets do not support Flash anymore ===== Customize the page ===== Open wsStartpage.php in a decent program editor. The list to be displayed is at the beginnig of the script: Just to explain i will show you a few <code> $dashboard[] = 'ajax'; $dashboard[] = 'wdlive'; </code> **$dashboard[]** is an array which is loaded with your choices from all lines WITHOUT a comment mark # at the first position of the line. \\ The text after the **=** sign is one choice , in this example the **ajax** dashboard and **wdlive** (small version for dashboard) will be shown on the startpage. WD-live will only be shown when your weather-program can upload the 4 files needed. Customize:\\ ** 1** set a comment mark at all lines you do not want to use\\ ** 2** remove a comment mark (if it is there) on all lines you want to use\\ ** 3** **move** all lines you want to use to the upper part just below <code>#---------------------------- SETTINGS: ------------------------------ # Rearrange and place here the lines you want to use </code> ** 4** Move the lines also in the correct sequence. Example: <code>#---------------------------- SETTINGS: ------------------------------ # Rearrange and place here the lines you want to use $dashboard[] = 'ajax'; // ajax dashboard $dashboard[] = 'fc'; // soil fc=forecast AQ=air quality $dashboard[] = 'yo'; // yo=yowindow # leave all other lines WITH a comment mark below this one #---------------------------- NOT USED: ------------------------------ # old fashioned dashboard # air quality #$dashboard[] = 'aqhi_map'; // US air quality maps #$dashboard[] = 'aqhi'; // US air quality sliders #$dashboard[] = 'AQ'; // cananda air quality # "realtime displays" #$dashboard[] = 'wdlive'; // weatherDisplay live #$dashboard[] = 'wdliveplug'; // weatherDisplay alternative meteoplug #$dashboard[] = 'wulive'; // wulive . . . and all other lines . . </code> That is all. Do not change more, especialy do not change anything bewlow the line with: <code>#----------------------------------------------------------------------- # PLEASE DO NOT CHANGE ANYTHING BELOW THIS LINE #----------------------------------------------------------------------- </code> ===== Add new / your own components ===== New components will come available from me or from other developers. And you can make new scripts and add them as components to the startpage yourself. So lets go step by step through the development process: - Copy the **_my_scripts/my_NewPage.php** script and give it a new name: **my_component_1.php** - To test the component, place it in your menu by adding it to the wsMenuData.xml file\\ <code><item nr = "1000" hide = "yes" caption = "test component" link = "_my_scripts/my_component_1.php" /></code>With **hide = "yes"** in a menu entry you can run the script but it will not be shown in the menu for a normal visitor. - Test your script/component www.uwwebsite.xyz/weather??/?p=1000 using the number as typed in the previous step - When you are happy with the functioning of your new script, it is time to add the new script to your startpage. - Add the following code <code> if ($dashboard[$iDash] == 'my_component_1') { $script = '_my_scripts/my_component_1.php'; if (is_file($script) ) { ws_message ( '<!-- module wsStartPage.php ('.__LINE__.'): loading '.$script.' -->');include $script;} else { ws_message ( '<!-- module wsStartPage.php ('.__LINE__.'): '.$script.' not found -->', true);} continue; } </code>to the bottom of wsStartPage.php **before** the last **}**.\\ It should look like this <code> if ($dashboard[$iDash] == 'my_component_1') { $script = '_my_scripts/my_component_1.php'; if (is_file($script) ) { ws_message ( '<!-- module wsStartPage.php ('.__LINE__.'): loading '.$script.' -->');include $script;} else { ws_message ( '<!-- module wsStartPage.php ('.__LINE__.'): '.$script.' not found -->', true);} continue; } }</code>**Make sure that you did not add the extra code after the last }** - In the previous step you added the code to execute your new script on the start-page. You now have to add the selection in the list of components which should be displayed. That list at the top of wsStartPage.php should look like this <code># Rearrange and place here the lines you want to use, without a comment mark $dashboard[] = 'ajax'; // ajax dashboard $dashboard[] = 'uv'; // uv 6 day forecast + explanation dropdown $dashboard[] = 'fc'; // one of the forecast as based on settings $dashboard[] = 'soil'; // soil sensors $dashboard[] = 'my_component_1'; // example how to add your own or brand new components </code>So we added our new compent as the last one on the startpage. All done, succes with developing your own components. If they are usefull to others also, please mention them on the different forums also.

en/startpage.1463558389.txt.gz · Last modified: 2016/05/18 07:59 by wvdkuil