- Posts: 8
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Premium Content Items Invisible IF Not Logged In
[SOLVED] Premium Content Items Invisible IF Not Logged In
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
docs.joomla.org/Accessing_the_current_user_object
This is an example check;
$user = JFactory::getUser();
if ($user->guest) {
echo "<p>You must login to see the content. I want your email address.</p>";
} else {
// do sth
}
More on K2 overrides can be found here:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
- Posts: 8
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.
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
- Posts: 8
Please Log in or Create an account to join the conversation.
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
- Posts: 8
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
You can use Joomla!'s API and user groups to hide certain aspects of your content, hence the link I sent you.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
- Posts: 8
Without K2 installed, guests can still see the title and intro of premium articles (they can't read the full articles, of course). With K2 installed, the premium item in a K2 module does not show up at all, which means it must be blocking it somewhere. I'd like to just make it behave as Joomla standard does in regard to premium items.
So, the primary issue is how to prevent the premium item's title and intro from being blocked. The message to the guest would come after that - once I've got hold of the premium item.
Are you saying that premium items don't even get inside a K2 module if the user is a guest? Am I understanding this right?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
In its modules you can only retrieve K2 items, not articles.
With the link I sent you, you can block several aspects of the module to non-registered users. Remember to change the feeds as well.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
- Posts: 8
You mentioned the feed. That's what I need to control. Where can I find that, please?
Please Log in or Create an account to join the conversation.
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
- Posts: 8
For those of us who have subscriber-based websites, this is an urgent issue. K2 is unusable as it is. I'm not a programmer, and I don't seem to be able to make headway on this issue. Actually, I consider it a bug. The functionality is reduced from standard Joomla. Guests have to be able to see the title and intro of premium items. If this can't be resolved within a few days, I'll have to uninstall K2. I would hate to do that because I love the masonry effect, and I love the future potential in what I can offer my subscribers.
Please solve this. Telling me that I need to check the feed is just not useful. I don't know how to do that, or even where to look.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
If you are looking for 24/7 support you should consider hiring a developer. Open source does not mean 24.7 support.
I have already posted my answer multiple times as well as links to documentation. I will post it for one final time.
You need to use the code snippet I sent you in your template overrides. The item.php in particular. Check the link to locate the file/ folder. Then you need to disable or change the feeds so users are not able to see the entire item from the RSS feeds.
It is that simple. I am really sorry If you are having issues implementing this solution.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Lisa Jorgensen
-
Topic Author
- Offline
- New Member
- Posts: 8
Unfortanately, I will be uninstalling K2 today.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Feed are disabled from either K2' category option or from the menu item's settings.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Vlachos Evaggelos
-
- Offline
- Junior Member
- Posts: 22
1.) if not use joomla 1.5 and
2.) need to view non login users all k2 items where have access level public and register (if need extra access levels just put level(s) id in "i.access IN(1,2, your_extra_level_id(s))" and if click the item then must login edit ./components/com_k2/models/itemlist.php
final code ./components/com_k2/models/itemlist.php:62-88
if ($user->guest)
{
$query .= "i.access IN(1,2)"." AND i.trash = 0"." AND c.published = 1"." AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).")"." AND c.trash = 0";
$mainframe = JFactory::getApplication();
$languageFilter = $mainframe->getLanguageFilter();
if ($languageFilter)
{
$languageTag = JFactory::getLanguage()->getTag();
$query .= " AND c.language IN (".$db->quote($languageTag).",".$db->quote('*').")
AND i.language IN (".$db->quote($languageTag).",".$db->quote('*').")";
}
}
else
{
$query .= "i.access IN(".implode(',', $user->getAuthorisedViewLevels()).")"." AND i.trash = 0"." AND c.published = 1"." AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).")"." AND c.trash = 0";
$mainframe = JFactory::getApplication();
$languageFilter = $mainframe->getLanguageFilter();
if ($languageFilter)
{
$languageTag = JFactory::getLanguage()->getTag();
$query .= " AND c.language IN (".$db->quote($languageTag).",".$db->quote('*').")
AND i.language IN (".$db->quote($languageTag).",".$db->quote('*').")";
}
}
Please use k2 template for above changes... :)
Please Log in or Create an account to join the conversation.
- George
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
docs.joomla.org/Accessing_the_current_user_object
This way you will not lose your changes when you update.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- George
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Lawrence Clayton
-
- Offline
- New Member
- Posts: 5
I have recently moved to K2, im about to uninstall it due to the same issue, I need customers to login to read content. I dont want to charge people... I want to capture their details so I can direct market to them... But they also need to be able to read the first 50 - 70 words, to incite them to login.. Native joomla can do this.
How did you configure Akeeba Subscriptions for the desired result?
Regards
Lawrence
Please Log in or Create an account to join the conversation.
- Mars Cureg
-
- Offline
- New Member
- Posts: 11
Now, I need the same logic to display in in K2 content module
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Premium Content Items Invisible IF Not Logged In