require_once("util/fns.inc");
require_once("html/forum.inc");
public_access(4);
$include_social = true;
$user = $_SESSION['user'];
$dbo = db_connect_dbo();
$id = get_topic_id_from_html();
if(!validate_id($id)) {
show_user_error();
exit;
}
$time_now = get_time_now();
$query = "select * from message_parent where status = 1 and mpid = " . $id . " and updatetime < '$time_now'";
$result = do_mysqli_query($query);
if(!$result || mysqli_num_rows($result) != 1) {
show_user_error();
exit;
}
$row1 = mysqli_fetch_array($result);
$query = "select name from message_type where mtid = " . $row1['tid'];
$result = do_mysqli_query($query);
$roomname = do_mysqli_result($result, "name");
//start index of this page.
$query = "select count(mpid) as count from message_parent where tid = " . $row1['tid'] .
" and status = 1 and updateTime > '" . $row1['updateTime'] . "'";
$sequence = get_count($query);
$start = $sequence - $sequence%20 + 1;
if($start <=0) {
$start = 1;
}
$title = "CFA Discussion Topic: " . $row1['title'];
$tweeter_text = $title;
$canonical_link = "cfa-topic-" . $row1['link'] . ".html";
$breadcrumb = array(array("forum_lobby.php", "Forums"),
array("forum_room.php?mtid=" . $row1['tid'] . "&start=" . $start, $roomname),
array("", "Topic: " . $row1['title']));
print_page_header($title, $canonical_link);
print_breadcrumb($breadcrumb);
print_container_start();
if(is_logged_on()) {
$custom_js = get_view_topic_jquery_js($id);
}
print_main_section_start_with_card_header();
$thead = " ";
print_study_table_start($thead);
?>
Author Topic: " . $row1['title'] . "