*

terry

  • ***
  • 39 posts
Hide Notification/Alerts icons for Non Logged in Users
« on: March 30, 2017, 10:26:39 AM »
Hi

I would like to hide the notification/alert icons for non logged in users and ONLY show to users who are logged in.

Am I missing a setting somewhere or could anyone point me in the right direction please?



*

MB Themes

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #1 on: March 30, 2017, 12:45:26 PM »
@terry
You can wrap them into:
Code: [Select]
<?php if(osc_is_web_user_logged_in()) { ?>
 ... your code ...
<?php ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

terry

  • ***
  • 39 posts
Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #2 on: March 30, 2017, 01:00:42 PM »
Thanks, frosticek!  :)

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #3 on: June 10, 2018, 01:21:27 AM »
Tell me what function can be wrapped so as not to show the notification icons are "0" messages, alerts, announcements, photos... And if more "0>" the already appeared.

*

MB Themes

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #4 on: June 10, 2018, 08:32:02 AM »
You can find counter functions in header.php in notification section.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #5 on: June 10, 2018, 09:52:45 PM »
And where exactly to look in what lines? I thought I should be wrapped in a notification function 0< ' do not show, and if more than 0>, show.

And the question is how to properly wrap the function that would not show 0 photos.

<span class="image-count round2"><i class="fa fa-camera"></i> <?php echo osc_count_item_resources(); ?></span>
« Last Edit: June 10, 2018, 09:58:14 PM by Александр Лонгардт »

*

MB Themes

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #6 on: June 11, 2018, 06:08:50 PM »
What about == 0?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #7 on: June 11, 2018, 10:30:33 PM »
Well, I understand, but how to write code more correctly? Where to insert == 0? For example, in the code that I gave out. Thanks.

*

MB Themes

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #8 on: June 12, 2018, 01:48:46 PM »
<0 replace with <=0
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #9 on: June 12, 2018, 04:11:07 PM »
that I did not quite understand you, where exactly to insert this code?

<span class="image-count round2"><i class="fa fa-camera"></i> <?php echo osc_count_item_resources(); ?></span>


example in the screenshot
« Last Edit: June 12, 2018, 04:23:17 PM by Александр Лонгардт »

*

MB Themes

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #10 on: June 12, 2018, 04:58:55 PM »
Code you posted should be wrapped by php condition
if () {... code ...}
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Hide Notification/Alerts icons for Non Logged in Users
« Reply #11 on: June 12, 2018, 05:20:28 PM »
Code you posted should be wrapped by php condition
if () {... code ...}

I realized that the bad idea was to modify the code in the file loop-single.php. Well, how in the header do what would be 0 notifications? but already more than 1 already shown?

here is my code, and below is a screenshot how to do it correctly?

Code: [Select]
<a class="alert tr1" title="<?php _e('Alerts''veronika'); ?>" href="<?php echo osc_user_alerts_url(); ?>"><i class="fa fa-bell-o"></i> <span class="counter"><?php echo (osc_is_web_user_logged_in() ? count(Alerts::newInstance()->findByUser(osc_logged_user_id())) : 0); ?></span></a>
          <a class="item tr1" title="<?php _e('Listings''veronika'); ?>" href="<?php echo osc_user_list_items_url(); ?>"><i class="fa fa-list"></i> <span class="counter"><?php echo (osc_is_web_user_logged_in() ? Item::newInstance()->countByUserID(osc_logged_user_id()) : 0); ?></span></a>
  <?php osc_run_hook('show_dealers_link'); ?>
« Last Edit: June 12, 2018, 05:29:04 PM by Александр Лонгардт »