Beispiel #1
0
         $rss_items[] = $item;
     }
     break;
 case 'all':
 default:
     $rss_channel['title'] = sprintf(__('Posts in %s', 'mywords'), $xoopsConfig['sitename']);
     $rss_channel['link'] = XOOPS_URL . ($config->permalinks ? $config->basepath : '/modules/mywords');
     $rss_channel['description'] = __('All recent published posts', 'mywords');
     $rss_channel['lastbuild'] = formatTimestamp(time(), 'rss');
     $rss_channel['webmaster'] = checkEmail($xoopsConfig['adminmail'], true);
     $rss_channel['editor'] = checkEmail($xoopsConfig['adminmail'], true);
     $rss_channel['category'] = 'Blog';
     $rss_channel['generator'] = 'Common Utilities';
     $rss_channel['language'] = RMCLANG;
     // Get posts
     $posts = MWFunctions::get_posts(0, 10);
     $rss_items = array();
     foreach ($posts as $post) {
         $item = array();
         $item['title'] = $post->getVar('title');
         $item['link'] = $post->permalink();
         $img = new RMImage();
         $img->load_from_params($post->getVar('image', 'e'));
         if (!$img->isNew()) {
             $image = '<img src="' . $img->url() . '" alt="' . $post->getVar('title') . '" /><br />';
         } else {
             $image = '';
         }
         $item['description'] = XoopsLocal::convert_encoding(htmlspecialchars($image . $post->content(true), ENT_QUOTES));
         $item['pubdate'] = formatTimestamp($post->getVar('pubdate'), 'rss');
         $item['guid'] = $post->permalink();