<?php require_once('includes/requirelogin.inc.php'); require_once('includes/question.inc.php'); $mb_id_to=TGET('mb_id_to'); $mb_id_from=TGET('mb_id_from'); $st_id=TGET('st_id'); $lctr_id=TGET('lctr_id'); $type=TGET('type'); $timezone_bias_seconds=get_user_time_zone()*60; if (!$lctr_id || !$mb_id_to) return; $DBConn->connect(true); $lecture=db_load_lecture_by_id($DBConn,$lctr_id); $course=db_load_course_by_id($DBConn,0+$lecture['cs_id']); if (!$course) return; $dataset+=$course; $dataset+=array_key_prepend(split_datetime($lecture['lctr_since'],$timezone_bias_seconds),'since_'); $dataset['since_weekday']=datetime_to_weekday($lec['lctr_since'],$timezone_bias_seconds); if ($mb_id_to && !$mb_id_from) $mb_id_from=$course['mb_id_owner']; $comperes=array( $mb_id_from=>db_load_compere($DBConn,$mb_id_from), $mb_id_to=>db_load_compere($DBConn,$mb_id_to) ); $members=array( $mb_id_from=>db_load_member($DBConn,$mb_id_from), $mb_id_to=>db_load_member($DBConn,$mb_id_to) ); $messages=db_load_lecture_messages_of_peers($DBConn,$lctr_id,$mb_id_from,$mb_id_to); $msg_ids=array_projection($messages,'msg_id'); $messages_attrib=db_get_message_attrib($DBConn,$msg_ids); $msgattrmap=array(); foreach ($messages_attrib as $ma) $msgattrmap[$ma['msg_id']][$ma['msga_prop']]=$ma['msga_value']; if ($st_id) { $reservation=db_load_reservation2($DBConn,$lctr_id,$st_id); $rsv_id_as_id=db_load_reservations_answer_sets($DBConn,$reservation['rsv_id']); if ($rsv_id_as_id) $dataset+=prepare_answer_set_dataset($DBConn,$rsv_id_as_id[0]['as_id']); } $dataset['DISPLAY-ANSWER-SET']=$dataset['ANSWER-SET']?array(0):array(); $dataset['MESSAGE']=array(); foreach ($messages as $msg) { if (!$msg['fh_brief'] && !$msg['fh_text']) continue; if ($msg['msg_from_as']=='MEMBER') { $msg['sender.name']=$members[$msg['mb_id_from']]['mb_nickname']; $msg['AS-MESSAGE']=array(0); } else if ($msg['msg_from_as']=='COMPERE') { $msg['sender.name']=$comperes[$msg['mb_id_from']]['cp_name']; $msg['AS-COMPERE']=array(0); } else if ($msg['msg_from_as']=='GUEST') { $msg['sender.name']=$msgattrmap[$msg['msg_id']]['sender.name']; $msg['AS-GUEST']=array(0); } $msg['BRIEF']=$msg['fh_brief']?array(0):array(); array_push($dataset['MESSAGE'],$msg); } if ($type=='pop') { $dataset['POPUP']=array(0); turnoff_mainmenu(); turnoff_mainfooter(); } ?>