diff options
| author | Tyler Bello <tylerbello@users.sourceforge.net> | 2009-09-25 18:15:08 +0000 |
|---|---|---|
| committer | Tyler Bello <tylerbello@users.sourceforge.net> | 2009-09-25 18:15:08 +0000 |
| commit | d8a63e703a3ab4ae8658d5f3e1fc37bd84273444 (patch) | |
| tree | 1445d98af284e3f853b2f658a1a79c7f998e22fd /modules | |
| parent | aba8836cd19cb30065b81c1464f79ff3ac226d79 (diff) | |
| download | feed-d8a63e703a3ab4ae8658d5f3e1fc37bd84273444.tar.gz feed-d8a63e703a3ab4ae8658d5f3e1fc37bd84273444.tar.bz2 feed-d8a63e703a3ab4ae8658d5f3e1fc37bd84273444.zip | |
add ability to hide excess comments, its awesome
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mod_status.php | 4 | ||||
| -rw-r--r-- | modules/mod_status.tpl | 51 |
2 files changed, 48 insertions, 7 deletions
diff --git a/modules/mod_status.php b/modules/mod_status.php index f115bbb..fd6271e 100644 --- a/modules/mod_status.php +++ b/modules/mod_status.php @@ -15,7 +15,10 @@ if( !empty( $moduleParams['module_params']['no_link_user'] ) ) { } if( !empty( $moduleParams['module_rows'] ) ) { $listHash['max_records'] = $moduleParams['module_rows']; +}elseif (!empty($moduleParams['module_params']['max_records'])){ + $listHash['max_records'] = $moduleParams['module_params']['max_records']; } + if( !empty( $moduleParams['module_params']['user_id'] ) ){ $listHash['user_id'] = $moduleParams['module_params']['user_id']; }else{ @@ -23,7 +26,6 @@ if( !empty( $moduleParams['module_params']['user_id'] ) ){ } $statuses = feed_get_status( $listHash ); - $gBitSmarty->assign( 'statuses', $statuses); foreach ($statuses as $status){ diff --git a/modules/mod_status.tpl b/modules/mod_status.tpl index 0e8efde..3e1afc4 100644 --- a/modules/mod_status.tpl +++ b/modules/mod_status.tpl @@ -1,7 +1,31 @@ -<form> - <input type="text" name="feed_status"/> - <input type="submit"/> -</form> +{literal} +<script type="text/javascript"> + +function showHideReplies( contentId , total , feedback ){ + +var hidden = document.getElementById('hidden_'+contentId); + +if( hidden.style.display == 'none' ){ + hidden.style.display = 'block'; + feedback.innerHTML = 'Hide '+ total + ' replies'; +}else{ + hidden.style.display = 'none'; + feedback.innerHTML = 'Show '+ total + ' replies'; +} + +} + +</script> + +{/literal} + + +{if $gBitUser->mUserId == $statuses.0.user_id} + <form> + <input type="text" name="feed_status"/> + <input type="submit"/> + </form> +{/if} {foreach from=$statuses item='status'} <div style="margin-top:25px;clear:both;"> @@ -10,8 +34,23 @@ {displayname hash=$status} {$status.data} <br/> <small>{$status.last_modified|date_format}</small> <div> + {if !empty($status.replies_excess) } + {* loop through all but the ones we want to be actually visible and place them in a collapsed div*} + <div id="hidden_{$status.content_id}" style="display:none;"> + {foreach from = $status.replies_excess item='reply'} + <div style="margin-top:10px;background-color:#eee;"> + {if $reply.feed_icon_url} <img style="width:25px;height:25px;float:left;" src="{$reply.feed_icon_url}"/> {/if} + <div style="vertical-align:top;"> + {displayname hash=$reply} {$reply.data} <br/> + <small>{$reply.last_modified|date_format}</small> + </div> + </div> + {/foreach} + </div> + <a onclick="showHideReplies( {$status.content_id}, {$status.replies_excess|@count}, this );">Show {$status.replies_excess|@count} replies</a> + {/if} {foreach from = $status.replies item='reply'} - <div style="margin-top:10px;"> + <div style="margin-top:10px;background-color:#eee;"> {if $reply.feed_icon_url} <img style="width:25px;height:25px;float:left;" src="{$reply.feed_icon_url}"/> {/if} <div style="vertical-align:top;"> {displayname hash=$reply} {$reply.data} <br/> @@ -21,7 +60,7 @@ {/foreach} </div> <form> - <input type="text" name="comment_{$status.content_id}"/> + <input type="text" value="write something..." onclick="this.value='';" name="comment_{$status.content_id}"/> <input style="width:25px;height:20px;" value="go" type="submit"/> </form> </div> |
