My personal blog. https://blog.airikr.me
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
1.6 KiB

<?php
require_once 'site-settings.php';
$is_root = false;
$feed = new \Zelenin\Feed;
$feed->addChannel(str_replace('/en', '', $og_url).'/rss'.($viewing_in_english == false ? '' : '-en').'.xml')
->addChannelTitle($og_title)
->addChannelLink($og_url)
->addChannelDescription($og_description)
->addChannelLanguage(($viewing_in_english == false ? 'sv-SE' : 'en-GB'))
->addChannelCopyright($config_author_name.' © '.date('Y'))
->addChannelManagingEditor($config_author_email)
->addChannelWebMaster($config_author_email)
->addChannelPubDate(time())
->addChannelLastBuildDate(time())
->addChannelTtl(60)
->addChannelImage($og_image, $og_url, 80, 80, $config_author_name);
$get_posts = sql("SELECT *
FROM posts
WHERE timestamp_saved IS NULL
AND is_inenglish ".($viewing_in_english == false ? "IS" : "IS NOT")." NULL
ORDER BY timestamp_published DESC
", Array());
foreach($get_posts AS $post) {
$feed->addItem()
->addItemTitle($post['subject'])
->addItemDescription($Parsedown->text($post['content_beforebreak']) . ($post['content_afterbreak'] == null ? '' : $Parsedown->text($post['content_afterbreak'])))
->addItemLink($og_url.'/read:'.$post['id_unique'])
->addItemAuthor($config_author_email.' ('.$config_author_name.')')
->addItemGuid($og_url.'/read:'.$post['id_unique'], true)
->addItemPubDate($post['timestamp_published'])
->addItemSource($og_title.' RSS', 'https://blog.airikr.me/rss'.($viewing_in_english == false ? '' : '-en').'.xml');
}
$feed->save('rss'.($viewing_in_english == false ? '' : '-en').'.xml');
?>