Note: Stable release attached here / dev versions available at the homepage.http://cpmfetch.fistfullofcode.com - latest info, news, development versions, tips, etcThis is a PHP object that allows you to easily display random or latest images from your coppermine gallery on external php and html pages. It is being actively supported and developed by me. Its simple, but I am also trying to make it as feature rich as I can without achieving bloat. You can draw images (random or otherwise) from the entire gallery, a specific category or a single album. Notifications of new releases
I added a sign up to my site for email notifications of new updates to cpmfetch.http://www.fistfullofcode.com/projects/copperminefetch/index.php
A little ways down the page there is a signup entry. What is this all about
Basically It takes criteria and returns tables containing thumbnails based on a row col combination you specify. You tell it what kind of random images you want, in how many columns by how many rows (1 x 1 being a single image). It gets the images and gives you back HTML code that displays them all. What about private albums?
This library will not display any images that are not viewable by the world or are not in an approved state. If you request the number of images in the gallery, it will count the private images in the number it returns. Reporting Problems?
Make sure you have the newest version! Message me on this board or contact me via my website www.fistfullofcode.com
. Do me a favor and:
- Include what version of coppermine you are using
- a link to your website and gallery
- a link to an example of the problem (if possible)
- how computer savvy you are (newbie, intermediate, damn good)
- what kind of web server you are running on (if known)
- Include the syntax of the command you are using.
Also, try adding this to the top of your php page. It will cause more errors and warnings to be displayed.
<?php What if its close to what you need, but not quite?
ini_set('display_errors',1); // 0 is off, 1 is on
. Contact me and let me know what you think it needs. I won't quarentee anything, but if it sounds reasonable I will probably do it. Can I control the HTML it generates?
Currently you can control the tables and images it gives back via css settings and passing the css class to the object. Future plans include adding titles and such. Examples of CSS control are on the website (some are pretty cool)Aside from images, it can also returns other data such as (note: the album names are links)Since Friday, December 10 2004 we've added about 355 images
|Category name||Album||New count|
|Haley - The early years (1999-2002)||2000 Haley - the second year||17 new |
| || 1999 Haley - the first year ||69 new |
| ||2001 Haley - the third year ||30 new |
|Haley, Christi and me||Our furry friends ||18 new|
| ||May 2003 - Beckett Trip||15 new |
| ||Misc - Just don't fit anywhere||11 new |
| || || |
More examples and downloads are here:http://www.fistfullofcode.com/projects/copperminefetch/Among the functions so far are stuff like this... Many more have been added, so see the web siteFunctions that return images
Functions that return textual statistics
- cpm_viewLastAddedMedia ($rows, $columns, [array $options = ""])
- cpm_viewLastAddedMediaFromAlbum ( $rows, $columns, $albumid, [array $options = ""])
- cpm_viewLastAddedMediaFromCategory ( $rows, $columns, $catid, [array $options = ""])
- cpm_viewLastAddedMediaFrom ( $rows, $columns, $source, [array $options = ""])
- cpm_viewRandomMedia ( $rows, $columns, [array $options = ""])
- cpm_viewRandomMediaFromAlbum ( $rows, $columns, $albumid, [array $options = ""])
- cpm_viewRandomMediaFromCategory ( $rows, $columns, $catid, [array $options = ""])
- cpm_viewRandomMediaFrom ( $rows, $columns, $source, [array $options = ""])
Functions that return gallery level images and text
- cpm_formatStats ($format)
- cpm_listMediaCount ()
- cpm_getMediaCount ()
- cpm_listMediaCountForAlbum ($albumid)
- cpm_getMediaCountForAlbum ($albumid)
Functions that control this program and its behavior
- cpm_listMediaAddedOverLastDays ($numberOfDays, [ array $options=""])
- cpm_viewLastCommentedImages($rows,$columns, [ array $options=""])
Brief explanation of some of the above parameters
- cpm ($urltocpm)
- cpm_init ( Depreciated old constructor )
- cpm_close ()
$albumid - is always the numerical id of the album
$catid - is always the numerical if of the category
$source - this is a new way of specifying albums and categories at the same time
$rows,$columns - the combination determine how many total to show and in what orientaion
$columns - how many columns of images to show
$options - this is an array of options (covered below)
$format - text to display interspersed with placeholders for variables
Some features are:
- Limiting what kinds of media to return (not music, etc)
- Multimedia images returned for video, sound, etc (unless overridden with custom media)
- Last added media by album and category
- Access override into private albums
- Option to link images to album or fullsize image
- Option to link to intermediate image
- Text reporting on how many added, how many comments, etc, since...
- Improved documentation - Ongoing
- Docs on how to use this for random avatars
- Alt and title tag formatting
- Clean html output
(http://www.fistfullofcode.com/projects/copperminefetch/css_example_2.jpg)Example of usage:
The HTML version of the library only allows for one image to be retrieved at a time via an img tag. To do this you simply point the image tag at the php page supplied and away you go.
(http://www.fistfullofcode.com/php-lib/cpmfetch/cfimageget.php?category=7)The above image was served up from my gallery via an img tag .
The following code shows how you would get 3 random images in a column from album #7
<?php A more intricate example passing some CSS info for the table is
$objCpm = new cpm('/photos');
<?php Boy I am impressed! I want to send you things... money, gifts, girls, etc... how can I do this?
$options = array(
"tableStyle" => "photoclip",
"rowStyle" => "photoclip",
"cellStyle" => "photoclip",
"linkStyle" => "photoclip",
"altTag" => "One of the last photos submitted",
"imageStyle" => "photoclip",
"imagesize" => "int") ;
Well, tell you what... the Coppermine people have put probably at least 2000x more work into Coppermine. Why not send something to them instead. http://forum.coppermine-gallery.net/index.php?topic=14227.0
You could also always send a donation to the www.eff.org
instead. Whats coming up in the near future for this?
Well, basically I got it about as far as I think it will go... for the basics anyway. I am sure more features will be added on soon, and such - but can't say what they will be. There is a lot there - and I am always open for suggestions.Any advice, comments, request for something new in it, etc... pass them on, pleasehttp://cpmfetch.fistfullofcode.com
See the readme.html enclosed for information, etc - or available online in the docs section of the website. Toward the bottom a list will show you what has been added to new development versions since the stable.
The version attached below is the latest stable version. However, there are always development versions available at the web site shown above... those should always work, and sometimes have neat new features added. I only post the latest stable version here and remove old ones - sometimes I even forget to do that. If you need an older version or want to make sure you have the latest, see the web site.