IMPORTANT MESSAGE REGARDING THE FORUM

As you may already know, the JoomlaWorks Forum is powered by Kunena (the only decent forum component for Joomla).

Unfortunately, the latest update for Kunena has seemingly broken all code snippets (old and new) in the forum.

Until this message is removed, please paste any code as regular text - in other words, don't use the [code]...[/code] tags in Kunena's post editor.

Keyword

Extra field only for registered users

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
5 months 1 week ago #178140 by Goble002
Extra field only for registered users was created by Goble002
Hello,

am using k2 for a personal project (a photo website). K2 item will load a picture of low resolution. When a user is on the k2 item page, I would like is that the user can download the HD picture only after he is logged in. I was hoping that I could make an extra field (or it's corresponding extra field group) available only to registered users. As such I could create this extra field with the link to the image file.

After that, what would be perfect is to restrict the user to 5 downloads per day (but for this I have no idea how I can make it happen)

My stock photo website powered by k2 : explora.mu

Please Log in or Create an account to join the conversation.

More
5 months 6 days ago - 5 months 6 days ago #178154 by Fotis
Replied by Fotis on topic Extra field only for registered users
Showing the large image to logged in users is easy. Just get the user's state (NOT guest) and echo the large image's link in <a> element with the "download" attribute. Easy-peasy.

However if you need to track the downloads per user, you need a DB table and a K2 plugin for the code to integrate that feature. And all that is beyond the scope of this support forum.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member
Last edit: 5 months 6 days ago by Fotis.

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
5 months 6 days ago #178164 by Goble002
Replied by Goble002 on topic Extra field only for registered users
Hi and thanks

1. "Showing the large image to logged in users is easy. "
I would prefer that registered users get a download link, so that it's more obvious to them that they can download after logged in.

2. "Just get the user's state (NOT guest) and echo the large image's link in <a> element with the "download" attribute. Easy-peasy."
Am not sure where to go to do this. However I don't want to manually assign individual permissions to users. I was thinking that the users will automatically be assigned this download permission because after registration they are automatically assigned to a group which has permission to download.

3. "you need a DB table and a K2 plugin for the code to integrate that feature. And all that is beyond the scope of this support forum."
Any idea if there is a k2 plugin out there ?

My stock photo website powered by k2 : explora.mu

Please Log in or Create an account to join the conversation.

More
5 months 5 days ago #178173 by Fotis
Replied by Fotis on topic Extra field only for registered users
Like I said, 1 & 2 is possible with a K2 item override. But what you ask is a very specific customization which is beyond the scope of this support forum. The code you ask requires some time to be implemented, it's not 5-6 lines of code to just give you out.

As for 3, the short answer is no.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum