Osclass Support Forums
General osclass questions => Plugins => Topic started by: Aleš Tomažič 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?
-
Try...
<?php if($mes_counter > 0) { ?>
<span class="counter"><?php echo $mes_counter; ?></span>
<?php } ?>
-
@mwindey
You miss most important part :)
$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'];
}
}
-
Hi
I want to express my gratitude to both of you, it's working perfectly :-* :-* :-*.
Thank you.
-
@MB Themes
Sorry i forgot about that part :D
@: Aleš Tomažič
Glad to hear we could help you out ..... :P