Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display most recent notifications and messages in divs


  • jameshh93
    Participant

    @jameshh93

    Hi I was wondering if some one could help me out. Im looking to display the 5 most recent notifications of the logged in user in a small div to put in my header.php and the same sort of thing for messages and friend requests.

    For the messages and friend requests is there a way to echo the person sending the message to the logged in users avatar, subject, a small bit of the message and time sent?

    and for the friend requests it would be awesome to echo out in the list the user sending the requests avatar, name and maybe even a button to accept or reject the request?

    I know that this maybe a lot to ask but it would really help me and probably a load other peoples sites as well!

    thank you.

Viewing 1 replies (of 1 total)

  • jameshh93
    Participant

    @jameshh93

    at the moment I am using

    
     <?php if ( bp_has_message_threads() ) : ?>
     
      <div class="pagination-count">
        <?php bp_messages_pagination_count() ?>
      </div>
     
      <div class="pagination-links">
        <?php bp_messages_pagination() ?>
      </div>
     
      <ul id="message-threads">
      <?php while ( bp_message_threads() ) : bp_message_thread(); ?>
     
        <li>
          <!-- Example template tags you can use -->
      
          <?php bp_message_thread_avatar() ?>
          <?php bp_message_thread_from() ?>
          <?php bp_message_thread_last_post_date() ?>
          <a href="<?php bp_message_thread_view_link() ?>"><?php bp_message_thread_subject() ?></a>
          
          <?php bp_message_thread_excerpt() ?>
          <a href="<?php bp_message_thread_delete_link() ?>"><i class="fa fa-times" aria-hidden="true"></i></a>
        </li>
      <?php endwhile; ?>
      </ul>
     
    <?php else: ?>
     
      <div id="message" class="info">
        <p>There are no messages to display.</p>
      </div>
     
    <?php endif;?>

    the standard loop for messages however the delete message link doesn’t work it just sends me to a 404 page. Also is there a way to make it ajaxsy and make it delete the message straight away??

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar