/**
  * Process the delete hidden posts request from the admin
  */
 function ami_dhp_delete_hidden_posts_process()
 {
     // load all required files if not loaded
     require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
     require_once QA_INCLUDE_DIR . 'qa-db-admin.php';
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     //	Check admin privileges
     if (qa_user_maximum_permit_error('permit_hide_show') && qa_user_maximum_permit_error('permit_delete_hidden')) {
         return false;
     }
     $userid = qa_get_logged_in_userid();
     //	Find recently hidden questions, answers, comments
     list($hiddenquestions, $hiddenanswers, $hiddencomments) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, null, 'Q_HIDDEN', true), qa_db_recent_a_qs_selectspec($userid, 0, null, null, 'A_HIDDEN', true), qa_db_recent_c_qs_selectspec($userid, 0, null, null, 'C_HIDDEN', true));
     // first delete all hidden posts
     if (count($hiddencomments)) {
         foreach ($hiddencomments as $hiddencomment) {
             ami_dhp_post_delete_recursive($hiddencomment['opostid']);
         }
     }
     // delete all the hidden answers
     if (count($hiddenanswers)) {
         foreach ($hiddenanswers as $hiddenanswer) {
             ami_dhp_post_delete_recursive($hiddenanswer['opostid']);
         }
     }
     // delete all the hidden questions
     if (count($hiddenquestions)) {
         foreach ($hiddenquestions as $hiddenquestion) {
             ami_dhp_post_delete_recursive($hiddenquestion['postid']);
         }
     }
 }
 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     $widget_opt = @$themeobject->current_widget['param']['options'];
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     require_once QA_INCLUDE_DIR . 'qa-app-q-list.php';
     $categoryslugs = '';
     $userid = qa_get_logged_in_userid();
     //	Get lists of recent activity in all its forms, plus category information
     list($questions1, $questions2, $questions3, $questions4) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, $categoryslugs, null, false, false, $qcount), qa_db_recent_a_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_c_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_edit_qs_selectspec($userid, 0, $categoryslugs));
     //	Prepare and return content for theme
     $content = qa_q_list_page_content(qa_any_sort_and_dedupe(array_merge($questions1, $questions2, $questions3, $questions4)), $qcount, 0, null, null, null, null, null, true, 'activity/', null, null, null, null);
     $content = $content['q_list']['qs'];
     if (@$themeobject->current_widget['param']['locations']['show_title']) {
         $themeobject->output('<h3 class="widget-title">' . qa_lang('cleanstrap/recent_activities') . ' <a href="' . qa_path_html('activity') . '">' . qa_lang('cleanstrap/view_all') . '</a></h3>');
     }
     $themeobject->output('<div class="ra-question-activity-widget">');
     $q_list = $content;
     $themeobject->output('<ul class="activity-list">');
     foreach ($q_list as $list) {
         $themeobject->output('<li class="clearfix ' . (is_featured($list['raw']['postid']) ? ' featured' : '') . '"><span class="fav-star icon-heart' . (@$list['raw']['userfavoriteq'] ? ' active' : '') . '"></span><span class="post-status-c">' . cs_post_status($list) . '</span><a href="' . $list['url'] . '">' . $list['title'] . '<span class="time">' . implode(' ', $list['when']) . '</span><span class="ans-count total-' . $list['raw']['acount'] . '">' . $list['raw']['acount'] . '</span></a></li>');
     }
     $themeobject->output('</ul>');
     $themeobject->output('</div>');
 }
Exemplo n.º 3
0
	GNU General Public License for more details.

	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'app/admin.php';
require_once QA_INCLUDE_DIR . 'db/admin.php';
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'app/format.php';
//	Find recently hidden questions, answers, comments
$userid = qa_get_logged_in_userid();
list($hiddenquestions, $hiddenanswers, $hiddencomments) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, null, 'Q_HIDDEN', true), qa_db_recent_a_qs_selectspec($userid, 0, null, null, 'A_HIDDEN', true), qa_db_recent_c_qs_selectspec($userid, 0, null, null, 'C_HIDDEN', true));
//	Check admin privileges (do late to allow one DB query)
if (qa_user_maximum_permit_error('permit_hide_show') && qa_user_maximum_permit_error('permit_delete_hidden')) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_lang_html('users/no_permission');
    return $qa_content;
}
//	Check to see if any have been reshown or deleted
$pageerror = qa_admin_check_clicks();
//	Combine sets of questions and remove those this user has no permissions for
$questions = qa_any_sort_by_date(array_merge($hiddenquestions, $hiddenanswers, $hiddencomments));
if (qa_user_permit_error('permit_hide_show') && qa_user_permit_error('permit_delete_hidden')) {
    // not allowed to see all hidden posts
    foreach ($questions as $index => $question) {
        if (qa_user_post_permit_error('permit_hide_show', $question) && qa_user_post_permit_error('permit_delete_hidden', $question)) {
            unset($questions[$index]);
Exemplo n.º 4
0
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'app/admin.php';
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'app/format.php';
//	Find queued questions, answers, comments
$userid = qa_get_logged_in_userid();
list($queuedquestions, $queuedanswers, $queuedcomments) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, null, 'Q_QUEUED', true), qa_db_recent_a_qs_selectspec($userid, 0, null, null, 'A_QUEUED', true), qa_db_recent_c_qs_selectspec($userid, 0, null, null, 'C_QUEUED', true));
//	Check admin privileges (do late to allow one DB query)
if (qa_user_maximum_permit_error('permit_moderate')) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_lang_html('users/no_permission');
    return $qa_content;
}
//	Check to see if any were approved/rejected here
$pageerror = qa_admin_check_clicks();
//	Combine sets of questions and remove those this user has no permission to moderate
$questions = qa_any_sort_by_date(array_merge($queuedquestions, $queuedanswers, $queuedcomments));
if (qa_user_permit_error('permit_moderate')) {
    // if user not allowed to moderate all posts
    foreach ($questions as $index => $question) {
        if (qa_user_post_permit_error('permit_moderate', $question)) {
            unset($questions[$index]);
Exemplo n.º 5
0
	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
require_once QA_INCLUDE_DIR . 'qa-app-q-list.php';
$categoryslugs = qa_request_parts(1);
$countslugs = count($categoryslugs);
$userid = qa_get_logged_in_userid();
//	Get list of comments with related questions, plus category information
list($questions, $categories, $categoryid) = qa_db_select_with_pending(qa_db_recent_c_qs_selectspec($userid, 0, $categoryslugs), qa_db_category_nav_selectspec($categoryslugs, false, false, true), $countslugs ? qa_db_slugs_to_category_id_selectspec($categoryslugs) : null);
if ($countslugs) {
    if (!isset($categoryid)) {
        return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
    }
    $categorytitlehtml = qa_html($categories[$categoryid]['title']);
    $sometitle = qa_lang_html_sub('main/recent_cs_in_x', $categorytitlehtml);
    $nonetitle = qa_lang_html_sub('main/no_comments_in_x', $categorytitlehtml);
} else {
    $sometitle = qa_lang_html('main/recent_cs_title');
    $nonetitle = qa_lang_html('main/no_comments_found');
}
//	Prepare and return content for theme
return qa_q_list_page_content(qa_any_sort_and_dedupe($questions), qa_opt('page_size_activity'), 0, null, $sometitle, $nonetitle, $categories, $categoryid, false, 'comments/', qa_opt('feed_for_activity') ? 'comments' : null, qa_html_suggest_qs_tags(qa_using_tags(), qa_category_path_request($categories, $categoryid)));
/*
	Omit PHP closing tag to help avoid accidental output
Exemplo n.º 6
0
     $questions = qa_feed_load_ifcategory($categoryslugs, 'main/hot_qs_title', 'main/hot_qs_in_x', $title, qa_db_qs_selectspec(null, 'hotness', 0, $categoryslugs, null, false, $full, $count));
     break;
 case 'unanswered':
     $questions = qa_feed_load_ifcategory($categoryslugs, 'main/unanswered_qs_title', 'main/unanswered_qs_in_x', $title, qa_db_unanswered_qs_selectspec(null, null, 0, $categoryslugs, false, $full, $count));
     break;
 case 'answers':
     $questions = qa_feed_load_ifcategory($categoryslugs, 'main/recent_as_title', 'main/recent_as_in_x', $title, qa_db_recent_a_qs_selectspec(null, 0, $categoryslugs, null, false, $full, $count));
     break;
 case 'comments':
     $questions = qa_feed_load_ifcategory($categoryslugs, 'main/recent_cs_title', 'main/recent_cs_in_x', $title, qa_db_recent_c_qs_selectspec(null, 0, $categoryslugs, null, false, $full, $count));
     break;
 case 'qa':
     $questions = qa_feed_load_ifcategory($categoryslugs, 'main/recent_qs_as_title', 'main/recent_qs_as_in_x', $title, qa_db_qs_selectspec(null, 'created', 0, $categoryslugs, null, false, $full, $count), qa_db_recent_a_qs_selectspec(null, 0, $categoryslugs, null, false, $full, $count));
     break;
 case 'activity':
     $questions = qa_feed_load_ifcategory($categoryslugs, 'main/recent_activity_title', 'main/recent_activity_in_x', $title, qa_db_qs_selectspec(null, 'created', 0, $categoryslugs, null, false, $full, $count), qa_db_recent_a_qs_selectspec(null, 0, $categoryslugs, null, false, $full, $count), qa_db_recent_c_qs_selectspec(null, 0, $categoryslugs, null, false, $full, $count), qa_db_recent_edit_qs_selectspec(null, 0, $categoryslugs, null, true, $full, $count));
     break;
 case 'tag':
     $tag = $feedparams[0];
     $questions = qa_feed_load_ifcategory(null, null, null, $title, qa_db_tag_recent_qs_selectspec(null, $tag, 0, $full, $count));
     $title = qa_lang_sub('main/questions_tagged_x', $tag);
     $linkrequest = 'tag/' . $tag;
     break;
 case 'search':
     require_once QA_INCLUDE_DIR . 'app/search.php';
     $query = $feedparams[0];
     $results = qa_get_search_results($query, 0, $count, null, true, $full);
     $title = qa_lang_sub('main/results_for_x', $query);
     $linkrequest = 'search';
     $linkparams = array('q' => $query);
     $questions = array();
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$ip = qa_request_part(1);
// picked up from qa-page.php
if (long2ip(ip2long($ip)) !== $ip) {
    return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
//	Find recently (hidden, queued or not) questions, answers, comments and edits for this IP
$userid = qa_get_logged_in_userid();
list($qs, $qs_queued, $qs_hidden, $a_qs, $a_queued_qs, $a_hidden_qs, $c_qs, $c_queued_qs, $c_hidden_qs, $edit_qs) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, $ip, false), qa_db_qs_selectspec($userid, 'created', 0, null, $ip, 'Q_QUEUED'), qa_db_qs_selectspec($userid, 'created', 0, null, $ip, 'Q_HIDDEN', true), qa_db_recent_a_qs_selectspec($userid, 0, null, $ip, false), qa_db_recent_a_qs_selectspec($userid, 0, null, $ip, 'A_QUEUED'), qa_db_recent_a_qs_selectspec($userid, 0, null, $ip, 'A_HIDDEN', true), qa_db_recent_c_qs_selectspec($userid, 0, null, $ip, false), qa_db_recent_c_qs_selectspec($userid, 0, null, $ip, 'C_QUEUED'), qa_db_recent_c_qs_selectspec($userid, 0, null, $ip, 'C_HIDDEN', true), qa_db_recent_edit_qs_selectspec($userid, 0, null, $ip, false));
//	Check we have permission to view this page, and whether we can block or unblock IPs
if (qa_user_maximum_permit_error('permit_anon_view_ips')) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_lang_html('users/no_permission');
    return $qa_content;
}
$blockable = qa_user_level_maximum() >= QA_USER_LEVEL_MODERATOR;
// allow moderator in one category to block across all categories
//	Perform blocking or unblocking operations as appropriate
if (qa_clicked('doblock') || qa_clicked('dounblock') || qa_clicked('dohideall')) {
    if (!qa_check_form_security_code('ip-' . $ip, qa_post_text('code'))) {
        $pageerror = qa_lang_html('misc/form_security_again');
    } elseif ($blockable) {
        if (qa_clicked('doblock')) {
            $oldblocked = qa_opt('block_ips_write');
	GNU General Public License for more details.

	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
// report that we entered this page
qa_report_event('page_enter', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array('params' => $_SERVER['QUERY_STRING'], 'path' => $_SERVER['SCRIPT_NAME']));
require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
//	Find recently hidden questions, answers, comments
list($hiddenquestions, $hiddenanswers, $hiddencomments) = qa_db_select_with_pending(qa_db_qs_selectspec($qa_login_userid, 'created', 0, null, null, true), qa_db_recent_a_qs_selectspec($qa_login_userid, 0, null, null, true), qa_db_recent_c_qs_selectspec($qa_login_userid, 0, null, null, true));
//	Check admin privileges (do late to allow one DB query)
if (!qa_admin_check_privileges($qa_content)) {
    return $qa_content;
}
//	Combine sets of questions and get information for users
$questions = qa_any_sort_and_dedupe(array_merge($hiddenquestions, $hiddenanswers, $hiddencomments));
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
//	Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/recent_hidden_title');
$qa_content['error'] = qa_admin_page_error();
$qa_content['q_list']['qs'] = array();
if (count($questions)) {
    foreach ($questions as $question) {
        $htmloptions = qa_post_html_defaults('Q');
Exemplo n.º 9
0
 function get_updated_qs($count)
 {
     $userid = qa_get_logged_in_userid();
     $aselspec = qa_db_recent_a_qs_selectspec($userid, 0, null, null, false, false, $count);
     $aselspec['columns']['content'] = '^posts.content';
     $aselspec['columns']['notify'] = '^posts.notify';
     $aselspec['columns']['updated'] = 'UNIX_TIMESTAMP(^posts.updated)';
     $aselspec['columns']['updatetype'] = '^posts.updatetype';
     $aselspec['columns'][] = '^posts.format';
     $aselspec['columns'][] = '^posts.lastuserid';
     $aselspec['columns']['lastip'] = 'INET_NTOA(^posts.lastip)';
     $aselspec['columns'][] = '^posts.parentid';
     $aselspec['columns']['lastviewip'] = 'INET_NTOA(^posts.lastviewip)';
     $cselspec = qa_db_recent_c_qs_selectspec($userid, 0, null, null, false, false, $count);
     $cselspec['columns']['content'] = '^posts.content';
     $cselspec['columns']['notify'] = '^posts.notify';
     $cselspec['columns']['updated'] = 'UNIX_TIMESTAMP(^posts.updated)';
     $cselspec['columns']['updatetype'] = '^posts.updatetype';
     $cselspec['columns'][] = '^posts.format';
     $cselspec['columns'][] = '^posts.lastuserid';
     $cselspec['columns']['lastip'] = 'INET_NTOA(^posts.lastip)';
     $cselspec['columns'][] = '^posts.parentid';
     $cselspec['columns']['lastviewip'] = 'INET_NTOA(^posts.lastviewip)';
     $eselspec = qa_db_recent_edit_qs_selectspec($userid, 0, null, null, false, false, $count);
     $eselspec['columns']['content'] = '^posts.content';
     $eselspec['columns']['notify'] = '^posts.notify';
     $eselspec['columns']['updated'] = 'UNIX_TIMESTAMP(^posts.updated)';
     $eselspec['columns']['updatetype'] = '^posts.updatetype';
     $eselspec['columns'][] = '^posts.format';
     $eselspec['columns'][] = '^posts.lastuserid';
     $eselspec['columns']['lastip'] = 'INET_NTOA(^posts.lastip)';
     $eselspec['columns'][] = '^posts.parentid';
     $eselspec['columns']['lastviewip'] = 'INET_NTOA(^posts.lastviewip)';
     @(list($questions1, $questions2, $questions3, $questions4) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, null, false, true, $count), $aselspec, $cselspec, $eselspec));
     $qarray = qa_any_sort_and_dedupe(array_merge($questions1, $questions2, $questions3, $questions4));
     // questions
     return array_values($qarray);
 }
Exemplo n.º 10
0
	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'app/format.php';
require_once QA_INCLUDE_DIR . 'app/q-list.php';
$categoryslugs = qa_request_parts(1);
$countslugs = count($categoryslugs);
$userid = qa_get_logged_in_userid();
//	Get lists of recent activity in all its forms, plus category information
list($questions1, $questions2, $questions3, $questions4, $categories, $categoryid) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, $categoryslugs, null, false, false, qa_opt_if_loaded('page_size_activity')), qa_db_recent_a_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_c_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_edit_qs_selectspec($userid, 0, $categoryslugs), qa_db_category_nav_selectspec($categoryslugs, false, false, true), $countslugs ? qa_db_slugs_to_category_id_selectspec($categoryslugs) : null);
if ($countslugs) {
    if (!isset($categoryid)) {
        return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
    }
    $categorytitlehtml = qa_html($categories[$categoryid]['title']);
    $sometitle = qa_lang_html_sub('main/recent_activity_in_x', $categorytitlehtml);
    $nonetitle = qa_lang_html_sub('main/no_questions_in_x', $categorytitlehtml);
} else {
    $sometitle = qa_lang_html('main/recent_activity_title');
    $nonetitle = qa_lang_html('main/no_questions_found');
}
//	Prepare and return content for theme
return qa_q_list_page_content(qa_any_sort_and_dedupe(array_merge($questions1, $questions2, $questions3, $questions4)), qa_opt('page_size_activity'), 0, null, $sometitle, $nonetitle, $categories, $categoryid, true, 'activity/', qa_opt('feed_for_activity') ? 'activity' : null, qa_html_suggest_qs_tags(qa_using_tags(), qa_category_path_request($categories, $categoryid)), null, null);
/*
	Omit PHP closing tag to help avoid accidental output
Exemplo n.º 11
0
	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
// report that we entered this page
qa_report_event('page_enter', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array('params' => $_SERVER['QUERY_STRING'], 'path' => $_SERVER['SCRIPT_NAME']));
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
require_once QA_INCLUDE_DIR . 'qa-app-q-list.php';
$categoryslugs = $pass_subrequests;
$countslugs = count($categoryslugs);
//	Get lists of recent activity in all its forms, plus category information
@(list($questions1, $questions2, $questions3, $questions4, $categories, $categoryid) = qa_db_select_with_pending(qa_db_qs_selectspec($qa_login_userid, 'created', 0, $categoryslugs), qa_db_recent_a_qs_selectspec($qa_login_userid, 0, $categoryslugs), qa_db_recent_c_qs_selectspec($qa_login_userid, 0, $categoryslugs), qa_db_recent_edit_qs_selectspec($qa_login_userid, 0, $categoryslugs), qa_db_category_nav_selectspec($categoryslugs, false), $countslugs ? qa_db_slugs_to_category_id_selectspec($categoryslugs) : null));
if ($countslugs) {
    if (!isset($categoryid)) {
        return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
    }
    $categorytitlehtml = qa_html($categories[$categoryid]['title']);
    $sometitle = qa_lang_html_sub('main/recent_activity_in_x', $categorytitlehtml);
    $nonetitle = qa_lang_html_sub('main/no_questions_in_x', $categorytitlehtml);
} else {
    $sometitle = qa_lang_html('main/recent_activity_title');
    $nonetitle = qa_lang_html('main/no_questions_found');
}
//	Prepare and return content for theme
return qa_q_list_page_content(qa_any_sort_and_dedupe(array_merge($questions1, $questions2, $questions3, $questions4)), qa_opt('page_size_activity'), 0, null, $sometitle, $nonetitle, $categories, $categoryid, true, 'activity/', qa_opt('feed_for_activity') ? 'activity' : null, qa_html_suggest_qs_tags(qa_using_tags(), qa_category_path_request($categories, $categoryid)));
/*
	Omit PHP closing tag to help avoid accidental output
Exemplo n.º 12
0
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
// report that we entered this page
qa_report_event('page_enter', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array('params' => $_SERVER['QUERY_STRING'], 'path' => $_SERVER['SCRIPT_NAME']));
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$ip = @$pass_subrequests[0];
// picked up from qa-page.php
if (long2ip(ip2long($ip)) !== $ip) {
    return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
//	Find recently (hidden or not) questions, answers, comments and edits
list($qs, $qs_hidden, $a_qs, $a_hidden_qs, $c_qs, $c_hidden_qs, $edit_qs) = qa_db_select_with_pending(qa_db_qs_selectspec($qa_login_userid, 'created', 0, null, $ip, false), qa_db_qs_selectspec($qa_login_userid, 'created', 0, null, $ip, true, true), qa_db_recent_a_qs_selectspec($qa_login_userid, 0, null, $ip, false), qa_db_recent_a_qs_selectspec($qa_login_userid, 0, null, $ip, true, true), qa_db_recent_c_qs_selectspec($qa_login_userid, 0, null, $ip, false), qa_db_recent_c_qs_selectspec($qa_login_userid, 0, null, $ip, true, true), qa_db_recent_edit_qs_selectspec($qa_login_userid, 0, null, $ip, false));
//	Check we have permission to view this page, and whether we can block or unblock IPs
if (qa_user_permit_error('permit_anon_view_ips')) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_lang_html('users/no_permission');
    return $qa_content;
}
$blockable = qa_get_logged_in_level() >= QA_USER_LEVEL_MODERATOR;
//	Perform blocking or unblocking operations as appropriate
if ($blockable) {
    if (qa_clicked('doblock')) {
        $oldblocked = qa_opt('block_ips_write');
        qa_set_option('block_ips_write', (strlen($oldblocked) ? $oldblocked . ' , ' : '') . $ip);
        qa_redirect($qa_request);
    }
    if (qa_clicked('dounblock')) {