Level:
Intermediate+
Official release:
2012-12-02
Prerequisite:
Php v5.x+
Javascript
Cumulus v1.9.3+
Features:
12 pages
Multilingual
Update module
Modules addons
Links:
Tools suggested:
In previous page, you have created a new folder to contain all files and folders of your new Weather Eden template and we have take a look on the most important files it contains.
Also, we have talked about why so many files? And the "law of least effort", consisting to seperate the content to be repeated all over again, and to not duplicate tedious tasks which in the end will give us more time for creations and customizations.
Finally, I indicated NEVER to modify files, as they will be updated frequently! (files ending with "_txt.php" and files in lang folder!
Now that you know Weather Eden's principle of operation, you could begin to edit it for your own needs. I've keep it very short and simple!
Weather Eden header section is identified by this: <div id="header"> and contain these texts:
- <?php echo $location; ?> (the Station Name in Cumulus configuration)
- Dreaming weather template (your site's slogan)
You simply have to edit these 2 lines to identify your weather site. Take time to fill it at your very best, because these 2 lines will probably be used by search engines (as Google, Yahoo, etc...) to identify your site; the more it's accurate and attractive the more you will be visited!
Weather Eden provides a list of 11 different languages that could be selected in any pages within the language selector box. These languages are stored in a separate language file and each of these files are available in the lang folder. Filenames are ending with 2 letters language abbreviation, as this:
text_standard_XX.php, where "XX" is the language code.
You see below a list of languages code used at time of template launch:
Abbr | Language | Abbr | Language |
---|---|---|---|
cz | Czech | en | English |
es | Spanish | fi | Finnish |
fr | French | it | Italiano |
nl | Dutch | no | Norwegian |
pl | Polish | sl | Slovenian |
sv | Swedish |
In each pages, you will find in first lines a language module, where default language is defined. At line #18, you will find that line:
$lang = 'en'; // Default language
If you want to change default language for your website, simply change language code ('en' in that example) with one included in your lang folder.
To have Cumulus data in you pages, you need 2 different files:
For months page only:
wt_month_inc.php
For all other pages:
wt_data_inc.php
These files are offered in 2 "flavors". The first one is for English and other languages managed well by Pc with Ascii characters and accomodated by web pages with iso-8559-1 charset. The second is the "international" file for all other languages mainly with accented characted not included in Ascii basic character set and needing web pages with "Utd-8" charset.
These files are for "English" configuration:
wt_data_inc.php, and wt_month_inc.php
For all "foreign" languages:
wt_data_intl.php, and wt_month_intl.php
If you decide to use the "international" version, you have to rename them to be recognized by your template. Simply delete files wt_data_inc.php, and wt_month_inc.php before renaming _inc.php files
Note that if you want to display all languages available with your template, you "must" use the international ("_intl" files) version.
Now that you have choosen your data files, you could also choose how dates will be presented; to do so edit wt_data_inc.php and wt_month_inc.php files. In the first lines, you will see these lines:
$to = "to "; // Ex: to 20 may
$pre_time ="at "; // Ex: at 10:45
$pre_date = " on "; // Ex: on 25 may
$only_date = "on "; // Ex: On 25 may
Like explain in each lines, these variable has been added to Cumulus date and time to normalize these timestamp. You could define your own words or let them empty to have nothing to "surround" your date and/or time.
Weather Eden provide 3 different page to suit your configuration and offer alternative page for disabled Javascript visitors.
This file is for "no-js" configuration:
gauges.php
For all others:
gauges_ss.php or gauges_ssUV.php(*)
(*)Only if you have UV/Solar sensors,
Now that you have prepared and configured your template, it's time to send it to your web-site. If you already have a weather template, like the Cumulus standard, you need to wipe it from your website to avoid a mix between that one and your new Weather Eden template. To install your template, you simply need to take all Weather Eden files and folders and send them to your web site, using your prefered ftp software. .
Now that you have sent (uploaded) your new template, it's time to tell Cumulus to use it! To do so, start Cumulus and go to menu: Configuration --> Internet --> Files tab. That will bring you a screen as the one you see (partly) in the image shown below
First thing you have to do is to unselect option "Include Standard Files" as we don't want Cumulus to send its standard template at the same time as your Weather Eden template. Also, be sure to keep the option "Include Standard Images" checked as we want to use Cumulus graphs.
Now, it's time to tell Cumulus to process our data files: wt_data_inc.php and wt_month_inc.php. To do this, you have to fill 2 lines, as indicated below:
To process your template, Cumulus need 4 informations:
Then, for our data file we have to enter the fields in this way:
This example is for the wt_data_inc.php file, then you have now to repeat it 2 times.
On a new line replace filename with the public_html/wt_month_inc.php.
Note: In our example, we've show public_html for remote path as it is the most common name used in website configuration, but this could be different on your provider configuration or you could want to send it to a subfolder of your site.
Now, that all is in place, it's time to launch the Template Manager Module on your website to "initialize" you website template (eg. http://MyWeatherSite/manage.php.)
Now, Final: Template Manager Module! >>