<?php require_once('includes/requirelogin.inc.php'); $cs_id=TGET('cs_id'); $lctr_id=TGET('lctr_id'); $type=TGET('type'); $mb_id_peer=TGET('mb_id_peer'); list($offset,$pagesize,$pageno)=decide_page_range(TGET("p"),TGET("ps")); $mb_id_reader=current_mb_id(); $timezone_bias_seconds=get_user_time_zone()*60; if ($type=='pop') turnoff_mainmenu(); $dataset['cs_id']=$cs_id; $dataset['lctr_id']=$lctr_id; $dataset['type']=$type; $dataset['mb_id_peer']=$mb_id_peer; $DBConn->connect(true); $lecture=array(); $course=array(); if ($lctr_id) $lecture=db_load_lecture_by_id($DBConn,$lctr_id); if ($lecture) { $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); $course=db_load_course_by_id($DBConn,$lecture['cs_id']); } else if ($cs_id) $course=db_load_course_by_id($DBConn,$cs_id); if ($course) { $dataset['cs_name']=$course['cs_name']; $USE_THEME_BY_USER_ID=$course['mb_id_owner']; $dataset['IS-CSOWNER']=$course['mb_id_owner']==$mb_id_reader?array(0):array(); } $billboard=db_load_billboard_lecture_history($DBConn,$mb_id_reader,$cs_id,$lctr_id,$mb_id_peer,$offset,$pagesize+1); $dataset+=prepare_paging_dataset($pageno,$pagesize,$billboard); $dataset['COMMENT']=$billboard; foreach ($dataset['COMMENT'] as &$comment) { $comment['TITLE']=$comment['fh_brief']?array(0):array(); $comment+=split_datetime($comment['fh_timestamp'],$timezone_bias_seconds); $comment+=array_key_prepend(split_datetime($comment['lctr_since'],$timezone_bias_seconds),'lctr_'); } if ($mb_id_peer) { $dataset['MB_ID_PEER']=$mb_id_peer; $dataset['PEER-DESC']=array(0); $dataset+=db_load_member($DBConn,$mb_id_peer); } $dataset['POPPING']=$type=='pop'?array(0):array(); $dataset['COMMENT-NONE']=$billboard?array():array(0); $dataset['COURSE-DESC']=$course?array(0):array(); $dataset['LECTURE-DESC']=$lecture?array(0):array(); ?>