Weather by You!

Templates and Projects support => Templates and Projects discussion => Topic started by: CrasHBoneS on August 08, 2012, 07:05:22 AM

Title: Weather Blues Template: htm to php
Post by: CrasHBoneS on August 08, 2012, 07:05:22 AM
Hi all

I set up Cumulus to upload and process cumuluswebtags.txt->cumuluswebtags.php

I would like to avoid Cumulus process and upload every time "standard page"

How do I upgrade, for example, indexT.htm to index.php, using cumuluswebtags.php?
I used this code, but I don't know how to apply to my index.htm
Code: [Select]
<?php 
 
require_once("cumuluswebtags.php");
 echo 
$time;
 echo 
"<br/>";
 Echo 
"The current forecast is " $forecast;
?>

this is my index.htm, can someone suggest me how to use php coding?
I don't want the whole page "translated" to php, but only some example, thank You

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso8559-1" />
<title><#location> | Dati attuali</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<LINK REL="shortcut icon" HREF="../favicon.ico">
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/clockt.js"></script>
<script type="text/javascript" src="js/clockp.js"></script>
</script>
</script>
</head>
<body>
<center>
<script type="text/javascript">
/* <![CDATA[ */
document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=728X90/r='+new Date().getTime()+'"><\/s'+'cript>');
/* ]]> */
</script>
</center>
<div id="bg_clouds">
<div id="main">
<!-- header begins -->
<div id="ident">
<div id="logo">
<div style="border:0px solid black; width:600px; height:90px; position:absolute; left:50%; margin:-20px 0 0 -500px;">
<a href="#"><img border="0" src="images/logometeobellaria.png" width="600" height="90" alt="MeteoBellaria" title="MeteoBellaria"></a>
</div>
<br />
<br />
<br />
<br />
<h1><a href="#" id="metamorph">Bellaria Igea Marina, Rimini, Italia</a></h2>
</div>
</div>
<div style="border:0px solid black; width:56px; height:56px; position:absolute; left:50%; margin:-45px 0 0 100px;">
<a href="https://www.facebook.com/pages/Meteo-Bellaria/347635548633937" target="_blank"><img border="0" src="images/Facebook.png" width="56" height="56" alt="Seguici su Facebook" title="Seguici su Facebook"></a>
</div>
<br />
<br />
<br />
<!--  Main menu  -->
<div id="buttons">
<a href="gauges.htm" class="but" title="Dati meteo real-time" style="height: 45px;padding-top:10px">Real<br />Time</a>
<a href="index.htm" class="but but_t" title="Dati attuali" style="height: 45px;padding-top:10px">Dati<br />attuali</a>
<a href="today.htm" class="but" title="Dati odierni">Oggi</a>
<a href="yesterday.htm" class="but" title="Dati del giorno precedente">Ieri</a>
<a href="thismonth.htm" class="but" title="Dati mensili">Mese</a>
<a href="thisyear.htm" class="but" title="Dati annuali">Anno</a>
<a href="record.htm" class="but" title="Estremi registrati">Records</a>
<a href="noaareports.htm" class="but" title="NOAA Reports" style="height: 45px;padding-top:10px">NOAA<br />Reports</a>
<a href="trends.htm" class="but" title="Grafici" style="height: 45px;padding-top:10px">Grafici<br />Cumulus</a>
<a href="trendsGW.htm" class="but" title="Grafici GraphWeather" style="height: 45px;padding-top:10px">Grafici <br />GW</a>
</div>
<div id="buttons">
<a href="satellite.htm" class="but" title="Situazione dal satellite">Satellite</a>
<a href="trendsGW.htm" class="but" title="Immagini in diretta">Webcam</a>
<a href="trendsGW.htm" class="but" title="Immagini">Gallery</a>
<a href="infos.htm" class="but" title="Informazioni sull'installazione">Info</a>
</div>
<div style="height:15px"></div>
<!-- header ends -->
<div class="header_top"></div>
<div class="header">
<div id="wrapper">
<div id="slider-wrapper">       
<div id="slider" class="nivoSlider">
<img src="images/header.jpg" alt="" />
<img src="images/header2.jpg" alt=""/>
<img src="images/header3.jpg" alt="" />
<img src="images/header4.jpg" alt="" />
<img src="images/header5.jpg" alt="" />
<img src="images/header6.jpg" alt="" />
<img src="images/header7.jpg" alt="" />
</div>
</div>
</div>
</div>
<div class="header_bot"></div>
<div style="height:15px"></div>
<!-- content begins -->
<div class="cont_top"></div>
<div id="content">
<div class="razd_lr_h">
<div id="left_h">
<h1 style="padding-top:15px">Benvenuto a Bellaria Igea Marina!</h1>
<p>La stazione meteorologica utilizzata &egrave; la <#stationtype>, queste pagine sono aggiornate ogni  <#interval> minuti. Termine del giorno meteorologico: 
mezzanotte.
</p>
<br />
<!-- <h1>Tempo previsto: <span style="color: #000"><#forecast></span></h1><br />-->
<!-- WEATHER DATA BEGIN -->
<table width="100%"  border="0" cellpadding="0" cellspacing="0" summary="Observations actuelles">
<caption style="text-align: left;"><strong>Condizioni attuali alle ore <#time format="h:nn"> di <#date format="dddd, d mmmm yyyy"> </strong></caption>
<tr>
<td colspan="4" class="input_txt2">TEMPERATURA E UMIDITA'</td>
</tr>
<tr class="td_data">
<td>Temperatura </td>
<td><#temp> <#tempunit></td>
<td>Temperatura apparente</td>
<td><#apptemp> <#tempunit></td>
</tr>
<tr class="td_data">
<td>Trend orario</td>
<td><#temptrend> <#tempunit></td>
<td>Temperatura bulbo umido</td>
<td><#wetbulb> <#tempunit></td>
</tr>
<!--  Humidex for summer
<tr class="td_data">
<td>Humidex</td>
<td><#heatindex> <#tempunit></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr> -->
<tr class="td_data">
<td>Temperatura media</td>
<td><#avgtemp> <#tempunit></td>
<td>Umidità</td>
<td><#hum>%</td>
</tr>
<tr class="td_data">
<td>Indice di calore</td>
<td><#heatindex> <#tempunit></td>
<td>Punto di rugiada</td>
<td><#dew> <#tempunit></td>
</tr>
<tr class="td_data">
<td>Windchill</td>
<td><#wchill> <#tempunit></td>
<td>Altezza nuvole</td>
<td><#cloudbase></td>
</tr>
<tr>
<td colspan="4" class="input_txt2">PRECIPITAZIONI</td>
</tr>
<tr class="td_data">
<td>Rain rate</td>
<td><#rrate> <#rainunit>/hr</td>
<td>Totale odierno</td>
<td><#rfall> <#rainunit></td>
</tr>
<tr class="td_data">
<td>Precipitazioni ultima ora</td>
<td><#rhour> <#rainunit></td>
<td>Totale mensile</td>
<td><#rmonth> <#rainunit></td>
</tr>
<tr class="td_data">
<td>Precipitazioni dalla mezzanotte</td>
<td><#rmidnight> <#rainunit></td>
<td>Totale annuale</td>
<td><#ryear> <#rainunit></td>
</tr>
<tr class="td_data">
<td>Precipitazioni ultime 24 ore</td>
<td><#r24hour> <#rainunit></td>
<td>Ultime precipitazioni</td>
<td><#LastRainTipISO></td>
</tr>
<tr>
<td colspan="4" class="input_txt2">VENTO</td>
</tr>
<tr class="td_data">
<td>Velocità del vento (ultima lettura)</td>
<td><#wlatest> <#windunit></td>
<td>Direzione del vento (ultima lettura)</td>
<td><#currentwdir></td>
</tr>
<tr class="td_data">
<td>Raffica (media su 10 minuti)</td>
<td><#wgust> <#windunit></td>
<td>Direzione (°)</td>
<td><#bearing></td>
</tr>
<tr class="td_data">
<td>Velocità (media su 10 minuti)</td>
<td><#wspeed> <#windunit></td>
<td>Direzione media del vento</td>
<td><#avgbearing>&deg; <#wdir></td>
</tr>
<tr class="td_data">
<td>Scala Beaufort</td>
<td><#beaufort></td>
<td><#beaudesc></td>
<td>-</td>
</tr>
<tr>
<td colspan="4" class="input_txt2">PRESSIONE (normalizzata al livello del mare)</td>
</tr>
<tr class="td_data">
<td>Pressione relativa</td>
<td><#press> <#pressunit></td>
<td><#presstrend></td>
<td><#presstrendval> <#pressunit>/hr</td>
</tr>
<tr class="td_data">
<td>Pressione assoluta</td>
<td><#altimeterpressure> <#pressunit></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4" class="input_txt2">EFFEMERIDI</td>
</tr>
<tr class="td_data">
<td>Il sole sorge</td>
<td><#sunrise></td>
<td>Il sole tramonta</td>
<td><#sunset></td>
</tr>
<tr class="td_data">
<td>Alba</td>
<td><#dawn></td>
<td>Crepuscolo</td>
<td><#dusk></td>
</tr>
<tr class="td_data">
<td>La Luna sorge</td>
<td><#moonrise></td>
<td>La Luna tramonta</td>
<td><#moonset></td>
</tr>
<tr class="td_data">
<td>Durata del giorno</td>
<td><#daylength></td>
<td>Durata della luce</td>
<td><#daylightlength></td>
</tr>
<tr>
<td colspan="4" class="input_txt2">DOVE SIAMO</td>
</tr>
<tr class="td_data">
<td>Latitudine </td>
<td><#latitude></td>
<td>Longitudine</td>
<td><#longitude></td>
</tr>
<tr class="td_data">
<td>Altitudine </td>
<td colspan="3"><#altitude></td>
</tr>
</table>
<p class="credits" style="margin:10px 25px 0px 0px; text-align:right">
Update : <#update><br />
Powered by <a href="http://sandaysoft.com/products/cumulus">Cumulus</a> v<#version> (<#build>)
</p>
<div style="clear: both"></div>
</div>
<div id="right_h">
<div class="pan_clock">
<div class="local_time">
<h1 style="padding: 5px 0px; text-align:center">Ora locale</h1>
<p><strong>Bellaria Igea Marina</strong></p>
<p><strong>Rimini, Italia</strong></p>
</div>
<div id="clock_a" class="clock"></div>
</div>
<div class="pan observ" style="margin-top:5px">
<h2 style="padding-top:10px;">Situazione meteo</h2>
<table style="text-align:center; padding:30px 25px 20px 0px" summary="Most recent observations">
<tr>
<td style="text-align:right">Temperatura:</td>
<td style="text-align:left"><strong><#temp></strong><#tempunit></td>
</tr><tr>
<td style="text-align:right">Umidità:</td>
<td style="text-align:left"><strong><#hum></strong>%</td>
</tr><tr>
<td style="text-align:right">Velocità del vento:</td>
<td style="text-align:left"><strong><#wspeed></strong> <#windunit></td>
</tr><tr>
<td style="text-align:right">Direzione:</td>
<td style="text-align:left"><strong><#wdir></strong></td></tr>
</table>
<p style="text-align: center"><#date format="dddd, d mmmm yyyy"></p>
<font size="2">
<p style="text-align: center">Ultimo aggiornamento alle <#time format="h:nn"></p>
</font>
</div>
<div class="pan forec">
<h2>Previsione <em><font size="2">(prossime 12 ore)</small></em></font></h2>
<img src="images/meteo/<#forecastnumber>.png" style="padding: 25px 0px 0px 50px" alt="Forecast icon" title="Forecast icon" />
<p style="text-align:center; padding: 20px 0px 0px 0px"><span style="color: #000"><#forecast></span></p>
</div>
<div class="pan night" style="margin-bottom:5px;">
<h2>Fase lunare</h2>
<img src="images/moon.bmp" style="padding: 50px 0px 52px 70px" alt="Forecast icon" title="Forecast icon" />
<p style="text-align:center"><strong><#moonphase></strong><br />
<font size="2">
Visibile al <strong><#MoonPercentAbs>%</strong></p>
</font>
</div>
</div>
<div style="clear: both"></div>
</div>
</div>
<div class="cont_bot"></div>
    <!-- content ends -->
<!-- footer begins -->
<div id="footer">
<a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a> | Weather Blues Template by <a href="http://meteoduquebec.com/english.html">Météo du Québec</a>
<p style="width:100%; font-family:helvetica; font-size:10px; color:#fff">Copyright  2011. <!-- Do not remove -->Designed by <a href="http://www.metamorphozis.com/free_templates/free_templates.php" title="Free Web Templates">Free Web Templates</a>, coded by <a href="http://www.myfreecsstemplates.com/" title="Free CSS Templates">Free CSS Templates</a><!-- end --></p>
</div>
<!-- footer ends -->
</div>
</div>
<script type="text/javascript" src="lib/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="lib/jquery.nivo.slider.pack.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
<div style="border:0px solid black; width:112px; height:62px; position:absolute; left:50%; margin:25px 0 0 -56px;">
<!-- Histats.com  (div with counter) --><div id="histats_counter"></div>
<!-- Histats.com  START  (aync)-->
<script type="text/javascript">var _Hasync= _Hasync|| [];
_Hasync.push(['Histats.start', '1,2019191,4,328,112,62,00011010']);
_Hasync.push(['Histats.fasi', '1']);
_Hasync.push(['Histats.track_hits', '']);
(function() {
var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;
hs.src = ('http://s10.histats.com/js15_as.js');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);
})();</script>
<noscript><a href="http://www.histats.com" target="_blank"><img  src="http://sstatic1.histats.com/0.gif?2019191&101" alt="contatore utenti connessi" border="0"></a></noscript>
<!-- Histats.com  END  -->
</div>
</body>
</html>
Title: Re: Weather Blues Template: htm to php
Post by: Mr.Meteo on August 08, 2012, 07:55:58 AM
Hi Crash,

For php migration, it's easy as for your first page you could just rename your file from .htm to .php
...that's it! you have created your 1st Php page!

Php has to be viewed as a html file writer; Php is just filling "holes" in your html file with information
or caculation it does. in example above, he find no hole to process, then it display only html content!

For the case of Cumulus weather pages, there is a lot of "holes" to fill as you have to replace all
Cumulus webtags by it's Php version. I don't know your cumuluswebtags.txt file as I used mine
in all my projects. but principle stay the same. Suppose you enconter a Cumulus webtag like this:

<p><#temp></p> // For current température
You're searching to replace only <#temp> (the php "hole"), like this:
<p><?php echo $temp ?></p>

Then you example is good, but it lacks html tags, then your page will contain "validation errors"
and will appear as plain text!

Your project is a good idea to learn Php, but Weather Blues v2 is already a "full php" version!
and I used IS, because I'm at end, some tweaking to do in Template Manager Module and
installation/configuration instructions to do! About 2 or 3 days before launch!
(You could see this link to see how it work: http://weatherbyyou.com/ws_sheet.php)

Tnen, welcome to Php world!

Regards,
Jacques
Title: Re: Weather Blues Template: htm to php
Post by: CrasHBoneS on August 08, 2012, 04:15:35 PM

Your project is a good idea to learn Php, but Weather Blues v2 is already a "full php" version!
and I used IS, because I'm at end, some tweaking to do in Template Manager Module and
installation/configuration instructions to do! About 2 or 3 days before launch!
(You could see this link to see how it work: http://weatherbyyou.com/ws_sheet.php)

Tnen, welcome to Php world!

Regards,
Jacques

thank You very much for help
I'll be waiting V2 weather blues
1)I like php
2)I like very much new menù button bar