= 4) $output[] = $f; } return $output; } function generate_post_list($limit = -1) { $events = scan_for_posts(); $output = ""; if ($limit == -1) { foreach ($events as $event) { $lines = file(__DIR__ . '/../posts/' . $event); $title = $lines[0]; $desc = $lines[1]; $date = $lines[2]; $signatur = $lines[3]; $output .= '

'.$signatur.'
'.$date.'

'.$title.'

'.$desc.'

'; } } else { if($limit > count($events)) $limit = count($events); for ($i = 0; $i < $limit; $i++) { $lines = file(__DIR__ . '/../posts/' . $events[$i]); $title = $lines[0]; $desc = $lines[1]; $date = $lines[2]; $signatur = $lines[3]; $output .= '

'.$signatur.'

'.$date.'

'.$title.'

'.$desc.'

'; } } return $output; } function get_post_content($id) { $lines = file(__DIR__ . '/../posts/' . str_replace('.', '', $id) . '.md'); $output = ""; for ($i = 5; $i < count($lines); $i++) $output .= $lines[$i] . "\n"; return $output; } ?>