Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: An Additional Hook for the Plugin Feature (picture_url)  (Read 12257 times)

0 Members and 1 Guest are viewing this topic.

jjhat1

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 17
An Additional Hook for the Plugin Feature (picture_url)
« on: June 09, 2006, 04:33:39 am »

I have written a plugin that works by replacing all of the URL's in a Coppermine so that the files are loaded through a PHP script.  I realize other mods exist for this but my plugin is the only one that takes the form of a plugin.  The kicker is that it requires a Mod to get it to work.  You can view my plugin at this post: http://forum.coppermine-gallery.net/index.php?topic=32348.0

What it boils down to is there is no hook that lets you really control the output of the function get_pic_url.  While there is a hook near the end of the function it only applies to thumbnail pictures.  Additionally, I found that attempting to modify the URLs through already existing hooks simply results missed links.  I have identified that both the editOnePic.php and slide show function simply do not obtain their URL anyplace except the get_pic_url function.  By this I mean that the other hooks that can manipulate the URLs are just not called.

In my case I want ALL files to load through a PHP script and this function is the clear target for manipulating this type of data.

What I have done is added the line:
$pic_row = CPGPluginAPI::filter('picture_url',$pic_row);
just before the return statement.


While I realize that only the value of the url in the array is going to be of any consequence the other values in the array $pic_row are useful in constructing a plugin especially if the PID needs to be identified.  Other information in this array include file type which could be used to selectively change the URL.

While I understand this hook would not make it into Coppermine version 1.4.x it would be a much welcome addition to version 1.5.x because of the possibility of manupulating the URLs of every file in Coppermine with simplicity and guarenteed accuracy.

Thank you very much for the consideration. :)
« Last Edit: July 31, 2007, 08:44:15 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: An Additional Hook for the Plugin Feature (picture_url)
« Reply #1 on: July 31, 2007, 08:43:35 am »

Added hook as suggested to cpg1.5.x code in subversion repository. This means that the hook will go into cpg1.5.x. Marking thread as "done".
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.