0) { // get the correct display for the inbox view if($vars['page_view'] == "inbox") { $counter = 0; foreach($vars['entity'] as $message) { if ($message->owner_guid == get_loggedin_userid() || $message->toId == get_loggedin_userid()) { //make sure to only display the messages that have not been 'deleted' (1 = deleted) if($message->hiddenFrom != 1){ // check to see if the message has been read, if so, set the correct container class if($message->readYet == 1){ echo "
"; }else{ echo "
"; } // get the icon of the user who owns the message $from = get_entity($message->fromId); echo "
".elgg_view("profile/icon",array('entity' => $from, 'size' => 'tiny'))."
"; // message block (message sender, message subject, delete checkbox) echo "
".$from->name."

".elgg_view_friendly_time($message->time_created)."

"; // display message subject echo "
"; // display delete button echo "" . elgg_view("output/confirmlink", array( 'href' => "action/messages/delete?message_id=" . $message->getGUID() . "&type=inbox&submit=" . urlencode(elgg_echo('delete')), 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), )) . ""; echo "

guid}\" />"; echo "getURL()}\">" . $message->title . "

"; echo "
"; // close the message container }//end of hiddenFrom if statement } // end of user check $counter++; if ($counter == $limit) break; }//end of for each loop }//end of inbox if statement // get the correct display for the sentbox view if($vars['page_view'] == "sent") { $counter = 0; foreach($vars['entity'] as $message) { //make sure to only display the messages that have not been 'deleted' (1 = deleted) if($message->hiddenTo != 1){ //get the correct user entity $user = get_entity($message->toId); echo "
"; //get the icon for the user the message was sent to echo "
".elgg_view("profile/icon",array('entity' => $user, 'size' => 'tiny'))."
"; echo "
".get_loggedin_user()->name."

".elgg_view_friendly_time($message->time_created)."

"; // display message subject echo "
"; //display the link to 'delete' echo "
" . elgg_view("output/confirmlink", array( 'href' => "action/messages/delete?message_id=" . $message->getGUID() . "&type=sent&submit=" . urlencode(elgg_echo('delete')), 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), )) . "
"; echo "

guid}\" /> "; echo "getURL()}?type=sent\">" . $message->title . "

"; echo "
"; // close the message container }//close hiddeTo if statement $counter++; if ($counter == $limit) break; }//close foreach }//close page_view sent if statement $baseurl = $_SERVER['REQUEST_URI']; $nav = ''; if (sizeof($vars['entity']) > $limit) { $newoffset = $offset + $limit; $nexturl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); $nav .= '« ' . elgg_echo('previous') . ' '; } if ($offset > 0) { $newoffset = $offset - $limit; if ($newoffset < 0) $newoffset = 0; $prevurl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); $nav .= '' . elgg_echo('next') . ' » '; } if (!empty($nav)) { echo ''; } } else { echo "

".elgg_echo("messages:nomessages")."

"; }