diff options
| author | Christian Fowler <spider@viovio.com> | 2007-11-25 04:42:56 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2007-11-25 04:42:56 +0000 |
| commit | 4b4ceddc444c826afa8714ba9b52300439767b9a (patch) | |
| tree | c687a550f3da9e1fec337366c072d179ce85f05e /templates | |
| parent | bb068bfef2e61b1848571fd2f99d050edb2dae89 (diff) | |
| download | fisheye-4b4ceddc444c826afa8714ba9b52300439767b9a.tar.gz fisheye-4b4ceddc444c826afa8714ba9b52300439767b9a.tar.bz2 fisheye-4b4ceddc444c826afa8714ba9b52300439767b9a.zip | |
add center image comments
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/center_image_comments.php | 52 | ||||
| -rw-r--r-- | templates/center_image_comments.tpl | 37 |
2 files changed, 89 insertions, 0 deletions
diff --git a/templates/center_image_comments.php b/templates/center_image_comments.php new file mode 100644 index 0000000..8c20dac --- /dev/null +++ b/templates/center_image_comments.php @@ -0,0 +1,52 @@ +<?php +/** + * @version $Header: /cvsroot/bitweaver/_bit_fisheye/templates/center_image_comments.php,v 1.1 2007/11/25 04:42:56 spiderr Exp $ + * @package fisheye + * @subpackage modules + */ + +/** + * A specialized version of liberty/modules/mod_last_comments.php for fisheye + */ +require_once( LIBERTY_PKG_PATH.'LibertyComment.php' ); +global $gQueryUser, $gBitUser, $gLibertySystem, $moduleParams; +$params = $moduleParams['module_params']; +$moduleTitle = !empty($moduleParams['title'])? $moduleParams['title'] : 'Recent Image Comments'; + +$userId = NULL; +if( !empty( $gQueryUser->mUserId ) ) { + $userId = $gQueryUser->mUserId; +} + +$listHash = array( + 'user_id' => $userId, + 'max_records' => $moduleParams['module_rows'], +); + +if (!empty($params['full'])) { + $listHash['parse'] = TRUE; +} + +if (!empty($params['pigeonholes'])) { + $listHash['pigeonholes']['root_filter'] = $params['pigeonholes']; +} + +if( !empty( $params['root_content_type_guid'] ) ) { + if( empty($moduleTitle) && is_string( $params['root_content_type_guid'] ) ) { + $moduleTitle = $gLibertySystem->mContentTypes[$params['root_content_type_guid']]['content_description'].' '.tra( 'Comments' ); + } + $listHash['root_content_type_guid'] = $params['root_content_type_guid']; +} else { + // default to base image types + $listHash['root_content_type_guid'] = array('fisheyeimage','fisheyegallery'); +} +$gBitSmarty->assign( 'moduleTitle', $moduleTitle ); + +$lcom = new LibertyComment(); +$modLastComments = $lcom->getList( $listHash ); +$keys = array_keys( $modLastComments ); +foreach( $keys as $k ) { + $modLastComments[$k]['object'] = LibertyBase::getLibertyObject( $modLastComments[$k]['root_id'], $modLastComments[$k]['root_content_type_guid'] ); +} +$gBitSmarty->assign( 'modLastComments', $modLastComments ); +?> diff --git a/templates/center_image_comments.tpl b/templates/center_image_comments.tpl new file mode 100644 index 0000000..beee6fe --- /dev/null +++ b/templates/center_image_comments.tpl @@ -0,0 +1,37 @@ +{* $Header: /cvsroot/bitweaver/_bit_fisheye/templates/center_image_comments.tpl,v 1.1 2007/11/25 04:42:56 spiderr Exp $ *} +{strip} +{if $modLastComments} +<div class="listing fisheye"> + <div class="header"> + <h1>{tr}{$moduleTitle|default:'Image Comments'}{/tr}</h1> + </div> + + <div class="body"> + <ul class="comment"> + {section name=ix loop=$modLastComments} + <li class="post"> + <a href="{$gal.display_url}"> + <img class="thumb" src="{$modLastComments[ix].object->getThumbnailUrl($moduleParams.module_params.thumb_size)}" alt="{$modLastComments[ix].object->getTitle()|escape}" title="{$modLastComments[ix].object->getTitle()|escape}" /> + </a> + + <div class="header"> + <h3>{$modLastComments[ix].object->getTitle()|escape}: {$modLastComments[ix].display_link}</h3> + {if $moduleParams.module_params.show_date} + <div class="date">{tr}by{/tr} {displayname hash=$modLastComments[ix]}, {$modLastComments[ix].last_modified|bit_short_datetime}</div> + {/if} + </div> + {if $moduleParams.module_params.full} + <p>{$modLastComments[ix].parsed_data}</p> + {/if} + <div class="clear"></div> + </li> + {sectionelse} + <li></li> + {/section} + </ul> + <div class="clear"></div> + {pagination} + </div> <!-- end .body --> +</div> <!-- end .fisheye --> +{/if} +{/strip} |
