Ejemplo n.º 1
0
 $month = date('m', $post->getVar('pubdate'));
 $year = date('Y', $post->getVar('pubdate'));
 $link = $post->permalink();
 # Generamos el vínculo para el autor
 if ($post->getVar('author') > 0) {
     if (!isset($editors[$post->getVar('author')])) {
         $editors[$post->getVar('author')] = new MWEditor($post->getVar('author'), 'user');
     }
     if ($editors[$post->getVar('author')]->isNew()) {
         if ($xoopsUser && $xoopsUser->uid() == $post->author) {
             $user = $xoopsUser;
         } else {
             $user = new RMUser($post->author);
         }
         $editors[$post->getVar('author')]->uid = $user->uid();
         $editors[$post->getVar('author')]->name = $user->getVar('name');
         $editors[$post->getVar('author')]->shortname = $user->getVar('uname');
         $editors[$post->getVar('author')]->privileges = array('tags', 'tracks', 'comms');
         $editors[$post->getVar('author')]->save();
     }
     $editor = $editors[$post->getVar('author')];
     $alink = $editor->permalink();
 } else {
     $alink = '';
 }
 # Información de Publicación
 $published = sprintf(__('%s by %s', 'mywords'), MWFunctions::format_time($post->getVar('pubdate'), 'string'), '<a href="' . $alink . '">' . (isset($editor) ? $editor->name : __('Anonymous', 'mywords')) . "</a>");
 # Texto de continuar leyendo
 if ($post->getVar('visibility') == 'password') {
     $text = isset($_SESSION['password-' . $post->id()]) && $_SESSION['password-' . $post->id()] == $post->getVar('password') ? $post->content(true) : MWFunctions::show_password($post);
 } else {
Ejemplo n.º 2
0
# Generamos los vínculos
$day = date('d', $post->getVar('pubdate'));
$month = date('m', $post->getVar('pubdate'));
$year = date('Y', $post->getVar('pubdate'));
//
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 0;
# Cargamos los datos del autor
$editor = new MWEditor($post->getVar('author'), 'user');
if ($editor->isNew()) {
    if ($xoopsUser && $xoopsUser->uid() == $post->author) {
        $user = $xoopsUser;
    } else {
        $user = new RMUser($post->author);
    }
    $editor->uid = $user->uid();
    $editor->name = $user->getVar('name');
    $editor->shortname = $user->getVar('uname');
    $editor->privileges = array('tags', 'tracks', 'comms');
    $editor->save();
}
# Texto de continuar leyendo
$xoopsTpl->assign('xoops_pagetitle', $post->getVar('customtitle') != '' ? $post->getVar('customtitle') : $post->getVar('title'));
# Cargamos los comentarios del Artículo
if ($page <= 0) {
    $path = explode("/", $request);
    $srh = array_search('page', $path);
    if (isset($path[$srh]) && $path[$srh] == 'page') {
        if (!isset($path[$srh])) {
            $page = 1;
        } else {
            $page = $path[$srh + 1];