Esempio n. 1
0
 /**
  * Get User Timestamp
  *
  * @param mixed  $time       unix timestamp
  * @param string $timeoffset timezone
  *
  * @return int
  */
 public function getUserTimestamp($time, $timeoffset = '')
 {
     if ($timeoffset == '') {
         if ($this->isUser()) {
             $timeoffset = $this->user->getVar('timezone_offset');
         } else {
             $timeoffset = $this->getConfig('default_TZ');
         }
     }
     $usertimestamp = (int) $time + ((double) $timeoffset - $this->getConfig('server_TZ')) * 3600;
     return (int) $usertimestamp;
 }
Esempio n. 2
0
 /**
  * @param int $uid
  * @param string $subject
  * @param string $body
  * @return bool
  */
 private function sendPM($uid, $subject, $body)
 {
     $xoops = Xoops::getInstance();
     $pm_handler = $xoops->getHandlerPrivateMessage();
     $pm = $pm_handler->create();
     $pm->setVar("subject", $subject);
     // RMV-NOTIFY
     $pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') : (!$xoops->isUser() ? 1 : $xoops->user->getVar('uid')));
     $pm->setVar("msg_text", $body);
     $pm->setVar("to_userid", $uid);
     $pm->setVar('msg_time', time());
     if (!$pm_handler->insert($pm)) {
         return false;
     }
     return true;
 }
Esempio n. 3
0
 /**
  * Send a message to user's email
  *
  * @param XoopsObject|PmMessage $pm
  * @param null|XoopsUser $user
  * @return bool
  */
 public function sendEmail(PmMessage $pm, XoopsUser $user = null)
 {
     $xoops = Xoops::getInstance();
     if (!is_object($user)) {
         $user = $xoops->user;
     }
     $msg = sprintf(_PM_EMAIL_DESC, $user->getVar("uname"));
     $msg .= "\n\n";
     $msg .= XoopsLocale::formatTimestamp($pm->getVar("msg_time"));
     $msg .= "\n";
     $from = new XoopsUser($pm->getVar("from_userid"));
     $to = new XoopsUser($pm->getVar("to_userid"));
     $msg .= sprintf(_PM_EMAIL_FROM, $from->getVar("uname") . " (" . \XoopsBaseConfig::get('url') . "/userinfo.php?uid=" . $pm->getVar("from_userid") . ")");
     $msg .= "\n";
     $msg .= sprintf(_PM_EMAIL_TO, $to->getVar("uname") . " (" . \XoopsBaseConfig::get('url') . "/userinfo.php?uid=" . $pm->getVar("to_userid") . ")");
     $msg .= "\n";
     $msg .= _PM_EMAIL_MESSAGE . ":\n";
     $msg .= "\n" . $pm->getVar("subject") . "\n";
     $msg .= "\n" . strip_tags(str_replace(array("<p>", "</p>", "<br />", "<br />"), "\n", $pm->getVar("msg_text"))) . "\n\n";
     $msg .= "--------------\n";
     $msg .= $xoops->getConfig('sitename') . ": " . \XoopsBaseConfig::get('url') . "\n";
     $xoopsMailer = $xoops->getMailer();
     $xoopsMailer->useMail();
     $xoopsMailer->setToEmails($user->getVar("email"));
     $xoopsMailer->setFromEmail($xoops->getConfig('adminmail'));
     $xoopsMailer->setFromName($xoops->getConfig('sitename'));
     $xoopsMailer->setSubject(sprintf(_PM_EMAIL_SUBJECT, $pm->getVar("subject")));
     $xoopsMailer->setBody($msg);
     return $xoopsMailer->send();
 }
Esempio n. 4
0
 /**
  * __construct
  *
  * @param XoopsUser|XoopsObject &$obj user object
  */
 public function __construct(XoopsUser $obj)
 {
     $xoops = Xoops::getInstance();
     if ($obj->isNew()) {
         //Add user
         $uid_value = "";
         $uname_value = "";
         $name_value = "";
         $email_value = "";
         $email_cbox_value = 0;
         $url_value = "";
         $timezone_value = $xoops->getConfig('default_TZ');
         $icq_value = "";
         $aim_value = "";
         $yim_value = "";
         $msnm_value = "";
         $location_value = "";
         $occ_value = "";
         $interest_value = "";
         $sig_value = "";
         $sig_cbox_value = 0;
         $bio_value = "";
         $rank_value = 0;
         $mailok_value = 0;
         $form_title = SystemLocale::ADD_USER;
         $form_isedit = false;
         $groups = array(FixedGroups::USERS);
     } else {
         //Edit user
         $uid_value = $obj->getVar("uid", "E");
         $uname_value = $obj->getVar("uname", "E");
         $name_value = $obj->getVar("name", "E");
         $email_value = $obj->getVar("email", "E");
         $email_cbox_value = $obj->getVar("user_viewemail") ? 1 : 0;
         $url_value = $obj->getVar("url", "E");
         $timezone_value = $obj->getVar("timezone_offset");
         $icq_value = $obj->getVar("user_icq", "E");
         $aim_value = $obj->getVar("user_aim", "E");
         $yim_value = $obj->getVar("user_yim", "E");
         $msnm_value = $obj->getVar("user_msnm", "E");
         $location_value = $obj->getVar("user_from", "E");
         $occ_value = $obj->getVar("user_occ", "E");
         $interest_value = $obj->getVar("user_intrest", "E");
         $sig_value = $obj->getVar("user_sig", "E");
         $sig_cbox_value = $obj->getVar("attachsig") == 1 ? 1 : 0;
         $bio_value = $obj->getVar("bio", "E");
         $rank_value = $obj->getVar('rank');
         $mailok_value = $obj->getVar('user_mailok', 'E');
         $form_title = sprintf(SystemLocale::F_UPDATE_USER, $obj->getVar("uname"));
         $form_isedit = true;
         $groups = array_values($obj->getGroups());
     }
     //Affichage du formulaire
     parent::__construct($form_title, "form_user", "admin.php", "post", true);
     $this->addElement(new Xoops\Form\Text(XoopsLocale::USER_NAME, "username", 4, 25, $uname_value), true);
     $this->addElement(new Xoops\Form\Text(XoopsLocale::NAME, "name", 5, 60, $name_value));
     $email_tray = new Xoops\Form\ElementTray(XoopsLocale::EMAIL, "<br />");
     $email_text = new Xoops\Form\Text("", "email", 5, 60, $email_value);
     $email_tray->addElement($email_text, true);
     $email_cbox = new Xoops\Form\Checkbox("", "user_viewemail", $email_cbox_value);
     $email_cbox->addOption(1, XoopsLocale::ALLOW_OTHER_USERS_TO_VIEW_EMAIL);
     $email_tray->addElement($email_cbox);
     $this->addElement($email_tray, true);
     $this->addElement(new Xoops\Form\Text(XoopsLocale::WEB_URL, "url", 5, 100, $url_value));
     $this->addElement(new Xoops\Form\SelectTimeZone(XoopsLocale::TIME_ZONE, "timezone_offset", $timezone_value));
     $this->addElement(new Xoops\Form\Text(XoopsLocale::ICQ, "user_icq", 3, 15, $icq_value));
     $this->addElement(new Xoops\Form\Text(XoopsLocale::AIM, "user_aim", 3, 18, $aim_value));
     $this->addElement(new Xoops\Form\Text(XoopsLocale::YIM, "user_yim", 3, 25, $yim_value));
     $this->addElement(new Xoops\Form\Text(XoopsLocale::MSNM, "user_msnm", 3, 100, $msnm_value));
     $this->addElement(new Xoops\Form\Text(XoopsLocale::LOCATION, "user_from", 5, 100, $location_value));
     $this->addElement(new Xoops\Form\Text(XoopsLocale::OCCUPATION, "user_occ", 5, 100, $occ_value));
     $this->addElement(new Xoops\Form\Text(XoopsLocale::INTEREST, "user_intrest", 5, 150, $interest_value));
     $sig_tray = new Xoops\Form\ElementTray(XoopsLocale::SIGNATURE, "<br />");
     $sig_tarea = new Xoops\Form\TextArea("", "user_sig", $sig_value, 5, 5);
     $sig_tray->addElement($sig_tarea);
     $sig_cbox = new Xoops\Form\Checkbox("", "attachsig", $sig_cbox_value);
     $sig_cbox->addOption(1, XoopsLocale::ALWAYS_ATTACH_MY_SIGNATURE);
     $sig_tray->addElement($sig_cbox);
     $this->addElement($sig_tray);
     $this->addElement(new Xoops\Form\TextArea(XoopsLocale::EXTRA_INFO, "bio", $bio_value, 5, 5));
     $ranklist = $xoops->service('userrank')->getAssignableUserRankList()->getValue();
     if ($ranklist !== null) {
         $rank_select = new Xoops\Form\Select(XoopsLocale::RANK, "rank", $rank_value);
         $rank_select->addOption(0, "--------------");
         if (count($ranklist) > 0) {
             $rank_select->addOptionArray($ranklist);
         }
         $this->addElement($rank_select);
     } else {
         $this->addElement(new Xoops\Form\Hidden("rank", $rank_value));
     }
     // adding a new user requires password fields
     if (!$form_isedit) {
         $this->addElement(new Xoops\Form\Password(XoopsLocale::PASSWORD, "password", 3, 32), true);
         $this->addElement(new Xoops\Form\Password(XoopsLocale::RETYPE_PASSWORD, "pass2", 3, 32), true);
     } else {
         $this->addElement(new Xoops\Form\Password(XoopsLocale::PASSWORD, "password", 3, 32));
         $this->addElement(new Xoops\Form\Password(XoopsLocale::RETYPE_PASSWORD, "pass2", 3, 32));
     }
     $this->addElement(new Xoops\Form\RadioYesNo(XoopsLocale::ONLY_USERS_THAT_ACCEPT_EMAIL, 'user_mailok', $mailok_value));
     //Groups administration addition XOOPS 2.0.9: Mith
     $gperm_handler = $xoops->getHandlerGroupPermission();
     $group_select = array();
     //If user has admin rights on groups
     if ($gperm_handler->checkRight("system_admin", XOOPS_SYSTEM_GROUP, $xoops->user->getGroups(), 1)) {
         //add group selection
         $group_select[] = new Xoops\Form\SelectGroup(XoopsLocale::GROUPS, 'groups', false, $groups, 5, true);
     } else {
         //add each user groups
         foreach ($groups as $key => $group) {
             $group_select[] = new Xoops\Form\Hidden('groups[' . $key . ']', $group);
         }
     }
     foreach ($group_select as $group) {
         $this->addElement($group);
         unset($group);
     }
     $this->addElement(new Xoops\Form\Hidden("fct", "users"));
     $this->addElement(new Xoops\Form\Hidden("op", "users_save"));
     $this->addElement(new Xoops\Form\Button("", "submit", XoopsLocale::A_SUBMIT, "submit"));
     if (!empty($uid_value)) {
         $this->addElement(new Xoops\Form\Hidden("uid", $uid_value));
     }
 }
Esempio n. 5
0
 $limit = $online_total > 20 ? 20 : $online_total;
 $criteria = new CriteriaCompo();
 $criteria->setLimit($limit);
 $criteria->setStart($start);
 $onlines = $online_handler->getAll($criteria, null, false, false);
 $count = count($onlines);
 $module_handler = $xoops->getHandlerModule();
 $modules = $module_handler->getNameList(new Criteria('isactive', 1));
 $onlineUsers = array();
 for ($i = 0; $i < $count; ++$i) {
     $onlineUsers[$i]['uid'] = $onlines[$i]['online_uid'];
     $onlineUsers[$i]['ip'] = $onlines[$i]['online_ip'];
     $onlineUsers[$i]['updated'] = $onlines[$i]['online_updated'];
     $onlineUsers[$i]['module'] = $onlines[$i]['online_module'] > 0 ? $modules[$onlines[$i]['online_module']] : '';
     if ($onlines[$i]['online_uid'] != 0 && is_object($user = new XoopsUser($onlines[$i]['online_uid']))) {
         $onlineUsers[$i]['name'] = $user->getVar('uname');
         $response = $xoops->service("Avatar")->getAvatarUrl($user);
         $avatar = $response->getValue();
         $avatar = empty($avatar) ? $xoops_upload_url . '/blank.gif' : $avatar;
         $onlineUsers[$i]['avatar'] = $avatar;
     } else {
         $onlineUsers[$i]['name'] = $xoops->getConfig('anonymous');
         $onlineUsers[$i]['avatar'] = $xoops_upload_url . '/blank.gif';
     }
 }
 $tpl = new XoopsTpl();
 if ($online_total > 20) {
     $nav = new XoopsPageNav($online_total, 20, $start, 'start', 'action=showpopups&amp;type=online');
     $tpl->assign('nav', $nav->renderNav());
 }
 $tpl->assign('onlineusers', $onlineUsers);
Esempio n. 6
0
 /**
  * activate a user
  *
  * @param XoopsUser $user the user object
  *
  * @return bool successful?
  */
 public function activateUser(XoopsUser $user)
 {
     if ($user->getVar('level') != 0) {
         return true;
     }
     $user->setVar('level', 1);
     return $this->userHandler->insert($user, true);
 }
Esempio n. 7
0
/**
 * Get {@link Xoops\Form\ThemeForm} for editing a user
 *
 * @param XoopsUser $user
 * @param ProfileProfile|null $profile
 * @param bool $action
 * @return Xoops\Form\ThemeForm
 */
function profile_getUserForm(XoopsUser $user, ProfileProfile $profile = null, $action = false)
{
    $xoops = Xoops::getInstance();
    if ($action === false) {
        $action = $_SERVER['REQUEST_URI'];
    }
    $title = $user->isNew() ? _PROFILE_AM_ADDUSER : XoopsLocale::EDIT_PROFILE;
    $form = new Xoops\Form\ThemeForm($title, 'userinfo', $action, 'post', true);
    /* @var $profile_handler ProfileProfileHandler */
    $profile_handler = \Xoops::getModuleHelper('profile')->getHandler('profile');
    // Dynamic fields
    if (!$profile) {
        $profile = $profile_handler->getProfile($user->getVar('uid'));
    }
    // Get fields
    $fields = $profile_handler->loadFields();
    // Get ids of fields that can be edited
    $gperm_handler = $xoops->getHandlerGroupPermission();
    $editable_fields = $gperm_handler->getItemIds('profile_edit', $xoops->user->getGroups(), $xoops->module->getVar('mid'));
    if ($user->isNew() || $xoops->user->isAdmin()) {
        $elements[0][] = array('element' => new Xoops\Form\Text(XoopsLocale::USERNAME, 'uname', 3, $xoops->user->isAdmin() ? 60 : $xoops->getConfig('maxuname'), $user->getVar('uname', 'e')), 'required' => 1);
        $email_text = new Xoops\Form\Text('', 'email', 4, 60, $user->getVar('email'));
    } else {
        $elements[0][] = array('element' => new Xoops\Form\Label(XoopsLocale::USERNAME, $user->getVar('uname')), 'required' => 0);
        $email_text = new Xoops\Form\Label('', $user->getVar('email'));
    }
    $email_tray = new Xoops\Form\ElementTray(XoopsLocale::EMAIL, '<br />');
    $email_tray->addElement($email_text, $user->isNew() || $xoops->user->isAdmin() ? 1 : 0);
    $weights[0][] = 0;
    $elements[0][] = array('element' => $email_tray, 'required' => 0);
    $weights[0][] = 0;
    if ($xoops->user->isAdmin() && $user->getVar('uid') != $xoops->user->getVar('uid')) {
        //If the user is an admin and is editing someone else
        $pwd_text = new Xoops\Form\Password('', 'password', 3, 32);
        $pwd_text2 = new Xoops\Form\Password('', 'vpass', 3, 32);
        $pwd_tray = new Xoops\Form\ElementTray(XoopsLocale::PASSWORD . '<br />' . XoopsLocale::TYPE_NEW_PASSWORD_TWICE_TO_CHANGE_IT);
        $pwd_tray->addElement($pwd_text);
        $pwd_tray->addElement($pwd_text2);
        $elements[0][] = array('element' => $pwd_tray, 'required' => 0);
        //cannot set an element tray required
        $weights[0][] = 0;
        $level_radio = new Xoops\Form\Radio(_PROFILE_MA_USERLEVEL, 'level', $user->getVar('level'));
        $level_radio->addOption(1, _PROFILE_MA_ACTIVE);
        $level_radio->addOption(0, _PROFILE_MA_INACTIVE);
        //$level_radio->addOption(-1, _PROFILE_MA_DISABLED);
        $elements[0][] = array('element' => $level_radio, 'required' => 0);
        $weights[0][] = 0;
    }
    $elements[0][] = array('element' => new Xoops\Form\Hidden('uid', $user->getVar('uid')), 'required' => 0);
    $weights[0][] = 0;
    $elements[0][] = array('element' => new Xoops\Form\Hidden('op', 'save'), 'required' => 0);
    $weights[0][] = 0;
    $cat_handler = \Xoops::getModuleHelper('profile')->getHandler('category');
    $categories = array();
    $all_categories = $cat_handler->getObjects(null, true, false);
    $count_fields = count($fields);
    /* @var ProfileField $field */
    foreach ($fields as $field) {
        if (in_array($field->getVar('field_id'), $editable_fields)) {
            // Set default value for user fields if available
            if ($user->isNew()) {
                $default = $field->getVar('field_default');
                if ($default !== '' && $default !== null) {
                    $user->setVar($field->getVar('field_name'), $default);
                }
            }
            if ($profile->getVar($field->getVar('field_name'), 'n') === null) {
                $default = $field->getVar('field_default', 'n');
                $profile->setVar($field->getVar('field_name'), $default);
            }
            $fieldinfo['element'] = $field->getEditElement($user, $profile);
            $fieldinfo['required'] = $field->getVar('field_required');
            $key = @$all_categories[$field->getVar('cat_id')]['cat_weight'] * $count_fields + $field->getVar('cat_id');
            $elements[$key][] = $fieldinfo;
            $weights[$key][] = $field->getVar('field_weight');
            $categories[$key] = @$all_categories[$field->getVar('cat_id')];
        }
    }
    if ($xoops->isUser() && $xoops->user->isAdmin()) {
        $xoops->loadLanguage('admin', 'profile');
        $gperm_handler = $xoops->getHandlerGroupPermission();
        //If user has admin rights on groups
        include_once $xoops->path('modules/system/constants.php');
        if ($gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_GROUP, $xoops->user->getGroups(), 1)) {
            //add group selection
            $group_select = new Xoops\Form\SelectGroup(XoopsLocale::USER_GROUPS, 'groups', false, $user->getGroups(), 5, true);
            $elements[0][] = array('element' => $group_select, 'required' => 0);
            //set as latest;
            $weights[0][] = $count_fields + 1;
        }
    }
    ksort($elements);
    foreach (array_keys($elements) as $k) {
        array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
        $title = isset($categories[$k]) ? $categories[$k]['cat_title'] : _PROFILE_MA_DEFAULT;
        $desc = isset($categories[$k]) ? $categories[$k]['cat_description'] : "";
        //$form->addElement(new Xoops\Form\Label("<div class='break'>{$title}</div>", $desc), false);
        $desc = $desc != '' ? ' - ' . $desc : '';
        $form->insertBreak($title . $desc);
        foreach (array_keys($elements[$k]) as $i) {
            $form->addElement($elements[$k][$i]['element'], $elements[$k][$i]['required']);
        }
    }
    $form->addElement(new Xoops\Form\Hidden('uid', $user->getVar('uid')));
    $form->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::SAVE_CHANGES, 'submit'));
    return $form;
}
Esempio n. 8
0
 /**
  * Subscribe for notification for an event(s)
  *
  * @param string $category  category of notification
  * @param int    $item_id   ID of the item
  * @param mixed  $events    event string or array of events
  * @param int    $mode      force a particular notification mode
  *                          (e.g. once_only) (default to current user preference)
  * @param int    $module_id ID of the module (default to current module)
  * @param int    $user_id   ID of the user (default to current user)
  *
  * @return bool
  *
  * @todo: how about a function to subscribe a whole group of users???
  *      e.g. if we want to add all moderators to be notified of subscription
  *      of new threads...
  */
 public function subscribe($category, $item_id, $events, $mode = null, $module_id = null, $user_id = null)
 {
     $xoops = Xoops::getInstance();
     if (!isset($user_id)) {
         if (!$xoops->isUser()) {
             return false;
             // anonymous cannot subscribe
         } else {
             $user_id = $xoops->user->getVar('uid');
         }
     }
     if (!isset($module_id)) {
         $module_id = $xoops->module->getVar('mid');
     }
     //todo, remove this from user profile
     if (!isset($mode)) {
         $user = new XoopsUser($user_id);
         $mode = $user->getVar('notify_mode');
     }
     if (!is_array($events)) {
         $events = array($events);
     }
     foreach ($events as $event) {
         if ($notification = $this->getNotification($module_id, $category, $item_id, $event, $user_id)) {
             if ($notification->getVar('mode') != $mode) {
                 $this->updateByField($notification, 'mode', $mode);
             }
         } else {
             $notification = $this->create();
             $notification->setVar('modid', $module_id);
             $notification->setVar('category', $category);
             $notification->setVar('itemid', $item_id);
             $notification->setVar('uid', $user_id);
             $notification->setVar('event', $event);
             $notification->setVar('mode', $mode);
             $this->insert($notification);
         }
     }
     return true;
 }
Esempio n. 9
0
 /**
  * Returns a value for output of this field
  *
  * @param XoopsUser $user {@link XoopsUser} object to get the value of
  * @param profileProfile $profile object to get the value of
  *
  * @return string
  **/
 public function getOutputValue(XoopsUser $user, ProfileProfile $profile)
 {
     $xoops = Xoops::getInstance();
     $xoops->loadLanguage('modinfo', 'profile');
     $value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
     switch ($this->getVar('field_type')) {
         default:
         case "textbox":
             if ($this->getVar('field_name') == 'url' && $value != '') {
                 return '<a href="' . $xoops->formatURL($value) . '" rel="external">' . $value . '</a>';
             } else {
                 return $value;
             }
             break;
         case "textarea":
         case "dhtml":
         case 'theme':
         case "language":
         case "list":
             return $value;
             break;
         case "select":
         case "radio":
             $options = $this->getVar('field_options');
             if (isset($options[$value])) {
                 $value = htmlspecialchars(defined($options[$value]) ? constant($options[$value]) : $options[$value]);
             } else {
                 $value = "";
             }
             return $value;
             break;
         case "select_multi":
         case "checkbox":
             $options = $this->getVar('field_options');
             $ret = array();
             if (count($options) > 0) {
                 foreach (array_keys($options) as $key) {
                     if (in_array($key, $value)) {
                         $ret[$key] = htmlspecialchars(defined($options[$key]) ? constant($options[$key]) : $options[$key]);
                     }
                 }
             }
             return $ret;
             break;
         case "group":
             $member_handler = $xoops->getHandlerMember();
             $options = $member_handler->getGroupList();
             $ret = isset($options[$value]) ? $options[$value] : '';
             return $ret;
             break;
         case "group_multi":
             $member_handler = $xoops->getHandlerMember();
             $options = $member_handler->getGroupList();
             $ret = array();
             foreach (array_keys($options) as $key) {
                 if (in_array($key, $value)) {
                     $ret[$key] = htmlspecialchars($options[$key]);
                 }
             }
             return $ret;
             break;
         case "longdate":
             //return YYYY/MM/DD format - not optimal as it is not using local date format, but how do we do that
             //when we cannot convert it to a UNIX timestamp?
             return str_replace("-", "/", $value);
         case "date":
             return XoopsLocale::formatTimestamp($value, 's');
             break;
         case "datetime":
             if (!empty($value)) {
                 return XoopsLocale::formatTimestamp($value, 'm');
             } else {
                 return _PROFILE_MI_NEVER_LOGGED_IN;
             }
             break;
         case "autotext":
             $value = $user->getVar($this->getVar('field_name'), 'n');
             //autotext can have HTML in it
             $value = str_replace("{X_UID}", $user->getVar("uid"), $value);
             $value = str_replace("{X_URL}", \XoopsBaseConfig::get('url'), $value);
             $value = str_replace("{X_UNAME}", $user->getVar("uname"), $value);
             return $value;
             break;
         case "rank":
             $userrank = $user->rank();
             $user_rankimage = "";
             if (isset($userrank['image']) && $userrank['image'] != "") {
                 $user_rankimage = '<img src="' . $userrank['image'] . '" alt="' . $userrank['title'] . '" /><br />';
             }
             return $user_rankimage . $userrank['title'];
             break;
         case "yesno":
             return $value ? XoopsLocale::YES : XoopsLocale::NO;
             break;
         case "timezone":
             $timezones = XoopsLists::getTimeZoneList();
             $value = empty($value) ? "0" : (string) $value;
             return $timezones[str_replace('.0', '', $value)];
             break;
     }
 }