- Posts: 49
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- What happened to option for showing attachments only to registered?
What happened to option for showing attachments only to registered?
- Mike C
-
Topic Author
- Offline
- Senior Member
forum.joomlaworks.gr/index.php?topic=7432.0
I was all excited only to see that this option does not exist (yet?) unless I've somehow missed it as there are a lot of options throughout K2.
Edit:
It appears that the code hack still works, so I'll just do that....
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6229
Just wrap the "attachments" div with some PHP code instructing K2 to only show the attachments when someone is logged in. See the code here: k2.pastebin.com/d1bafc8ef
You must use this inside the item.php or category_item.php templates in K2. ;)
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Emily Pearce
-
- Offline
- Junior Member
- Posts: 24
I am also looking for a way of collecting guests email addresses before they are able to download attachments. I have searched the Joomla extensions directory for something that might work with K2 to achieve this - however I've come to a dead-end.
The site I am working on offers walking tours and the owner wants to collect the email address of guests before they download the tour itinerary so that they can be followed up.
Ideally i would like guests who click the link to download an attachment to recieve a message asking them for their email address before they are able to download the file (this email address would then be sent to the site administrator).
Any ideas would be welcomed.
Cheers
JoomlaWorks said:It's very easy to hide the attachments on the K2 templates...
Just wrap the "attachments" div with some PHP code instructing K2 to only show the attachments when someone is logged in. See the code here: k2.pastebin.com/d1bafc8ef
You must use this inside the item.php or category_item.php templates in K2. ;)
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
I'm not sure how you could do that, except for some auto responder script. But why not just have them register to download the attachment? That's what I'm going to do with K2. Thing is, if you just ask people for an email address, they'll enter anything. So you have to use the email confirmation.
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
* Unknown post id, it may have expired or been deleted
=(
Please Log in or Create an account to join the conversation.
- Emily Pearce
-
- Offline
- Junior Member
- Posts: 24
Mike C said:I just went to the link you provided, but it says this:
* Unknown post id, it may have expired or been deleted
=(
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- Jochen Kästle
-
- Offline
- New Member
- Posts: 13
So look around line 345 - there is written an endif statement. Followed by a blank line (~346).
Insert there the following code
#?php $user =& JFactory::getUser(); ?#
#php if($user->get('guest') ==0 ): ?#
Afterwards scroll down to arround line 365 and insert
#?php endif; ?#
So hope this will work!
Mike C said:Still waiting for a reply for this; please don't use that pastebin again....
Please Log in or Create an account to join the conversation.
- Mike C
-
Topic Author
- Offline
- Senior Member
- Posts: 49
Please Log in or Create an account to join the conversation.
- leenie
-
- Offline
- New Member
- Posts: 5
Jochen Kästle said:So I think I found a way - you have to modify your item.php (consider to do some custom templating) So look around line 345 - there is written an endif statement. Followed by a blank line (~346).
Insert there the following code
#?php $user =& JFactory::getUser(); ?#
#php if($user->get('guest') ==0 ): ?#
Afterwards scroll down to arround line 365 and insert
#?php endif; ?#
So hope this will work!
Please Log in or Create an account to join the conversation.
- igorfilipepereira
-
- Offline
- New Member
- Posts: 1
So look around line 345 - there is written an endif statement. Followed by a blank line (~346).
Insert there the following code
#?php $user =& JFactory::getUser(); ?#
#php if($user->get('guest') ==0 ): ?#
Afterwards scroll down to arround line 365 and insert
#?php endif; ?#
So hope this will work!
Mike C said:Still waiting for a reply for this; please don't use that pastebin again....
Thanks for the trick ;)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- What happened to option for showing attachments only to registered?