<?php $cs_id=TGET('cs_id'); $lctr_id=TGET('lctr_id'); $mb_id_to=TGET('mb_id_to'); $type=TGET('type'); $mb_id_current=current_mb_id(); $timezone_bias_seconds=get_user_time_zone()*60; list($offset,$pagesize,$pageno)=decide_page_range(TGET("p"),TGET("ps")); $dataset['cs_id']=$cs_id; $dataset['lctr_id']=$lctr_id; $dataset['type']=$type; $dataset['mb_id_to']=$mb_id_to; $DBConn->connect(true); if ($mb_id_to) $dataset+=db_load_member($DBConn,$mb_id_to); if ($lctr_id) { $lecture=db_load_lecture_by_id($DBConn,$lctr_id); $cs_id=$lecture['cs_id']; } if ($cs_id) { $course=db_load_course_by_id($DBConn,$cs_id); $USE_THEME_BY_USER_ID=$course['mb_id_owner']; $dataset+=$course; if ($course) $dataset+=db_load_compere($DBConn,$course['mb_id_owner']); } $dataset+=array_key_prepend(split_datetime($lecture['lctr_since'],$timezone_bias_seconds),'since_'); $dataset+=array_key_prepend(split_datetime($lecture['lctr_expire'],$timezone_bias_seconds),'expire_'); $dataset['since_weekday']=datetime_to_weekday($lecture['lctr_since'],$timezone_bias_seconds); $dataset['expire_weekday']=datetime_to_weekday($lecture['lctr_expire'],$timezone_bias_seconds); if (datetime_datepart($lecture['lctr_since'],$timezone_bias_seconds)==datetime_datepart($lecture['lctr_expire'],$timezone_bias_seconds)) $dataset['DATE-SAME']=array(0); else $dataset['DATE-DIFF']=array(0); $billboard=db_load_billboard($DBConn,$mb_id_current,array('cs_id'=>$dataset['cs_id'],'lctr_id'=>$lctr_id,'mb_id_reader'=>$mb_id_to),array(),$offset,$pagesize+1); $dataset+=prepare_paging_dataset($pageno,$pagesize,$billboard); $bb_ids=array_projection($billboard,'bb_id'); $bbreaders=db_load_billboard_reader($DBConn,$bb_ids); $bb2reader=rowset2multimap($bbreaders,'bb_id'); if ($billboard) { $dataset['COMMENT']=$billboard; foreach ($dataset['COMMENT'] as &$comment) { $comment+=split_datetime($comment['fh_timestamp'],$timezone_bias_seconds); if ($bb2reader[$comment['bb_id']]) { foreach ($bb2reader[$comment['bb_id']] as $reader) { if ($reader['mb_id_reader']) $comment['SCOPE-SPECIFIC']=array(0); else if ($reader['lctr_id']) $comment['SCOPE-LECTURE']=array(0); else if ($reader['cs_id']) $comment['SCOPE-ALL']=array(0); } } $comment['IS-AUTHOR']=$comment['mb_id_author']==$mb_id_current?array(0):array(); } } else $dataset['COMMENT-NONE']=array(0); if ($type=='pop') { $dataset['POPPING']=array(0); $dataset['GUEST-ONLY']=array(); turnoff_mainmenu(); turnoff_mainfooter(); } $dataset['TO-MEMBER']=$mb_id_to?array(0):array(); $dataset['TO-COMPERE']=!$mb_id_to && $cs_id?array(0):array(); $dataset['PRIVATE-COMMENT']=$mb_id_to?array(0):array(); $dataset['PUBLIC-COMMENT']=$cs_id && !$lctr_id && !$mb_id_to?array(0):array(); $dataset['SCOPED-COMMENT']=$dataset['PUBLIC-COMMENT']?array():array(0); $dataset['COURSE-DESC']=$cs_id?array(0):array(); $dataset['LECTURE-DESC']=$lctr_id?array(0):array(); $dataset['WRITABLE']=is_member()?array(0):array(); $dataset['UNWRITABLE']=is_member()?array():array(0); ?>