unset($questions[$index]);
        }
    }
}
//	Get information for users
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
//	Create list of actual hidden postids and see which ones have dependents
$qhiddenpostid = array();
foreach ($questions as $key => $question) {
    $qhiddenpostid[$key] = isset($question['opostid']) ? $question['opostid'] : $question['postid'];
}
$dependcounts = qa_db_postids_count_dependents($qhiddenpostid);
//	Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/recent_hidden_title');
$qa_content['error'] = isset($pageerror) ? $pageerror : qa_admin_page_error();
$qa_content['q_list'] = array('form' => array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('admin/click'))), 'qs' => array());
if (count($questions)) {
    foreach ($questions as $key => $question) {
        $elementid = 'p' . $qhiddenpostid[$key];
        $htmloptions = qa_post_html_options($question);
        $htmloptions['voteview'] = false;
        $htmloptions['tagsview'] = !isset($question['opostid']);
        $htmloptions['answersview'] = false;
        $htmloptions['viewsview'] = false;
        $htmloptions['updateview'] = false;
        $htmloptions['contentview'] = true;
        $htmloptions['flagsview'] = true;
        $htmloptions['elementid'] = $elementid;
        $htmlfields = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, $htmloptions);
        if (isset($htmlfields['what_url'])) {
            foreach ($optionnames as $optionname) {
                qa_set_option($optionname, (int) qa_post_text('option_' . $optionname));
            }
            if (!qa_post_text('has_js')) {
                qa_redirect('admin/recalc', array('dorecalcpoints' => 1));
            } else {
                $recalculate = true;
            }
        }
    }
    $options = qa_get_options($optionnames);
}
//	Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/admin_title') . ' - ' . qa_lang_html('admin/points_title');
$qa_content['error'] = $securityexpired ? qa_lang_html('admin/form_security_expired') : qa_admin_page_error();
$qa_content['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '" name="points_form" onsubmit="document.forms.points_form.has_js.value=1; return true;"', 'style' => 'wide', 'buttons' => array('saverecalc' => array('tags' => 'id="dosaverecalc"', 'label' => qa_lang_html('admin/save_recalc_button'))), 'hidden' => array('dosaverecalc' => '1', 'has_js' => '0', 'code' => qa_get_form_security_code('admin/points')));
if (qa_clicked('doshowdefaults')) {
    $qa_content['form']['ok'] = qa_lang_html('admin/points_defaults_shown');
    $qa_content['form']['buttons']['cancel'] = array('tags' => 'name="docancel"', 'label' => qa_lang_html('main/cancel_button'));
} else {
    if ($recalculate) {
        $qa_content['form']['ok'] = '<span id="recalc_ok"></span>';
        $qa_content['form']['hidden']['code_recalc'] = qa_get_form_security_code('admin/recalc');
        $qa_content['script_rel'][] = 'qa-content/qa-admin.js?' . QA_VERSION;
        $qa_content['script_var']['qa_warning_recalc'] = qa_lang('admin/stop_recalc_warning');
        $qa_content['script_onloads'][] = array("qa_recalc_click('dorecalcpoints', document.getElementById('dosaverecalc'), null, 'recalc_ok');");
    }
    $qa_content['form']['buttons']['showdefaults'] = array('tags' => 'name="doshowdefaults"', 'label' => qa_lang_html('admin/show_defaults_button'));
}
foreach ($optionnames as $optionname) {
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';
//	Check admin privileges (do late to allow one DB query)
if (!qa_admin_check_privileges($qa_content)) {
    return $qa_content;
}
//	Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/admin_title') . ' - ' . qa_lang_html('admin/plugins_title');
$qa_content['error'] = qa_admin_page_error();
if (count($qa_plugin_files)) {
    $qa_content['form'] = array('style' => 'tall', 'fields' => array('plugins' => array('type' => 'custom', 'label' => qa_lang_html('admin/installed_plugins'), 'html' => '')));
    $metafields = array('name' => 'Plugin Name', 'uri' => 'Plugin URI', 'description' => 'Plugin Description', 'version' => 'Plugin Version', 'date' => 'Plugin Date', 'author' => 'Plugin Author', 'author_uri' => 'Plugin Author URI', 'license' => 'Plugin License', 'min_q2a' => 'Plugin Minimum Question2Answer Version');
    foreach ($qa_plugin_files as $pluginfile) {
        $contents = file_get_contents($pluginfile);
        $metadata = array();
        foreach ($metafields as $key => $fieldname) {
            if (preg_match('/' . str_replace(' ', '[ \\t]*', preg_quote($fieldname, '/')) . ':[ \\t]*([^\\n\\f]*)[\\n\\f]/i', $contents, $matches)) {
                $metadata[$key] = trim($matches[1]);
            }
        }
        if (strlen(@$metadata['name'])) {
            $namehtml = qa_html($metadata['name']);
        } else {
            $namehtml = qa_lang_html('admin/unnamed_plugin');