No Support => Feature requests => Scheduled for cpg1.5.x => Topic started by: jjhat1 on June 09, 2006, 04:33:39 am

Title: An Additional Hook for the Plugin Feature (picture_url)
Post by: jjhat1 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:

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. :)
Title: Re: An Additional Hook for the Plugin Feature (picture_url)
Post by: Joachim Müller 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".