rss feed
parent
860cbdd42d
commit
97855bdf6c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,19 +6,20 @@
|
|||
<meta name="description" content="a tiny php script to automagically display photos">
|
||||
<title>p-view</title>
|
||||
<h1>p-view</h1>
|
||||
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.
|
||||
<a href='rss.php'>rss!</a>
|
||||
<div class='wrapper'>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
$images = glob("i/*.{png,jpg,JPG}", GLOB_BRACE);
|
||||
$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("i/", "", $title);
|
||||
$title = str_replace("src/", "", $title);
|
||||
$title = str_replace(".png", "", $title);
|
||||
$title = str_replace(".jpg", "", $title);
|
||||
$title = str_replace(".JPG", "", $title);
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
$url = 'https://data.bellz.org/l/i/gidderoni/';
|
||||
?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0">
|
||||
|
||||
<channel>
|
||||
<title>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; ?></title>
|
||||
<link><?php echo $url . '#' . $anchor;?></link>
|
||||
|
||||
<description><?php echo $url . $image; ?></description>
|
||||
</item>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
|
Loading…
Reference in New Issue