Hide AlbumsDownload Zip icon from non-admin users Hide AlbumsDownload Zip icon from non-admin users
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Hide AlbumsDownload Zip icon from non-admin users

Started by GarryS, March 22, 2013, 09:21:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GarryS

My website URL is: http://www.victoriacameraclub.org/vcccompetitions/

Thanks to this forum, I have successfully installed the albumsdownload plugin. Works great!

My desire is to be able to hide the zip/download icon to all viewers except those with admin authority on the gallery.

Your advice on how that might be done would be appreciated.

Thank you.

ΑndrĂ©

To hide the button for non-admin users, open codebase.php, find
if ($superCage->get->getInt('album') > 0) {
and replace with
if (GALLERY_ADMIN_MODE && $superCage->get->getInt('album') > 0) {

open zip.php, find
<?php
and below, add
if (!GALLERY_ADMIN_MODE) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}

GarryS

Thank you very much, Andre. That works perfectly.