if ($level == 'pictures') { $cond = "WHERE `parent_album` = '" . intval($id) . "'"; } } $plog_page = isset($_REQUEST['plog_page']) ? $_REQUEST['plog_page'] : 1; // we're on the first page $first_item = ($plog_page - 1) * $_SESSION['entries_per_page']; if ($first_item < 0) { $first_item = 0; } $limit = "LIMIT " . $first_item . ", " . $_SESSION['entries_per_page']; // Let's generate the pagination menu as well $recordCount = "SELECT COUNT(*) AS num_items FROM " . PLOGGER_TABLE_PREFIX . "{$level} {$cond}"; $totalRowsResult = mysql_query($recordCount); $totalRows = mysql_result($totalRowsResult, 0, 'num_items'); $pagination_menu = "\n\t\t" . '<div class="entries-page">' . generate_pagination_view_menu() . ' </div><!-- /entries-page --> <div class="pagination">' . generate_pagination('admin', 'manage', $plog_page, $totalRows, $_SESSION['entries_per_page'], array('level' => $level, 'id' => $id)) . '</div><!-- /pagination -->'; $output .= "\n\t\t" . '<form id="contentList" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; $empty = false; switch ($level) { case 'comments': $output .= $pagination_menu . generate_breadcrumb_admin('comments', $id); $output .= plog_comment_manager($id, $first_item, $_SESSION['entries_per_page']); break; case 'pictures': $output .= $pagination_menu . generate_breadcrumb_admin('pictures', $id); $output .= plog_picture_manager($id, $first_item, $_SESSION['entries_per_page']); break; case 'albums': $output .= $pagination_menu . generate_breadcrumb_admin('albums', $id);
if ($num_comments_im > 0) { $output .= '<p class="actions">' . sprintf(plog_tr('You have %d comment(s) waiting for approval.'), $num_comments_im) . ' <a href="plog-feedback.php?moderate=1">' . plog_tr('Click here') . '</a>.</p>'; } } $counter = 0; while ($row = mysql_fetch_assoc($result)) { // if we're on our first iteration, dump the header if ($counter == 0) { if ($approved) { $output .= '<table style="width: 100%"><tr><td>' . sprintf(plog_tr('You have <strong>%d</strong> user comment(s).'), $num_comments) . '</td>'; } else { $output .= '<table style="width: 100%"><tr><td>' . sprintf(plog_tr('You have <strong>%d</strong> user comment(s) awaiting approval.'), $num_comments_im) . '</td>'; } // output view entries pagination control $output .= '<td align="right">' . generate_pagination_view_menu() . '</td></tr></table>'; $output .= '<table style="width: 100%" cellpadding="4"><tr class="header"><td class="table-header-left"></td><td class="table-header-middle" width="65">thumb</td>'; foreach ($row as $name => $value) { if (in_array($name, $allowedCommentKeys)) { $output .= "<td class=\"table-header-middle\">" . $name . "</td>"; } } $output .= '<td class="table-header-right">Actions</td></tr>'; } if ($counter % 2 == 0) { $table_row_color = "color-1"; } else { $table_row_color = "color-2"; } // start a new table row (alternating colors) $output .= "<tr class=\"{$table_row_color}\">";