public function PublicHeartbeat::dressUpMessages in Heartbeat 6.3
Same name and namespace in other branches
- 6.4 includes/publicheartbeat.inc \PublicHeartbeat::dressUpMessages()
Implementation of dressUpMessages().
Parameters
object HeartbeatParser $heartbeat: The state of the viewed message sets
Return value
object HeartbeatParser $heartbeat
Overrides HeartbeatAccess::dressUpMessages
File
- includes/
publicheartbeat.inc, line 19
Class
- PublicHeartbeat
- Class PublicHeartbeat Concrete class to prepare messages for all users in the site of whom the heartbeat is set to public
Code
public function dressUpMessages(HeartbeatParser $heartbeat) {
$heartbeatInfo = $heartbeat
->get_info();
$heartbeatInfo->uid = 0;
$heartbeatInfo->limit_view = variable_get('heartbeat_block_public_items_max', 25);
$heartbeatInfo->user_relations = $heartbeatInfo->uid;
$heartbeat
->set_info($heartbeatInfo);
$sql = $heartbeatInfo->sql_start;
// logic to fetch messages public to all
$sql .= " AND ua.uid > 0 AND ua.access > 0 ";
$sql .= $heartbeatInfo->sql_end;
$result = db_query_range($sql, $heartbeatInfo->language, $heartbeatInfo->start_time, 0, $heartbeatInfo->limit_sql);
while ($heartbeat_row = db_fetch_object($result)) {
$heartbeat->raw_messages[$heartbeat_row->uaid] = $heartbeat_row;
}
return $heartbeat;
}