Class cpm_dao

Description

This object handles all database transactions with the backend

Located in /cpmfetch_dao.php (line 22)


	
			
Direct descendents
Class Description
 class cpm CpmFetch allows you to easily access and display information from your Coppermine Photo Gallery (CPG) in a variety of ways. CpmFetch respects the privacy settings in your gallery and will not display images the public would not be allowed to see normally.
Variable Summary
Method Summary
 cpm_dao cpm_dao ([ $config_file = ""])
 void addPathInfo ( &$data)
 void cpm_debugMode ([$bool $bool = ""])
 void cpm_getConfigEntry (string $_keyName)
 void cpm_setDateFormat ([string $_format = ""])
 void cpm_setFilter ([mixed $filter = ""])
 void cpm_setMediaPrefixes ($string $_thumb, $string $_intermediate, [$string $_large = ""])
 void cpm_unlock_private ([$bool $bool = ""])
 void createDescription ( $format,  &$row, [ $failOnMissing = false])
 void createlink ( $filepath,  $filename,  $aid,  $pos, [ $imagelink = "int"])
 void createOldFormatDescription ( $format,  $row, [ $failOnMissing = false])
 void dbConnect ()
 void dbDisconnect ()
 void dbExecuteSql ( $sqlcode)
 void debugPrint ()
 void destroy ()
 void formatStats ( $format)
 void getAlbumCount ()
 void getAlbumListFrom ( $source)
 void getCategoryListFrom ([ $source = ""])
 void getCommentCount ()
 void getdefaultimagename ( $ext)
 void getImageToUse ( $filepath,  $filename,  $fileprefix)
 void getLastAddedMediaFrom ( $source, [ $count = 1])
 void getLastImagesWithComments ( $limit)
 void getLastUpdatedAlbumsFrom ( $source, [ $count = 1])
 void getMediaAddedSince ( $timestamp)
 void getMediaAddedToCategoriesSince ( $timestamp)
 void getMediaByPid ( $pid)
 void getMediaCount ()
 void getMediaCountAddedSince ( $timestamp)
 void getMediaCountForAlbum ( $albumid)
 void getMediaCountFrom ( $source)
 void getMostVotedMediaFrom ( $source, [ $count = 1])
 void getRandomImageFrom ( $source,  $count)
 void getRandomMostViewedMediaFrom ( $source, [ $count = 1])
 void getRandomSeed ()
 void getRandomTopRatedMediaFrom ( $source, [ $count = 1])
 void getTopRatedMediaFrom ( $source, [ $count = 1])
 void getViewcount ()
 void makeSourceSql ( $source)
 void urlEncodeImagePath ( $_name)
Variables
mixed $cfCfg (line 31)
  • access: private
mixed $cfDefaultComments (line 34)
  • access: private
mixed $dbconnection = "" (line 28)
  • access: private
mixed $filetypefilter = "" (line 46)
  • access: private
mixed $lastSQLErrorMessage = "" (line 40)
  • access: private
mixed $lastSQLRowsReturned = "" (line 37)
  • access: private
mixed $privacyfilter = "" (line 43)
  • access: private
mixed $resultArray = "" (line 64)

This holds the results array as provided by the SQL call

  • access: private
mixed $sqlPostSelect = "" (line 58)
  • access: private
mixed $sqlSelect = "" (line 49)
  • access: private
mixed $sqlTableSelect = "" (line 52)
  • access: private
mixed $sqlUserDataLink = "" (line 55)
  • access: private
mixed $VERSION = "@@@RELEASEVERSION@@@" (line 25)
  • access: private

Redefined in descendants as:
  • cpm::$VERSION : This is the version number of this release of CpmFetch
Methods
Constructor cpm_dao (line 74)
  • access: private
cpm_dao cpm_dao ([ $config_file = ""])
  • $config_file
addPathInfo (line 1365)

Take an array of rows and add in tags for thumbnail, normal and large image paths

  • access: private
void addPathInfo ( &$data)
  • &$data
cpm_debugMode (line 207)

Toggles cpmFetch into a debug mode (default: returns setting)

Actives some extra output for troubleshooting. Debug data is output as HTML comments or blockquotes

  • since: 1.1.1
  • access: public
void cpm_debugMode ([$bool $bool = ""])
  • $bool $bool: true or false or blank. Do not enclose in quotes.
cpm_getConfigEntry (line 304)

Returns a named config variable.

This will return anything in the cpg settings table with the exception of those deemed a security risk (dbname, dbpass, bridge info, etc...)

  • access: private
void cpm_getConfigEntry (string $_keyName)
  • string $_keyName: - name of variable to return
cpm_setDateFormat (line 287)

Sets the format as seen in the php DATE function to be used in rendering dates

Sets the format as seen in the php DATE function to be used in rendering dates. For more information on the kinds of date strings you can use check http://www.php.net/manual/en/function.date.php

  • access: public
void cpm_setDateFormat ([string $_format = ""])
  • string $_format: - set to a valid date format string
cpm_setFilter (line 170)

Limits what types of media can be selected by this program

Allows you to specify a list of extensions that are allowable for displaying. 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.

  • access: public
void cpm_setFilter ([mixed $filter = ""])
  • mixed $filter: - either a string of one extension or an array of several extensions
cpm_setMediaPrefixes (line 271)

Allows you to change the default media prefixes settings for large are now ignored since cpg does not support it

  • access: private
void cpm_setMediaPrefixes ($string $_thumb, $string $_intermediate, [$string $_large = ""])
  • $string $_thumb: thumbnail size prefix
  • $string $_intermediate: Normal / Intermediate size prefix
  • $string $_large: Large sized (original) photo prefix (optional but ignored)
cpm_unlock_private (line 248)

Toggles access to non-public photos (default: false)

Allows images not publically available to be selected and displayed until it is turned off, or the object is recreated. This program makes no distinction beyond if a media item is public or not.

  • since: Version 0.7
  • access: public
void cpm_unlock_private ([$bool $bool = ""])
  • $bool $bool: true or fale. True unlocks access to private media
createDescription (line 1584)
  • access: private
void createDescription ( $format,  &$row, [ $failOnMissing = false])
  • $format
  • &$row
  • $failOnMissing
createlink (line 1559)

Creates the href and img tags to be displayed

  • access: private
void createlink ( $filepath,  $filename,  $aid,  $pos, [ $imagelink = "int"])
  • $filepath
  • $filename
  • $aid
  • $pos
  • $imagelink
createOldFormatDescription (line 1674)
  • deprecated: since version 2.0, will be removed in 4.0
  • access: private
void createOldFormatDescription ( $format,  $row, [ $failOnMissing = false])
  • $format
  • $row
  • $failOnMissing
dbConnect (line 1267)

Creates a connection to the gallery database

If

  • access: private
void dbConnect ()
dbDisconnect (line 1301)

Calls a mysql_close on the current db connection.

This will close the db connection, unless you are running PHP >= 4.2.0 and have CpmFetch configured to use an existing db connection (cfUseExistingDBConnection), in which case it will not close it at all.

  • access: private
void dbDisconnect ()
dbExecuteSql (line 1318)
  • access: private
void dbExecuteSql ( $sqlcode)
  • $sqlcode
debugPrint (line 232)
  • access: private
void debugPrint ()

Redefined in descendants as:
  • cpm::debugPrint() : Used for printing debug information. If will output the parameter directly, preceeding it with a newline, then inside HTML blockquote tag, followed by a newline.
destroy (line 154)
  • access: private
void destroy ()
formatStats (line 942)

Provides shortcuts into different function that return data

The format is specified by placeholders indicated by percent signs '%'. If you actually want a percent sign you will need to put two percent signs in a row '%%'. The most up to date list for supported placeholders can be found in the coppermine_dao formatStats function. But the main ones are:

  • %f - file count
  • %a - album count
  • %c - category count
  • %v - view count
  • %n - comment count (note count)

  • access: public
void formatStats ( $format)
  • $format
getAlbumCount (line 424)

Returns the number of albums in the database.

  • access: public
void getAlbumCount ()
getAlbumListFrom (line 516)
  • access: private
void getAlbumListFrom ( $source)
  • $source
getCategoryCount (line 474)

Returns the number of categories in the CPG database

  • access: public
void getCategoryCount ()
getCategoryListFrom (line 545)
  • todo: Source does not work on this call?
  • access: private
void getCategoryListFrom ([ $source = ""])
  • $source
getCommentCount (line 442)

Returns the number of comments in the CPG database

  • access: public
void getCommentCount ()
getdefaultimagename (line 1452)
  • access: private
void getdefaultimagename ( $ext)
  • $ext
getImageToUse (line 1387)

The following methods are not data access per say, but do provide data back independing of formatting, and I did not want to include another file...

  • access: private
void getImageToUse ( $filepath,  $filename,  $fileprefix)
  • $filepath
  • $filename
  • $fileprefix
getLastAddedMediaFrom (line 744)
  • access: private
void getLastAddedMediaFrom ( $source, [ $count = 1])
  • $source
  • $count
getLastImagesWithComments (line 851)
  • access: private
void getLastImagesWithComments ( $limit)
  • $limit
getLastUpdatedAlbumsFrom (line 777)
  • access: private
void getLastUpdatedAlbumsFrom ( $source, [ $count = 1])
  • $source
  • $count
getMediaAddedSince (line 905)

Returns a report of media added since a timestamp

  • access: private
void getMediaAddedSince ( $timestamp)
  • $timestamp
getMediaAddedToCategoriesSince (line 879)

Returns a report of media added since a timestamp

  • access: private
void getMediaAddedToCategoriesSince ( $timestamp)
  • $timestamp
getMediaByPid (line 491)
  • access: private
void getMediaByPid ( $pid)
  • $pid
getMediaCount (line 335)
  • access: private
void getMediaCount ()
getMediaCountAddedSince (line 401)
  • access: private
void getMediaCountAddedSince ( $timestamp)
  • $timestamp
getMediaCountForAlbum (line 378)
  • access: private
  • deprecated: since version 2.0, to be removed in version 4.0
void getMediaCountForAlbum ( $albumid)
  • $albumid
getMediaCountFrom (line 353)
  • access: private
void getMediaCountFrom ( $source)
  • $source
getMostVotedMediaFrom (line 602)
  • access: private
void getMostVotedMediaFrom ( $source, [ $count = 1])
  • $source
  • $count
getRandomImageFrom (line 816)

Returns a random image from a category in cpm

  • access: private
void getRandomImageFrom ( $source,  $count)
  • $source
  • $count
getRandomMostViewedMediaFrom (line 692)
  • access: private
void getRandomMostViewedMediaFrom ( $source, [ $count = 1])
  • $source
  • $count
getRandomSeed (line 1793)
  • access: private
void getRandomSeed ()
getRandomTopRatedMediaFrom (line 635)
  • access: private
void getRandomTopRatedMediaFrom ( $source, [ $count = 1])
  • $source
  • $count
getTopRatedMediaFrom (line 572)
  • access: private
void getTopRatedMediaFrom ( $source, [ $count = 1])
  • $source
  • $count
getViewcount (line 455)

Returns the total views across the entire CPG database

  • access: public
void getViewcount ()
makeSourceSql (line 995)
  • access: private
void makeSourceSql ( $source)
  • $source
urlEncodeImagePath (line 1437)
  • access: private
void urlEncodeImagePath ( $_name)
  • $_name

Documentation generated on Fri, 22 Jun 2007 10:16:58 -0400 by phpDocumentor 1.3.0