'Jan',2=>'Feb',3=>'Mar',4=>'Apr',5=>'May',6=>'Jun',
7=>'Jul',8=>'Aug',9=>'Sep',10=>'Oct',11=>'Nov',12=>'Dec'];
$fullMonths = [1=>'January',2=>'February',3=>'March',4=>'April',
5=>'May',6=>'June',7=>'July',8=>'August',
9=>'September',10=>'October',11=>'November',12=>'December'];
$slug = isset($_GET['p']) ? preg_replace('/[^a-z0-9_]/','',strtolower($_GET['p'])) : '';
$refMonth = isset($_GET['m']) ? (int)$_GET['m'] : 0;
$plant = null;
if ($slug && file_exists($dataFile)) {
$json = json_decode(file_get_contents($dataFile), true);
if ($json && isset($json['plants'][$slug])) {
$plant = $json['plants'][$slug];
}
}
if (!$plant) {
http_response_code(404);
echo '
Plant not found
';
echo 'â Home';
exit;
}
function actionBadge($action) {
$a = strtolower($action);
if (strpos($a,'sow seed') !== false) return ['type'=>'sow', 'label'=>'Sow Seed', 'icon'=>'ðą'];
if (strpos($a,'seed tray') !== false ||
strpos($a,'start in') !== false) return ['type'=>'tray', 'label'=>'Start in Trays','icon'=>'ðŠī'];
if (strpos($a,'transplant') !== false ||
strpos($a,'plant out') !== false) return ['type'=>'transplant','label'=>'Transplant', 'icon'=>'ðŋ'];
if (strpos($a,'tuber') !== false) return ['type'=>'tuber', 'label'=>'Plant Tubers', 'icon'=>'ðĨ'];
if (strpos($a,'crown') !== false) return ['type'=>'crown', 'label'=>'Plant Crowns', 'icon'=>'ð'];
if (strpos($a,'clove') !== false) return ['type'=>'clove', 'label'=>'Plant Cloves', 'icon'=>'ð§'];
return ['type'=>'general','label'=>'Plant','icon'=>'ðą'];
}
?>
= htmlspecialchars($plant['name']) ?> - Zone 8b
= htmlspecialchars($plant['name']) ?>
Also known as:
= htmlspecialchars(implode(', ', $plant['aliases'])) ?>
ðŠī Pot Friendly
ð Zone 8b
ð About
= htmlspecialchars($plant['description']) ?>
ð Growing Information
âïļ
Plant Spacing
= htmlspecialchars($plant['spacing']) ?>
âïļ
Row Spacing
= htmlspecialchars($plant['row_spacing']) ?>
ð
Plant Height
= htmlspecialchars($plant['height']) ?>
ðĨ
Harvest Time
= htmlspecialchars($plant['harvest_time']) ?>
No growing stats yet. Re-run the scraper for more detail.
ð
Planting Calendar (Zone 8b)
$name):
$hasMonth = isset($plant['months'][strval($num)]);
$badge = $hasMonth ? actionBadge($plant['months'][strval($num)]) : null;
$title = $hasMonth ? htmlspecialchars($plant['months'][strval($num)]) : 'Not a planting month';
?>
= $name ?>
= $hasMonth ? $badge['icon'] : 'â' ?>
Active month
Not recommended
ðïļ Monthly Actions
$action):
$badge = actionBadge($action);
?>
= $fullMonths[(int)$mnum] ?>
= $badge['icon'] ?> = $badge['label'] ?>
= htmlspecialchars($action) ?>
ð Notes & Tips
= nl2br(htmlspecialchars($plant['notes'])) ?>
ðĪ Companion Planting
â
Grows Well With
- = htmlspecialchars($c) ?>
â Avoid Growing With
- = htmlspecialchars($c) ?>