Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Suppressor Plugin  (Read 3356 times)

0 Members and 1 Guest are viewing this topic.

406man

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 46
Suppressor Plugin
« on: July 16, 2023, 03:34:17 pm »

    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 (*)[/li]

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.
« Last Edit: August 25, 2023, 06:06:55 pm by 406man »
Logged

406man

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 46
Re: Suppressor Plugin
« Reply #1 on: July 16, 2023, 03:38:09 pm »

The screenshots seem not to have attached to my previous message, apologies. Trying again.
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Suppressor Plugin
« Reply #2 on: August 23, 2023, 01:46:49 pm »

Thank you for your plugin contributions. Please replace each of the plugin zip files submitted with:
1. A zipped folder (not just the constituent files) that is named appropriately according to the documentation e.g. suppressor
2. Name the zip file according to the convention used for other plugin contributions e.g. cpg1.6.x_plugin_suppressor_v1.0.zip
Logged
Pages: [1]   Go Up
 

Page created in 0.041 seconds with 22 queries.