This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

oscman

  • ****
  • 227 posts
Show Header Link to Registered Only
« on: March 14, 2017, 05:00:07 AM »
1. Show Header Link to Registered Only doesn't work i have it enabled and visitors can see the messages button.

2. Any way to make messenger to not send email at all?

*

MB Themes

Re: Show Header Link to Registered Only
« Reply #1 on: March 14, 2017, 07:42:35 AM »
@oscman
1) I have tested it on demo and everything works fine (you can test it as well)
2) Will consider it in next update
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

oscman

  • ****
  • 227 posts
Re: Show Header Link to Registered Only
« Reply #2 on: March 14, 2017, 05:49:25 PM »
Maybe its just for veronika theme, i installed 2 times fresh osclass, fresh veronika and fresh messenger, the show only to registered users doesn't work with veronika theme

Marked as best answer by frosticek on March 15, 2017, 08:18:55 AM
*

MB Themes

Re: Show Header Link to Registered Only
« Reply #3 on: March 14, 2017, 07:24:40 PM »
@oscman
Veronika use own functions.
Go to header.php of veronika.

Find:
Code: [Select]
<?php if(function_exists('im_messages') { ?>
Replace with:
Code: [Select]
<?php if(function_exists('im_messages') && (osc_is_web_user_logged_in() || osc_get_preference('link_reg_only','plugin-instant_messenger') <> 1)) { ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

oscman

  • ****
  • 227 posts
Re: Show Header Link to Registered Only
« Reply #4 on: March 14, 2017, 07:38:41 PM »
i did that and this just hidding the number of inbox messages the link to messenger is still there

*

MB Themes

Re: Show Header Link to Registered Only
« Reply #5 on: March 14, 2017, 07:44:11 PM »
@oscman
Try to replace both occurences.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

oscman

  • ****
  • 227 posts
Re: Show Header Link to Registered Only
« Reply #6 on: March 14, 2017, 08:05:11 PM »
still doesnt work

*

MB Themes

Re: Show Header Link to Registered Only
« Reply #7 on: March 14, 2017, 08:18:08 PM »
@oscman
Then you do something wrong.
It will be included in next update.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

oscman

  • ****
  • 227 posts
Re: Show Header Link to Registered Only
« Reply #8 on: March 14, 2017, 08:23:36 PM »
I changed this:

Code: [Select]
  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'];
    } else {
      $message_count = 0;
    }
  }

To this:

Code: [Select]
  if(function_exists('im_messages') && (osc_is_web_user_logged_in() || osc_get_preference('link_reg_only','plugin-instant_messenger') <> 1)) {
      $message_count = ModelIM::newInstance()->countMessagesByUserId( osc_logged_user_id() );
      $message_count = $message_count['i_count'];
    } else {
      $message_count = 0;
    }

Or did i get it wrong?
 

*

MB Themes

Re: Show Header Link to Registered Only
« Reply #9 on: March 14, 2017, 08:27:55 PM »
@oscman
Carefully check what should be replaced.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

oscman

  • ****
  • 227 posts
Re: Show Header Link to Registered Only
« Reply #10 on: March 14, 2017, 08:35:12 PM »
ok replaced all instances and worked i should take a break now.  :-[