/
read.php
43 lines (32 loc) · 1.24 KB
/
read.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* View a question
*/
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
// Get the specified question
$post = (int) get_input('question_id');
// If we can get question ...
$question = get_entity($post);
if ($question instanceof ElggEntity && $question->getSubtype() == "question") {
// Set the page owner
if ($question->container_guid) {
elgg_set_page_owner_guid($question->container_guid);
} else {
set_page_owner($question->owner_guid);
}
// Display it
//$area2 = elgg_view_title(elgg_echo("answers"));
$area2 .= elgg_view_entity($question, array('full_view' => true));
// Set the title appropriately
$title = sprintf(elgg_echo("answers:question:fulltitle"), $question->title);
// Display through the correct canvas area
//$body = elgg_view_layout("two_column_left_sidebar", '', $area2);
$body = elgg_view_layout("content", array('content' => $area2, 'title' => sprintf(elgg_echo("answers:question:fulltitle"), $question->title), 'filter_override' => ''));
// If we're not allowed to see the question
} else {
// Display the 'post not found' page instead
$body = elgg_view("answers/notfound");
$title = elgg_echo("answers:notfound");
}
echo elgg_view_page($title, $body);
//page_draw($title, $body);