Customised templates: Difference between revisions
From Cumulus Wiki
Jump to navigationJump to search
m (→Replacing HTML by PHP: tidy up) |
|||
Line 364: | Line 364: | ||
#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: | #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> | <code><!DOCTYPE HTML> | ||
<html> | <html> | ||
<head> | <head> | ||
<meta charset="UTF-8"> | <meta charset="UTF-8"> | ||
<meta name="description" content="<#location> weather data" /> | <meta name="description" content="<#location> weather data" /> | ||
<meta name="keywords" content="Cumulus, <#location> weather data, weather, data, weather station" /> | <meta name="keywords" content="Cumulus, <#location> weather data, weather, data, weather station" /> | ||
<title><?php | <title><?php | ||
include 'cumuluswebtags.php'; | include 'cumuluswebtags.php'; | ||
echo "$location"; | echo "$location"; | ||
?>weather</title> | ?>weather</title> | ||
<link href="weatherstyle.css" rel="stylesheet" type="text/css" /> | <link href="weatherstyle.css" rel="stylesheet" type="text/css" /> | ||
</head> | </head> | ||
<body> | <body> | ||
<div id="content"> | <div id="content"> | ||
<h1><?php | <h1><?php | ||
echo "$location"; | echo "$location"; | ||
?> weather</h1> | ?> weather</h1> | ||
.... | .... | ||
<table style="width:100%;border-collapse: collapse; border-spacing: 0;" > | <table style="width:100%;border-collapse: collapse; border-spacing: 0;" > | ||
<caption>This month's highs and lows</caption> | <caption>This month's highs and lows</caption> | ||
<tr> | <tr> | ||
<td colspan="3" class="tableseparator_temp">Temperature and Humidity </td> | <td colspan="3" class="tableseparator_temp">Temperature and Humidity </td> | ||
</tr> | </tr> | ||
<tr class="td_temperature_data"> | <tr class="td_temperature_data"> | ||
<?php | <?php | ||
echo "<th>Highest</th>"; | echo "<th>Highest</th>"; | ||
echo "<td>$MonthTempH $tempunit</td>"; | echo "<td>$MonthTempH $tempunit</td>"; | ||
echo "<td>$MonthTempHT on $MonthTempHD</td>"; | echo "<td>$MonthTempHT on $MonthTempHD</td>"; | ||
echo "<th>Lowest</th>"; | echo "<th>Lowest</th>"; | ||
echo "<td>$MonthTempL $tempunit</td>"; | echo "<td>$MonthTempL $tempunit</td>"; | ||
echo "<td>$MonthTempLT on $MonthTempLD</td>"; | echo "<td>$MonthTempLT on $MonthTempLD</td>"; | ||
?> | ?> | ||
</tr> | </tr> | ||
Line 402: | Line 432: | ||
echo <<< END_OF_QUOTE | echo <<< END_OF_QUOTE | ||
<tr> | <tr> | ||
<td colspan="2" class="spacer">Pressure (sea level)</td> | <td colspan="2" class="spacer">Pressure (sea level)</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<th class="labels">Lowest</th> | <th class="labels">Lowest</th> | ||
<td class="site_data">$MonthPressL {$pressunit}</td> | <td class="site_data">$MonthPressL {$pressunit}</td> | ||
<td class="time_stamp">at $MonthPressLT on $MonthPressLD</td> | <td class="time_stamp">at $MonthPressLT on $MonthPressLD</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<th class="labels">Highest</th> | <th class="labels">Highest</th> | ||
<td class="site_data">$MonthPressH {$pressunit}</td> | <td class="site_data">$MonthPressH {$pressunit}</td> | ||
<td class="time_stamp">at $MonthPressHT on $MonthPressHD</td> | <td class="time_stamp">at $MonthPressHT on $MonthPressHD</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
END_OF_QUOTE; | END_OF_QUOTE; | ||