예제 #1
0
    $first_user_post = isset($user_article_stats['P']) ? $user_article_stats['P']['first_post'] : '';
    $last_user_post = isset($user_article_stats['P']) ? $user_article_stats['P']['last_post'] : '';
    $total_user_post = isset($user_article_stats['P']) ? $user_article_stats['P']['total'] : '0';
}
unset($_GET['author_id']);
// now get sitewide stats (if author rights allow)
$all_article_stats = '';
$all_comment_stats = '';
if (empty($_SESSION[WW_SESS]['guest'])) {
    $all_article_stats = get_articles_stats();
    if (!empty($all_article_stats)) {
        $first_site_post = isset($all_article_stats['P']) ? $all_article_stats['P']['first_post'] : '';
        $last_site_post = isset($all_article_stats['P']) ? $all_article_stats['P']['last_post'] : '';
        $total_site_post = isset($all_article_stats['P']) ? $all_article_stats['P']['total'] : '';
    }
    $all_comment_stats = get_comments_stats();
    $all_new_comments = get_new_comments();
}
// output aside content
// quick links
$quicklinks = '
		<ul>
			<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=categories">Manage Categories</a></li>
			<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=tags">Manage Tags</a></li>
			<li><a href="' . $_SERVER["PHP_SELF"] . '?page_name=authors">Manage Authors</a></li>
		</ul>
	';
// alternate quicklinks for contributors
if (!empty($_SESSION[WW_SESS]['guest']) && $_SESSION[WW_SESS]['level'] != 'editor') {
    $quicklinks = '
		<ul>
예제 #2
0
					</p>';
    } elseif (isset($_GET['approved']) && empty($initial_content)) {
        $initial_content = empty($_GET['approved']) ? '<h4>Showing disapproved comments only</h4>' : '<h4>Showing approved comments only</h4>';
    } else {
        $initial_content = '<h4>Showing all comments</h4>';
    }
}
// grab whichever comments we need to list
$comments = empty($is_contributor) ? get_comments() : get_comments($_SESSION[WW_SESS]['user_id']);
$total_found = !empty($comments) ? $comments[0]['total_found'] : 0;
$total_pages = !empty($comments) ? $comments[0]['total_pages'] : 0;
// per page - same definition as get_comments()
$per_page = !isset($_GET['per_page']) || empty($_GET['per_page']) ? 15 : (int) $_GET['per_page'];
// get aside content
// get list of comment stats and articles
$comment_stats = empty($is_contributor) ? get_comments_stats() : get_comments_stats($_SESSION[WW_SESS]['user_id']);
$new_comments = empty($is_contributor) ? get_new_comments() : get_new_comments($_SESSION[WW_SESS]['user_id']);
// output main content - into $main_content variable
$main_content = show_page_header('Comments', $right_text);
$main_content .= isset($initial_content) ? $initial_content : '';
$main_content .= build_admin_comment_listing($comments);
if ($total_found > $per_page) {
    $main_content .= show_admin_listing_nav($total_pages, $per_page);
}
// output aside content - into $aside_content variable
$aside_content = '
			
			<h4><a href="' . $_SERVER["PHP_SELF"] . '?page_name=comments&amp;action=post">post a comment</a></h4>
			<h4>Filter comments</h4>
			<div class="snippet">
			<ul>