@ -18,19 +18,28 @@ function admin_questions() {
if (!isset ($_REQUEST['action'])) {
if (!isset ($_REQUEST['action'])) {
$open_questions = "";
$open_questions = "";
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID`=0");
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID`=0");
foreach ($questions as $question) {
foreach ($questions as $question)
$open_questions .= '< tr > < td > ' . UID2Nick($question['UID']) . '< / td > < td > ' . str_replace("\n", '< br / > ', $question['Question']) . '< / td > ';
$open_questions .= template_render(
$open_questions .= '< td > < form action = "' . page_link_to(" admin_questions " ) . ' & action = answer" method = "post" > < textarea name = "answer" > < / textarea > < input type = "hidden" name = "id" value = "' . $question['QID'] . '" / > < br / > < input type = "submit" name = "submit" value = "Send" / > < / form > < / td > ';
'../templates/admin_question_unanswered.html', array (
$open_questions .= '< td > < a href = "' . page_link_to(" admin_questions " ) . ' & action = delete&id=' . $ question [ ' QID ' ] . ' " > Delete< / a > < / td > < tr > ';
'question_nick' => UID2Nick($question['UID']),
}
'question_id' => $question['QID'],
'link' => page_link_to("admin_questions"),
'question' => str_replace("\n", '< br / > ', $question['Question'])
));
$answered_questions = "";
$answered_questions = "";
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0");
$questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0");
foreach ($questions as $question) {
$answered_questions .= '< tr > < td > ' . UID2Nick($question['UID']) . '< / td > < td > ' . str_replace("\n", '< br / > ', $question['Question']) . '< / td > ';
foreach ($questions as $question)
$answered_questions .= '< td > ' . UID2Nick($question['AID']) . '< / td > < td > ' . str_replace("\n", '< br / > ', $question['Answer']) . '< / td > ';
$answered_questions .= template_render(
$answered_questions .= '< td > < a href = "' . page_link_to(" admin_questions " ) . ' & action = delete&id=' . $ question [ ' QID ' ] . ' " > Delete< / a > < / td > < tr > ';
'../templates/admin_question_answered.html', array (
}
'question_id' => $question['QID'],
'question_nick' => UID2Nick($question['UID']),
'question' => str_replace("\n", "< br / > ", $question['Question']),
'answer_nick' => UID2Nick($question['AID']),
'answer' => str_replace("\n", "< br / > ", $question['Answer']),
'link' => page_link_to("admin_questions"),
));
return template_render('../templates/admin_questions.html', array (
return template_render('../templates/admin_questions.html', array (
'link' => page_link_to("admin_questions"),
'link' => page_link_to("admin_questions"),
@ -73,4 +82,4 @@ function admin_questions() {
}
}
}
}
}
}
?>
?>