Member
Member
Dynamics99   27-06-2024, 14:40
#1

Hi,

My site is using the default theme with modifications to the CSS and uploading videos. Trying to find a way to disable a user from downloading a file (video, image etc.) for a specific album. Would this be code related?

Administrator
Administrator
acrylian   27-06-2024, 14:44
#2

My site is using the default theme

You mean the basic theme? There is no default theme otherwise. Anway take a look at Options > Image for full image options

Otherwise anyone who knows the direct link to an image can download it as that bypasses ZP naturally. You would have to do that serverside via htaccess. Another way may be to use an external albums folder but that's a bit advanced perhaps.

Member
Member
Dynamics99   27-06-2024, 14:54
#3

Yes, I meant the basic theme. So I see that there is an option for full image protection. I set it to no access. I have a guest user account that can only view that specific album yet when I log into that guest account I can still see an option to download the video or other files.
By the way I am on version 1.5.9.

Member
Member
Dynamics99   27-06-2024, 15:02
#4

I found this piece of code in the image.php file in the modified basic theme which I upload to imgur since when I paste it the code does not fully display.

https://imgur.com/a/BeSP2pQ

The code starts with the div class for imageDownload which is after the closing tag for strong (/strong).

When I remove it it would remove the download button but this would do it for all albums. How would I designate this to only affect based on rights or specific users?

Administrator
Administrator
acrylian   27-06-2024, 15:33
#5

By the way I am on version 1.5.9.

Please consider to upgrade, we are on 1.6.4 already. 1.5.9 is three years old and I mean to remember there might have been bugs with this ;-)

The user is loggedin so can still download. You can use the object of the current admin $_zp_current_admin_obj to get the name of the user and limit it to specific users.
Alternatively use zp_loggedin(ADMIN_RIGHTS). Replace ADMIN_RIGHTS with the rights level constant you want. See https://www.zenphoto.org/news/user-rights/ for more info.

Note that all docs reflect the current release version ;-)

Member
Member
Dynamics99   27-06-2024, 15:42
#6

I plan on upgrading in the fall. It would mean I would have to make adjustments to the 1.6.4 base theme to match my current modifications right? I won't be able to copy pasta code since it would break things?

Thanks for the guidance for the rights. I will look into it.

Administrator
Administrator
acrylian   27-06-2024, 15:57
#7

I plan on upgrading in the fall.

That's a while until then ;-)

It would mean I would have to make adjustments to the 1.6.4 base theme to match my current modifications right?

Of course. 1.6 has a lot smaller changes. Not really breaking ones but lots of deprecations.

I won't be able to copy pasta code since it would break things?

I cannot tell that of course. Depends on your changes.

Member
Member
Dynamics99   27-06-2024, 16:29
#8

Thanks Acrylian, I was able to add in user rights when logged in to turn off downloads for files with mp4 filetype.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.