$query = "SELECT * FROM $table_message WHERE group_id='$group_id' AND msg_status <> 4 ORDER BY id";
$query = "SELECT * FROM $table_message WHERE group_id=$group_id AND msg_status <> ".MESSAGE_STATUS_OUTBOX." ORDER BY id";
$rs = Database::query($query,__FILE__,__LINE__);
$rs = Database::query($query,__FILE__,__LINE__);
$data = array();
$data = array();
if (Database::num_rows($rs) > 0) {
if (Database::num_rows($rs) > 0) {
@ -533,7 +534,7 @@ class MessageManager
$condition_limit = " LIMIT $offset,$limit ";
$condition_limit = " LIMIT $offset,$limit ";
}
}
$query = "SELECT * FROM $table_message WHERE parent_id='$parent_id' AND msg_status <> 4 $condition_group_id ORDER BY send_date DESC $condition_limit ";
$query = "SELECT * FROM $table_message WHERE parent_id='$parent_id' AND msg_status <> ".MESSAGE_STATUS_OUTBOX." $condition_group_id ORDER BY send_date DESC $condition_limit ";
$sql_query = "SELECT id as col0, user_sender_id as col1, title as col2, send_date as col3, user_receiver_id as col4, msg_status as col5 FROM $table_message " .
$sql_query = "SELECT id as col0, user_sender_id as col1, title as col2, send_date as col3, user_receiver_id as col4, msg_status as col5 FROM $table_message " .
"WHERE user_sender_id=".api_get_user_id()." AND msg_status=4 " .
"WHERE user_sender_id=".api_get_user_id()." AND msg_status=".MESSAGE_STATUS_OUTBOX." " .
"ORDER BY col$column $direction LIMIT $from,$number_of_items";
"ORDER BY col$column $direction LIMIT $from,$number_of_items";
$sql_query = "SELECT COUNT(*) as number_messages FROM $table_message WHERE msg_status=4 AND user_sender_id=".api_get_user_id();
$sql_query = "SELECT COUNT(*) as number_messages FROM $table_message WHERE msg_status=".MESSAGE_STATUS_OUTBOX." AND user_sender_id=".api_get_user_id();