Plugin: suppressor

Author:  KF  (406man)
Description: Suppresses file information displayed with an image. Also suppresses sub-menu items.
License: Standard Coppermine
Installation: Standard method.
Version: V1.0   This is the first released version

Coppermine has a large range of features and functions, which allows it to be useful in many applications, but a 
downside is that there can be too much displayed on the screen

Originally in my gallery I suppressed display of file information by modifying the PHP code as that’s what my skills 
allowed. It’s not a recommended practice and the code changes have to be added to new versions of the code when an 
upgrade is released. A plugin is a much neater solution for ongoing support. I set about learning how to write a 
plugin using the documentation on this site – which is pretty good – although the subject seems quite complicated 
initially. Now that the plugin is working I’m sharing it with the community here as there may be other admins who 
would like to use the functionality. 

This plugin is called “suppressor” and the configuration menu allows the administrator to decide which items to 
display (or not). Two types of item can be suppressed:

1) items of file information that are displayed on the screen created by displayimage.php  The screen is the 
“medium” sized image,  which shouldn’t be confused with the option to display a full size image (which is enabled as 
a configuration option and isn’t affected by this plugin). 

Any of these items of file information can be suppressed using the plugin configuration menu:
•	Filename
•	Filesize
•	Date added
•	Dimensions
•	Displayed
•	DateTime Original
•	URL
•	Favorites (*)

2) The second row of menu items is known in Coppermine as the sub-menu. These menu items can be suppressed:
•	Last Uploads
•	Last comments
•	Most viewed
•	Top rated
•	My Favorites (*)
•	Search

(*)If you suppress Favorites, the main menu item “Favorites” (actually appears on what is called the sub-menu) will 
be removed as well as the “Add to favourites” link on the image display page. 

The following items of file information always appear unless they are blank:
•	Title
•	Caption
•	Album name
•	Name of uploader
•	Optional custom fields configured in the “Custom fields for image description” section

There is a button above the image on the image display screen “Show File Information” or “Hide File Information” 
which toggles between displaying all the file information or none of it. What suppressor does is to prevent the 
selected information being shown when the “Show File Information” button is set to show all file information. 

The attached screenshots demonstrate an image being displayed with and without fields being suppressed by the 
plugin. Note the differences in both image information and sub-menus.

I’ve tested the plugin with Coppermine version 1.6.22 and 1.6.25. It won’t install on 1.5.x. I’ve also tested it 
with French as the main language and it works fine.

LIMITATION: With the standard Coppermine eyeball and hardwired themes the plugin cannot change the sub_menu because 
the themes have their own definition of the sub_menu template which lacks the plugin hook. The image display works 
in the normal way so the plugin can suppress file info.

Occasionally I’ve made a change to the configuration but it seems not to have taken effect on the web page. This was 
due to a caching problem, not a problem with the plugin. Deleting temporary files and reloading sorted it out. 

Comments, bug reports and feedback welcome.





