示例#1
0
    unset($edit);
}
$xoopsTpl->assign('lang_reads', sprintf(__('%u views', 'mywords'), $post->getVar('reads')));
// Tags
$tags = $post->tags(true);
$tags_list = '';
foreach ($tags as $i => $tag) {
    $tags_list .= ($tags_list == '' ? '' : ', ') . '<a href="' . $tag->permalink() . '">' . $tag->getVar('tag') . '</a>';
}
// Post pages
$total_pages = $post->total_pages();
$nav = new RMPageNav($total_pages, 1, $page, 5);
$nav->target_url($post->permalink() . ($mc['permalinks'] > 1 ? 'page/{PAGE_NUM}/' : '&amp;page={PAGE_NUM}'));
$xoopsTpl->assign('post_navbar', $nav->render(true));
// Post data
$post_arr = array('id' => $post->id(), 'title' => $post->getVar('title'), 'published' => sprintf(__('%s by %s', 'mywords'), MWFunctions::format_time($post->getVar('pubdate')), date('H:i', $post->getVar('pubdate')), '<a href="' . $editor->permalink() . '">' . (isset($editor) ? $editor->getVar('name') : __('Anonymous', 'mywords')) . "</a>"), 'text' => $post->content(false, $page), 'cats' => $post->get_categories_names(), 'tags' => $tags_list, 'trackback' => $post->getVar('pingstatus') ? MWFunctions::get_url(true) . $post->id() : '', 'meta' => $post->get_meta('', false), 'time' => $post->getVar('pubdate'), 'image' => $post->getImage($xoopsModuleConfig['post_imgs_size']), 'author' => $editor->getVar('name'), 'alink' => $editor->permalink());
// Plugins?
$post_arr = RMEvents::get()->run_event('mywords.view.post', $post_arr, $post);
$xoopsTpl->assign('post', $post_arr);
// 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')) {