/** * Get the default image according to specified size * @param string Size name to get * @return string */ public function image() { if ($this->getVar('image', 'e') == '') { return ''; } return RMImage::get()->load_from_params($this->getVar('image', 'e')); }
// 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 // use of Common Utilities templates or use your own templates // We will use MyWords included templates if ($post->getVar('comstatus')) { $comms = RMFunctions::get_comments('mywords', 'post=' . $post->id(), 'module', 0, null, false);