fix xml problems
[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>WebSub tester</title>
12   <link rel="alternate" type="application/atom+xml" title="WebSub 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   <p>
20    This is a tool to test your <a href="https://www.w3.org/TR/websub/">WebSub</a>
21    subscriber.
22    With one click, a new post gets published and the hub gets notified.
23   </p>
24   <h1>Articles</h1>
25   <?php foreach ($articles as $article) { ?>
26    <article class="h-entry">
27     <h2><?php echo htmlspecialchars($article->title); ?></h2>
28     <div class="e-content">
29      <?php echo $article->content; ?>
30     </div>
31     <p>
32      <a href="<?php echo $article->file; ?>" class="u-url">permalink</a>
33      at <time class="dt-published"><?php echo date('c', $article->time); ?></time>
34      by
35      <span class="h-card vcard author p-author">
36       <img class="u-photo" src="someone.png" width="16" height="16" alt=""/>
37       <a class="p-author h-card" href="someone.htm">Someone</a>
38      </span>
39     </p>
40    </article>
41   <?php } ?>
42  </body>
43 </html>