コード例 #1
0
ファイル: functions_online.php プロジェクト: 0hyeah/yurivn
function construct_online_bit($userinfo, $doall = 0)
{
    global $vbulletin, $vbphrase, $show;
    global $wol_album, $wol_attachment, $wol_calendar, $wol_event, $wol_inf, $wol_pm, $wol_post, $wol_search, $wol_socialgroup, $wol_thread, $wol_user;
    static $count;
    $count++;
    $show['nopermission'] = false;
    $show['lockedout'] = false;
    $show['errormessage'] = false;
    if ($userinfo['attachmentid']) {
        $postid = $wol_attachment["{$userinfo['attachmentid']}"];
    } else {
        $postid = $userinfo['postid'];
    }
    if ($postid) {
        $threadid = $wol_post["{$postid}"];
    } else {
        $threadid = $userinfo['threadid'];
    }
    $forumid = $userinfo['forumid'];
    $calendarid = $userinfo['calendarid'];
    $eventid = $userinfo['eventid'];
    $searchid = $userinfo['searchid'];
    $groupid = $userinfo['socialgroupid'];
    $albumid = $userinfo['albumid'];
    if ($albumid) {
        require_once DIR . '/includes/functions_album.php';
        $albumname = fetch_censored_text($wol_album["{$albumid}"]['title']);
        $canviewalbum = true;
        if ($wol_album["{$albumid}"]['state'] == 'profile' and !can_view_profile_albums($wol_album["{$albumid}"]['userid'])) {
            $canviewalbum = false;
        } else {
            if ($wol_album["{$albumid}"]['state'] == 'private' and !can_view_private_albums($wol_album["{$albumid}"]['userid'])) {
                $canviewalbum = false;
            }
        }
    }
    if ($groupid) {
        $groupname = fetch_censored_text($wol_socialgroup["{$groupid}"]['name']);
        $canviewgroup = true;
    }
    if ($searchid) {
        $searchquery = $wol_search["{$searchid}"]['query'];
        $searchuser = $wol_search["{$searchid}"]['searchuser'];
        $searchuserid = $wol_search["{$searchid}"]['userid'];
    }
    if (!$forumid and isset($wol_thread["{$threadid}"]['forumid'])) {
        $forumid = $wol_thread["{$threadid}"]['forumid'];
    } else {
        if (!$forumid and isset($wol_thread["{$wol_post[$postid]}"]['forumid'])) {
            $forumid = $wol_thread["{$wol_post[$postid]}"]['forumid'];
        }
    }
    $threadtitle = fetch_censored_text($wol_thread["{$threadid}"]['title']);
    $threadprefix = $wol_thread["{$threadid}"]['prefixid'] ? $vbphrase['prefix_' . $wol_thread["{$threadid}"]['prefixid'] . '_title_rich'] . ' ' : '';
    $canview = $vbulletin->userinfo['forumpermissions']["{$forumid}"] & $vbulletin->bf_ugp_forumpermissions['canview'];
    $canviewothers = $vbulletin->userinfo['forumpermissions']["{$forumid}"] & $vbulletin->bf_ugp_forumpermissions['canviewothers'];
    $canviewthreads = $vbulletin->userinfo['forumpermissions']["{$forumid}"] & $vbulletin->bf_ugp_forumpermissions['canviewthreads'];
    $postuserid = $wol_thread["{$threadid}"]['postuserid'];
    $forumtitle = $vbulletin->forumcache["{$forumid}"]['title'];
    $threadpreview = $wol_thread["{$threadid}"]['preview'];
    if (!$calendarid and isset($wol_event["{$eventid}"]['calendarid'])) {
        $calendarid = $wol_event["{$eventid}"]['calendarid'];
    }
    $eventtitle = $wol_event["{$eventid}"]['title'];
    $eventpostuserid = $wol_event["{$eventid}"]['postuserid'];
    $calendartitle = $wol_calendar["{$calendarid}"];
    $canviewcalendar = $vbulletin->userinfo['calendarpermissions']["{$calendarid}"] & $vbulletin->bf_ugp_calendarpermissions['canviewcalendar'];
    $canviewothersevent = $vbulletin->userinfo['calendarpermissions']["{$calendarid}"] & $vbulletin->bf_ugp_calendarpermissions['canviewothersevent'];
    if (($wol_thread["{$threadid}"]['isdeleted'] or !$wol_thread["{$threadid}"]['visible']) and !can_moderate($forumid)) {
        $threadviewable = 0;
    } else {
        $threadviewable = 1;
    }
    if ($threadviewable and $threadtitle and $canview and ($canviewothers or $postuserid == $vbulletin->userinfo['userid']) and verify_forum_password($forumid, $vbulletin->forumcache["{$forumid}"]['password'], false)) {
        $seetitle = 1;
    }
    if ($forumtitle and ($canview or $vbulletin->forumcache["{$forumid}"]['showprivate'] > 1 or !$vbulletin->forumcache["{$forumid}"]['showprivate'] and $vbulletin->options['showprivateforums'])) {
        $seeforum = 1;
    }
    if ($eventtitle and $canviewcalendar and ($canviewothersevent or $eventpostuserid == $vbulletin->userinfo['userid'])) {
        $seeevent = 1;
    }
    if ($calendartitle and $canviewcalendar) {
        $seecalendar = 1;
    }
    if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull']) {
        if ($userinfo['pmid']) {
            $seeuserid = $wol_pm["{$userinfo['pmid']}"];
        } else {
            if ($userinfo['searchid']) {
                $seeuserid = $wol_search["{$searchid}"]['targetuserid'];
            } else {
                if ($userinfo['infractionid']) {
                    $seeuserid = $wol_inf["{$userinfo['infractionid']}"]['userid'];
                } else {
                    $seeuserid = $userinfo['targetuserid'];
                }
            }
        }
        $username = $wol_user["{$seeuserid}"]['musername'];
    }
    if (strpos($userinfo['location'], 'route:') === 0) {
        $handled = false;
        $location = substr($userinfo['location'], strlen('route:'));
        $location = explode('|', $location);
        if (sizeof($location) == 4) {
            try {
                list($route_path, $phrasegroup, $phrasekey, $title) = $location;
                $route_path = urldecode($route_path);
                $title = urldecode($title);
                list($type) = explode('_', vB_Router::getRouteClassFromPath($route_path));
                $class = $type . '_Permissions';
                $route = vB_Router::createRoute($route_path);
                $nodeid = intval($route->getRoutePath());
                $userinfo['action'] = new vB_Phrase($phrasegroup, $phrasekey);
                if (class_exists($class)) {
                    $perms = new $class();
                    $canview = $perms->canView($nodeid);
                } else {
                    $canview = true;
                    // Default to allowed
                }
                if ($canview) {
                    $userinfo['where'] = '<a href="' . $route->getCurrentUrl() . '">' . htmlspecialchars_uni($title) . '</a>';
                } else {
                    $userinfo['where'] = '';
                }
                if (vB::$vbulletin->session->vars['sessionhash']) {
                    $userinfo['where'] .= '&amp;s=' . vB::$vbulletin->session->vars['sessionhash'];
                }
                $handled = true;
            } catch (vB_Exception $e) {
            }
        }
    }
    if (!$handled) {
        switch ($userinfo['activity']) {
            case 'api':
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinebad']) {
                    $userinfo['action'] = $vbphrase['calling_api'];
                    $userinfo['where'] = $userinfo['api'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                    $userinfo['where'] = '<a href="' . fetch_seo_url('forumhome', array()) . '">' . $vbulletin->options['bbtitle'] . '</a>';
                }
                break;
            case 'visitormessage_posting':
                $userinfo['action'] = $vbphrase['posting_visitor_message'];
                break;
            case 'visitormessage_delete':
                $userinfo['action'] = $vbphrase['deleting_visitor_message'];
                break;
            case 'viewingipaddress':
                $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
                if (can_moderate()) {
                    $userinfo['action'] = $vbphrase['viewing_ip_address'];
                }
                break;
            case 'visitormessage_reporting':
                $userinfo['action'] = $vbphrase['reporting_visitor_message'];
                break;
            case 'activitystream':
                $userinfo['action'] = $vbphrase['viewing_activity_stream'];
                break;
            case 'posthistory':
                $userinfo['action'] = $vbphrase['viewing_post_history'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title']), array('p' => $postid)) . "#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'tags':
                $userinfo['action'] = $vbphrase['managing_tags'];
                break;
            case 'tag_list':
                $userinfo['action'] = $vbphrase['viewing_tag_list'];
                break;
            case 'socialgroups_join':
                $userinfo['action'] = $vbphrase['joining_social_group'];
                if ($canviewgroup) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('group', array('groupid' => $groupid, 'name' => $groupname)) . "\">{$groupname}</a>";
                }
                break;
            case 'socialgroups_leave':
                $userinfo['action'] = $vbphrase['leaving_social_group'];
                if ($canviewgroup) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('group', array('groupid' => $groupid, 'name' => $groupname)) . "\">{$groupname}</a>";
                }
                break;
            case 'socialgroups_edit':
                $userinfo['action'] = $vbphrase['editing_social_group'];
                if ($canviewgroup) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('group', array('groupid' => $groupid, 'name' => $groupname)) . "\">{$groupname}</a>";
                }
                break;
            case 'socialgroups_view':
                $userinfo['action'] = $vbphrase['viewing_social_group'];
                if ($canviewgroup) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('group', array('groupid' => $groupid, 'name' => $groupname)) . "\">{$groupname}</a>";
                }
                break;
            case 'socialgroups_memberlist':
                $userinfo['action'] = $vbphrase['viewing_social_group_memberlist'];
                if ($canviewgroup) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('group', array('groupid' => $groupid, 'name' => $groupname)) . "\">{$groupname}</a>";
                }
                break;
            case 'socialgroups_delete':
                $userinfo['action'] = $vbphrase['deleting_social_group'];
                if ($canviewgroup) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('group', array('groupid' => $groupid, 'name' => $groupname)) . "\">{$groupname}</a>";
                }
                break;
            case 'socialgroups_create':
                $userinfo['action'] = $vbphrase['creating_social_group'];
                break;
            case 'socialgroups_list':
                $userinfo['action'] = $vbphrase['viewing_social_group_list'];
                if ($canviewgroup) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('group', array('groupid' => $groupid, 'name' => $groupname)) . "\">{$groupname}</a>";
                }
                break;
            case 'socialgroups_subscriptions':
                $userinfo['action'] = $vbphrase['viewing_social_group_subscriptions'];
                break;
            case 'group_inlinemod':
                $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
                break;
            case 'showthread':
                $userinfo['action'] = $vbphrase['viewing_thread'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'showpost':
                $userinfo['action'] = $vbphrase['viewing_thread'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title']), array('p' => $postid)) . "#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'forumdisplay':
                $userinfo['action'] = $vbphrase['viewing_forum'];
                if ($seeforum) {
                    if ($vbulletin->forumcache["{$forumid}"]['link']) {
                        $userinfo['action'] = $vbphrase['followed_forum_link'];
                    }
                    $userinfo['where'] = '<a href="' . fetch_seo_url('forum', array('forumid' => $forumid, 'title' => $forumtitle)) . "\">{$forumtitle}</a>";
                }
                break;
            case 'newthread':
                $userinfo['action'] = $vbphrase['creating_thread'];
                if ($seeforum) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('forum', array('forumid' => $forumid, 'title' => $forumtitle)) . "\">{$forumtitle}</a>";
                }
                break;
            case 'newreply':
                $userinfo['action'] = $vbphrase['replying_to_thread'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'attachments':
            case 'manageattachment':
                $userinfo['action'] = $vbphrase['managing_attachments'];
                break;
            case 'attachment':
                $userinfo['action'] = $vbphrase['viewing_attachment'];
                break;
            case 'index':
                $userinfo['action'] = $vbphrase['viewing_index'];
                $userinfo['where'] = '<a href="' . fetch_seo_url('forumhome', array()) . '">' . $vbulletin->options['bbtitle'] . '</a>';
                break;
            case 'online':
                $userinfo['action'] = $vbphrase['viewing_whos_online'];
                break;
            case 'searchnew':
                $userinfo['action'] = $vbphrase['viewing_new_posts'];
                $userinfo['where'] = '<a href="search.php?' . $vbulletin->session->vars['sessionurl'] . "do=getnew\">{$vbphrase['new_posts']}</a>";
                break;
            case 'search':
                $userinfo['action'] = $vbphrase['searching_forums'];
                if ($searchid and $vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull']) {
                    if ($searchquery) {
                        $userinfo['where'] = construct_phrase($vbphrase['query_x'], htmlspecialchars_uni($searchquery));
                    }
                    if ($searchuser and $wol_search["{$searchid}"]['targetuserid']) {
                        if ($searchquery) {
                            $userinfo['where'] .= '<br />';
                        }
                        $userinfo['where'] .= construct_phrase($vbphrase['user_x'], '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>");
                    }
                }
                break;
            case 'mail':
                $userinfo['action'] = $vbphrase['emailing'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                }
                break;
            case 'getinfo':
                $userinfo['action'] = $vbphrase['viewing_user_profile'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                }
                break;
            case 'converse':
                $userinfo['action'] = $vbphrase['viewing_conversation'];
                if ($seeuserid and $wol_user["{$userinfo['guestuserid']}"]) {
                    $userinfo['where'] = construct_phrase($vbphrase['x_and_y_converse'], '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>", '<a href="' . fetch_seo_url('member', array('userid' => $userinfo['guestuserid'], 'username' => $wol_user["{$userinfo['guestuserid']}"]['username'])) . "\">" . $wol_user["{$userinfo['guestuserid']}"]['username'] . "</a>");
                }
                break;
            case 'editprofile':
                $userinfo['action'] = $vbphrase['modifying_profile'];
                break;
            case 'editoptions':
                $userinfo['action'] = $vbphrase['modifying_options'];
                break;
            case 'lostpw':
            case 'editpassword':
                $userinfo['action'] = $vbphrase['modifying_password'];
                break;
            case 'editavatar':
                $userinfo['action'] = $vbphrase['modifying_avatar'];
                break;
            case 'editprofilepic':
                $userinfo['action'] = $vbphrase['modifying_profilepic'];
                break;
            case 'editsignature':
                $userinfo['action'] = $vbphrase['modifying_signature'];
                break;
            case 'markread':
                $userinfo['where'] = $vbphrase['marking_forums_read'];
                break;
            case 'whoposted':
                if ($seetitle) {
                    $userinfo['action'] = $vbphrase['viewing_who_posted'];
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                } else {
                    $userinfo['action'] = $vbphrase['viewing_thread'];
                }
                break;
            case 'showattachments':
                if ($seetitle) {
                    $userinfo['action'] = $vbphrase['viewing_attachment_list'];
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                } else {
                    $userinfo['action'] = $vbphrase['viewing_thread'];
                }
                break;
            case 'showgroups':
                $userinfo['action'] = $vbphrase['viewing_forum_leaders'];
                break;
            case 'login':
                $userinfo['action'] = $vbphrase['logging_in'];
                break;
            case 'logout':
                if ($userinfo['badlocation']) {
                    $userinfo['action'] = $vbphrase['logging_out'];
                }
                break;
            case 'archive':
                $userinfo['action'] = $vbphrase['viewing_archives'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . "<a href=\"archive/index.php/t-{$threadid}.html\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                } else {
                    if ($seeforum) {
                        $userinfo['where'] = "<a href=\"archive/index.php/f-{$forumid}.html\">{$forumtitle}</a>";
                    }
                }
                break;
            case 'pm':
                $userinfo['action'] = $vbphrase['private_messaging'];
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull']) {
                    if ($seeuserid) {
                        $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                    }
                    if ($userinfo['values']['do'] == 'newpm' or $userinfo['values']['do'] == 'insertpm' or $userinfo['values']['do'] == 'newmessage') {
                        $userinfo['action'] = $vbphrase['creating_private_message'];
                    } else {
                        if ($userinfo['values']['do'] == 'editfolders' or $userinfo['action']['do'] == 'updatefolders') {
                            $userinfo['action'] = $vbphrase['modifying_private_message_folders'];
                        } else {
                            if ($userinfo['values']['do'] == 'trackpm' or $userinfo['values']['do'] == 'deletepmreceipt') {
                                $userinfo['action'] = $vbphrase['tracking_private_messages'];
                            } else {
                                if ($userinfo['values']['do'] == 'showpm') {
                                    $userinfo['action'] = $vbphrase['viewing_private_message'];
                                } else {
                                    if ($userinfo['values']['do'] == 'downloadpm') {
                                        $userinfo['action'] = $vbphrase['downloading_private_messages'];
                                    }
                                }
                            }
                        }
                    }
                }
                break;
            case 'addbuddy':
            case 'addignore':
            case 'buddyignore':
                $userinfo['action'] = $vbphrase['modifying_contact_ignore_list'];
                break;
            case 'subfolders':
                $userinfo['action'] = $vbphrase['modifying_subscription_folders'];
                break;
            case 'subscription':
                $userinfo['action'] = $vbphrase['viewing_subscribed_threads'];
                break;
            case 'addsubforum':
                $userinfo['action'] = $vbphrase['subscribing_to_forum'];
                if ($seeforum) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('forum', array('forumid' => $forumid, 'title' => $forumtitle)) . "\">{$forumtitle}</a>";
                }
                break;
            case 'addsubthread':
                $userinfo['action'] = $vbphrase['subscribing_to_thread'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'remsubthread':
                $userinfo['action'] = $vbphrase['deleting_subscribed_threads'];
                break;
            case 'remsubforum':
                $userinfo['action'] = $vbphrase['deleting_subscribed_forums'];
                break;
            case 'usercp':
                $userinfo['action'] = $vbphrase['viewing_user_control_panel'];
                break;
            case 'memberlistsearch':
                $userinfo['action'] = $vbphrase['searching_member_list'];
                break;
            case 'memberlist':
                $userinfo['action'] = $vbphrase['viewing_member_list'];
                break;
            case 'member_inlinemod':
                $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
                if (can_moderate()) {
                    if ($seeuserid) {
                        $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                    }
                }
                break;
            case 'inlinemod':
                $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
                if (can_moderate()) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                    switch ($userinfo['values']['do']) {
                        case 'open':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_opening_threads'] . '</i>';
                            break;
                        case 'close':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_closing_threads'] . '</i>';
                            break;
                        case 'stick':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_sticking_threads'] . '</i>';
                            break;
                        case 'unstick':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_unsticking_threads'] . '</i>';
                            break;
                        case 'deletethread':
                        case 'dodeletethreads':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_deleting_threads'] . '</i>';
                            break;
                        case 'undeletethread':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_undeleting_threads'] . '</i>';
                            break;
                        case 'approvethread':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_approving_threads'] . '</i>';
                            break;
                        case 'unapprovethread':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_unapproving_threads'] . '</i>';
                            break;
                        case 'movethread':
                        case 'domovethreads':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_moving_threads'] . '</i>';
                            break;
                        case 'mergethread':
                        case 'domergethreads':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_merging_threads'] . '</i>';
                            break;
                        case 'deleteposts':
                        case 'dodeleteposts':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_deleting_posts'] . '</i>';
                            break;
                        case 'undeleteposts':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_undeleting_posts'] . '</i>';
                            break;
                        case 'approveposts':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_approving_posts'] . '</i>';
                            break;
                        case 'unapproveposts':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_unapproving_posts'] . '</i>';
                            break;
                        case 'mergeposts':
                        case 'domergeposts':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_merging_posts'] . '</i>';
                            break;
                        case 'moveposts':
                        case 'domoveposts':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_moving_posts'] . '</i>';
                            break;
                        case 'clearthread':
                        case 'clearpost':
                            $userinfo['action'] = '<i>' . $vbphrase['inline_mod_clear'] . '</i>';
                            break;
                        case 'spampost':
                        case 'dodeletespam':
                        case 'spamconfirm':
                            $userinfo['action'] = '<i>' . $vbphrase['managing_spam'] . '</i>';
                            break;
                    }
                }
                break;
            case 'postings':
                $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</b></i>';
                if (can_moderate($forumid) and $threadtitle and $canview and ($canviewothers or $postuserid == $vbulletin->userinfo['userid'])) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                    switch ($userinfo['values']['do']) {
                        case 'editthread':
                        case 'updatethread':
                            $userinfo['action'] = '<i>' . $vbphrase['modifying_thread'] . '</i>';
                            break;
                        case 'openclosethread':
                            $userinfo['action'] = '<i>' . $vbphrase['open_close_thread'] . '</i>';
                            break;
                        case 'movethread':
                            $userinfo['action'] = '<i>' . $vbphrase['choosing_forum_to_move_thread_to'] . '</i>';
                            break;
                        case 'domovethread':
                            switch ($userinfo['values']['method']) {
                                case 'copy':
                                    $userinfo['action'] = '<i>' . $vbphrase['copying_thread_to_forum'] . '</i>';
                                    break;
                                case 'move':
                                    $userinfo['action'] = '<i>' . $vbphrase['moving_thread_to_forum'] . '</i>';
                                    break;
                                case 'movered':
                                    $userinfo['action'] = '<i>' . $vbphrase['moving_thread_with_redirect_to_forum'] . '</i>';
                                    break;
                            }
                            $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a><br />" . '<a href="' . fetch_seo_url('forum', array('forumid' => $forumid, 'title' => $forumtitle)) . "\">{$forumtitle}</a>";
                            break;
                        case 'deletethread':
                        case 'dodeletethread':
                            $userinfo['action'] = '<i>' . $vbphrase['deleting_thread'] . '</i>';
                            break;
                        case 'deleteposts':
                        case 'dodeleteposts':
                            $userinfo['where'] = '<i>' . $vbphrase['deleting_posts'] . '</i>';
                            break;
                        case 'merge':
                        case 'domergethread':
                            $userinfo['where'] = '<i>' . $vbphrase['merging_threads'] . '</i>';
                            break;
                        case 'stick':
                            $userinfo['where'] = '<i>' . $vbphrase['stick_unstick_thread'] . '</i>';
                            break;
                        case 'getip':
                            $userinfo['where'] = '<i>' . $vbphrase['viewing_ip_address'] . '</i>';
                            break;
                        case 'removeredirect':
                            $userinfo['where'] = '<i>' . $vbphrase['deleting_redirect'] . '</i>';
                            break;
                    }
                }
                break;
            case 'register':
                $userinfo['action'] = $vbphrase['registering'];
                break;
            case 'requestemail':
                $userinfo['action'] = $vbphrase['request_activation_code'];
                break;
            case 'activate':
                $userinfo['action'] = $vbphrase['activating_registration'];
                break;
            case 'announcement':
                $userinfo['action'] = $vbphrase['viewing_announcement'];
                if ($seeforum) {
                    $userinfo['where'] = '<a href="announcement.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
                }
                break;
            case 'usergroup':
                $userinfo['action'] = $vbphrase['modifying_usergroups'];
                break;
            case 'polls':
                switch ($userinfo['values']['do']) {
                    case 'showresults':
                        $userinfo['action'] = $vbphrase['viewing_poll'];
                        break;
                    case '':
                    case 'newpoll':
                    case 'postpoll':
                        $userinfo['action'] = $vbphrase['creating_poll'];
                        if ($seeforum) {
                            $userinfo['where'] = '<a href="' . fetch_seo_url('forum', array('forumid' => $forumid, 'title' => $forumtitle)) . "\">{$forumtitle}</a>";
                        }
                        break;
                    case 'polledit':
                    case 'updatepoll':
                        $userinfo['action'] = $vbphrase['modifying_poll'];
                        break;
                    case 'pollvote':
                        $userinfo['action'] = $vbphrase['voting'];
                        break;
                }
                break;
            case 'showsmilies':
                $userinfo['action'] = $vbphrase['viewing_smilies'];
                break;
            case 'showavatars':
                $userinfo['action'] = $vbphrase['viewing_avatars'];
                break;
            case 'bbcode':
                $userinfo['action'] = $vbphrase['viewing_bb_code'];
                break;
            case 'faq':
                $userinfo['action'] = $vbphrase['viewing_faq'];
                break;
            case 'edit':
                $userinfo['action'] = $vbphrase['modifying_post'];
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title']), array('p' => $postid)) . "#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'sendto':
                $userinfo['action'] = $vbphrase['sending_thread_to_friend'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="printthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'contactus':
                $userinfo['action'] = $vbphrase['sending_forum_feedback'];
                break;
            case 'aim':
                $userinfo['action'] = $vbphrase['sending_aim_message'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                }
                break;
            case 'msn':
                $userinfo['action'] = $vbphrase['sending_msn_message'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                }
                break;
            case 'yahoo':
                $userinfo['action'] = $vbphrase['sending_yahoo_message'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                }
                break;
            case 'icq':
                $userinfo['action'] = $vbphrase['sending_icq_message'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                }
                break;
            case 'skype':
                $userinfo['action'] = $vbphrase['sending_skype_message'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                }
                break;
            case 'report':
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title']), array('p' => $postid)) . "#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                $userinfo['action'] = $vbphrase['reporting_post'];
                break;
            case 'printthread':
                $userinfo['action'] = $vbphrase['viewing_printable_version'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="printthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'calendarweek':
                $userinfo['action'] = $vbphrase['viewing_calendar'];
                if ($seecalendar) {
                    if ($userinfo['week']) {
                        $week = "&amp;week={$userinfo['week']}";
                    }
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=displayweek&amp;c={$calendarid}{$week}\">{$calendartitle}</a>";
                }
                break;
            case 'calendarmonth':
                $userinfo['action'] = $vbphrase['viewing_calendar'];
                if ($seecalendar) {
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=displaymonth&amp;c={$calendarid}&amp;month={$userinfo['month']}&amp;year={$userinfo['year']}\">{$calendartitle}</a>";
                }
                break;
            case 'calendaryear':
                $userinfo['action'] = $vbphrase['viewing_calendar'];
                if ($seecalendar) {
                    if ($userinfo['year']) {
                        $year = "&amp;year={$userinfo['year']}";
                    }
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=displayyear&amp;c={$calendarid}{$year}\">{$calendartitle}</a>";
                }
                break;
            case 'calendarday':
                $userinfo['action'] = $vbphrase['viewing_calendar'];
                if ($seecalendar) {
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getday&amp;c={$calendarid}&amp;day={$userinfo['day']}\">{$calendartitle}</a>";
                }
                break;
            case 'calendarevent':
                $userinfo['action'] = $vbphrase['viewing_event'];
                if ($seeevent) {
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;e={$eventid}\">{$eventtitle}</a>";
                }
                break;
            case 'calendaradd':
            case 'calendaraddrecur':
                $userinfo['action'] = $vbphrase['creating_event'];
                if ($seecalendar) {
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "c={$calendarid}\">{$calendartitle}</a>";
                }
                break;
            case 'calendaredit':
                $userinfo['action'] = $vbphrase['modifying_event'];
                if ($seeevent) {
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;e={$eventid}\">{$eventtitle}</a>";
                }
                break;
            case 'calreminder':
                $userinfo['action'] = $vbphrase['managing_reminder'];
                if ($seeevent) {
                    $userinfo['where'] = '<a href="calendar.php?' . $vbulletin->session->vars['sessionurl'] . "do=getinfo&amp;e={$eventid}\">{$eventtitle}</a>";
                }
                break;
            case 'newusernote':
                $userinfo['action'] = $vbphrase['creating_user_note'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="usernote.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewuser&amp;u={$seeuserid}\">{$username}</a>";
                }
                break;
            case 'usernote':
                $userinfo['action'] = $vbphrase['viewing_user_note'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="usernote.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewuser&amp;u={$seeuserid}\">{$username}</a>";
                }
                break;
            case 'reputation':
                $userinfo['action'] = $vbphrase['giving_reputation'];
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'joinrequests':
                $userinfo['action'] = $vbphrase['processing_joinrequests'];
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $vbulletin->usergroupcache["{$userinfo['usergroupid']}"]['title']) {
                    $userinfo['where'] = construct_phrase($vbphrase['viewing_x'], $vbulletin->usergroupcache["{$userinfo['usergroupid']}"]['title']);
                }
                break;
            case 'threadrate':
                $userinfo['action'] = $vbphrase['rating_thread'];
                if ($seetitle) {
                    $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title'])) . "\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                }
                break;
            case 'infractionreport':
                if ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangiveinfraction'] or $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_wolpermissions['canreverseinfraction']) {
                    $userinfo['action'] = $vbphrase['giving_infraction'];
                    if ($seeuserid) {
                        $userinfo['where'] = '<a href="' . fetch_seo_url('member', array('userid' => $seeuserid, 'username' => $wol_user["{$seeuserid}"]['username'])) . "\">{$username}</a>";
                    } else {
                        if ($seetitle) {
                            $userinfo['where'] = $threadprefix . '<a href="' . fetch_seo_url('thread', array('threadid' => $threadid, 'title' => $wol_thread["{$threadid}"]['title']), array('p' => $postid)) . "#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
                        }
                    }
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'infractionreverse':
                if ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangiveinfraction'] or $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_wolpermissions['canreverseinfraction']) {
                    $userinfo['action'] = $vbphrase['reversing_infraction'];
                    if ($seeuserid) {
                        $userinfo['where'] = '<a href="infraction.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;infractionid={$userinfo['infractionid']}\">{$username}</a>";
                    }
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'infractionview':
                if ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangiveinfraction'] or $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_wolpermissions['canreverseinfraction']) {
                    $userinfo['action'] = $vbphrase['viewing_infraction'];
                    if ($seeuserid) {
                        $userinfo['where'] = '<a href="infraction.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;infractionid={$userinfo['infractionid']}\">{$username}</a>";
                    }
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_deletedthreads':
                if (can_moderate()) {
                    $userinfo['action'] = $vbphrase['viewing_deleted_threads'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_deletedposts':
                if (can_moderate()) {
                    $userinfo['action'] = $vbphrase['viewing_deleted_posts'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_deletedvms':
                if (can_moderate(0, 'canmoderatevisitormessages')) {
                    $userinfo['action'] = $vbphrase['viewing_deleted_visitor_messages'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_deletedgms':
                if (can_moderate(0, 'canmoderategroupmessages')) {
                    $userinfo['action'] = $vbphrase['viewing_deleted_social_group_messages'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_deletedpcs':
                if (can_moderate(0, 'canmoderatepicturecomments')) {
                    $userinfo['action'] = $vbphrase['viewing_deleted_picture_comments'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_moderatedthreads':
                if (can_moderate(0, 'canmoderateposts')) {
                    $userinfo['action'] = $vbphrase['viewing_moderated_threads'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_moderatedposts':
                if (can_moderate(0, 'canmoderateposts')) {
                    $userinfo['action'] = $vbphrase['viewing_moderated_posts'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_moderatedvms':
                if (can_moderate(0, 'canmoderatevisitormessages')) {
                    $userinfo['action'] = $vbphrase['viewing_moderated_visitor_messages'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_moderatedgms':
                if (can_moderate(0, 'canmoderategroupmessages')) {
                    $userinfo['action'] = $vbphrase['viewing_moderated_social_group_messages'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_moderatedpcs':
                if (can_moderate(0, 'canmoderatepicturecomments')) {
                    $userinfo['action'] = $vbphrase['viewing_moderated_picture_comments'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'modcp_moderatedattachments':
                if (can_moderate()) {
                    $userinfo['action'] = $vbphrase['viewing_moderated_attachments'];
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                }
                break;
            case 'payments':
                $userinfo['action'] = $vbphrase['viewing_paid_subscriptions'];
                break;
            case 'spider':
                $userinfo['action'] = $vbphrase['search_engine_spider'];
                break;
            case 'admincp':
                $userinfo['action'] = $vbphrase['admin_control_panel'];
                break;
            case 'admincplogin':
                $userinfo['action'] = $vbphrase['admin_control_panel_login'];
                break;
            case 'modcp':
                $userinfo['action'] = $vbphrase['moderator_control_panel'];
                break;
            case 'modcplogin':
                $userinfo['action'] = $vbphrase['moderator_control_panel_login'];
                break;
            case 'album_delete':
                $userinfo['action'] = $vbphrase['deleting_album'];
                break;
            case 'album_edit_album':
                $userinfo['action'] = $vbphrase['editing_album'];
                if ($canviewalbum) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
                }
                break;
            case 'album_new_album':
                $userinfo['action'] = $vbphrase['creating_album'];
                break;
            case 'album_edit_picture':
                $userinfo['action'] = $vbphrase['editing_pictures'];
                if ($canviewalbum) {
                    if (!empty($userinfo['attachmentid'])) {
                        $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}&amp;attachmentid=" . $userinfo['attachmentid'] . "\">{$albumname}</a>";
                    } else {
                        $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
                    }
                }
                break;
            case 'album_upload':
                $userinfo['action'] = $vbphrase['uploading_pictures'];
                if ($canviewalbum) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
                }
                break;
            case 'album_picture':
                $userinfo['action'] = $vbphrase['viewing_picture'];
                if ($canviewalbum) {
                    if (!empty($userinfo['attachmentid'])) {
                        $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}&amp;attachmentidid=" . $userinfo['attachmentid'] . "\">{$albumname}</a>";
                    } else {
                        $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
                    }
                }
                break;
            case 'album_album':
                $userinfo['action'] = $vbphrase['viewing_album'];
                if ($canviewalbum) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}\">{$albumname}</a>";
                }
                break;
            case 'album_user':
                $userinfo['action'] = $vbphrase['viewing_users_album'];
                if ($seeuserid) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "userid={$seeuserid}\">{$username}</a>";
                }
                break;
            case 'album_unread_comments':
                $userinfo['action'] = $vbphrase['viewing_unread_picture_comments'];
                break;
            case 'album_moderated_comments':
                $userinfo['action'] = $vbphrase['viewing_picture_comments_awaiting_approval'];
                break;
            case 'picturecomment_posting':
                $userinfo['action'] = $vbphrase['posting_picture_comment'];
                break;
            case 'picturecomment_delete':
                $userinfo['action'] = $vbphrase['deleting_picture_comment'];
                break;
            case 'picturecomment_reporting':
                $userinfo['action'] = $vbphrase['reporting_picture_comment'];
                break;
            case 'picture_inlinemod':
                $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
                break;
            case 'viewing_cms_content':
                require_once DIR . '/includes/functions_login.php';
                $userinfo['action'] = $vbphrase['viewing_cms_content'];
                $userinfo['location'] = fetch_replaced_session_url(stripslashes($userinfo['location']));
                $userinfo['where'] = "<a href=\"{$userinfo['location']}\">{$userinfo['location']}</a>";
                break;
            case 'viewing_cms_list':
                require_once DIR . '/includes/functions_login.php';
                $userinfo['action'] = $vbphrase['viewing_cms_list'];
                $userinfo['location'] = fetch_replaced_session_url(stripslashes($userinfo['location']));
                $userinfo['where'] = "<a href=\"{$userinfo['location']}\">{$userinfo['location']}</a>";
                break;
            default:
                $handled = false;
                ($hook = vBulletinHook::fetch_hook('online_location_unknown')) ? eval($hook) : false;
                if ($handled == false) {
                    if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinebad']) {
                        require_once DIR . '/includes/functions_login.php';
                        $userinfo['location'] = fetch_replaced_session_url(stripslashes($userinfo['location']));
                        $userinfo['where'] = "<a href=\"{$userinfo['location']}\">{$userinfo['location']}</a>";
                        $userinfo['action'] = '<b>' . $vbphrase['unknown_location'] . '</b>';
                    } else {
                        // We were unable to parse the location
                        $userinfo['action'] = $vbphrase['viewing_index'];
                        $userinfo['where'] = '<a href="' . fetch_seo_url('forumhome', array()) . '">' . $vbulletin->options['bbtitle'] . "</a>";
                    }
                }
        }
    }
    if ($userinfo['badlocation'] == 1) {
        // User received 'no permissions screen'
        if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinebad'] or $userinfo['userid'] == $vbulletin->userinfo['userid']) {
            $show['nopermission'] = true;
        } else {
            $userinfo['action'] = $vbphrase['viewing_index'];
            $userinfo['where'] = '<a href="' . fetch_seo_url('forumhome', array()) . '">' . $vbulletin->options['bbtitle'] . "</a>";
        }
    } else {
        if ($userinfo['badlocation'] == 2) {
            // Forum is locked
            $show['lockedout'] = true;
        } else {
            if ($userinfo['badlocation'] == 3) {
                // User received error screen
                if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinebad'] or $userinfo['userid'] == $vbulletin->userinfo['userid']) {
                    $show['errormessage'] = true;
                } else {
                    $userinfo['action'] = $vbphrase['viewing_index'];
                    $userinfo['where'] = '<a href="' . fetch_seo_url('forumhome', array()) . '">' . $vbulletin->options['bbtitle'] . "</a>";
                }
            }
        }
    }
    if (!($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinelocation'])) {
        unset($userinfo['location']);
    }
    $userinfo['host_encoded'] = urlencode($userinfo['host']);
    if ($vbulletin->options['yestoday'] == 2) {
        $userinfo['time'] = vbdate($vbulletin->options['dateformat'], $userinfo['lastactivity'], 1);
    } else {
        $userinfo['time'] = vbdate($vbulletin->options['timeformat'], $userinfo['lastactivity']);
    }
    $wol_post['userid'] = $userinfo['userid'];
    $wol_post['username'] = $userinfo['realname'];
    ($hook = vBulletinHook::fetch_hook('online_bit_complete')) ? eval($hook) : false;
    if ($doall) {
        $show['loggedinuser'] = iif($userinfo['userid'], true, false);
        $show['buddy'] = iif($userinfo['buddy'], true, false);
        if ($userinfo['spider']) {
            $show['spider'] = true;
            if (!$userinfo['spidertype'] or !($spidertype = construct_phrase($vbphrase["x_spider_{$userinfo['spidertype']}"], $userinfo['spider']))) {
                $spidertype = construct_phrase($vbphrase['x_spider_searchspider'], $userinfo['spider']);
            }
        } else {
            $show['spider'] = false;
        }
        $userinfo['spidertype'] = $spidertype;
        $show['reallocation'] = iif($userinfo['location'], true, false);
        $show['subscribed'] = iif($wol_thread["{$threadid}"]['issubscribed'] and $seetitle, true, false);
        $show['where'] = iif($userinfo['where'], true, false);
        $userinfo['location'] = htmlspecialchars_uni($userinfo['location']);
        $userinfo['show'] = $show;
        return $userinfo;
    } else {
        return $userinfo;
    }
}