Keyword

What happened to option for showing attachments only to registered?

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 10 months ago #70297 by Mike C
Part of the reason I decided to go with K2 was because back in April, I was told that hiding attachments from non-registered users would be added to future version of K2 for ease of use:

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
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 9 months ago #70298 by Mike C
Well, I just upgraded to K2 2.1 and in doing so I lost that code hack. And now I find out that the old forum where the solution was posted is gone.. Does anyone know how to make it so that attachments are hidden from unregistered users??? My post is almost 2 months old with no reply =(

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

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 9 months ago #70299 by Mike C
Helloooooooooooo, am I the only one that wants to hide attachments from unregistered users?

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

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 9 months ago #70300 by Mike C
Are you going to bring the old forum back so I can at least see how it was done?

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

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 9 months ago #70301 by Mike C
Please, if anyone can help me with this issue?

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

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 8 months ago #70302 by Mike C
It's been two months since I posted, and not a single reply. I'm still waiting for a response, which wouldn't even be necessary if the old forum wasn't removed......

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

More
15 years 8 months ago #70303 by JoomlaWorks
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
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 8 months ago #70304 by Mike C
Thank You!!!!!!!!

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

More
15 years 8 months ago #70305 by Emily Pearce
I've been searching for a way to do this too, so thank you so much for your answer.

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
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 8 months ago #70306 by Mike C
Hi Emily,
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
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 8 months ago #70307 by Mike C
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.

More
15 years 8 months ago #70308 by Emily Pearce
I had the pastebin open for a couple of days meaning to copy the code - but like you when I went to get it the page had expired! Should have been quicker....hopefully someone will post it again for us??

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
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 8 months ago #70309 by Mike C
haha, we are certainly a couple of bright lights! I didn't know that the thing would expire. Now I feel like I missed the bus I was waiting for for so long =( Any programmer gurus know what the code is to hide attachments from unregistered users?

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

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 6 months ago #70310 by Mike C
Hello, is it possible to have this code again, but not in that pastebin because it expires.. Please, I need it, I think Emily does too.. Thanks!

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

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 6 months ago #70311 by Mike C
Anyone know what the code is for this?

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

  • Mike C
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 6 months ago #70312 by Mike C
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.

More
15 years 6 months ago #70313 by Jochen Kästle
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!


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
  • Mike C's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 6 months ago #70314 by Mike C
Jochen, I will try this today - THANK YOU!

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

More
15 years 5 months ago #70315 by leenie
I'm not having any luck with this code, where is the item.php located?

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.

More
14 years 7 months ago #70316 by igorfilipepereira
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!


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.


Powered by Kunena Forum