}
                } else {
                    $qa_content['form_profile']['buttons']['block'] = array('tags' => 'NAME="doblock"', 'label' => qa_lang_html('users/block_user_button'));
                }
            }
        }
    }
    if (!is_array($qa_content['form_profile']['fields']['removeavatar'])) {
        unset($qa_content['form_profile']['fields']['removeavatar']);
    }
    $qa_content['raw']['account'] = $useraccount;
    // for plugin layers to access
    $qa_content['raw']['profile'] = $userprofile;
}
//	Information about user activity, available also with single sign-on integration
$qa_content['form_activity'] = array('title' => '<A NAME="activity">' . qa_lang_html_sub('profile/activity_by_x', $userhtml) . '</A>', 'style' => 'wide', 'fields' => array('bonus' => array('label' => qa_lang_html('profile/bonus_points'), 'tags' => 'NAME="bonus"', 'value' => qa_html($userpoints['bonus']), 'type' => 'number', 'note' => qa_lang_html('users/only_shown_admins')), 'points' => array('type' => 'static', 'label' => qa_lang_html('profile/score'), 'value' => @$userpoints['points'] == 1 ? qa_lang_html_sub('main/1_point', '<SPAN CLASS="qa-uf-user-points">1</SPAN>', '1') : qa_lang_html_sub('main/x_points', '<SPAN CLASS="qa-uf-user-points">' . qa_html(number_format(@$userpoints['points'])) . '</SPAN>')), 'title' => array('type' => 'static', 'label' => qa_lang_html('profile/title'), 'value' => qa_get_points_title_html(@$userpoints['points'], qa_get_points_to_titles())), 'questions' => array('type' => 'static', 'label' => qa_lang_html('profile/questions'), 'value' => '<SPAN CLASS="qa-uf-user-q-posts">' . qa_html(number_format(@$userpoints['qposts'])) . '</SPAN>'), 'answers' => array('type' => 'static', 'label' => qa_lang_html('profile/answers'), 'value' => '<SPAN CLASS="qa-uf-user-a-posts">' . qa_html(number_format(@$userpoints['aposts'])) . ' (each reaction you write<br>will generate 3 points)<br></SPAN>')));
if ($loginlevel >= QA_USER_LEVEL_ADMIN) {
    $qa_content['form_activity']['tags'] = 'METHOD="POST" ACTION="' . qa_self_html() . '"';
    $qa_content['form_activity']['buttons'] = array('setbonus' => array('tags' => 'NAME="dosetbonus"', 'label' => qa_lang_html('profile/set_bonus_button')));
} else {
    unset($qa_content['form_activity']['fields']['bonus']);
}
if (!isset($qa_content['form_activity']['fields']['title']['value'])) {
    unset($qa_content['form_activity']['fields']['title']);
}
if (qa_opt('comment_on_qs') || qa_opt('comment_on_as')) {
    // only show comment count if comments are enabled
    $qa_content['form_activity']['fields']['comments'] = array('type' => 'static', 'label' => qa_lang_html('profile/comments'), 'value' => '<SPAN CLASS="qa-uf-user-c-posts">' . qa_html(number_format(@$userpoints['cposts'])) . '</SPAN>');
}
if (qa_opt('voting_on_qs') || qa_opt('voting_on_as')) {
    // only show vote record if voting is enabled
                $qa_content['form_profile']['buttons']['block'] = array('tags' => 'name="doblock"', 'label' => qa_lang_html('users/block_user_button'));
            }
            $qa_content['form_profile']['hidden'] = array('code' => qa_get_form_security_code('user-' . $handle));
        }
    } elseif (isset($loginuserid) && $loginuserid == $userid) {
        $qa_content['form_profile']['buttons'] = array('account' => array('tags' => 'name="doaccount"', 'label' => qa_lang_html('users/edit_profile')));
    }
    if (!is_array($qa_content['form_profile']['fields']['removeavatar'])) {
        unset($qa_content['form_profile']['fields']['removeavatar']);
    }
    $qa_content['raw']['account'] = $useraccount;
    // for plugin layers to access
    $qa_content['raw']['profile'] = $userprofile;
}
//	Information about user activity, available also with single sign-on integration
$qa_content['form_activity'] = array('title' => '<a name="activity">' . qa_lang_html_sub('profile/activity_by_x', $userhtml) . '</a>', 'style' => 'wide', 'fields' => array('bonus' => array('label' => qa_lang_html('profile/bonus_points'), 'tags' => 'name="bonus"', 'value' => qa_html(isset($inbonus) ? $inbonus : $userpoints['bonus']), 'type' => 'number', 'note' => qa_lang_html('users/only_shown_admins'), 'id' => 'bonus'), 'points' => array('type' => 'static', 'label' => qa_lang_html('profile/score'), 'value' => @$userpoints['points'] == 1 ? qa_lang_html_sub('main/1_point', '<span class="qa-uf-user-points">1</span>', '1') : qa_lang_html_sub('main/x_points', '<span class="qa-uf-user-points">' . qa_html(number_format(@$userpoints['points'])) . '</span>'), 'id' => 'points'), 'title' => array('type' => 'static', 'label' => qa_lang_html('profile/title'), 'value' => qa_get_points_title_html(@$userpoints['points'], qa_get_points_to_titles()), 'id' => 'title'), 'questions' => array('type' => 'static', 'label' => qa_lang_html('profile/questions'), 'value' => '<span class="qa-uf-user-q-posts">' . qa_html(number_format(@$userpoints['qposts'])) . '</span>', 'id' => 'questions'), 'answers' => array('type' => 'static', 'label' => qa_lang_html('profile/answers'), 'value' => '<span class="qa-uf-user-a-posts">' . qa_html(number_format(@$userpoints['aposts'])) . '</span>', 'id' => 'answers')));
if ($loginlevel >= QA_USER_LEVEL_ADMIN) {
    $qa_content['form_activity']['tags'] = 'method="post" action="' . qa_self_html() . '"';
    $qa_content['form_activity']['buttons'] = array('setbonus' => array('tags' => 'name="dosetbonus"', 'label' => qa_lang_html('profile/set_bonus_button')));
    $qa_content['form_activity']['hidden'] = array('code' => qa_get_form_security_code('user-activity-' . $handle));
} else {
    unset($qa_content['form_activity']['fields']['bonus']);
}
if (!isset($qa_content['form_activity']['fields']['title']['value'])) {
    unset($qa_content['form_activity']['fields']['title']);
}
if (qa_opt('comment_on_qs') || qa_opt('comment_on_as')) {
    // only show comment count if comments are enabled
    $qa_content['form_activity']['fields']['comments'] = array('type' => 'static', 'label' => qa_lang_html('profile/comments'), 'value' => '<span class="qa-uf-user-c-posts">' . qa_html(number_format(@$userpoints['cposts'])) . '</span>', 'id' => 'comments');
}
if (qa_opt('voting_on_qs') || qa_opt('voting_on_as')) {
Exemple #3
0
function qa_other_to_q_html_fields($question, $userid, $cookieid, $usershtml, $dummy, $options)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    require_once QA_INCLUDE_DIR . 'app/updates.php';
    $fields = qa_post_html_fields($question, $userid, $cookieid, $usershtml, null, $options);
    switch ($question['obasetype'] . '-' . @$question['oupdatetype']) {
        case 'Q-':
            $langstring = 'main/asked';
            break;
        case 'Q-' . QA_UPDATE_VISIBLE:
            if (@$question['opersonal']) {
                $langstring = $question['hidden'] ? 'misc/your_q_hidden' : 'misc/your_q_reshown';
            } else {
                $langstring = $question['hidden'] ? 'main/hidden' : 'main/reshown';
            }
            break;
        case 'Q-' . QA_UPDATE_CLOSED:
            if (@$question['opersonal']) {
                $langstring = isset($question['closedbyid']) ? 'misc/your_q_closed' : 'misc/your_q_reopened';
            } else {
                $langstring = isset($question['closedbyid']) ? 'main/closed' : 'main/reopened';
            }
            break;
        case 'Q-' . QA_UPDATE_TAGS:
            $langstring = @$question['opersonal'] ? 'misc/your_q_retagged' : 'main/retagged';
            break;
        case 'Q-' . QA_UPDATE_CATEGORY:
            $langstring = @$question['opersonal'] ? 'misc/your_q_recategorized' : 'main/recategorized';
            break;
        case 'A-':
            $langstring = @$question['opersonal'] ? 'misc/your_q_answered' : 'main/answered';
            break;
        case 'A-' . QA_UPDATE_SELECTED:
            $langstring = @$question['opersonal'] ? 'misc/your_a_selected' : 'main/answer_selected';
            break;
        case 'A-' . QA_UPDATE_VISIBLE:
            if (@$question['opersonal']) {
                $langstring = $question['ohidden'] ? 'misc/your_a_hidden' : 'misc/your_a_reshown';
            } else {
                $langstring = $question['ohidden'] ? 'main/hidden' : 'main/answer_reshown';
            }
            break;
        case 'A-' . QA_UPDATE_CONTENT:
            $langstring = @$question['opersonal'] ? 'misc/your_a_edited' : 'main/answer_edited';
            break;
        case 'Q-' . QA_UPDATE_FOLLOWS:
            $langstring = @$question['opersonal'] ? 'misc/your_a_questioned' : 'main/asked_related_q';
            break;
        case 'C-':
            $langstring = 'main/commented';
            break;
        case 'C-' . QA_UPDATE_C_FOR_Q:
            $langstring = @$question['opersonal'] ? 'misc/your_q_commented' : 'main/commented';
            break;
        case 'C-' . QA_UPDATE_C_FOR_A:
            $langstring = @$question['opersonal'] ? 'misc/your_a_commented' : 'main/commented';
            break;
        case 'C-' . QA_UPDATE_FOLLOWS:
            $langstring = @$question['opersonal'] ? 'misc/your_c_followed' : 'main/commented';
            break;
        case 'C-' . QA_UPDATE_TYPE:
            $langstring = @$question['opersonal'] ? 'misc/your_c_moved' : 'main/comment_moved';
            break;
        case 'C-' . QA_UPDATE_VISIBLE:
            if (@$question['opersonal']) {
                $langstring = $question['ohidden'] ? 'misc/your_c_hidden' : 'misc/your_c_reshown';
            } else {
                $langstring = $question['ohidden'] ? 'main/hidden' : 'main/comment_reshown';
            }
            break;
        case 'C-' . QA_UPDATE_CONTENT:
            $langstring = @$question['opersonal'] ? 'misc/your_c_edited' : 'main/comment_edited';
            break;
        case 'Q-' . QA_UPDATE_CONTENT:
        default:
            $langstring = @$question['opersonal'] ? 'misc/your_q_edited' : 'main/edited';
            break;
    }
    $fields['what'] = qa_lang_html($langstring);
    if (@$question['opersonal']) {
        $fields['what_your'] = true;
    }
    if ($question['obasetype'] != 'Q' || @$question['oupdatetype'] == QA_UPDATE_FOLLOWS) {
        $fields['what_url'] = qa_q_path_html($question['postid'], $question['title'], false, $question['obasetype'], $question['opostid']);
    }
    if (@$options['contentview'] && !empty($question['ocontent'])) {
        $viewer = qa_load_viewer($question['ocontent'], $question['oformat']);
        $fields['content'] = $viewer->get_html($question['ocontent'], $question['oformat'], array('blockwordspreg' => @$options['blockwordspreg'], 'showurllinks' => @$options['showurllinks'], 'linksnewwindow' => @$options['linksnewwindow']));
    }
    if (@$options['whenview']) {
        $fields['when'] = qa_when_to_html($question['otime'], @$options['fulldatedays']);
    }
    if (@$options['whoview']) {
        $isbyuser = qa_post_is_by_user(array('userid' => $question['ouserid'], 'cookieid' => @$question['ocookieid']), $userid, $cookieid);
        $fields['who'] = qa_who_to_html($isbyuser, $question['ouserid'], $usershtml, @$options['ipview'] ? @$question['oip'] : null, false, @$question['oname']);
        if (isset($question['opoints'])) {
            if (@$options['pointsview']) {
                $fields['who']['points'] = $question['opoints'] == 1 ? qa_lang_html_sub_split('main/1_point', '1', '1') : qa_lang_html_sub_split('main/x_points', qa_html(number_format($question['opoints'])));
            }
            if (isset($options['pointstitle'])) {
                $fields['who']['title'] = qa_get_points_title_html($question['opoints'], $options['pointstitle']);
            }
        }
        if (isset($question['olevel'])) {
            $fields['who']['level'] = qa_html(qa_user_level_string($question['olevel']));
        }
    }
    unset($fields['flags']);
    if (@$options['flagsview'] && @$question['oflagcount']) {
        $fields['flags'] = $question['oflagcount'] == 1 ? qa_lang_html_sub_split('main/1_flag', '1', '1') : qa_lang_html_sub_split('main/x_flags', $question['oflagcount']);
    }
    unset($fields['avatar']);
    if (@$options['avatarsize'] > 0) {
        if (QA_FINAL_EXTERNAL_USERS) {
            $fields['avatar'] = qa_get_external_avatar_html($question['ouserid'], $options['avatarsize'], false);
        } else {
            $fields['avatar'] = qa_get_user_avatar_html($question['oflags'], $question['oemail'], $question['ohandle'], $question['oavatarblobid'], $question['oavatarwidth'], $question['oavatarheight'], $options['avatarsize']);
        }
    }
    return $fields;
}
 function get_full_post($post, $options, $usershtml)
 {
     $fields['raw'] = $post;
     $userid = qa_get_logged_in_userid();
     $cookieid = qa_cookie_get();
     $fields['netvotes_raw'] = (int) $post['netvotes'];
     $postid = $post['postid'];
     $isquestion = $post['basetype'] == 'Q';
     $isanswer = $post['basetype'] == 'A';
     $isbyuser = @$post['userid'] == $userid;
     $anchor = urlencode(qa_anchor($post['basetype'], $postid));
     $elementid = isset($options['elementid']) ? $options['elementid'] : $anchor;
     $microformats = false;
     $isselected = @$options['isselected'];
     // content
     if (@$options['contentview'] && !empty($post['content'])) {
         $viewer = qa_load_viewer($post['content'], $post['format']);
         $fields['content'] = $viewer->get_html($post['content'], $post['format'], array('blockwordspreg' => @$options['blockwordspreg'], 'showurllinks' => @$options['showurllinks'], 'linksnewwindow' => @$options['linksnewwindow']));
     }
     if ($post['hidden']) {
         $fields['vote_state'] = 'disabled';
     } elseif ($isbyuser) {
         $fields['vote_state'] = 'disabled';
     } elseif (@$post['uservote'] > 0) {
         $fields['vote_state'] = 'voted_up';
     } elseif (@$post['uservote'] < 0) {
         $fields['vote_state'] = 'voted_down';
     } else {
         if (strpos($options['voteview'], '-uponly-level')) {
             $fields['vote_state'] = 'up_only';
         } else {
             $fields['vote_state'] = 'enabled';
         }
     }
     //	Created when and by whom
     $fields['meta_order'] = qa_lang_html('main/meta_order');
     // sets ordering of meta elements which can be language-specific
     if (@$options['whatview']) {
         $fields['what'] = qa_lang_html($isquestion ? 'main/asked' : ($isanswer ? 'main/answered' : 'main/commented'));
         if (@$options['whatlink'] && !$isquestion) {
             $fields['what_url'] = qa_path_html(qa_request(), array('show' => $postid), null, null, qa_anchor($post['basetype'], $postid));
         }
     }
     if (isset($post['created']) && @$options['whenview']) {
         $fields['when'] = qa_when_to_html($post['created'], @$options['fulldatedays']);
     }
     if (@$options['whoview']) {
         $fields['who'] = qa_who_to_html($isbyuser, @$post['userid'], $usershtml, @$options['ipview'] ? @$post['createip'] : null, $microformats);
         if (isset($post['points'])) {
             if (@$options['pointsview']) {
                 $fields['who']['points'] = $post['points'] == 1 ? qa_lang_html_sub_split('main/1_point', '1', '1') : qa_lang_html_sub_split('main/x_points', qa_html(number_format($post['points'])));
             }
             if (isset($options['pointstitle'])) {
                 $fields['who']['title'] = qa_get_points_title_html($post['points'], $options['pointstitle']);
             }
         }
         if (isset($post['level'])) {
             $fields['who']['level'] = qa_html(qa_user_level_string($post['level']));
         }
     }
     $isselected = @$options['isselected'];
     //	Updated when and by whom
     if (isset($post['opostid'])) {
         // updated meta
         switch ($post['obasetype'] . '-' . @$post['oupdatetype']) {
             case 'Q-':
                 $langstring = 'main/asked';
                 break;
             case 'Q-' . QA_UPDATE_VISIBLE:
                 $langstring = $post['hidden'] ? 'main/hidden' : 'main/reshown';
                 break;
             case 'Q-' . QA_UPDATE_CLOSED:
                 $langstring = isset($post['closedbyid']) ? 'main/closed' : 'main/reopened';
                 break;
             case 'Q-' . QA_UPDATE_TAGS:
                 $langstring = 'main/retagged';
                 break;
             case 'Q-' . QA_UPDATE_CATEGORY:
                 $langstring = 'main/recategorized';
                 break;
             case 'A-':
                 $langstring = 'main/answered';
                 break;
             case 'A-' . QA_UPDATE_SELECTED:
                 $langstring = 'main/answer_selected';
                 break;
             case 'A-' . QA_UPDATE_VISIBLE:
                 $langstring = $post['ohidden'] ? 'main/hidden' : 'main/answer_reshown';
                 break;
             case 'A-' . QA_UPDATE_CONTENT:
                 $langstring = 'main/answer_edited';
                 break;
             case 'Q-' . QA_UPDATE_FOLLOWS:
                 $langstring = 'main/asked_related_q';
                 break;
             case 'C-':
                 $langstring = 'main/commented';
                 break;
             case 'C-' . QA_UPDATE_TYPE:
                 $langstring = 'main/comment_moved';
                 break;
             case 'C-' . QA_UPDATE_VISIBLE:
                 $langstring = $post['ohidden'] ? 'main/hidden' : 'main/comment_reshown';
                 break;
             case 'C-' . QA_UPDATE_CONTENT:
                 $langstring = 'main/comment_edited';
                 break;
             case 'Q-' . QA_UPDATE_CONTENT:
             default:
                 $langstring = 'main/edited';
                 break;
         }
         $fields['what_2'] = qa_lang_html($langstring);
         if ($post['obasetype'] != 'Q' || @$post['oupdatetype'] == QA_UPDATE_FOLLOWS) {
             $fields['what_2_url'] = qa_q_path_html($post['postid'], $post['title'], false, $post['obasetype'], $post['opostid']);
         }
         if (@$options['contentview'] && !empty($post['ocontent'])) {
             $viewer = qa_load_viewer($post['ocontent'], $post['oformat']);
             $fields['content_2'] = $viewer->get_html($post['ocontent'], $post['oformat'], array('blockwordspreg' => @$options['blockwordspreg'], 'showurllinks' => @$options['showurllinks'], 'linksnewwindow' => @$options['linksnewwindow']));
         }
         if (@$options['whenview']) {
             $fields['when_2'] = qa_when_to_html($post['otime'], @$options['fulldatedays']);
         }
         if (@$options['whoview']) {
             $isbyuser = qa_post_is_by_user(array('userid' => $post['ouserid'], 'cookieid' => @$post['ocookieid']), $userid, $cookieid);
             $fields['who_2'] = qa_who_to_html($isbyuser, $post['ouserid'], $usershtml, @$options['ipview'] ? @$post['oip'] : null, false);
             if (isset($post['opoints'])) {
                 if (@$options['pointsview']) {
                     $fields['who_2']['points'] = $post['opoints'] == 1 ? qa_lang_html_sub_split('main/1_point', '1', '1') : qa_lang_html_sub_split('main/x_points', qa_html(number_format($post['opoints'])));
                 }
                 if (isset($options['pointstitle'])) {
                     $fields['who_2']['title'] = qa_get_points_title_html($post['opoints'], $options['pointstitle']);
                 }
             }
             if (isset($post['olevel'])) {
                 $fields['who_2']['level'] = qa_html(qa_user_level_string($post['olevel']));
             }
         }
     } else {
         if (@$options['updateview'] && isset($post['updated']) && ($post['updatetype'] != QA_UPDATE_SELECTED || $isselected) && (!isset($post['created']) || $post['hidden'] && $post['updatetype'] == QA_UPDATE_VISIBLE || isset($post['closedbyid']) && $post['updatetype'] == QA_UPDATE_CLOSED || abs($post['updated'] - $post['created']) > 300 || $post['lastuserid'] != $post['userid'])) {
             switch ($post['updatetype']) {
                 case QA_UPDATE_TYPE:
                 case QA_UPDATE_PARENT:
                     $langstring = 'main/moved';
                     break;
                 case QA_UPDATE_CATEGORY:
                     $langstring = 'main/recategorized';
                     break;
                 case QA_UPDATE_VISIBLE:
                     $langstring = $post['hidden'] ? 'main/hidden' : 'main/reshown';
                     break;
                 case QA_UPDATE_CLOSED:
                     $langstring = isset($post['closedbyid']) ? 'main/closed' : 'main/reopened';
                     break;
                 case QA_UPDATE_TAGS:
                     $langstring = 'main/retagged';
                     break;
                 case QA_UPDATE_SELECTED:
                     $langstring = 'main/selected';
                     break;
                 default:
                     $langstring = 'main/edited';
                     break;
             }
             $fields['what_2'] = qa_lang_html($langstring);
             if (@$options['whenview']) {
                 $fields['when_2'] = qa_when_to_html($post['updated'], @$options['fulldatedays']);
             }
             if (isset($post['lastuserid']) && @$options['whoview']) {
                 $fields['who_2'] = qa_who_to_html(isset($userid) && $post['lastuserid'] == $userid, $post['lastuserid'], $usershtml, @$options['ipview'] ? $post['lastip'] : null, false);
             }
         }
     }
     $fields['avatar'] = $this->get_post_avatar($post);
     return $fields;
 }
function qa_other_to_q_html_fields($question, $userid, $cookieid, $usershtml, $dummy, $options)
{
    $fields = qa_post_html_fields($question, $userid, $cookieid, $usershtml, null, $options);
    switch ($question['obasetype']) {
        case 'Q':
            $fields['what'] = @$question['oedited'] ? qa_lang_html('main/edited') : null;
            break;
        case 'A':
            $fields['what'] = @$question['oedited'] ? qa_lang_html('main/answer_edited') : qa_lang_html('main/answered');
            break;
        case 'C':
            $fields['what'] = @$question['oedited'] ? qa_lang_html('main/comment_edited') : qa_lang_html('main/commented');
            break;
    }
    if ($question['obasetype'] != 'Q') {
        $fields['what_url'] = $fields['url'] . '#' . qa_html(urlencode(qa_anchor($question['obasetype'], $question['opostid'])));
    }
    if (@$options['whenview']) {
        $fields['when'] = qa_lang_html_sub_split('main/x_ago', qa_html(qa_time_to_string(qa_opt('db_time') - $question['otime'])));
    }
    if (@$options['whoview']) {
        $isbyuser = qa_post_is_by_user(array('userid' => $question['ouserid'], 'cookieid' => $question['ocookieid']), $userid, $cookieid);
        $fields['who'] = qa_who_to_html($isbyuser, $question['ouserid'], $usershtml, @$options['ipview'] ? $question['oip'] : null, false);
        if (isset($question['opoints'])) {
            if (@$options['pointsview']) {
                $fields['who']['points'] = $question['opoints'] == 1 ? qa_lang_html_sub_split('main/1_point', '1', '1') : qa_lang_html_sub_split('main/x_points', qa_html(number_format($question['opoints'])));
            }
            if (isset($options['pointstitle'])) {
                $fields['who']['title'] = qa_get_points_title_html($question['opoints'], $options['pointstitle']);
            }
        }
        if (isset($question['olevel'])) {
            $fields['who']['level'] = qa_html(qa_user_level_string($question['olevel']));
        }
    }
    unset($fields['flags']);
    if (@$options['flagsview'] && @$post['oflagcount']) {
        $fields['flags'] = $post['oflagcount'] == 1 ? qa_lang_html_sub_split('main/1_flag', '1', '1') : qa_lang_html_sub_split('main/x_flags', $post['oflagcount']);
    }
    unset($fields['avatar']);
    if (!QA_FINAL_EXTERNAL_USERS && @$options['avatarsize'] > 0) {
        $fields['avatar'] = qa_get_user_avatar_html($question['oflags'], $question['oemail'], $question['ohandle'], $question['oavatarblobid'], $question['oavatarwidth'], $question['oavatarheight'], $options['avatarsize']);
    }
    return $fields;
}
            $qa_content['form_profile']['buttons'] = array('edit' => array('tags' => 'NAME="doedit"', 'label' => qa_lang_html($fieldseditable ? 'users/edit_user_button' : 'users/edit_level_button')));
            if (isset($maxlevelassign) && $useraccount['level'] < QA_USER_LEVEL_MODERATOR) {
                if ($useraccount['flags'] & QA_USER_FLAGS_USER_BLOCKED) {
                    $qa_content['form_profile']['buttons']['unblock'] = array('tags' => 'NAME="dounblock"', 'label' => qa_lang_html('users/unblock_user_button'));
                    if (count($questions) && !qa_user_permit_error('permit_hide_show')) {
                        $qa_content['form_profile']['buttons']['hideall'] = array('tags' => 'NAME="dohideall"', 'label' => qa_lang_html('users/hide_all_user_button'));
                    }
                } else {
                    $qa_content['form_profile']['buttons']['block'] = array('tags' => 'NAME="doblock"', 'label' => qa_lang_html('users/block_user_button'));
                }
            }
        }
    }
}
//	Information about user activity, available also with single sign-on integration
$qa_content['form_activity'] = array('title' => qa_lang_html_sub('profile/activity_by_x', $userhtml), 'style' => 'wide', 'fields' => array('points' => array('type' => 'static', 'label' => qa_lang_html('profile/score'), 'value' => @$userpoints['points'] == 1 ? qa_lang_html_sub('main/1_point', '<SPAN CLASS="qa-uf-user-points">1</SPAN>', '1') : qa_lang_html_sub('main/x_points', '<SPAN CLASS="qa-uf-user-points">' . qa_html(number_format(@$userpoints['points'])) . '</SPAN>')), 'title' => array('type' => 'static', 'label' => qa_lang_html('profile/title'), 'value' => qa_get_points_title_html(@$userpoints['points'], qa_get_points_to_titles())), 'questions' => array('type' => 'static', 'label' => qa_lang_html('profile/questions'), 'value' => '<SPAN CLASS="qa-uf-user-q-posts">' . qa_html(number_format(@$userpoints['qposts'])) . '</SPAN>'), 'answers' => array('type' => 'static', 'label' => qa_lang_html('profile/answers'), 'value' => '<SPAN CLASS="qa-uf-user-a-posts">' . qa_html(number_format(@$userpoints['aposts'])) . '</SPAN>')));
if (!isset($qa_content['form_activity']['fields']['title']['value'])) {
    unset($qa_content['form_activity']['fields']['title']);
}
if (qa_opt('comment_on_qs') || qa_opt('comment_on_as')) {
    // only show comment count if comments are enabled
    $qa_content['form_activity']['fields']['comments'] = array('type' => 'static', 'label' => qa_lang_html('profile/comments'), 'value' => '<SPAN CLASS="qa-uf-user-c-posts">' . qa_html(number_format(@$userpoints['cposts'])) . '</SPAN>');
}
if (qa_opt('voting_on_qs') || qa_opt('voting_on_as')) {
    // only show vote record if voting is enabled
    $votedonvalue = '';
    if (qa_opt('voting_on_qs')) {
        $qvotes = @$userpoints['qupvotes'] + @$userpoints['qdownvotes'];
        $innervalue = '<SPAN CLASS="qa-uf-user-q-votes">' . number_format($qvotes) . '</SPAN>';
        $votedonvalue .= $qvotes == 1 ? qa_lang_html_sub('main/1_question', $innervalue, '1') : qa_lang_html_sub('main/x_questions', $innervalue);
        if (qa_opt('voting_on_as')) {