<when <string-eq "$(WML_SRC_BASENAME)" "view">>
<protect pass=2>
<?
- if ($period == 'thismonth') {
- for ($anno = 2007; $anno <= $maxyear; $anno++) {
- if ($year == $anno)
- printf (' <a href="view.php?type=%s&site=%s&period=thismonth&year=%04d">%04d</a><br>',
- $type, urlencode($site), $anno, $anno);
- else
- printf (' <a href="view.php?type=%s&site=%s&period=thismonth&year=%04d">%04d</a><br>',
+ if (!empty($site)) {
+ for ($anno = $minyear; $anno <= $maxyear; $anno++) {
+ printf (' <a href="view.php?type=%s&site=%s&year=%04d">%04d</a><br>',
$type, urlencode($site), $anno, $anno);
}
}
else
$site = '';
- $maxyear = 2007;
+ $minyear = 2007;
$maxyear = date("Y");
if (isset($_GET["year"]) && is_numeric($_GET["year"]) && $_GET["year"] >= $minyear && $_GET["year"] <= $maxyear)
$year = $_GET["year"];
else
- $year = $maxyear;
+ unset ($year);
$thispage = explode('/', $_SERVER['SCRIPT_NAME']);
$thispage = $thispage[count($thispage)-1];
$link = sprintf("%s?type=%s&site=%s", $thispage, $type, 'total');
emit_image ('total', $type, $period, $link);
} else {
- if ($period === 'thismonth') {
+ if (isset($year)) {
for ($mon = 1; $mon <= 12; $mon++) {
emit_image($site, $type, sprintf('%04d-%02d', $year, $mon), '');
}