Ejemplo n.º 1
0
}
$qa_content['script_rel'][] = 'qa-content/qa-question.js?' . QA_VERSION;
if (isset($pageerror)) {
    $qa_content['error'] = $pageerror;
} elseif ($question['queued']) {
    $qa_content['error'] = $question['isbyuser'] ? qa_lang_html('question/q_your_waiting_approval') : qa_lang_html('question/q_waiting_your_approval');
}
if ($question['hidden']) {
    $qa_content['hidden'] = true;
}
qa_sort_by($commentsfollows, 'created');
//	Prepare content for the question...
if ($formtype == 'q_edit') {
    // ...in edit mode
    $qa_content['title'] = qa_lang_html($question['editable'] ? 'question/edit_q_title' : (qa_using_categories() ? 'question/recat_q_title' : 'question/retag_q_title'));
    $qa_content['form_q_edit'] = qa_page_q_edit_q_form($qa_content, $question, @$qin, @$qerrors, $completetags, $categories);
    $qa_content['q_view']['raw'] = $question;
} else {
    // ...in view mode
    $qa_content['q_view'] = qa_page_q_question_view($question, $parentquestion, $closepost, $usershtml, $formrequested);
    $qa_content['title'] = $qa_content['q_view']['title'];
    $qa_content['description'] = qa_html(qa_shorten_string_line(qa_viewer_text($question['content'], $question['format']), 150));
    $categorykeyword = @$categories[$question['categoryid']]['title'];
    $qa_content['keywords'] = qa_html(implode(',', array_merge(qa_using_categories() && strlen($categorykeyword) ? array($categorykeyword) : array(), qa_tagstring_to_tags($question['tags']))));
    // as far as I know, META keywords have zero effect on search rankings or listings, but many people have asked for this
}
$microdata = qa_opt('use_microdata');
if ($microdata) {
    $qa_content['head_lines'][] = '<meta itemprop="name" content="' . qa_html($qa_content['q_view']['raw']['title']) . '">';
    $qa_content['html_tags'] = ' itemscope itemtype="http://schema.org/QAPage"';
    $qa_content['main_tags'] = ' itemscope itemtype="http://schema.org/Question"';
//	Prepare content for theme
$qa_content = qa_content_prepare(true, array_keys(qa_category_path($categories, $question['categoryid'])));
$qa_content['main_form_tags'] = 'METHOD="POST" ACTION="' . qa_self_html() . '"';
if (isset($pageerror)) {
    $qa_content['error'] = $pageerror;
}
// might also show voting error set in qa-index.php
if ($question['hidden']) {
    $qa_content['hidden'] = true;
}
qa_sort_by($commentsfollows, 'created');
//	Prepare content for the question...
if ($formtype == 'q_edit') {
    // ...in edit mode
    $qa_content['title'] = qa_lang_html('question/edit_q_title');
    $qa_content['form_q_edit'] = qa_page_q_edit_q_form();
    $qa_content['q_view']['raw'] = $question;
} else {
    // ...in view mode
    $htmloptions = qa_post_html_defaults('Q', true);
    $htmloptions['answersview'] = false;
    // answer count is displayed separately so don't show it here
    $htmloptions['avatarsize'] = qa_opt('avatar_q_page_q_size');
    $qa_content['q_view'] = qa_post_html_fields($question, $qa_login_userid, $qa_cookieid, $usershtml, null, $htmloptions);
    $qa_content['title'] = $qa_content['q_view']['title'];
    $qa_content['description'] = qa_html(qa_shorten_string_line(qa_viewer_text($question['content'], $question['format']), 150));
    $qa_content['canonical'] = qa_path_html(qa_q_request($question['postid'], $question['title']), null, qa_opt('site_url'));
    $categorykeyword = @$categories[$question['categoryid']]['title'];
    $qa_content['keywords'] = qa_html(implode(',', array_merge(qa_using_categories() && strlen($categorykeyword) ? array($categorykeyword) : array(), qa_tagstring_to_tags($question['tags']))));
    // as far as I know, META keywords have zero effect on search rankings or listings, but many people have asked for this
    //	Buttons for operating on the question