function initCommentsFeed() { // Get the weblog items $comments = $this->weblog->getComments(null, 'CREATED DESC', YDConfig::get('max_syndicated_items', 15)); // Initialize the feed $this->feed = new YDFeedCreator(); $this->feed->setTitle(YDConfig::get('weblog_title', 'Untitled Weblog') . ' - ' . t('comments')); $this->feed->setDescription(YDConfig::get('weblog_description', 'Untitled Weblog Description')); $this->feed->setLink(YDUrl::makeLinkAbsolute('index.php')); // Add the items foreach ($comments as $comment) { $body = $comment['comment'] . "\n\n" . t('by') . ' ' . $comment['username']; $this->feed->addItem($comment['item_title'], YDTplModLinkItem($comment['item_id'], '#comment'), YDTplModBBCode($body)); } }
function initGalleryFeed() { // Get the weblog items $items = $this->weblog->getItems(); // Initialize the feed $this->feed = new YDFeedCreator(); $this->feed->setTitle(YDConfig::get('weblog_title', 'Untitled Weblog') . ' - ' . t('archives_gallery')); $this->feed->setDescription(YDConfig::get('weblog_description', 'Untitled Weblog Description')); $this->feed->setLink(YDUrl::makeLinkAbsolute('index.php')); // Add the items foreach ($items as $item) { if (sizeof($item['images']) > 0) { $body = ''; foreach ($item['images'] as $image) { $body .= '<img src="' . YDTplModLinkThumb($image) . '"/> '; } $this->feed->addItem($item['title'], YDTplModLinkItemGallery($item), YDTplModBBCode($body)); } } }