class MessageDB extends DB {
function __construct() {
parent::__construct();
$g_user_object = lms_get_user_object();
$this->has(array(
message_id => array(isa => 'int',
join => array(where => '(lms_message.from_user_id = ' . $g_user_object->user_id . ' OR ' . 'lms_message.to_user_id = ' . $g_user_object->user_id . ')')),
subject => array(name => 'Subject',
isa => 'Str32',
//read_date_time is in the 5th array position of this MOUSE object
style => function($data) {
if ($data[5] == "0000-00-00 00:00:00") { return("font-weight:bold;"); }},
//message_id is in the 0th array position of this MOUSE object
link => function($data) {
return('default.php?appname=message-view&message_id=' . $data[0]);}),
from_user_id => array(name => 'From',
isa => 'Username',
join => array(table => 'lms_user lu_from',
column => 'lu_from.username',
where => 'lu_from.user_id = lms_message.from_user_id')),
to_user_id => array(name => 'To',
isa => 'Username',
join => array(table => 'lms_user lu_to',
column => 'lu_to.username',
where => 'lu_to.user_id = lms_message.to_user_id')),
sent_date_time => array(name => 'Time Sent',
isa => 'DateTime',
order => 'desc'),
read_date_time => array(isa => 'DateTime')
));
}
}
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer