- Posts: 24
COMMUNITY FORUM
K2 translation don't work
- Casper
-
Topic Author
- Offline
- Junior Member
I have some issues with the K2 translations of the facebook like button as shown in the attachment.
I downloaded and installed the dutch version but it still doesn't shows the dutch translation but still the english text. What do I need to do?
Also, how to set the rating of articles only for registered members? Currently you cannot rate at all, so its not working:
www.mybeautyreview.com/mybeautyreview.com/index.php/blog/test/item/3-testing-3#
Thanks in advance
Please Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
docs.joomla.org/JFactory/getUser
And use it to wrap the K2 rating system.
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
Only thing is that I am kind of newbee with CSS, so could you please explain further what is wrong with the ratings and how to set only for registered?
Please Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
The way i see, you can hide the k2 rating system for non-registered users user the example code on joomla documentation.
You can see a sample on how to show items to registered users only here - getk2.org/community/New-to-K2-Ask-here-first/178670-SOLVED-how-attachment-file-to-give-privilege#178698
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
When you try to vote nothing happens, also when logged in.
Furthermore, I want that gast can see the ability for rating and the amount of stars the product received so far. But when you want to vote you should login first (registered)
Should I modify this section in com_k2 --> templates --> default --> item.php?
<?php endif; ?>
<?php if($this->item->params->get('itemRating')): ?>
<!-- Item Rating -->
<div class="itemRatingBlock">
<span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
<div class="itemRatingForm">
<ul class="itemRatingList">
<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
<li><a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
</ul>
<div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
<div class="clr"></div>
</div>
<div class="clr"></div>
</div>
Please Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
You should make use of template override - see here - getk2.org/documentation/tutorials/item/174-templating-with-k2-and-the-concepts-of-sub-templates
then edit the item.php inside your templates/templatename/html/com_k2/templates/subtemplatename/item.php
Yes, thats the code block for the rating system. I'm afraid you can just set it to hide for public and display for registered users. Or just display a text saying, "Rating for registered users only"
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
Rating works fine now. Don't know if it still shows JQUERY errors?
For tamplate override: I just added the k2_com map in my /templates/YOURJOOMLATEMPLATE/html/com_k2/ and created the files in it by just create a new file and copying the codes into them. Does this work as well?
What code do I need to add in order to show it to only registered?
Something with this link you shared: getk2.org/community/New-to-K2-Ask-here-first/178670-SOLVED-how-attachment-file-to-give-privilege#178698
Found this thread: getk2.org/community/New-to-K2-Ask-here-first/150760-Changing-the-content-rating-from-public-to-register#180805
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
<?php$user = &JFactory::getUser();$userId = $user->get('id');?>
Just somewhere near the top of item.php and category_item.php
And add this:
<ul class="itemRatingList"> <li class="itemCurrentRating" id="itemCurrentRating... <?php if($userId != 0) : ?> <li><a href="#" rel="<?php echo $this->item->id; ?>"... <li><a href="#" rel="<?php echo $this->item->id; ?>"... <li><a href="#" rel="<?php echo $this->item->id; ?>"... <li><a href="#" rel="<?php echo $this->item->id; ?>"... <li><a href="#" rel="<?php echo $this->item->id; ?>"... <?php endif; ?></ul>
around line 200 in item.php and 73 in category_item.php.
Or do I need to delete also something?
Thanks in advance
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
Please Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
-
- Offline
- Platinum Member
- Aham Brahmasmi
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Depending on where you wish to paste this snippet you need to be careful if $this-> or this $this->item is been used.
The code seems fine although I have not tested it (it could have a typo). You can enable error reporting (from global configuration) and see the actual error so I can assist you.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
thanks for you reply. I enabled error reporting, but deleted the code because it didn't work. Are we talking about the snippet Kannan provided? And where exactly would you implement it in the item.php and category_item.php?
Thanks in advance,
Casper
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Yes that snippet. You can add it where you like since all blocks are well commented. Just make sure you don't break any if/else statement and the <?php $user = JFactory::getUser(); ?> part does not already exist.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Casper
-
Topic Author
- Offline
- Junior Member
- Posts: 24
This page as example: mybeautyreview.com/mybeautyreview.com/index.php/component/k2/item/21-art-deco-blusher-color-art
It only shows on the bottom of the page the text 'please log in to rate'
Please Log in or Create an account to join the conversation.