/** Luo HTML kysymykselle * @param $title string * @param $tags array * @param $question_id integer * @param $user_id integer * @param $username string * @param $was_sent_at_time string * @param $describtion string */ function create_question($title, $tags, $question_id, $user_id, $username, $was_sent_at_time, $describtion) { // TODO include("validate_url_parameters.php"); create_question_count_box($question_id); create_title($title, $question_id); create_tags($tags); create_user_info_box_question($user_id, $username, $was_sent_at_time, $describtion); echo "</div>"; }
/** Tee kysymykselle infolaatikko * @param $question_id integer */ function create_bottom_bar($question_id) { /* $was_sent_at_time string * $username string * $user_id integer */ $was_sent_at_time = get_was_sent_at_time($question_id); $user_id = get_user_id($question_id); $username = get_username($question_id); echo "<div class='user_info_bottom_box'>"; // print the user box for the question create_moderator_box_for_a_question($question_id, $user_id); create_user_info_box_question($user_id, $username, $was_sent_at_time, "asked"); echo "</div>"; // to end the body of the question echo "</div>"; }
/** Luo HTML vastausten s\"{a}ili\"{o} * @param $question_id integer */ function create_answer_box($question_id) { /* $number_of_answers integer * $result_answers array * $answers_real array * $answer string * $user_id integer * $username string * $was_sent_at_time string */ $result_answers = fetch_answers($question_id); // to print subheader for Answers $number_of_answers = pg_num_rows($result_answers); if ($number_of_answers !== 0) { $result_answers = fetch_answers($question_id); $answers_real = pg_fetch_all($result_answers); foreach ($answers_real as $answer_row) { echo "<div id='one_answer'>"; $answer = $answer_row['answer']; create_answer($answer); echo "<div class='clear'> </div>"; $user_id = $answer_row['user_id']; $username = $answer_row['username']; $was_sent_at_time = $answer_row['was_sent_at_time']; $was_sent_at_time = get_was_sent_time_for_answer($question_id); create_user_info_box_question($user_id, $username, $was_sent_at_time, "answered"); echo "</div>"; } echo "</div>"; } }