From f5cf66b6929928fe5a4a6cf227f9a2f2195329e5 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sun, 3 Jul 2016 18:07:29 +0200 Subject: Initial commit. --- feed.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 feed.php (limited to 'feed.php') diff --git a/feed.php b/feed.php new file mode 100644 index 0000000..b1f7630 --- /dev/null +++ b/feed.php @@ -0,0 +1,42 @@ +title(htmlspecialchars($user_string . " / " . $inbox_string, ENT_XML1, 'UTF-8')) + ->description($inbox_string) + ->url("https://www.maxmail.xyz") + ->language('en-US') + ->copyright('Copyright 2016, maxmail.xyz') + ->pubDate(strtotime("r", date(time()))) + ->lastBuildDate(strtotime("r", date(time()))) + ->ttl(60) + ->appendTo($feed); + + for( $i = 0; $i < count($mail); $i++ ) { + $item = new Item(); + + if( is_null($mail[$i]['textPlain']) ) { + $body = $mail[$i]['textHtml']; + } else { + $body = $mail[$i]['textPlain']; + } + $item + ->title( htmlspecialchars($mail[$i]["mailbox"] . ": " . $mail[$i]['subject'], ENT_XML1, 'UTF-8') ) + ->description( "
" . $body . "" ) + #->description($body) + ->url("https://www.maxmail.xyz/" . $user_string) + ->author( htmlspecialchars($mail[$i]['fromName'] . "<" . $mail[$i]['fromAddress'] . ">", ENT_XML1, 'UTF-8') ) + ->pubDate( strtotime($mail[$i]['date'] ) ) + ->appendTo($channel); + } + + ob_start(); + echo $feed; + return ob_get_clean(); +} -- cgit v1.2.3