Instant Messenger Plugin - How to show message count
« on: November 28, 2022, 07:39:28 PM »
Hi, can someone help me out. I want to make custom menu in header for Instant Messenger, and i managed to get uniform resource locator but i can't figure out, how to get message count. I i've tried this <?php echo $message_count; ?>, but for some reason it doesn't work. What did I missed?

*

mwindey

  • *****
  • 475 posts
Re: Instant Messenger Plugin - How to show message count
« Reply #1 on: November 29, 2022, 04:13:00 PM »
Try...
Code: [Select]
<?php if($mes_counter 0) { ?>
<span class="counter"><?php echo $mes_counter?></span>
<?php ?>   

Marked as best answer by frosticek on November 29, 2022, 09:05:22 PM
*

MB Themes

Re: Instant Messenger Plugin - How to show message count
« Reply #2 on: November 29, 2022, 05:49:25 PM »
@mwindey
You miss most important part :)

Code: [Select]
  $message_count = 0;
  if(function_exists('im_messages')) {
    if(osc_is_web_user_logged_in()) {
      $message_count = ModelIM::newInstance()->countMessagesByUserId( osc_logged_user_id() );
      $message_count = $message_count['i_count'];
    }
  }
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Instant Messenger Plugin - How to show message count
« Reply #3 on: November 29, 2022, 07:05:13 PM »
Hi
 
I want to express my gratitude to both of you, it's working perfectly  :-* :-* :-*.

Thank you.

*

mwindey

  • *****
  • 475 posts
Re: Instant Messenger Plugin - How to show message count
« Reply #4 on: November 30, 2022, 06:19:15 PM »
@MB Themes

Sorry i forgot about that part  :D

@: Aleš Tomažič

Glad to hear we could help you out ..... :P