Esempio n. 1
0
    $tf = new RMTimeFormatter(0, __('%T% %d%, %Y%', 'bxpress'));
    // Likes parsing
    if (!is_null($row['liked'])) {
        $likes_ids = explode(",", $row['liked'], 3);
    } else {
        $likes_ids = array();
    }
    $likes = array();
    foreach ($likes_ids as $like) {
        if (!isset($users[$like])) {
            $users[$like] = new XoopsUser($like);
        }
        $like_user = $users[$like];
        $likes[] = array('uid' => $like, 'uname' => $like_user->getVar('uname'), 'name' => $like_user->getVar('name') != '' ? $like_user->getVar('name') : $like_user->getVar('uname'), 'avatar' => RMEvents::get()->run_event("rmcommon.get.avatar", $like_user->getVar('email'), 40));
    }
    $posts[$post->id()] = array('id' => $post->id(), 'text' => $post->text(), 'edit' => $post->editText(), 'approved' => $post->approved(), 'date' => $tf->ago($post->date()), 'canedit' => $canedit, 'candelete' => $candelete, 'canshow' => $canshow, 'canreport' => $report, 'poster' => $userData, 'attachs' => $attachs, 'attachscount' => count($attachs), 'parent' => $post->parent, 'replies' => $row['replies'], 'likes_count' => $row['likes'], 'likes' => $likes);
    $posts_ids[] = $post->id();
}
$tpl->assign('posts', $posts);
unset($userData, $bbUser, $users);
// Common Utilities Notifications
$notifications = RMNotifications::get();
$events = Bxpress_Notifications::get();
$permissions = $forum->permissions();
// New topics notifications
$event = $events->event('reply')->parameters($topic->id())->permissions(array('groups' => in_array(0, $permissions['view']) ? array() : $permissions['view']));
$notifications->add_item($event);
unset($event, $permissions);
$tpl->assign('notifications', $notifications->render());
$tpl->assign('lang_edit', __('Edit', 'bxpress'));
$tpl->assign('lang_delete', __('Delete', 'bxpress'));
Esempio n. 2
0
        $userData = array();
        $userData['id'] = 0;
        $userData['uname'] = $xoopsModuleConfig['anonymous_prefix'] . $post->uname();
        $userData['rank'] = $xoopsConfig['anonymous'];
        $userData['rank_image'] = '';
        $userData['registered'] = '';
        $userData['avatar'] = RMEvents::get()->run_event("rmcommon.get.avatar", '', 0);
        $userData['posts'] = sprintf(__('Posts: %u', 'bxpress'), 0);
        $userData['online'] = false;
    }
    // Adjuntos
    $attachs = array();
    foreach ($post->attachments() as $k) {
        $attachs[] = array('title' => $k->name(), 'downs' => $k->downloads(), 'id' => $k->id(), 'ext' => $k->extension(), 'size' => RMUtilities::formatBytesSize($k->size()), 'icon' => $k->getIcon());
    }
    $tpl->append('posts', array('id' => $post->id(), 'text' => $post->text(), 'edit' => $post->editText(), 'approved' => $post->approved(), 'date' => bXFunctions::formatDate($post->date()), 'canedit' => $canedit, 'candelete' => $candelete, 'canshow' => $canshow, 'canreport' => $report, 'poster' => $userData, 'attachs' => $attachs, 'attachscount' => count($attachs)));
}
unset($userData, $bbUser, $users);
$tpl->assign('lang_edit', __('Edit', 'bxpress'));
$tpl->assign('lang_delete', __('Delete', 'bxpress'));
$tpl->assign('lang_report', __('Report', 'bxpress'));
$tpl->assign('lang_quote', __('Quote', 'bxpress'));
$tpl->assign('lang_online', __('Online!', 'bxpress'));
$tpl->assign('lang_offline', __('Disconnected', 'bxpress'));
$tpl->assign('lang_attachments', __('Attachments', 'bxpress'));
$tpl->assign('xoops_pagetitle', $topic->title() . " » " . $xoopsModuleConfig['forum_title']);
$tpl->assign('token', $xoopsSecurity->createToken());
$tpl->assign('lang_edittext', __('Edit Text', 'bxpress'));
$tpl->assign('lang_goto', __('Change Forum:', 'bxpress'));
$tpl->assign('lang_go', __('Go!', 'bxpress'));
//$tpl->assign('url',XOOPS_URL."/modules/bxpress/report.php");