} $tag = new MWTag($id); if ($tag->isNew()) { redirect_header('backend.php', 1, __('Sorry, specified tag was not foud!', 'mywords')); die; } $rss_channel['title'] = sprintf(__('Posts tagged %s in %s', 'mywords'), $tag->tag, $xoopsConfig['sitename']); $rss_channel['link'] = $tag->permalink(); $rss_channel['description'] = sprintf(__('Posts tagged as %s', 'mywords'), $tag->getVar('tag')); $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_posts_by_tag($id, 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();
$xoopsTpl->assign('lang_editpost', __('Edit Post', 'mywords')); $xoopsTpl->assign('lang_postedin', __('Posted in:', 'mywords')); $xoopsTpl->assign('lang_taggedas', __('Tagged as:', 'mywords')); $xoopsTpl->assign('enable_images', $xoopsModuleConfig['list_post_imgs']); // Plugins? $post_arr = RMEvents::get()->run_event('mywords.view.post', $post_arr, $post); $xoopsTpl->assign('post', $post_arr); // Related posts if ($xoopsModuleConfig['related']) { $rtags = $post->tags(); $tt = array(); foreach ($rtags as $tag) { $tt[] = $tag['id_tag']; } unset($rtags, $tag); $related = MWFunctions::get_posts_by_tag($tt, 0, $xoopsModuleConfig['related_num'], 'RAND()', '', 'publish', $post->id()); unset($tt); $tf = new RMTimeFormatter(0, "%d% %T%, %Y%"); foreach ($related as $rpost) { $xoopsTpl->append('relatedPosts', array('title' => $rpost->getVar('title'), 'pubdate' => $tf->format($rpost->getVar('pubdate')), 'link' => $rpost->permalink(), 'image' => RMImage::get()->load_from_params($rpost->image))); } } // Social sites if ($xoopsModuleConfig['showbookmarks']) { foreach ($socials as $site) { $xoopsTpl->append('socials', array('title' => $site->getVar('title'), 'icon' => $site->getVar('icon'), 'url' => $site->link($post->getVar('title'), $post->permalink(), TextCleaner::truncate($post->content(true), 60)), 'alt' => $site->getVar('alt'))); } } unset($tags_list); // Comments // When use the common utilities comments system you can choose between