Just in time for xmas
Version 0.6 -
http://www.fistfullofcode.com/projects/copperminefetch/copperminefetch-dev.tar.gzThis is not quite everything I want to get done this year, but its enough where you can start playing with it. In summary:
<ul>
<li>Changed stylehash is now optionhash</li>
<li>Added imagesize=[thumb,int,large] as optionhash option</li>
<li>Improved cfimageget.php program</li>
<li>Initialize by pointing to the cpm directory</li>
<li>Multimedia images returned for video, sound, etc</li>
<li>Last added media by album and category</li>
<li>Text reporting on how many added, how many comments, etc</li>
</ul>
Some really really important notes:The biggest change, and the one that will cause you the most grief is the way the coppermine object is constructed. The old way involved this:
include "../photos/include/config.inc.php";
include "./coppermine.php";
$objCpm = new cpm($CONFIG['dbname'], $CONFIG['dbserver'],
$CONFIG['dbuser'],$CONFIG['dbpass'], $CONFIG['TABLE_PREFIX'], '/photos');
No more! The new way has been reduced to this:
include "./coppermine.php";
$objCpm = new cpm('/photos');
Now, the parameter there is the url path to the coppermine directory. NOT THE WHOLE URL... in my case my coppermine gallery is at
http://www.fistfullofcode.com/photos. So I just have to put /photos. it will figure everything else out.
If you still want to do the old way (for some reason), you can do it with
$objCpm = new cpm( );
$objCpm->init( ... all the old parameters ... )
But why on earth would you want to?
Okay, we have something for everyone here.
The Stylehash is now an option hash and takes a size argument.
imagesize = thumb, int, large. More options will be added to this in the future and it will become the main way to customize your returned images
I also reworked the code so the parameters you pass in are case insensitive.
Somewhat graceful handling of multimedia files. CoppermineFetch will, when getting something other than a JPG check first for a custom thumbnail for the file, and if that does not work, it will return the default image for that file type. This is less than perfect as if you request intermediate sized files, you still get a little thumbnail. More work will be done on this in the future, but for now you at least get something back. IT DOES NOT at this time take into account themed icons. That could be coming up, if you use them, let me know and I may bump it up my list. That would involve extra DB calls to get configuration which I refuse to do - unless absolutely need to. I have a work around in mind, but thats coming up later.
Last added media by album or category. By popular demand:
cpm_viewLastAddedMediaFromCategory($rows, $columns, $catid, $options="")
cpm_viewLastAddedMediaFromAlbum($rows, $columns, $albumid, $options="")
Nifty stats ouputing. For the guy who wanted it to say 72 files in 3 albums, etc.
cpm_formatStats($format);
Format would be a string interspersed with whatever text you want and placeholders. The following placeholders are valid at this time:
%f - file count
%a - album count
%c - category count
%v - view count
%n - comment count (note count)
%% - Escapes a percent sign. (I dont know either, it just seemed like a good idea)
This example:
$objCpm->cpm_formatStats("Here is a percent sign %% There are %f files in %c categories containing %a albums, having served %v views and getting %n comments");
outputs:
Here is a percent sign % There are 366 files in 8 categories containing 27 albums, having served 243 views and getting 0 comments
Still to do for the 1.0 release.* Access override into private albums<br />
* Subtitles under images generated<br />
* Option to link images to album or specific image<br />
* Improved documentation<br />
* Docs on how to use this for random avatars<br />
* Added private_override as optionhash options<br />
* Limiting what kinds of media to return (not music, etc)<br />
For those of you not familiar with development releases... this means it may work really well for you, or somethings may be broken. What tests here on my box, may not run on yours for some unknown reason. So PLEASE send me feedback if it works fine for you, if something is strange, etc... If I don't know about it, I cant fix it.
I also promise some usable docs!