Customised templates: Difference between revisions

m
#Then you create a new PHP script that does not get processed by Cumulus. For example "thismonth.php" would start with the same HTML5 as shown above, but the table is output by the PHP script:
<code><!DOCTYPE HTML>
 
<html>
 
<head>
 
<meta charset="UTF-8">
 
<meta name="description" content="<#location> weather data" />
 
<meta name="keywords" content="Cumulus, <#location> weather data, weather, data, weather station" />
 
<title>&lt;?php
 
include 'cumuluswebtags.php';
 
echo "$location";
 
?>weather</title>
 
<link href="weatherstyle.css" rel="stylesheet" type="text/css" />
 
</head>
 
&lt;body>
 
&lt;div id="content">
 
&lt;h1>&lt;?php
 
echo "$location";
 
?> weather</h1>
....
 
&lt;table style="width:100%;border-collapse: collapse; border-spacing: 0;" >
 
&lt;caption>This month's highs and lows</caption>
 
&lt;tr>
 
&lt;td colspan="3" class="tableseparator_temp">Temperature and Humidity </td>
 
</tr>
 
&lt;tr class="td_temperature_data">
 
&lt;?php
 
echo "&lt;th>Highest</th>";
 
echo "&lt;td>$MonthTempH $tempunit</td>";
 
echo "&lt;td>$MonthTempHT on $MonthTempHD</td>";
 
echo "&lt;th>Lowest</th>";
 
echo "&lt;td>$MonthTempL $tempunit</td>";
 
echo "&lt;td>$MonthTempLT on $MonthTempLD</td>";
 
?>
 
&lt;/tr>
 
 
echo &lt;&lt;&lt; END_OF_QUOTE
 
&lt;tr>
 
&lt;td colspan="2" class="spacer">Pressure (sea level)</td>
 
</tr>
 
&lt;tr>
 
&lt;th class="labels">Lowest</th>
 
&lt;td class="site_data">$MonthPressL {$pressunit}</td>
 
&lt;td class="time_stamp">at $MonthPressLT on $MonthPressLD</td>
 
</tr>
 
&lt;tr>
 
&lt;th class="labels">Highest</th>
 
&lt;td class="site_data">$MonthPressH {$pressunit}</td>
 
&lt;td class="time_stamp">at $MonthPressHT on $MonthPressHD</td>
 
</tr>
 
</table>
 
END_OF_QUOTE;
 
5,838

edits