Osclass Support Forums
Osclass plugin support => Favorite Items Plugin => Topic started 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
-
Open header.php in veronika and find notification section, you can find code for existing icons here.
-
@Hunter
<?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
-
It cannot, plugin does not contain such function.
-
Sorry, do not understand your question.
-
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)
-
@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.
-
@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.
-
Thank you for understanding! can I find a developer to fix errors in the subject ??
-
You published the code - and where did you publish it ??
-
Give me permission - and I'll go to another forum. Maybe they can help me there !!!
-
@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
-
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
-
@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.
<?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>
-
Thank you so much!!!!
-
np 8)
-
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>
-
Wher i can find problem ?