Osclass Support Forums

Osclass plugin support => Favorite Items Plugin => Topic started by: Hunter777 on October 08, 2017, 06:51:10 PM

Title: icon for the top of the site - how to do it?
Post by: Hunter777 on October 08, 2017, 06:51:10 PM
1) How to make a favorite icon for the top of the site (near the notification icons and ads) in the screenshot you can see
2) Make an icon-so that you can see how many (number) of favorites in it
3) If anyone knows - please tell me the code
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 08, 2017, 09:14:57 PM
Open header.php in veronika and find notification section, you can find code for existing icons here.
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 10, 2017, 01:08:34 PM
@Hunter
Code: [Select]
<?php
  
if(osc_is_web_user_logged_in()) {
    
$user_id osc_logged_user_id();
  } else {
    
$user_id mb_get_cookie('fi_user_id');
  }
?>

<?php $list_id ModelFI::newInstance()->getCurrentFavoriteListByUserId($uesr_id); ?>
<?php $fcount count(ModelFI::newInstance()->getFavoriteItemsByListId($list_id)); ?>
<a class="item tr1" title="<?php _e('Favorite''veronika'); ?>" href="<?php echo osc_route_url('favorite-lists', array('list-id' => '0''current-update' => '0''notification-update' => '0''list-remove' => '0''iPage' => '0')); ?>">
  <i class="fa fa-thumbs-up"></i>
  <span class="counter"><?php echo $fcount?></span>
</a>



//updated
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 10, 2017, 10:46:39 PM
It cannot, plugin does not contain such function.
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 10, 2017, 11:49:21 PM
Sorry, do not understand your question.
Title: Re: icon for the top of the site - how to do it?
Post by: Hunter777 on October 11, 2017, 01:06:27 PM
1) How do i make the code in header correct for displaying icons? 

2) Where else do I need to write the code (file)?

3) How to make sure that there is a count in these icons ?  (Favorite, Instant Messages)

Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 11, 2017, 04:21:15 PM
@Hunter
for messages icon, install instant messenger plugin.
For count of favorites, I update code I posted in few minutes to work for non-logged as well.
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 11, 2017, 09:57:01 PM
@Hunter
I posted code, check it , update it.
If you have no idea about coding, look for developer that will do custom requirements for you.
Title: Re: icon for the top of the site - how to do it?
Post by: Hunter777 on October 11, 2017, 10:03:06 PM
Thank you for understanding! can I find a developer to fix errors in the subject ??
Title: Re: icon for the top of the site - how to do it?
Post by: Hunter777 on October 11, 2017, 10:04:23 PM
You published the code - and where did you publish it ??
Title: Re: icon for the top of the site - how to do it?
Post by: Hunter777 on October 11, 2017, 10:05:53 PM
Give me permission - and I'll go to another forum. Maybe they can help me there !!!
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 12, 2017, 09:02:46 AM
@Hunter
You can use any forums you like.
https://forums.mb-themes.com/favorite-items-plugin/icon-for-the-top-of-the-site-how-to-do-it/msg11099/#msg11099
Title: Re: icon for the top of the site - how to do it?
Post by: Hunter777 on October 17, 2017, 01:20:35 PM
This code does not work! Help me someone who knows the working code and knows where to put it (this code). I would be very grateful
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 17, 2017, 02:46:51 PM
@Hunter
There was a typo.
You could also spend at least few minutes to do something and not just ask anyone to do your job.

Code: [Select]
<?php
  
if(osc_is_web_user_logged_in()) {
    
$user_id osc_logged_user_id();
  } else {
    
$user_id mb_get_cookie('fi_user_id');
  }
?>

<?php $list_id ModelFI::newInstance()->getCurrentFavoriteListByUserId($user_id)['list_id']; ?>
<?php $fcount count(ModelFI::newInstance()->getFavoriteItemsByListId($list_id)); ?>
<a class="item tr1" title="<?php _e('Favorite''veronika'); ?>" href="<?php echo osc_route_url('favorite-lists', array('list-id' => '0''current-update' => '0''notification-update' => '0''list-remove' => '0''iPage' => '0')); ?>">
  <i class="fa fa-thumbs-up"></i>
  <span class="counter"><?php echo $fcount?></span>
</a>
Title: Re: icon for the top of the site - how to do it?
Post by: Hunter777 on October 17, 2017, 03:07:25 PM
Thank you so much!!!!
Title: Re: icon for the top of the site - how to do it?
Post by: MB Themes on October 17, 2017, 03:27:01 PM
np  8)
Title: Re: icon for the top of the site - how to do it?
Post by: Dawid on November 29, 2017, 11:03:22 AM
Hi i install this code : in header.php looks perfect but not work . Dont show how many its favorite items . In user dashboard its 3 Favorite item , ( in header show 0 favorite item ) . wher its problem ?

<?php
  if(osc_is_web_user_logged_in()) {
    $user_id = osc_logged_user_id();
  } else {
    $user_id = mb_get_cookie('fi_user_id');
  }
?>
<?php $list_id = ModelFI::newInstance()->getCurrentFavoriteListByUserId($uesr_id); ?>
<?php $fcount = count(ModelFI::newInstance()->getFavoriteItemsByListId($list_id)); ?>
<a class="item tr1" title="<?php _e('Favorite', 'veronika'); ?>" href="<?php echo osc_route_url('favorite-lists', array('list-id' => '0', 'current-update' => '0', 'notification-update' => '0', 'list-remove' => '0', 'iPage' => '0')); ?>">
  <i class="fa fa-thumbs-up"></i>
  <span class="counter"><?php echo $fcount; ?></span>
</a>
Title: Re: icon for the top of the site - how to do it?
Post by: Dawid on November 29, 2017, 11:10:08 AM
Wher i can find problem ?