Keyword

Extra field only for registered users

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 9 months 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)

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

More
3 years 9 months ago - 3 years 9 months ago #178154 by JoomlaWorks
Replied by JoomlaWorks 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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 3 years 9 months ago by JoomlaWorks.

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

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
3 years 9 months 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 ?

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

More
3 years 9 months ago #178173 by JoomlaWorks
Replied by JoomlaWorks 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.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum