Ejemplo n.º 1
0
 if ($post->user() > 0) {
     if (!isset($users[$post->user()])) {
         $users[$post->user()] = new XoopsUser($post->user());
     }
     $bbUser = $users[$post->user()];
     $userData = array();
     $userData['id'] = $bbUser->uid();
     $userData['uname'] = $bbUser->uname();
     $userData['name'] = $bbUser->getVar('name') != '' ? $bbUser->getVar('name') : $bbUser->uname();
     //$userData['rank'] = $ranks[$bbUser->getVar('rank')]['title'];
     //$userData['rank_image'] = $ranks[$bbUser->getVar('rank')]['image'];
     $userData['registered'] = sprintf(__('Registered: %s', 'bxpress'), date($mc['dates'], $bbUser->getVar('user_regdate')));
     $userData['avatar'] = RMEvents::get()->run_event("rmcommon.get.avatar", $bbUser->getVar('email'), 0);
     $userData['posts'] = sprintf(__('Posts: %u', 'bxpress'), $bbUser->getVar('posts'));
     if ($xoopsUser && ($moderator || $admin)) {
         $userData['ip'] = sprintf(__('IP: %s', 'bxpress'), $post->ip());
     }
     $userData['online'] = $bbUser->isOnline();
     $userData['type'] = $bbUser->isAdmin() ? 'admin' : ($forum->isModerator($bbUser->uid()) ? 'moderator' : 'user');
 } else {
     $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;
     $userData['type'] = 'anon';
 }