User Tools

Site Tools


en:miscellaneous

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:miscellaneous [2015/05/26 15:26]
wvdkuil [Adding a usage counter]
en:miscellaneous [2015/09/17 12:09] (current)
Line 1: Line 1:
 +====== Other things you might need ======
 +===== Adding one extra tag/value to be used on your start-page =====
 +If you want to use a new temperature variable on the current start-screen,​ there are two actions
 +  - Add the tag to a file to be processed and uploaded by the weather program
 +  - Put the value on the screen were you want to display it.
  
 +==== Add it to a file to be processed by your weather program ==== 
 +For this explanation we are going to use WeatherDisplay. But most tag-files have the same format and also the **$ws[]** names are the same. So you can "​translate"​ this description to your own environment.
 +
 +For WD we are going to add the new temp-tag to **tags.wd.txt** . 
 +
 +You find that file in weather28/​scriptsWD/​
 +
 +There are three seldom used weather-variables in all tag-files for display ​
 +extra temperatures in and around the house.
 +<​code>​|tempActInside|%indoortemp%|!
 +|tempActExtra1|%generalextratemp1%|!
 +|tempActExtra2|%generalextratemp2%|!
 +</​code> ​
 +So if not in use already we are going to use one of those fields to contain our new temp-field.
 +<​code>​|tempActExtra1|%maxtempfortodayfromyourdata%|!</​code>​
 +
 +You save the file and  copy the changed tags.wd.txt to your WD webfiles folder on the PC
 +
 +==== Check if those fields are already used ==== 
 +In your wsUserSettings.php ​
 +during your first install ([[en:​check_these_also|Leuven-Template install step 4 of 7]]) 
 +you told the scripts to use and display those fields. ​
 +<​code>#​---------------------------------------------------------------------------
 +# IMPORTANT ​    ​Weather Station sensors and options for dashboard
 +#​---------------------------------------------------------------------------
 +$SITE['​UV'​] ​        = true;   // ##### set to false if no UV sensor
 +$SITE['​SOLAR'​] ​     = true;   // ##### set to false if no Solar sensor
 +$SITE['​tempInside'​] = true;   // ##### set to false if no inside temp sensor available or wanted on Ajax page
 +$SITE['​extraTemp1'​] = false; ​ // ##### set to false if no extra sensor available or wanted on Ajax page
 +$SITE['​extraTemp2'​] = false; ​ // ##### set to false if no extra sensor available or wanted on Ajax page</​code>​
 +Change the setting to true for the field you want to use.
 +<​code>​$SITE['​extraTemp1'​] = true;  // ##### set to false if no extra sensor available or wanted on Ajax page</​code>​
 +==== You have to have a place to add that value to your screen ==== 
 +{{ :​extratags2.jpg?​nolink|}}
 +You could use the default place for that variable which is below the thermometer on the startpage just above high low, as you can see on the image.
 +
 +In the current scripts those two optional ​ fields are displayed according to a setting and if you are not using those fields those settings are now set to false.:
 +
 +^veld op start-pagina ​ ^instelling ​         ^waarde uit WD-tag ​ ^omschrijving bij veld ^
 +|$ws['​tempActInside'​] ​ |$SITE['​insideTemp'​] |%indoortemp% ​      ​|**Inside** ​           |
 +|$ws['​tempActExtra1'​] ​ |$SITE['​extraTemp1'​] |%generalextratemp1% |**Pool** ​           |
 +|$ws['​tempActExtra2'​] ​ |$SITE['​extraTemp2'​] |%generalextratemp2% |**extra2** ​           |
 +Both extra temps use a descriptive string to display which is ALWAYS passed to the language translation script.
 +
 +We need the correct description ​ so we add a language line to weather28/​_my_texts/​wsLanguage-en-<​wrap hi>​local</​wrap>​.txt ​
 +<​code>​langlookup|Pool|Max temp ever|</​code>​
 +Now the text before the value shows the correct description.
 +
 +If done the startpage should display the text you want and the temp from the WD tag you specified in tags.wd.txt
 +
 +You will have to add the langlookup line for every supported language to the corresponding wsLanguage-??​-local.txt files.\\ ​
 +langlookup|Pool|**h e r e    the correct ​ t r a n s l a t i o n**|
 +
 +
 +===== Adding a Pay-Pal button in the side column =====
 +In the side column a donate button can be included:
 +{{  :​paypalbutton.jpg?​nolink|}}
 +You can instruct the display of this button in wsUserSettings.php
 +
 +<​code>#​---------------------------------------------------------------------------
 +# optional donate button
 +#​---------------------------------------------------------------------------
 +if (isset ($SITE['​donateButton'​]) &&​ $SITE['​donateButton'​] == true) {
 + include ('​_widgets/​donateButton.php'​);​
 +}</​code>​
 +
 +In the wsSideColom.php ​ script this setting is cecked and the donate button is added when **true**  ​
 +<​code>#​---------------------------------------------------------------------------
 +# optional donate button
 +#​---------------------------------------------------------------------------
 +if (isset ($SITE['​donateButton'​]) &&​ $SITE['​donateButton'​] == true) {
 + include ('​_widgets/​donateButton.php'​);​
 +}</​code>​
 +
 +As you see above in the wsSideColom.php lines, the code to be included is in
 + ​**weather28/​_widgets/​donateButton.php**
 +<WRAP important 100%>
 +Be aware that this code is an example for 4 languages. You have to generate your own code at the pay-pal organization.
 +Otherwise the donations would go to the developer of the template. After that generation you can 
 +adapt the code in  _widget/
 +
 +===== Adding a usage counter =====
 +{{ :​usagecounter.jpg?​nolink |}}
 +If you start using your Leuven-Template for the first time, 
 +you probably noticed a red usage counter on the bottom of the page. 
 +When you click that counter the browser will open a page at Histats.com. ​
 +
 +You can study the pro and cons of  such a counter and decide either to remove or adapt the counter to your liking. ​
 +As long as you leave the code unchanged you will see the results for the other users who are also just starting ​
 +with the implementation of the template. ​
 +
 +As far as I know the free HiStats counter is save and is never accused of wrong-doing,​ what so ever.
 +==== Adapting the counter ====
 +  * The code for the Histats counter is stored in weather28/​_widgets/​histats.txt
 +
 +  * If you configured your own histats counter use the code you downloaded / copied from their site to replace the code in weather28/​_widgets/​histats.txt
 +<​code>​$SITE['​statsCode'​] ​ = '​./​_widgets/​histats.txt'; ​ //      set your own visitors code or set to false</​code>​
 +  * if you want to use another counter ​
 +    * you can store the needed html/java code in the same manner in a file in weather28/​_widgets/​
 +    * change the setting **$SITE['​statsCode'​]** to point to the right file 
 +<​code>​$SITE['​statsCode'​] ​ = '​./​_myscripts/​my_xyz_counter.txt'; ​ //      set your own visitors code or set to false</​code> ​
 +  * If you do not want a counter set **$SITE['​statsCode'​] = false;**
 +<​code>​$SITE['​statsCode'​] ​ = false; ​ //      set your own visitors code or set to false</​code>​
 + 
en/miscellaneous.txt · Last modified: 2015/09/17 12:09 (external edit)