Advanced search  


CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: What is CpmFetch and what it can do for you... READ THIS  (Read 50861 times)

0 Members and 1 Guest are viewing this topic.


  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • []
    • Fist Full Of Code
What is CpmFetch and what it can do for you... READ THIS
« on: August 27, 2006, 06:47:48 am »

Note: Stable release attached here / dev versions available at the homepage. - latest info, news, development versions, tips, etc

This 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.

:D Notifications of new releases

I added a sign up to my site for email notifications of new updates to cpmfetch.

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  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.

Code: [Select]
ini_set('display_errors',1);  // 0 is off, 1 is on

 ??? What if its close to what you need, but not quite?.  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 nameAlbumNew count
Haley - The early years (1999-2002)2000 Haley - the second year17 new 
  1999 Haley - the first year  69 new 
  2001 Haley - the third year   30 new
Haley, Christi and meOur furry friends 18 new
  May 2003 - Beckett Trip15 new
  Misc - Just don't fit anywhere11 new

More examples and downloads are here:

Among the functions so far are stuff like this...  Many more have been added, so see the web site

Note:  The functions and calls are not always kept up to date - the documentation is typically the best source!

Functions that return images
  • 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 textual statistics
  • cpm_formatStats ($format)
  • cpm_listMediaCount ()
  • cpm_getMediaCount ()
  • cpm_listMediaCountForAlbum ($albumid)
  • cpm_getMediaCountForAlbum ($albumid)

Functions that return gallery level images and text
  • cpm_listMediaAddedOverLastDays ($numberOfDays, [ array $options=""])
  • cpm_viewLastCommentedImages($rows,$columns, [ array $options=""])
  • cpm_showCategoriesUpdatedOverLastDays($numberOfDays,$options="")
  • cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")

Functions that control this program and its behavior
  • cpm ($urltocpm)
  • cpm_init ( Depreciated old constructor )
  • cpm_close ()
  • cpm_setFilter($filter)
  • cpm_setReturnType($type)
  • cpm_unlock_private($bool)
  • cpm_OverridePathToCoppermine($newpath_)
  • cpm_OverrideUrlToCoppermine($newpath_)
  • cpm_setDebugMode($bool)

Brief explanation of some of the above parameters

$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


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.

Code: [Select]
img src="/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
Code: [Select]
include_once "./cpg/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./cpg/cpmfetch/cpmfetch_config.php');

A more intricate example passing some CSS info for the table is

Code: [Select]
= array(
"tableStyle" => "photoclip",
"rowStyle" => "photoclip",
"cellStyle" => "photoclip",
"linkStyle" => "photoclip",
"altTag" => "One of the last photos submitted",
"imageStyle" => "photoclip",
"imagesize" => "int") ;


 ??? Boy I am impressed!  I want to send you things... money, gifts, girls, etc... how can I do this?  Well, tell you what... the Coppermine people have put probably at least 2000x more work into Coppermine.  Why not send something to them instead. You could also always send a  donation to the 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, please

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.
« Last Edit: April 16, 2008, 07:40:04 am by vuud »
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco
Pages: [1]   Go Up

Page created in 0.026 seconds with 19 queries.