aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire/views/default/thewire/profile_status.php
blob: 9a9c95ec09a7eb1f26f8ee7cbc46b08d0eef8c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

/**
 * Latest wire post on profile activity page
 */
 
$owner = $vars['entity']->guid;
$url_to_wire = elgg_get_site_url() . "pg/thewire/" . $vars['entity']->username;
	
//grab the user's latest from the wire
$params = array(
	'types' => 'object',
	'subtypes' => 'thewire',
	'owner_guid' => $owner,
	'limit' => 1,
);
$latest_wire = elgg_get_entities($params);

if ($latest_wire) {
	foreach ($latest_wire as $lw) {
		$content = $lw->description;
		$time = "<p class='entity_subtext'> (" . elgg_view_friendly_time($lw->time_created) . ")</p>";
	}

	echo "<div class='wire_post'><div class='wire_post_contents clearfix radius8'>";
	echo $content;
	if ($owner == get_loggedin_userid()) {
		$text = elgg_echo('thewire:update');
		echo "<a class='action-button update small' href=\"{$url_to_wire}\">$text</a>";
	}
	echo $time;
	echo "</div></div>";
}