SimplePortal

Customization => Custom Coding => Topic started by: superj707 on August 08, 2014, 11:02:53 PM

Title: How can I allow guests to see attachements?
Post by: superj707 on August 08, 2014, 11:02:53 PM
I have it turned off in the admin permissions for the site (which is what I want) but how can I tell simple portal to ignore this setting?
I want guests to see thumbnails not "No attachments were found."
Please help!!!
Title: Re: How can I allow guests to see attachements?
Post by: Chen Zhen on August 08, 2014, 11:42:10 PM
superj707,

What specific type of block are you referring to?
Do you want guests to be able to click on the attachments thumbnail or have it just show a thumbnail image that is not a link?

Regards.
 
Title: Re: How can I allow guests to see attachements?
Post by: superj707 on August 08, 2014, 11:43:31 PM
just need to figure out what is blocking them from seeing the thumbnail. I can handle the rest.
image attachment block. I threw it into a custom php block but it's basically the same code.
Title: Re: How can I allow guests to see attachements?
Post by: Chen Zhen on August 08, 2014, 11:49:30 PM
superj707,

  The block code uses the ssi_recentAttachments() function which is located in SSI.php.
The function is designed to return an empty array when the user does not have permission to view attachments. This triggers the block to display a no attachments message to the user.

Regards.
Title: Re: How can I allow guests to see attachements?
Post by: superj707 on August 08, 2014, 11:53:29 PM
superj707,

  The block code uses the ssi_recentAttachments() function which is located in SSI.php.
The function is designed to return an empty array when the user does not have permission to view attachments. This triggers the block to display a no attachments message to the user.

Regards.

Thank you but I've already been working with the ssi_recentAttachments () function.  This is what I am trying to ask -->My question is what do I have to change about this ssi_recentAttachments() function so it will stop checking permissions and just throw up some thumbnails instead of empty arrays?
Please help
Thank you :-)
Title: Re: How can I allow guests to see attachements?
Post by: superj707 on August 09, 2014, 12:19:50 AM
I've toyed with everything in this function, including the query and Still no thumbnails.. I feel like pulling my hair out. Stupid unwanted permissions! Can't a guy just get some thumbnails?? :-(
Title: Re: How can I allow guests to see attachements?
Post by: Chen Zhen on August 09, 2014, 12:43:01 AM

file: ../SSI.php

find:
Code: [Select]
$attachments_boards = boardsAllowedTo('view_attachments');

replace with:
Code: [Select]
$attachments_boards = array(0);




With attachments disabled for guests they will be redirected to the login template when attempting to click on the link.
Title: Re: How can I allow guests to see attachements?
Post by: superj707 on August 09, 2014, 12:51:59 AM
I've toyed with everything in this function, including the query and Still no thumbnails.. I feel like pulling my hair out. Stupid unwanted permissions! Can't a guy just get some thumbnails?? :-(
'

OMG it works perfectly .. EXACTLY what I wanted. I was trying everything with that exact line like removing it etc.. anyway. I knew it was something simple
THANK YOU THANK YOU THANK YOU THANK YOU!!
SimplePortal 2.3.8 © 2008-2024, SimplePortal