ukash - ucuz ukash kart -
Wednesday, 18 August 2010 05:48

How to Force Users to Login before Downloading K2 Item Attachments

One of the great uses that K2 (Joomla Component) claims that their system can do is act as a download manager. However, it does not have the ability to restrict downloads to only logged-in users. I needed a system where we could display the K2 item, with a preview and description, but not actually let them download the attachments. This was not achievable using just the included K2 parameters / settings, so I made this hack:

LOOK IN THIS FILE:
/com_k2/templates/templatename/item.php (line 364)

Download the attachment (below) (Item.php K2 Template Modification Code) for the actual changes you need to make.

(note: stock, this will appear in your K2 component folder (/components/com_k2). You SHOULD be creating a template override (/templates/yourtemplate/html/) using the technique described here.

Nate Covington

Nate Covington

I work with advertising agencies and marketing consultants, as well as directly with business owners to build streamlined, effective web sites. The large majority of my projects are built using Joomla, although I also support Wordpress, Drupal, OSCommerce, and almost any other open-source platform.  If you are interested in hiring me, please use my "Get a Quote" form.

Website: www.covingtoncreations.com E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Comment subscription

Receive email notification when a new comment is added to this item.

11 comments

  • Comment Link Adeola Thursday, 07 April 2011 22:47 posted by Adeola

    hello,

    I have tried your writeup but it still doesn't prompt guest for login, what do you think i am doing wrong?
    Thank you

    This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Add comment


About the Author

Around the Joomla Community

JoomlaMarketing.org is not affiliated with or endorsed by the Joomla! Project.