aboutsummaryrefslogtreecommitdiff
path: root/mod/messageboard/views/default/messageboard/messageboard_content.php
blob: b6307f33bfe64ce6be6be8f90d95261b1f47b968 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php

/**
 * Elgg Message board individual item display view
 *
 * @package ElggMessageBoard
 */

?>

<div class="messageboard"><!-- start of messageboard div -->

	<!-- display the user icon of the user that posted the message -->
	<div class="message_sender">
		<?php
		echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny'));
		?>
	</div>

	<!-- display the user's name who posted and the date/time -->
	<p class="message_item_timestamp">
		<?php echo get_entity($vars['annotation']->owner_guid)->name . " " . elgg_view_friendly_time($vars['annotation']->time_created); ?>
	</p>

	<!-- output the actual comment -->
	<div class="message"><?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?></div>
	<div class="message_buttons">

		<?php

		// if the user looking at the comment can edit, show the delete link
		if ($vars['annotation']->canEdit()) {


			echo "<div class='delete_message'>" . elgg_view("output/confirmlink",array(
					'href' => "action/messageboard/delete?annotation_id=" . $vars['annotation']->id,
					'text' => elgg_echo('delete'),
					'confirm' => elgg_echo('deleteconfirm'),
					)) . "</div>";

		} //end of can edit if statement
		?>
		<?php
		// If the message being looked at is owned by the current user, don't show the reply
		// Also do not show if the user is not logged in
		if (isloggedin() && $vars['annotation']->owner_guid != get_loggedin_userid()) {

			//get the message owner
			$msg_owner = get_entity($vars['annotation']->owner_guid);
			//create the url to their messageboard
			$user_mb = "pg/messageboard/" . $msg_owner->username;

			echo "<a href=\"" . elgg_get_site_url() . $user_mb . "\">".elgg_echo('messageboard:replyon')." " . $msg_owner->name . "'s " . elgg_echo('messageboard:messageboard') . "</a> | ";

			echo "<a href=\"" . elgg_get_site_url() . "mod/messageboard/history.php?user=" . $msg_owner->guid ."\">" . elgg_echo('messageboard:history') . "</a>";
		}
		?>

	</div>
	<div class="clearfloat"></div>
</div><!-- end of messageboard div -->