history.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <div class="messages_extened-history">
  2. <h3><?= elgg_echo('messages_extended:history:title'); ?></h3>
  3. <hr/>
  4. <?php
  5. global $CONFIG;
  6. $title = str_replace('RE: ', '', $vars['message']->title);
  7. $messages = elgg_list_entities_from_metadata(array(
  8. 'type' => 'object',
  9. 'subtype' => 'messages',
  10. 'owner_guids' => $vars['message']->owner_guid,
  11. 'metadata_name_value_pairs' => array(
  12. array(
  13. 'name' => 'fromId',
  14. 'value' => array(
  15. $vars['message']->fromId,
  16. $vars['message']->toId
  17. )
  18. )
  19. ),
  20. 'joins' => array(
  21. 'JOIN ' . $CONFIG->dbprefix . 'objects_entity oe ON oe.guid = e.guid'
  22. ),
  23. 'wheres' => array(
  24. 'oe.title LIKE "%' . sanitise_string($title) . '"'
  25. ),
  26. 'full_view' => false,
  27. ));
  28. // We don't need to have a check if something is found, because the current item is always in there.
  29. echo $messages;
  30. ?>
  31. <script>
  32. $('#elgg-object-<?= $vars['message']->guid; ?>').css('font-weight', 'bold');
  33. </script>
  34. </div>