prepare(" SELECT `post_id`, `post_title`, `post_text`, UNIX_TIMESTAMP(`post_published`) AS `post_published` FROM `fm_blog_posts` AS bp WHERE `post_published` IS NOT NULL AND `post_published` < CURRENT_TIMESTAMP AND `post_deleted` IS NULL ORDER BY `post_published` DESC "); $posts = $getPosts->execute() ? $getPosts->fetchAll(PDO::FETCH_OBJ) : false; $posts = $posts ? $posts : []; } if(isset($_GET['blog_dump'])) { header('Content-Type: application/json; charset=utf-8'); echo json_encode($posts ?? []); return; } echo html_doctype(); ?> <?=$_SERVER['HTTP_HOST'];?>
New blog script is still work in progress, enjoy the old version!
post_text)[0]); $dateCustom = date('Y-m-d @ H:i:s T', $post->post_published); $dateISO = date('c', $post->post_published); echo <<

{$post->post_title}

{$preview}

Continue reading
\r\n HTML; } ?>