aboutsummaryrefslogtreecommitdiff
path: root/formats/HtmlFormat.php
diff options
context:
space:
mode:
Diffstat (limited to 'formats/HtmlFormat.php')
-rw-r--r--formats/HtmlFormat.php31
1 files changed, 18 insertions, 13 deletions
diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php
index 20d49014..19b7702d 100644
--- a/formats/HtmlFormat.php
+++ b/formats/HtmlFormat.php
@@ -12,22 +12,23 @@ class HtmlFormat extends FormatAbstract{
$extraInfos = $this->getExtraInfos();
$title = htmlspecialchars($extraInfos['name']);
$uri = htmlspecialchars($extraInfos['uri']);
- $atomquery = str_replace('format=HtmlFormat', 'format=AtomFormat', htmlentities($_SERVER['QUERY_STRING']));
+ $atomquery = str_replace('format=HtmlFormat', 'format=AtomFormat', htmlentities($_SERVER['QUERY_STRING']));
+ $mrssquery = str_replace('format=HtmlFormat', 'format=MrssFormat', htmlentities($_SERVER['QUERY_STRING']));
$entries = '';
foreach($this->getDatas() as $data){
- $entryUri = is_null($data->uri) ? $uri : $data->uri;
+ $entryAuthor = is_null($data->author) ? '' : '<br /><p class="author">by: ' . $data->author . '</p>';
$entryTitle = is_null($data->title) ? '' : $this->sanitizeHtml(strip_tags($data->title));
+ $entryUri = is_null($data->uri) ? $uri : $data->uri;
$entryTimestamp = is_null($data->timestamp) ? '' : '<time datetime="' . date(DATE_ATOM, $data->timestamp) . '">' . date(DATE_ATOM, $data->timestamp) . '</time>';
- $entryAuthor = is_null($data->author) ? '' : '<br /><p class="author">by: ' . $data->author . '</p>';
$entryContent = is_null($data->content) ? '' : '<div class="content">' . $this->sanitizeHtml($data->content). '</div>';
$entries .= <<<EOD
<section class="feeditem">
- <h2><a class="itemtitle" href="{$entryUri}">{$entryTitle}</a></h2>
- {$entryTimestamp}
- {$entryAuthor}
- {$entryContent}
+ <h2><a class="itemtitle" href="{$entryUri}">{$entryTitle}</a></h2>
+ {$entryTimestamp}
+ {$entryAuthor}
+ {$entryContent}
</section>
EOD;
@@ -39,14 +40,18 @@ EOD;
<!DOCTYPE html>
<html>
<head>
- <meta charset="UTF-8">
- <title>{$title}</title>
- <link href="css/HtmlFormat.css" rel="stylesheet">
- <meta name="robots" content="noindex, follow">
+ <meta charset="UTF-8">
+ <title>{$title}</title>
+ <link href="css/HtmlFormat.css" rel="stylesheet">
+ <meta name="robots" content="noindex, follow">
</head>
<body>
- <h1 class="pagetitle"><a href="{$uri}" target="_blank">{$title}</a></h1>
- <div class="buttons"><a href="./#bridge-{$_GET['bridge']}"><button class="backbutton">← back to rss-bridge</button></a><a href="./?{$atomquery}"><button class="rss-feed">RSS feed</button></a></div>
+ <h1 class="pagetitle"><a href="{$uri}" target="_blank">{$title}</a></h1>
+ <div class="buttons">
+ <a href="./#bridge-{$_GET['bridge']}"><button class="backbutton">← back to rss-bridge</button></a>
+ <a href="./?{$atomquery}"><button class="rss-feed">RSS feed (ATOM)</button></a>
+ <a href="./?{$mrssquery}"><button class="rss-feed">RSS feed (MRSS)</button></a>
+ </div>
{$entries}
</body>
</html>