it is Christmas time and that also means giving presents – and so here is a little present from me as well – introducing METEOTEMPLATE 3.0 Sour Cherry.
In some perspective, this update is the quite opposite of the Watermelon 2.0 update. Previous update was more about changes under the hood, optimization and especially preparing grounds for further development and fixing bugs of the initial 1.0 release.
This time however, it is especially changes that you can actually “see”. So what is new? There are of course couple of bug fixes, small changes in the code to make the overall experience smoother and more user friendly and also improved error handling. Then there are however, couple of brand new pages and functions, which I would now like to describe.
The absolutely most obvious change in Sour Cherry is a brand new homepage! This was actually in my opinion so far the biggest problem with the template itself. The original homepage was not very well adapted to adding your own stuff, Aeris forecast did not prove to be the ideal and overall I was not satisfied with it.
Well that is now over and there is now a brand new homepage, which uses a completely different concept of viewing stuff and because it is such a big change, it is described on a separate page and I will now list the other changes in the template.
And before I continue, with regards to this update, I would in particular like to thank Jean for his ideas, bug reports and testing, and Zoltán Korpás for the Hungarian translation.
Important: All so far released plugins are fully compatible with this update and require no changes! However, in the future I cannot guarantee newly released plugins will still be compatible with the old versions.
If you need help or do not understand any part of the homepage set up, something does not work or you need support with any other part of the page – PLEASE FEEL FREE TO CONTACT ME, IDEALLY BY EMAIL OR ALTERNATIVELY VIA THIS BLOG OR FORUMS
- NEW – Homepage – described on a separate page
- NEW – indexOld.php – if you decide to stick with the original homepage then it is still of course possible, it is now included in the download files as indexOld.php. And I have made a few tweaks to it for those who wish to use it. I fixed some small CSS problems and it now also shows the time and date of the last update of the current conditions in the left panel.
- NEW – the climate section in the menu has been completely redesigned so that you can now access climate of any city directly from the menu without having to choose particular cities to be included and also giving you more space for other climate-related stuff in the menu.
- NEW – station climate page – building up on the previous new feature, there is now a brand new page “station climate”, which shows you various climatological statistics for your station such as the number of summer or tropical days for particular years as well as overall etc.
- NEW – exporting functions – many tables especially in the reports now have a small toolbar at the top and you can directly export the values from that table into many formats, including JSON, TXT, CSV, XLS or even as a PNG image.
- NEW – gradients – even though you probably already now by this time I am not a fan of gradients, shadows and prefer a simple “material” design, I have implemented the possibility of using gradient colors to those who wish to do so.
- NEW – Hungarian language is now available
- NEW – it is now possible to directly add or remove specific records from the database directly from the admin section of Meteotemplate. Previously it was only possible to edit, you can now completely delete or add rows. In order to prevent potential accidental deletion of the entire database it is however limited to adding/removing rows one at a time, not allowing bulk operations (which are possible to those who know better what they are doing and can do it directly in their phpMyAdmin)
- NEW – website info page – in the info tab is now a new page, which describes your actual website. Originally there was only a page about the actual station. The newly included page info page includes a section about Meteotemplate (please leave it there) and you can add info about your actual website, updates you make to it etc.
- CHANGED – some changes were made in the function responsible for translations. This should prevent problems that were often reported by users, who tried to create their own translations. Previously, passing an unknown string to the function resulted in either an error or nothing, now it simply returns what you passed to it.
- FIX – solar data on annual report was not displayed correctly in some cases
- FIX – wind directions in the monthly report tables were not displayed correctly if language other than English was selected
- FIX – some obsolete functions were replaced in the METAR pages so that the page works fine even with PHP 5.5+
- FIX – some minor changes in the header for faster loading of the menu
- FIX – fixed a bug with gust gauge minimum value in the gauges page
- FIX – the sliding functions in the reports did not work when the header was showing rain
- DISCONTINUED – the dbInfo.php page is no longer part of the template and I highly recommend you do not use it. First of all it is extremely slow and often throws errors and second, some of the calculated values are not even correct.
Now I suggest you read the information about the new homepage – how it works and what it shows and then you can continue with reading here the information how to update.
Just like last time, in the download section are now two packages – one containing the entire template for those who want to do a clean install, and one which is intended for those upgrading from previous version.
Those who want to do a clean install should download the whole package and then follow the instructions for installation given in the Meteotemplate Wiki.
Following text is for those who want to perform an update. The most important thing is – follow the instructions very carefully. The update package does not contain all the files, only the ones that need to be changed, so unless you are told to replace the entire directory, do not simply take all the folders and overwrite the original.
Before you do anything, there is one important thing which cannot be emphasized more – MAKE A BACKUP of all your files in case something goes wrong. Only recently I have again experienced the huge importance of this when I about 2 weeks ago accidentally deleted this entire blog and wiki! One possible way of backing up is simply creating a copy of your meteotemplate files on your server, then rename the folder to “old” and simply perform the update on the copy, which if successful can then be used and the old one deleted. Please also take into account that you have been warned. I have already seen some servers behaving in a very peculiar way and even though the new version has been tested on several servers and configurations I cannot guarantee 100% that everything will go as described below and will not be responsible if your page stops working and you have no way of reverting it back because you did not make a backup.
- Download and extract the update package from Meteotemplate download section
- Now go to your server and delete completely the following folders: css, icons, lang and scripts. Then go to your update package and upload the same folders again to your server (css, lang, icons, scripts). There is just one thing you might need to do. If you do not use the default station icon, then before you delete the folders, save your station.png, then delete the folders, upload the new ones and then overwrite the newly uploaded icons/station.png with your original icon. However, if you forget to do this, it is still not a problem, you can still easily download it from meteotemplate.com.
- Now you need to update the “admin” folder. It is possible that you have edited the admin/index.php, but this file has not been modified and therefore is not part of the update package. What you therefore have to do is open your admin folder on your server and also open the admin folder in the update package. You will see that there are some completely new pages as well as some pages already existing on your server. What you have to do is take all the 5 files from the admin folder in the update package and copy them to your admin folder on your server. It will add the new and overwrite the original ones. admin/index.php will stay untouched.
- Now do the exact same thing with the “pages” folder – open it and overwrite the files that are included in the update package. There is also the new station climate page (climateIndices.php), so simply go through each folder in the pages folder of the update package and it reflects the structure of your files on the server, so either overwrite the original or add the new ones. Make sure you do not just delete the entire pages folder and replace it with the on in the update package – the update only contains some of the files! The folder “other” contains new page where you can describe your homepage. There is some text about the template used and you can add more stuff about your page at the top. So in order to do that, simply open the aboutPage.php and replace the text “This is where you can insert information about your website…” with whatever you want.
- Next step is to go to the update package again and you will see there is now a new directory “homepage”. This directory is completely new and all you have to do is take the entire directory and copy it to your server into the template root folder (so you will have the homepage directory along with the others – icons, css, pages, admin…, just like you see it in the update package).
- Now comes probably the most difficult part and that is the menu. Probably the best way of doing this is to look at your current menu. Note down the plugins you have installed. Also note down any additional links to pages you added yourself. Then go to the update package and open the menu.php in some text editor. What you will see is that in fact all the plugins are included in the menu. They are just commented out. So simply uncomment those that you have installed and if necessary add any other links you had in your original menu. Then save, close and overwrite your original menu. The new menu has a completely redesigned climate section and also bug fixes (the temperature in the weather station tab was showing wrong numbers when negative in the original menu). Also, you will notice there is one new file in the template root called submenuLoader.php. That one also needs to be copied and added to the root directory (next to the menu.php). The new menu.php also has a link to the new “aboutPage” page and the new climate page, which you should have added in the previous step from the “pages” folder.
- Now take footer.php and overwrite the original footer.php.
- Now do the same thing with the header.php, BUT! For some of you the automatic recognition of location by Yahoo, used by the interactive banner, did not work. So, before you replace your header.php. Open the original and go to line 62. This line should begin something like “$url =…..”. Copy the entire line. Then go to your update package and again, open the new header.php and this time, it is line 65, also beginning “$url =”. So simply paste the original line here – in most cases it will look the same, if it does not, use the one from the original. Once you make sure that line 62 of original header is the same as line 65 in the new one, save, close and upload the new header.php.
- If you want to include the Hungarian language (the strings should now be copied with the lang directory which you copied in the previous steps), simply add “hu” to the list of available languages in config.php.
- Config.php is not included in the update package. There is only one thing that needs to be changed in this script. So go to your server, download the config.php (or just edit it). And add the following line somewhere (ideally somewhere where you set the design to make it organized)$gradient = false; // setting this to true will use gradient colors in your templateDefault is false, but obviously, if you want to use the gradients then set this to true (you can later try both to see what exactly it does to the design).
- And now last thing to do is the actual homepage. It is now up to you. If you want to use the original homepage, then what you need to do is use the indexOld.php in the update package and obviously rename it to index.php and overwrite your original index.php. If you want to use the new homepage, then I suggest you read the separate post about it and how to set it up. Basically you just need to open the index.php in the update package and there are detailed instructions inside the file as to what to do and once you fill in all the customizations, you simply take the new homepage (index.php in the update package) and overwrite your original index.php on your server.
Your page should now be fully upgraded to Meteotemplate 3.0 Sour Cherry. As mentioned above, the other pages as well as all the plugins are fully compatible and need no changes to work properly. In the future however, I cannot guarantee newly released plugins will still work properly if sticking with older versions.
Last but not least…. I WISH YOU ALL A VERY NICE CHRISTMAS AND A HAPPY NEW YEAR (yes I know it is such a cliché but still… 🙂
Best regards from the Czech Republic
9 thoughts on “Meteotemplate 3.0 Sour Cherry”
Did not find the upgrade from 2 to 3 Version for download ..
Update done on meteoales.fr. Very good work as usual 🙂
Is it possible to display an image (SAT 24) infrared rather than “visible” on the main page?
Yes, just change the URL in the homepage script to the image you want.
Ok thanks. I have change on the directory from homepage. Good Software. Tanks.
Merci. Cela marche bien maintenant.
If you want to change the icon of the weather station station.png file should be replaced by a different image. But this does not update the image in the ” summary station time span”
correct, but this is not a bug. The homepage simply uses a different set of icons, which is found in the homepage/icons directory.
I have this problem => Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 64 bytes) in /home/httpd/vhosts/meteolausanne.com/httpdocs/meteotemplate/homepage/eqInfo.php on line 21
Aha I see. The problem in this case is: 1. your PHP memory limit is relatively low and 2. there was currently lot of earthquakes. So, we need to make a little fix.
Because your memory limit is lower, instead of loading the earthquakes from the past one month, you need to lower the interval, try this:
Go to homepage directory and open eqInfo.php. Then find line 15 and in the address at the end replace “month” with “week”.
Your final URL will look like this:
$urlEQ = “http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson”;
Do the same thing on line 61, replace “month” with “week”.
Then save, close and replace the eqInfo on your server. Also, open homepage/cache and delete the cache files for EQ. Then try refreshing your page.