示例#1
0
文件: base.php 项目: 0hyeah/yurivn
 protected function fetchCanViewAlbum($albumid)
 {
     if (!$this->fetchCanViewAlbums() or !($album = $this->content['album'][$albumid])) {
         return false;
     }
     if (!($userinfo = $this->content['user'][$album['userid']])) {
         return false;
     }
     cache_permissions($userinfo, false);
     if (!can_moderate(0, 'caneditalbumpicture') and !($userinfo['permissions']['albumpermissions'] & vB::$vbulletin->bf_ugp_albumpermissions['canalbum'])) {
         return false;
     }
     if (!can_view_profile_section($album['userid'], 'albums')) {
         // private album that we can not see
         return false;
     }
     require_once DIR . '/includes/functions_album.php';
     if ($album['state'] == 'private' and !can_view_private_albums($album['userid'], $album['buddy'])) {
         // private album that we can not see
         return false;
     } else {
         if ($album['state'] == 'profile' and !can_view_profile_albums($album['userid'])) {
             // profile album that we can not see
             return false;
         }
     }
     return true;
 }
示例#2
0
function construct_online_bit($userinfo, $doall = 0)
{
    global $vbulletin, $limitlower, $limitupper, $stylevar, $vbphrase, $ipclass, $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 ($doall == 1 and ($count > $limitupper or $count < $limitlower)) {
        return '';
    }
    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 = htmlspecialchars_uni($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'];
                }
            }
        }
    }
    switch ($userinfo['activity']) {
        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'] . '</b></i>';
            if (can_moderate()) {
                $userinfo['action'] = $vbphrase['viewing_ip_address'];
            }
            break;
        case 'visitormessage_reporting':
            $userinfo['action'] = $vbphrase['reporting_visitor_message'];
            break;
        case 'posthistory':
            $userinfo['action'] = $vbphrase['viewing_post_history'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "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="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_leave':
            $userinfo['action'] = $vbphrase['leaving_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_edit':
            $userinfo['action'] = $vbphrase['editing_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_view':
            $userinfo['action'] = $vbphrase['viewing_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_memberlist':
            $userinfo['action'] = $vbphrase['viewing_social_group_memberlist'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewmembers&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            break;
        case 'socialgroups_delete':
            $userinfo['action'] = $vbphrase['deleting_social_group'];
            if ($canviewgroup) {
                $userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewmembers&amp;groupid={$groupid}\">{$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="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid={$groupid}\">{$groupname}</a>";
            }
            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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'showpost':
            $userinfo['action'] = $vbphrase['viewing_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "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="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
            }
            break;
        case 'newthread':
            $userinfo['action'] = $vbphrase['creating_thread'];
            if ($seeforum) {
                $userinfo['where'] = '<a href="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
            }
            break;
        case 'newreply':
            $userinfo['action'] = $vbphrase['replying_to_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'attachments':
            $userinfo['action'] = $vbphrase['viewing_attachments'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="misc.php?' . $vbulletin->session->vars['sessionurl'] . "do=attachments&amp;u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'manageattachment':
            $userinfo['action'] = $vbphrase['managing_attachments'];
            break;
        case 'attachment':
            $userinfo['action'] = $vbphrase['viewing_attachment'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p={$postid}#post{$postid}\" title=\"{$threadpreview}\">{$threadtitle}</a>";
            }
            break;
        case 'index':
            $userinfo['action'] = $vbphrase['viewing_index'];
            $userinfo['where'] = '<a href="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>");
                }
            }
            break;
        case 'mail':
            $userinfo['action'] = $vbphrase['emailing'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'getinfo':
            $userinfo['action'] = $vbphrase['viewing_user_profile'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</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="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>", '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$userinfo['guestuserid']}\">" . $wol_user["{$userinfo['guestuserid']}"] . "</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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" 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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" 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="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</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="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$forumtitle}</a>";
            }
            break;
        case 'addsubthread':
            $userinfo['action'] = $vbphrase['subscribing_to_thread'];
            if ($seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" 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="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
                }
            }
            break;
        case 'inlinemod':
            $userinfo['action'] = '<b><i>' . $vbphrase['moderating'] . '</i></b>';
            if (can_moderate()) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" 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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" 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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" title=\"{$threadpreview}\">{$threadtitle}</a><br />" . '<a href="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$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="forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f={$forumid}\">{$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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "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="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'msn':
            $userinfo['action'] = $vbphrase['sending_msn_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'yahoo':
            $userinfo['action'] = $vbphrase['sending_yahoo_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'icq':
            $userinfo['action'] = $vbphrase['sending_icq_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'skype':
            $userinfo['action'] = $vbphrase['sending_skype_message'];
            if ($seeuserid) {
                $userinfo['where'] = '<a href="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
            }
            break;
        case 'report':
            if ($vbulletin->userinfo['permissions']['wolpermissions'] & $vbulletin->bf_ugp_wolpermissions['canwhosonlinefull'] and $seetitle) {
                $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "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}\">{$wol_user[$seeuserid]}</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}\">{$wol_user[$seeuserid]}</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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" 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="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadid}\" 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="member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$seeuserid}\">{$wol_user[$seeuserid]}</a>";
                } else {
                    if ($seetitle) {
                        $userinfo['where'] = $threadprefix . '<a href="showthread.php?' . $vbulletin->session->vars['sessionurl'] . "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']}\">{$wol_user[$seeuserid]}</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']}\">{$wol_user[$seeuserid]}</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_moderatedpictures':
            if (can_moderate(0, 'canmoderatepictures')) {
                $userinfo['action'] = $vbphrase['viewing_moderated_pictures'];
            } 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['pictureid'])) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}&amp;pictureid=" . $userinfo['pictureid'] . "\">{$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['pictureid'])) {
                    $userinfo['where'] = '<a href="album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albumid}&amp;pictureid=" . $userinfo['pictureid'] . "\">{$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}\">{$wol_user[$seeuserid]}</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;
        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="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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;
        }
        $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);
        eval('$onlinebits = "' . fetch_template('whosonlinebit') . '";');
        return $onlinebits;
    } else {
        return $userinfo;
    }
}
示例#3
0
 /**
  * Prepares Information Regarding the user's Albums
  *
  */
 function prepare_albuminfo()
 {
     if ($this->registry->options['socnet'] & $this->registry->bf_misc_socnet['enable_albums']) {
         require_once DIR . '/includes/functions_album.php';
         $state = array('public');
         if (can_view_private_albums($this->userinfo['userid'])) {
             $state[] = 'private';
         }
         if (can_view_profile_albums($this->userinfo['userid'])) {
             $state[] = 'public';
         }
         $albums = $this->registry->db->query_first_slave("\n\t\t\t\tSELECT COUNT(*) AS albumcount, SUM(album.visible) AS picturecount\n\t\t\t\tFROM " . TABLE_PREFIX . "album AS album\n\t\t\t\tWHERE album.userid = " . $this->userinfo['userid'] . "\n\t\t\t\t\tAND album.state IN ('" . implode("', '", $state) . "')\n\t\t\t");
         $this->prepared['albuminfo'] = array('albumcount' => vb_number_format($albums['albumcount']), 'picturecount' => vb_number_format($albums['picturecount']));
     }
 }
示例#4
0
文件: album.php 项目: holandacz/nb4
            $show['personalalbum'] = true;
            $albumtype = $vbphrase['profile_album_paren'];
        }
    }
    ($hook = vBulletinHook::fetch_hook('album_album_complete')) ? eval($hook) : false;
    // navbar and final output
    $navbits = construct_navbits(array('member.php?' . $vbulletin->session->vars['sessionurl'] . "u={$userinfo['userid']}" => construct_phrase($vbphrase['xs_profile'], $userinfo['username']), 'album.php?' . $vbulletin->session->vars['sessionurl'] . "u={$userinfo['userid']}" => $vbphrase['albums'], '' => $albuminfo['title_html']));
    eval('$navbar = "' . fetch_template('navbar') . '";');
    //$headinclude .= '<style type="text/css">#picturebits table { border: 1px solid red; }</style>';
    eval('print_output("' . fetch_template('album_picturelist') . '");');
}
// #######################################################################
if ($_REQUEST['do'] == 'user') {
    $vbulletin->input->clean_array_gpc('r', array('pagenumber' => TYPE_UINT));
    $state = array('public');
    if (can_view_private_albums($userinfo['userid'])) {
        $state[] = 'private';
    }
    if (can_view_profile_albums($userinfo['userid'])) {
        $state[] = 'profile';
    }
    $albumcount = $db->query_first("\n\t\tSELECT COUNT(*) AS total\n\t\tFROM " . TABLE_PREFIX . "album\n\t\tWHERE userid = {$userinfo['userid']}\n\t\t\tAND state IN ('" . implode("', '", $state) . "')\n\t");
    if ($vbulletin->GPC['pagenumber'] < 1) {
        $vbulletin->GPC['pagenumber'] = 1;
    }
    $perpage = $vbulletin->options['albums_perpage'];
    $total_pages = max(ceil($albumcount['total'] / $perpage), 1);
    // handle the case of 0 albums
    $pagenumber = $vbulletin->GPC['pagenumber'] > $total_pages ? $total_pages : $vbulletin->GPC['pagenumber'];
    $start = ($pagenumber - 1) * $perpage;
    $hook_query_fields = $hook_query_joins = $hook_query_where = '';
示例#5
0
function construct_online_bit($userinfo, $doall = 0)
{
	global $vbulletin, $limitlower, $limitupper, $vbphrase, $ipclass, $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 ($doall == 1 AND ($count > $limitupper OR $count < $limitlower))
	{
		return '';
	}

	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 = htmlspecialchars_uni($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
			{
				if (!defined('VB_FRAMEWORK'))
				{
					require_once(DIR . '/includes/class_bootstrap_framework.php');
					vB_Bootstrap_Framework::init();
				}

				list($route_path, $phrasegroup, $phrasekey, $title) = $location;
				$route_path = urldecode($route_path);
				$title = urldecode($title);
				$route = vB_Router::createRoute($route_path);

				$userinfo['action'] = new vB_Phrase($phrasegroup, $phrasekey);
				$userinfo['where'] = '<a href="' . $route->getCurrentUrl() . '">' . htmlspecialchars_uni($title) . '</a>';

				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 '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'] . '</b></i>';
				if (can_moderate())
				{
					$userinfo['action'] = $vbphrase['viewing_ip_address'];
				}
				break;
			case 'visitormessage_reporting':
				$userinfo['action'] = $vbphrase['reporting_visitor_message'];
				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="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid=$groupid\">$groupname</a>";
				}
				break;
			case 'socialgroups_leave':
				$userinfo['action'] = $vbphrase['leaving_social_group'];
				if ($canviewgroup)
				{
					$userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid=$groupid\">$groupname</a>";
				}
				break;
			case 'socialgroups_edit':
				$userinfo['action'] = $vbphrase['editing_social_group'];
				if ($canviewgroup)
				{
					$userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid=$groupid\">$groupname</a>";
				}
				break;
			case 'socialgroups_view':
				$userinfo['action'] = $vbphrase['viewing_social_group'];
				if ($canviewgroup)
				{
					$userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid=$groupid\">$groupname</a>";
				}
				break;
			case 'socialgroups_memberlist':
				$userinfo['action'] = $vbphrase['viewing_social_group_memberlist'];
				if ($canviewgroup)
				{
					$userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewmembers&amp;groupid=$groupid\">$groupname</a>";
				}
				break;
			case 'socialgroups_delete':
				$userinfo['action'] = $vbphrase['deleting_social_group'];
				if ($canviewgroup)
				{
					$userinfo['where'] = '<a href="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=viewmembers&amp;groupid=$groupid\">$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="group.php?' . $vbulletin->session->vars['sessionurl'] . "do=view&amp;groupid=$groupid\">$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="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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</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="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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="' . $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'] . '">' . $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;
		}

		$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);

		$templater = vB_Template::create('whosonlinebit');
			$templater->register('count', $count);
			$templater->register('ipclass', $ipclass);
			$templater->register('spidertype', $spidertype);
			$templater->register('userinfo', $userinfo);
		$onlinebits = $templater->render();
		return $onlinebits;
	}
	else
	{
		return $userinfo;
	}
}
示例#6
0
 /**
  * Prepare any data needed for the output
  *
  * @param	string	The id of the block
  * @param	array	Options specific to the block
  */
 function prepare_output($id = '', $options = array())
 {
     global $show, $vbphrase;
     if (is_array($options)) {
         $options = array_merge($this->option_defaults, $options);
     } else {
         $options = $this->option_defaults;
     }
     require_once DIR . '/includes/functions_album.php';
     $state = array('public');
     if (can_view_private_albums($this->profile->userinfo['userid'])) {
         $state[] = 'private';
     }
     if (can_view_profile_albums($this->profile->userinfo['userid'])) {
         $state[] = 'profile';
     }
     if (!$this->profile->prepared['myprofile']) {
         if (!can_moderate(0, 'canmoderatepictures')) {
             $sql = "AND album.visible > 0";
         } else {
             $sql = "AND (album.visible > 0 OR album.moderation > 0)";
         }
     } else {
         $sql = "";
     }
     $hook_query_fields = $hook_query_joins = $hook_query_where = '';
     ($hook = vBulletinHook::fetch_hook('member_profileblock_album_query')) ? eval($hook) : false;
     $albums = $this->registry->db->query_read_slave("\n\t\t\tSELECT album.*,\n\t\t\t\ta.attachmentid, album.moderation,\n\t\t\t\tfd.thumbnail_dateline, fd.thumbnail_width, fd.thumbnail_height, IF(fd.thumbnail_filesize > 0, 1, 0) AS hasthumbnail\n\t\t\t\t{$hook_query_fields}\n\t\t\tFROM " . TABLE_PREFIX . "album AS album\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "attachment AS a ON (album.coverattachmentid = a.attachmentid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "filedata AS fd ON (fd.filedataid = a.filedataid)\n\t\t\t{$hook_query_joins}\n\t\t\tWHERE\n\t\t\t\talbum.userid = " . $this->profile->userinfo['userid'] . "\n\t\t\t\t\tAND\n\t\t\t\talbum.state IN ('" . implode("', '", $state) . "')\n\t\t\t\t{$sql}\n\t\t\t\t{$hook_query_where}\n\t\t\tORDER BY album.lastpicturedate DESC\n\t\t\tLIMIT {$options['total']}\n\t\t");
     $albumbits = '';
     while ($album = $this->registry->db->fetch_array($albums)) {
         $album['picturedate'] = vbdate($this->registry->options['dateformat'], $album['lastpicturedate'], true);
         $album['picturetime'] = vbdate($this->registry->options['timeformat'], $album['lastpicturedate']);
         $album['title_html'] = fetch_word_wrapped_string(fetch_censored_text($album['title']));
         $album['coverdimensions'] = $album['thumbnail_width'] ? "width=\"{$album['thumbnail_width']}\" height=\"{$album['thumbnail_height']}\"" : '';
         if ($album['moderation']) {
             $album['moderatedcount'] = vb_number_format($album['moderation']);
             $show['moderated'] = true;
         } else {
             $show['moderated'] = false;
         }
         $templater = vB_Template::create('memberinfo_albumbit');
         $templater->register('album', $album);
         $albumbits .= $templater->render();
     }
     $this->block_data['albumbits'] = $albumbits;
 }
示例#7
0
文件: picture.php 项目: holandacz/nb4
    $have_image = false;
}
if ($have_image) {
    if ($vbulletin->options['album_dataloc'] == 'db') {
        $have_image = strlen($imageinfo['filedata']) > 0;
    } else {
        $have_image = file_exists(fetch_picture_fs_path($imageinfo, $vbulletin->GPC['thumb']));
    }
}
if ($have_image) {
    if ($imageinfo['albumstate'] != 'profile' and !($vbulletin->userinfo['permissions']['albumpermissions'] & $vbulletin->bf_ugp_albumpermissions['canviewalbum'])) {
        // user's w/o viewing permission can only view profile category pictures directly
        $have_image = false;
    }
    if ($imageinfo['albumstate'] == 'private') {
        if (!can_view_private_albums($imageinfo['userid'])) {
            // private album we can't see
            $have_image = false;
        }
    }
}
($hook = vBulletinHook::fetch_hook('picture_haveimage')) ? eval($hook) : false;
if ($have_image) {
    header('Cache-control: max-age=31536000');
    header('Expires: ' . gmdate('D, d M Y H:i:s', TIMENOW + 31536000) . ' GMT');
    header('Content-disposition: inline; filename=' . "user{$imageinfo['userid']}_pic{$imageinfo['pictureid']}_{$imageinfo['dateline']}" . ($vbulletin->GPC['thumb'] ? '_thumb' : '') . ".{$imageinfo['extension']}");
    header('Content-transfer-encoding: binary');
    if ($imageinfo['filesize']) {
        header('Content-Length: ' . $imageinfo['filesize']);
    }
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $imageinfo['dateline']) . ' GMT');
示例#8
0
}
$navbits = array();
// checks for specific types
if ($vbulletin->GPC['albumid']) {
    if (!($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canviewmembers'])) {
        print_no_permission();
    }
    $albuminfo = fetch_albuminfo($vbulletin->GPC['albumid']);
    if (!$albuminfo) {
        standard_error(fetch_error('invalidid', $vbphrase['album'], $vbulletin->options['contactuslink']));
    }
    if (!can_view_profile_section($albuminfo['userid'], 'albums')) {
        // private album that we can not see
        standard_error(fetch_error('invalidid', $vbphrase['album'], $vbulletin->options['contactuslink']));
    }
    if ($albuminfo['state'] == 'private' and !can_view_private_albums($albuminfo['userid'])) {
        // private album that we can not see
        standard_error(fetch_error('invalidid', $vbphrase['album'], $vbulletin->options['contactuslink']));
    } else {
        if ($albuminfo['state'] == 'profile' and !can_view_profile_albums($albuminfo['userid'])) {
            // profile album that we can not see
            standard_error(fetch_error('invalidid', $vbphrase['album'], $vbulletin->options['contactuslink']));
        }
    }
    $pictureinfo = fetch_pictureinfo($vbulletin->GPC['attachmentid'], $vbulletin->GPC['albumid']);
    $navbits = array(fetch_seo_url('member', $albuminfo) => construct_phrase($vbphrase['xs_profile'], $albuminfo['username']), 'album.php?' . $vbulletin->session->vars['sessionurl'] . "u={$albuminfo['userid']}" => $vbphrase['albums'], 'album.php?' . $vbulletin->session->vars['sessionurl'] . "albumid={$albuminfo['albumid']}" => $albuminfo['title_html']);
} else {
    if ($vbulletin->GPC['groupid']) {
        $group = fetch_socialgroupinfo($vbulletin->GPC['groupid']);
        if (!$group) {
            standard_error(fetch_error('invalidid', $vbphrase['social_group'], $vbulletin->options['contactuslink']));
示例#9
0
文件: album.php 项目: 0hyeah/yurivn
function do_get_albums()
{
    global $vbulletin, $db, $show, $vbphrase, $foruminfo, $userinfo;
    $vbulletin->input->clean_array_gpc('r', array('page' => TYPE_UINT, 'perpage' => TYPE_UINT));
    $state = array('public');
    if (can_view_private_albums($userinfo['userid'])) {
        $state[] = 'private';
    }
    if (can_view_profile_albums($userinfo['userid'])) {
        $state[] = 'profile';
    }
    $albumcount = $db->query_first("\n        SELECT COUNT(*) AS total\n        FROM " . TABLE_PREFIX . "album\n        WHERE userid = {$userinfo['userid']}\n        AND state IN ('" . implode("', '", $state) . "')\n        ");
    if ($vbulletin->GPC['page'] < 1) {
        $vbulletin->GPC['page'] = 1;
    }
    $perpage = $vbulletin->GPC['perpage'];
    if ($perpage <= 0) {
        $perpage = 10;
    }
    $total_pages = max(ceil($albumcount['total'] / $perpage), 1);
    // handle the case of 0 albums
    $pagenumber = $vbulletin->GPC['page'] > $total_pages ? $total_pages : $vbulletin->GPC['page'];
    $start = ($pagenumber - 1) * $perpage;
    $hook_query_fields = $hook_query_joins = $hook_query_where = '';
    ($hook = vBulletinHook::fetch_hook('album_user_query')) ? eval($hook) : false;
    // fetch data and prepare data
    $albums = $db->query_read("\n        SELECT album.*,\n        attachment.attachmentid,\n        IF(filedata.thumbnail_filesize > 0, 1, 0) AS hasthumbnail, filedata.thumbnail_dateline, filedata.thumbnail_width, filedata.thumbnail_height\n        {$hook_query_fields}\n        FROM " . TABLE_PREFIX . "album AS album\n        LEFT JOIN " . TABLE_PREFIX . "attachment AS attachment ON (album.coverattachmentid = attachment.attachmentid)\n        LEFT JOIN " . TABLE_PREFIX . "filedata AS filedata ON (attachment.filedataid = filedata.filedataid)\n        {$hook_query_joins}\n        WHERE\n        album.userid = {$userinfo['userid']}\n        AND\n        album.state IN ('" . implode("', '", $state) . "')\n        {$hook_query_where}\n        ORDER BY album.lastpicturedate DESC\n        LIMIT {$start}, {$perpage}\n        ");
    $out_albums = array();
    while ($album = $db->fetch_array($albums)) {
        $album['picturecount'] = vb_number_format($album['visible']);
        $album['picturedate'] = vbdate($vbulletin->options['dateformat'], $album['lastpicturedate'], true);
        $album['picturetime'] = vbdate($vbulletin->options['timeformat'], $album['lastpicturedate']);
        $album['description_html'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($album['description'])));
        $album['title_html'] = fetch_word_wrapped_string(fetch_censored_text($album['title']));
        $album['coverdimensions'] = $album['thumbnail_width'] ? "width=\"{$album['thumbnail_width']}\" height=\"{$album['thumbnail_height']}\"" : '';
        if ($album['state'] == 'private') {
            $show['personalalbum'] = true;
            $albumtype = $vbphrase['private_album_paren'];
        } else {
            if ($album['state'] == 'profile') {
                $show['personalalbum'] = true;
                $albumtype = $vbphrase['profile_album_paren'];
            } else {
                $show['personalalbum'] = false;
            }
        }
        if ($album['moderation'] and (can_moderate(0, 'canmoderatepictures') or $vbulletin->userinfo['userid'] == $album['userid'])) {
            $show['moderated'] = true;
            $album['moderatedcount'] = vb_number_format($album['moderation']);
        } else {
            $show['moderated'] = false;
        }
        $out = array('albumid' => $album['albumid'], 'title' => prepare_utf8_string(strip_tags(fetch_censored_text($album['title']))), 'description' => prepare_utf8_string(strip_tags(fetch_censored_text($album['description']))), 'private' => $album['state'] == 'private', 'photo_count' => strval($album['picturecount']));
        if ($album['hasthumbnail']) {
            $out['cover_url'] = fr_fix_url("attachment.php?{$session[sessionurl]}attachmentid={$album['attachmentid']}&thumb=1");
        }
        if ($album['lastpicturedate']) {
            $out['update_date'] = prepare_utf8_string($album['picturedate'] . ' ' . $album['picturetime']);
        } else {
            $createdate = vbdate($vbulletin->options['dateformat'], $album['createdate'], true);
            $createtime = vbdate($vbulletin->options['timeformat'], $album['createdate']);
            $out['update_date'] = prepare_utf8_string($createdate . ' ' . $createtime);
        }
        $out_albums[] = $out;
    }
    $show['add_album_option'] = $userinfo['userid'] == $vbulletin->userinfo['userid'];
    ($hook = vBulletinHook::fetch_hook('album_user_complete')) ? eval($hook) : false;
    $out = array('albums' => $out_albums, 'total_albums' => $albumcount['total'], 'can_add' => $userinfo['userid'] == $vbulletin->userinfo['userid']);
    return $out;
}
示例#10
0
 /**
  * Builds conditions for the message query based on the user's permissions.
  * @see fetch()
  *
  * @access protected
  *
  * @return string							The built SQL
  */
 function state_sql()
 {
     if (isset($this->state_sql)) {
         return $this->state_sql;
     }
     // Build state conditions for query
     $state = array('public');
     if ($this->parent_id) {
         if (can_view_private_albums($this->parent_id)) {
             $state[] = 'private';
         }
         if (can_view_profile_albums($this->parent_id)) {
             $state[] = 'profile';
         }
     }
     $this->state_sql = "AND (album.state IN ('" . implode("','", $state) . "')";
     if ($this->show_moderated and can_moderate(0, 'canmoderatepictures')) {
         $this->state_sql .= 'AND (album.visible > 0 OR album.moderation > 0)';
     } else {
         $this->state_sql .= 'AND album.visible > 0';
     }
     $this->state_sql .= ')';
     require_once DIR . '/includes/functions_user.php';
     $privacy_requirement = fetch_user_relationship($this->parent_id, $this->registry->userinfo['userid']);
     $this->state_sql .= " AND (profileblockprivacy.requirement <= " . intval($privacy_requirement) . " OR profileblockprivacy.requirement IS NULL)";
     return $this->state_sql;
 }
示例#11
0
文件: album.php 项目: hungnv0789/vhtm
	/**
	* Verify permissions of a single attachment
	*
	* @return	bool
	*/
	public function verify_attachment()
	{
		if (!($this->registry->options['socnet'] & $this->registry->bf_misc_socnet['enable_albums']))
		{
			return false;
		}

		$hook_query_fields = $hook_query_joins = $hook_query_where = '';
		($hook = vBulletinHook::fetch_hook('attachment_start')) ? eval($hook) : false;

		$selectsql = array(
			"album.state AS albumstate, album.albumid, album.userid AS albumuserid",
			"pbp.requirement AS privacy_requirement",
		);

		$joinsql = array(
			"LEFT JOIN " . TABLE_PREFIX . "album AS album ON (album.albumid = a.contentid)",
			"LEFT JOIN " . TABLE_PREFIX . "profileblockprivacy AS pbp ON (pbp.userid = a.userid AND pbp.blockid = 'albums')",
		);

		if (!$this->verify_attachment_specific('vBForum_Album', $selectsql, $joinsql))
		{
			return false;
		}

/*	TODO
		$this->browsinginfo = array(
			'bloginfo' => array(
				'blogid' => $this->attachmentinfo['blogid'],
			),
			'userinfo' => array(
				'userid' => $this->attachmentinfo['userid'],
			),
		);
*/
		require_once(DIR . '/includes/functions_user.php');
		if ($this->attachmentinfo['contentid'] == 0)
		{
			// there may be a condition where certain moderators could benefit by seeing these, I just don't know of any conditions at present
			if ($this->registry->userinfo['userid'] != $this->attachmentinfo['userid'])
			{
				return false;
			}
		}
		else if (
			!$this->attachmentinfo['albumid']
				OR
			$this->attachmentinfo['albumuserid'] != $this->attachmentinfo['userid']
				OR
			(
				$this->attachmentinfo['state'] == 'moderation'
					AND
				$this->attachmentinfo['userid'] != $this->registry->userinfo['userid']
					AND
				!can_moderate(0, 'canmoderatepictures')
					AND
				!can_moderate(0, 'caneditalbumpicture')
			)
				OR
			(
				$this->attachmentinfo['privacy_requirement']
					AND
				fetch_user_relationship($this->attachmentinfo['userid'], $this->registry->userinfo['userid']) < $this->attachmentinfo['privacy_requirement']
			)
				OR
			(
				$this->attachmentinfo['albumstate'] != 'profile'
					AND
				!($this->registry->userinfo['permissions']['albumpermissions'] & $this->registry->bf_ugp_albumpermissions['canviewalbum'])
			)
				OR
			(
				$this->attachmentinfo['albumstate'] == 'private'
					AND
				!can_view_private_albums($this->attachmentinfo['userid'])
			)
		)
		{
			// echo clear.gif, not permissions error. This may only be needed for 'albumstate' == 'profile'
			return 0;
		}

		return true;
	}