$output = '';
while ($name != null) {
$path = garden_path(GARDEN_TEMPLATE_DIR, $name . '.php');
-
+
+ if (file_exists($path) == false) {
+ $path = garden_path(GARDEN_FALLBACK_TEMPLATE_DIR, $name . '.php');
+ }
+
$base_template = null;
$base_template_variables = null;
return GARDEN_SITE_BASE_URL . garden_url(...$url_segments);
}
-
-
///////////////////////////////////////////////////////////////////////////////
// Images
///////////////////////////////////////////////////////////////////////////////
continue;
}
- $recent_items[$item->date] = $item;
+ $date_key = $item->date;
+
+ // Hack to support sorting without missing entries
+ while (isset($recent_items[$date_key])) {
+ $date_key += 1;
+ }
+
+ $recent_items[$date_key] = $item;
}
// Sort by date...
assert(extension_loaded('imagick'), 'Needs Imagick');
assert($argc >= 2, 'Please provide configuration file');
+define('GARDEN_FALLBACK_TEMPLATE_DIR', garden_path(__DIR__, 'templates'));
+
// First parameter needs to be the configuration php
$config_file = $argv[1];