Functions that control this program and its behavior - these functions start CpmFetch and also tell it to do stuff like showing private images, how to format dates, etc.
This is the constructor for the cpmfetch object. It takes one parameter, the partial url to your coppermine photo gallery. The partial URL is the part of your full URL to get to coppermine, without the domain name on it. So for example, to get to my photo gallery is http://www.fistfullofcode.com/photos - then my partial url is /photos
Database connections are time consuming in computer terms. So this program does not create a database connection till it absolutely has too, but then it keeps it until you call close. If you don't call close, strange things could possibly happen.
Did you know people can store all sorts of stuff in CPG? Neither did I. Types not explicity identified are omitted from results. The format for submitting file types is an array of extensions. such as array(".jpg",".avi"). There is a limit as matches will be made against the lower case and upper case versions of the types. If you have only one type, you may specifiy it as a string instead of an array and it will be automagically converted. * Passing it nothing - clears the filter (returns everything) * Passing it one extension (".jpg") - sets filter to match any .jpg or .JPG files * Passing it an array (array(".jpg",".mpg",".mp3")) - sets filters to match any of those Note: There is a flaw in this function... anything you pass will be compared as all uppercase and all lowercase against the files in the database. I am trying to work something out for this.
This allows you to define the format that dates will be shown in. This is a string containing placeholders that each represent aspects of a date. This format directly feeds the PHP Date( ) function (See the documentation on PHP.net). This is used for the subtitle and alt tag setting for now.
Example?7.1.?Examples of the setDateFormat format
Some examples (assuming today is March 22, 2005: m-Y = 3-2005 M-Y = Mar-2005 l,M d, Y = Tuesday, Mar 22, 2005 day z of 2005 = day 53 of 2005
Get it?
Allows you to change the default media prefixes.
This lets you set the return action of many functions to select from printing html, returning html or returning resultsets. Once you set this, it affects any calls made after this. Output can be selected by setting this function with:
print (default) - outputs html to the screen |
html - returns all the html code as a returned string |
resultset - Returns an array of associated arrays representing the resultset for the data |
Not all functions support it all of these... a general rule of thumb is that if it would normally just return a number or a line of text it will not support the resultset version - otherwise they are pretty supported
This toggles access to non-public photos (default: false) It allows images not publically available to be selected and displayed until it is turned off, or the object is lost. This program makes no distinction beyond if a media item is public or not - Meaning that photos that may be viewable by logged in users are considered private, not something in between.
Calling this parameter with a true or false turns on and off Debug mode. Basically this will dump a lot of SQL calls and such directly to your screen. Not really something for someone who is not trying to fix something.