# HG changeset patch # User Dan # Date 1205608907 14400 # Node ID 172544257e2ca5acfae5cc53ef90f93aa74c5f2a # Parent f50742368f907ec3f62098c79fa6fd9b42656df6 Merging changes from Nighthawk - visual tweak to post manager diff -r f50742368f90 -r 172544257e2c plugins/nuggie/client/usercp.js --- a/plugins/nuggie/client/usercp.js Sat Mar 15 15:19:42 2008 -0400 +++ b/plugins/nuggie/client/usercp.js Sat Mar 15 15:21:47 2008 -0400 @@ -35,7 +35,7 @@ } var fader = new Spry.Effect.Highlight(row, {to:'#AA0000', duration: 750}); fader.start(); - setTimeout('_global_ng_row.parentNode.removeChild(_global_ng_row);', 750); + setTimeout('_global_ng_row.parentNode.removeChild(_global_ng_row); nuggie_check_postlist_empty();', 750); } else { @@ -51,6 +51,21 @@ } } +function nuggie_check_postlist_empty() +{ + if ( document.getElementById('nuggie_postlist').childNodes.length == 1 ) + { + var td = document.createElement('td'); + td.className = 'row3'; + td.setAttribute('colspan', '6'); + td.appendChild(document.createTextNode('No posts.')); + td.style.textAlign = 'center'; + var tr = document.createElement('tr'); + tr.appendChild(td); + document.getElementById('nuggie_postlist').appendChild(tr); + } +} + function ajaxNuggieTogglePublished(id, obj) { var published = obj.getAttribute('nuggie:published') == '1' ? true : false; diff -r f50742368f90 -r 172544257e2c plugins/nuggie/usercp.php --- a/plugins/nuggie/usercp.php Sat Mar 15 15:19:42 2008 -0400 +++ b/plugins/nuggie/usercp.php Sat Mar 15 15:21:47 2008 -0400 @@ -436,7 +436,7 @@ $db->_die(); echo '
- '; +
'; echo ' @@ -446,20 +446,27 @@ '; - while ( $row = $db->fetchrow() ) + if ( $row = $db->fetchrow() ) { - echo ''; - - $uri = makeUrlNS('Blog', $session->username . date('/Y/n/j/', $row['post_timestamp']) . $row['post_title_clean'], false, true); - - echo ''; - echo ''; - $cls = ( $row['post_published'] == 1 ) ? 'row3_green' : 'row3_red'; - echo ''; - echo ''; - echo ''; - - echo ''; + do + { + echo ''; + + $uri = makeUrlNS('Blog', $session->username . date('/Y/n/j/', $row['post_timestamp']) . $row['post_title_clean'], false, true); + + echo ''; + echo ''; + $cls = ( $row['post_published'] == 1 ) ? 'row3_green' : 'row3_red'; + echo ''; + echo ''; + echo ''; + + echo ''; + } while ( $row = $db->fetchrow() ); + } + else + { + echo ''; } echo '
#
' . $row['post_id'] . '' . "" . htmlspecialchars($row['post_title']) . '' . ( ( $row['post_published'] == 1 ) ? 'Yes' : 'No' ) . '' . ( function_exists('enano_date') ? enano_date('Y-m-d', $row['post_timestamp']) : date('Y-m-d h:i', $row['post_timestamp']) ) . '
' . $row['post_id'] . '' . "" . htmlspecialchars($row['post_title']) . '' . ( ( $row['post_published'] == 1 ) ? 'Yes' : 'No' ) . '' . ( function_exists('enano_date') ? enano_date('Y-m-d', $row['post_timestamp']) : date('Y-m-d h:i', $row['post_timestamp']) ) . '
No posts.