forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: vuud on August 27, 2006, 06:47:48 am

Title: What is CpmFetch and what it can do for you... READ THIS
Post by: vuud on August 27, 2006, 06:47:48 am
Note: Stable release attached here / dev versions available at the homepage.

http://cpmfetch.fistfullofcode.com (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 (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 (http://www.fistfullofcode.com).  Do me a favor and:


Also, try adding this to the top of your php page.  It will cause more errors and warnings to be displayed.

Code: [Select]
<?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 (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

Functions that return textual statistics

Functions that return gallery level images and text

Functions that control this program and its behavior


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:


(https://forum.coppermine-gallery.net/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.

Code: [Select]
img src="/cfimageget.php?category=7"
(https://forum.coppermine-gallery.net/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
Code: [Select]
<?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

Code: [Select]
<?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 (http://forum.coppermine-gallery.net/index.php?topic=14227.0) You could also always send a  donation to the www.eff.org (http://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 (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.