diff options
| author | wjames5 <will@tekimaki.com> | 2007-05-06 01:18:30 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2007-05-06 01:18:30 +0000 |
| commit | 8320807fba8040332690adb610b1af25d4950d1f (patch) | |
| tree | c3151d640488dab25c6d501c26a3588114b44354 /modules | |
| parent | 398dabe35ab2e591803c101fe890e2ba99a5e548 (diff) | |
| download | tags-8320807fba8040332690adb610b1af25d4950d1f.tar.gz tags-8320807fba8040332690adb610b1af25d4950d1f.tar.bz2 tags-8320807fba8040332690adb610b1af25d4950d1f.zip | |
add module to include tag cloud in columns - note there is a weird style layout bug
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mod_tags_cloud.php | 30 | ||||
| -rw-r--r-- | modules/mod_tags_cloud.tpl | 17 |
2 files changed, 47 insertions, 0 deletions
diff --git a/modules/mod_tags_cloud.php b/modules/mod_tags_cloud.php new file mode 100644 index 0000000..6480cc2 --- /dev/null +++ b/modules/mod_tags_cloud.php @@ -0,0 +1,30 @@ +<?php +/** + * @version + * @package tags + * @subpackage modules + */ + +/** + * required setup + */ +require_once( TAGS_PKG_PATH."LibertyTag.php" ); +require_once( USERS_PKG_PATH.'BitUser.php' ); + +// moduleParams contains lots of goodies: extract for easier handling +extract( $moduleParams ); + +$listHash = array( + 'sort' => ( !empty( $module_params['sort'] ) ? $module_params['sort'] : NULL ), + 'sort_mode' => ( !empty( $module_params['sort_mode'] ) ? $module_params['sort_mode'] : 'tag_asc' ), +// do not enable until getList can return max of most popular requires more sophisticated query +// 'max_records' => $module_rows, + 'user' => ( !empty( $module_params['user'] ) ? $module_params['user'] : NULL ), + 'group_id' => ( @BitBase::verifyId( $module_params['group_id'] ) ? $module_params['group_id'] : NULL ), +); + +$tag = new LibertyTag(); + +$listData = $tag->getList( $listHash ); +$gBitSmarty->assign( 'modTagData', $listData["data"] ); +?> diff --git a/modules/mod_tags_cloud.tpl b/modules/mod_tags_cloud.tpl new file mode 100644 index 0000000..70b8f8c --- /dev/null +++ b/modules/mod_tags_cloud.tpl @@ -0,0 +1,17 @@ +{strip} +{if $gBitSystem->isPackageActive('tags')} + {bitmodule title="$moduleTitle" name="tags"} + {if $modTagData} + <div id="cloud"> + {foreach item=tag from=$modTagData} + <li class="tag{$tag.tagscale}"><a href="{$smarty.const.TAGS_PKG_URL}index.php?tags={$tag.tag}">{$tag.tag}</a></li> + {/foreach} + </div> + {else} + <div class="norecords"> + {tr}No tags found{/tr} + </div> + {/if} + {/bitmodule} +{/if} +{/strip}
\ No newline at end of file |
