summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2009-02-22 06:19:18 +0000
committerChristian Fowler <spider@viovio.com>2009-02-22 06:19:18 +0000
commit956b77541763bcb32f13a44367dcced2013c0efe (patch)
tree686bcd59f46e39dbf4a48db348ab53abff2d1630
parent5feb32051334fb0a73dfdc85987854399c5755fe (diff)
downloadliberty-956b77541763bcb32f13a44367dcced2013c0efe.tar.gz
liberty-956b77541763bcb32f13a44367dcced2013c0efe.tar.bz2
liberty-956b77541763bcb32f13a44367dcced2013c0efe.zip
add getThumbnailUrl method that will return the primary attachment, or last attachment if no is_primary
-rw-r--r--LibertyMime.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/LibertyMime.php b/LibertyMime.php
index ff5cd4b..813e061 100644
--- a/LibertyMime.php
+++ b/LibertyMime.php
@@ -3,7 +3,7 @@
* Manages liberty Uploads
*
* @package liberty
- * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyMime.php,v 1.41 2008/12/08 09:02:34 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyMime.php,v 1.42 2009/02/22 06:19:18 spiderr Exp $
*/
/**
@@ -254,6 +254,21 @@ class LibertyMime extends LibertyAttachable {
return ( count( $this->mErrors ) == 0 );
}
+ function getThumbnailUrl( $pSize='small', $pInfoHash=NULL ) {
+ $ret = NULL;
+ if( !empty( $pInfoHash ) ) {
+ // do some stuff if we are given a hash of stuff
+ } elseif( $this->isValid() && !empty( $this->mStorage ) ) {
+ foreach( array_keys( $this->mStorage ) as $attachmentId ) {
+ if( !empty( $this->mStorage[$attachmentId]['is_primary'] ) ) {
+ break;
+ }
+ }
+ $ret = $this->mStorage[$attachmentId]['thumbnail_url'][$pSize];
+ }
+ return $ret;
+ }
+
/**
* updateAttachmentParams will update attachment parameters
*