From 97855bdf6c3c994cd217d3515ac94f29fcad713f Mon Sep 17 00:00:00 2001 From: xfnw Date: Sun, 13 Dec 2020 21:31:34 -0500 Subject: [PATCH] rss feed --- assets/style.css | 11 +++++++---- index.php | 7 ++++--- rss.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 rss.php diff --git a/assets/style.css b/assets/style.css index acd95e2..4b37d06 100644 --- a/assets/style.css +++ b/assets/style.css @@ -16,18 +16,21 @@ max-width: 700px; margin: 0 auto; } - a { +color: #aac; +} + +h1 a { text-decoration: none; color: #cdcdcd; } -a::before { +h1 a::before { content: "#"; -color: #acc; +color: #aac; margin-right: 10px; } -a:hover::before { +h1 a:hover::before { text-decoration: underline; } diff --git a/index.php b/index.php index 9dedbb7..0865dcf 100644 --- a/index.php +++ b/index.php @@ -6,19 +6,20 @@ p-view

p-view

-tiny script to automagically display all the photos in a directory with php +tiny script to automagically display all the photos in a directory with php. +rss!
+ + + + +p-view/title> +<link><?php echo $url; ?></link> +<description>a tiny php script to automagically display photos</description> + + +<?php + +$images = glob("src/*.{png,jpg,JPG}", GLOB_BRACE); +usort( $images, function( $b, $a ) { return filemtime($a) - filemtime($b); } ); + + +foreach($images as $image) { +$title = str_replace("_", " ", $image); +$title = str_replace("src/", "", $title); +$title = str_replace(".png", "", $title); +$title = str_replace(".jpg", "", $title); +$title = str_replace(".JPG", "", $title); +$anchor = str_replace(" ", "", $title); +?> + +<item> +<title><?php echo $title; ?> + + + + + + + + + + +