} $ed = new MWEditor($id); if ($ed->isNew()) { redirect_header('backend.php', 1, __('Sorry, specified author was not foud!', 'mywords')); die; } $rss_channel['title'] = sprintf(__('Posts by %s in %s', 'mywords'), $ed->name != '' ? $ed->name : $ed->shortname, $xoopsConfig['sitename']); $rss_channel['link'] = $ed->permalink(); $rss_channel['description'] = sprintf(__('Posts published by %s.', 'mywords'), $ed->getVar('name')) . ' ' . htmlspecialchars(strip_tags($ed->getVar('bio')), ENT_QUOTES); $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; $posts = MWFunctions::get_filtered_posts("author=" . $ed->uid, 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();
} $ed = new MWEditor($id); if ($ed->isNew()) { redirect_header('backend.php', 1, __('Sorry, specified author was not foud!', 'mywords')); die; } $rss_channel['title'] = $xoopsModule->name(); $rss_channel['link'] = $ed->permalink(); $rss_channel['description'] = sprintf(__('Posts published by %s.', 'mywords'), $ed->getVar('name')) . ' ' . htmlspecialchars(strip_tags($ed->getVar('bio')), ENT_QUOTES); $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; $posts = MWFunctions::get_filtered_posts("author={$id}", 0, 10); $rss_items = array(); foreach ($posts as $post) { $item = array(); $item['title'] = $post->getVar('title'); $item['link'] = $post->permalink(); $item['description'] = XoopsLocal::convert_encoding(htmlspecialchars($post->content(true), ENT_QUOTES)); $item['pubdate'] = formatTimestamp($post->getVar('pubdate'), 'rss'); $item['guid'] = $post->permalink(); $rss_items[] = $item; } break; case 'all': default: $rss_channel['title'] = $xoopsModule->name(); $rss_channel['link'] = XOOPS_URL . ($config['permalinks'] ? $config['basepath'] : '/modules/mywords');