atom feed support
[push-tester.git] / www / index.php
1 <?php
2 require_once __DIR__ . '/../data/config.php';
3 require_once __DIR__ . '/functions.php';
4 header('Link: <' . $hub . '>; rel="hub"');
5 header('Link: <' . $self . '>; rel="self"', false);
6
7 $articles = loadArticles();
8 ?>
9 <html xmlns="http://www.w3.org/1999/xhtml">
10  <head>
11   <title>PubSubHubbub tester</title>
12   <link rel="alternate" type="application/atom+xml" title="PubSubHubbub tester" href="feed.php" />
13  </head>
14  <body class="h-feed">
15   <p>
16    <a href="add-article.php">create new article</a>
17    | <a href="feed.php">atom feed</a>
18   </p>
19   <h1>Articles</h1>
20   <?php foreach ($articles as $article) { ?>
21    <article class="h-entry">
22     <h2><?php echo htmlspecialchars($article->title); ?></h2>
23     <div class="e-content">
24      <?php echo $article->content; ?>
25     </div>
26     <p>
27      <a href="<?php echo $article->file; ?>" class="u-url">permalink</a>
28      at <time class="dt-published"><?php echo date('c', $article->time); ?></time>
29      by
30      <span class="h-card vcard author p-author">
31       <img class="u-photo" src="someone.png" width="16" height="16" alt=""/>
32       <a class="p-author h-card" href="someone.htm">Someone</a>
33      </span>
34     </p>
35    </article>
36   <?php } ?>
37  </body>
38 </html>