What is CpmFetch and what it can do for you... READ THIS What is CpmFetch and what it can do for you... READ THIS
 

News:

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

Main Menu

What is CpmFetch and what it can do for you... READ THIS

Started by vuud, August 27, 2006, 06:47:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vuud

Note: Stable release attached here / dev versions available at the homepage.

http://cpmfetch.fistfullofcode.com - 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.

http://cpmfetch.fistfullofcode.com

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 
error_reporting(E_ALL);
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:
http://cpmfetch.fistfullofcode.com

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

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.fistfullofcode.com%2Fprojects%2Fcopperminefetch%2Fcss_example_2.jpg&hash=c7bdf3a9b3101197032bd73f705ee6d368a4d494)

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.

img src="/cfimageget.php?category=7"

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.fistfullofcode.com%2Fphp-lib%2Fcpmfetch%2Fcfimageget.php%3Fcategory%3D7&hash=d36af8760990186cacf839d00f5ec5b5bc73d6c6)
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 
include_once "./cpg/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./cpg/cpmfetch/cpmfetch_config.php');
$objCpm->cpm_viewRandomMediaFrom("album=7",1,3); 
$objCpm->cpm_close(); 
?>



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


<?php 
$options 
= array(
"tableStyle" => "photoclip",
"rowStyle" => "photoclip",
"cellStyle" => "photoclip",
"linkStyle" => "photoclip",
"altTag" => "One of the last photos submitted",
"imageStyle" => "photoclip",
                
"imagesize" => "int") ;

$objCpm->cpm_viewLastAddedMedia(4,2,$options); 
?>



??? 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. 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, please

http://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.
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