diff options
Diffstat (limited to 'notes/index.php')
| -rw-r--r-- | notes/index.php | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/notes/index.php b/notes/index.php new file mode 100644 index 0000000..9daaf25 --- /dev/null +++ b/notes/index.php @@ -0,0 +1,113 @@ +<!--?php +ini_set('display_errors', '1'); +ini_set('display_startup_errors', '1'); +error_reporting(E_ALL); +?--> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Notes</title> + <link href="../style.css" rel="stylesheet" type="text/css" media="all"> + <style> + .noteentry { + max-width: 100%; + list-style: none; + display: inline-block; + margin: var(--stdpadding) 0; + } + .noteentry h3 { + margin-top: 0; + } + /*ul h2:first-of-type::before { + content: "Articles - " + }*/ + .noteentry > * { + display: block; + box-sizing: border-box; + } + .entrytag { + font-size: .9em; + color: #bbbbbb; + font-style: italic; + display: inline-block; + margin-right: 1ch; + } + .entrydate { + font-weight: bold; + } + .entrytitle { + padding-left: initial; + border-left: initial; + } + </style> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?> + </head> + <body> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/nav.php'); bg(true); ?> + <h1>isonotes</h1> + <h2 id="caption">superfluous commentary</h2> + <nav> + <a href="notes.atom">atom feed</a> + <?php + $content = simplexml_load_file("notes.atom"); + $year = "-69420"; + $yc = 0; + foreach($content->entry as $entry) { + $nyr = substr($entry->published, 0, 4); + if($nyr != $year) { + $year = $nyr; + echo "<a href='#$year'>$year</a>"; + } + } + ?> + </nav> + <?php + $stag = $_GET["tag"]; + $nostag = empty($stag); + if(!$nostag) { + echo "<a style='display: block; margin-top: 1rem; margin-bottom: 1rem;' href='.'>All notes</a>"; + } + $year = "-69420"; + $yc = 0; + $yeag = false; + foreach($content->entry as $entry) { + + if($yeag) { + echo "<hr>"; + } else { + $yeag = true; + } + + $pfilt = false; + if(!$nostag) { + foreach($entry->category as $cat) { + $term = $cat["term"]; + if($stag == $term) { + $pfilt = true; + } + } + } + + if($pfilt or $nostag) { + $nyr = substr($entry->published, 0, 4); + if($nyr != $year) { + $year = $nyr; + echo "<h2 id='$year'>$year</h2>"; + } + $dt = substr($entry->published, 0, 10); + $ti = $entry->title; + $cats = ""; + foreach($entry->category as $cat) { + $term = $cat["term"]; + $cats = $cats."<a class='entrytag' href='?tag=".$term."'>".$term."</a>"; + } + + echo "<article class='noteentry'><time class='entrydate'>$dt</time><h3 class='entrytitle'><a href='".$entry->link["href"]."'>$ti</h3></a>$entry->summary<span>$cats</span></article>"; + } + } + ?> + + </body> +</html> |
