Previous Up Next
Using the $option array effectively In depth explanations Troubleshooting : Common issues

Using the $format parameter effectively

Customize your subtitles, alt tags and links

Vuud

What is the $format tag?

The format tag allows you to create custom output based on image information contained in the CPG database.

For example, lets say you want to show the filename for each image displayed in your table of random images.

Example of creating the option array
$options = array("subtitle" => "File name is: {{pFilename}}");
$objCpm->cpm_viewLastAddedMedia(1, 4, $options);
This would add the subtitle under every image with the text File name is: followed be the pictures filename. Amazing? Yes!

What tags can I use?

The list varies to a slight degree by how you are using CpmFetch. If you are just using CpmFetch as a photo gallery, all of these tags should be available to you. If you are bridged with a forum or something, some may not be.

I have tried to follow a convention of setting the first letter to represent the table the information is coming from. While this may not hold up forever, it is generally correct. p - from the picture table a - from the album table c - from the category table u - from the user table Some others are determined by CpmFetch when it runs. Those are marked with an astrisk.

Tag Description Forum safe Notes
pFilepath The path to the media Y  
pFilename The medias filename Y  
pAidThe album ID the photo belongs toY
pFilesizeThe media reported fileseizeY
pFilesizeKB*The medias filesize in KBYCalculated by CpmFetch
pTitle
pCaption
pOwner_name
pOwnerId
pCtime
pCtimeAgo*
pCtimeFormatted*
pHits
pPid
pPic_Rating
pPic_RatingStars
pVotes
pWidth
pHeight
pUser1
pUser2
pUser3
pUser4
cName
cDescription
cPos
cParent
cThumb
uUser_lastvisit?
uUser_regdate?
uUser_email?
uUser_profile1?
uUser_profile2?
uUser_profile3?
uUser_profile4?
uUser_profile5?
uUser_profile6?
aAid
aTitle
aDescription
aVisibility
aPos
aCategory
aThumb
aKeyword
fullPathToThumb*
fullPathToNormal*
fullPathToFull*
cpmSubtitle*

The old ones use percent signs...

Older version of CpmFetch use a % sign for placeholders. This is deprecated and is not recommended moving forward. For the mean time they are still supported. However, if you use any % signs, it will slow down your program. Legacy placeholders: %a - album name it belongs in %A - Message Author %c - caption for the media %C - Message Body %d - album description %D - days old: returns # of days since the photo was added %e - display owners E-Mail (as of 1.5.1) %f - filename of the media %h - Total number of views or hits for the media %H - display owners web site or (H)ome page (as of 1.5.1) %i - shows the PID of that image %I - display owners (I)nterests (as of 1.5.1) %l - display owners (l)ast visit (lower case L) (as of 1.5.1) %L - display owners (L)ocation (as of 1.5.1) %o - owner name for the media %O - display owners occupation (as of 1.5.1) %p - filepath of the media %r - display owners (r)egistration date (as of 1.5.1) %s - filesize in bytes %S - filesize in KB rounded to one decimal place %t - title given to the media %v - total number of votes cast for this photo %V - the current rating in number of stars to one decimal place %w - when added (reformatted ctime field) %W - raw Ctime field data (seconds) %x - shows the photos width of image as stored on server %y - shows the photos height of image as stored on server

These will stop working in CpmFetch 4.0.

Previous Up Next
Using the $option array effectively In depth explanations Troubleshooting : Common issues

Documentation generated on Tue, 10 Apr 2007 23:00:31 -0400 by phpDocumentor 1.3.0