예제 #1
0
<?php

$pubc = count(get_posts_list('ACTIVE'));
$drac = count(get_posts_list('DRAFT'));
$trac = count(get_posts_list('INACTIVE'));
$appc = count(get_comments_list('APPROVED'));
$penc = count(get_comments_list('PENDING'));
?>
<aside id="main-navigation">
	<input id="main-controls" name="" type="checkbox">
	<label for="main-controls">
		<p class="top-title">Main Controls</p>
		<section class="nav-wrapper">
            <label class="setting-container">
                <ul>
                    <li><a href="<?php 
echo ADMINURL . '?action=newpost';
?>
">Create new post</a></li>
                </ul>
            </label>
			<input class="side-switch" id="content-switch" name="nav-section" type="radio">
			<label for="content-switch" class="setting-container">
				<p class="setting-title">Posts Manager</p>
				<ul class="setting-options">
					<li><a href="<?php 
echo ADMINURL . '?action=allposts';
?>
">Published Posts (<strong><?php 
echo $pubc;
?>
/**
 * Summary of trash_post
 * @param mixed $post_data 
 */
function trash_post($post_id)
{
    $output = false;
    $posts_list = get_posts_list();
    $new_data = array();
    $i = 0;
    while ($i < count($posts_list)) {
        if ($posts_list[$i]['id'] === $post_id) {
            $posts_list[$i]['status'] = 'INACTIVE';
            break;
        }
        $i++;
    }
    $new_data['posts'] = $posts_list;
    if (write_to_json(CONTENTPATH . 'content.json', $new_data)) {
        $output = true;
    }
    return $output;
}
예제 #3
0
function get_post_sidebar($post_id, $limit)
{
    $output = '';
    $i = 0;
    $posts = get_posts_list('ACTIVE', 'LMOD_DESC');
    if (is_array($posts) && !empty($posts)) {
        $output = '<aside class="related-posts">';
        $output .= '<h3>Keep Reading</h3>';
        foreach ($posts as $post) {
            if ($post['id'] !== (int) $post_id && $i < $limit) {
                $url = get_site_url() . '/blog/' . $post['url'];
                $date = date('Y-m-d', strtotime($post['modified']));
                $output .= '<article id="post-' . $post['id'] . '" class="quick-post">';
                $output .= '<header class="quick-post-header">';
                $output .= '<h1 class="quick-post-title"><a href="' . $url . '">' . $post['title'] . '</a></h1>';
                $output .= '<div class="quick-post-date">';
                $output .= '<p>' . $date . '</p>';
                $output .= '</div>';
                $output .= '</header>';
                $output .= '<footer class="quick-post-footer">';
                $output .= '<a class="quick-post-link" href=""></a>';
                $output .= '</footer>';
                $output .= '</article>';
                $i++;
            }
        }
        $output .= '</aside>';
    }
    return $output;
}
예제 #4
0
echo $_SESSION['ppp'] == 50 ? 'selected' : '';
?>
>50 Posts</option>
							<option value="100" <?php 
echo $_SESSION['ppp'] == 100 ? 'selected' : '';
?>
>100 Posts</option>
					</select>
				</li>
				<li>
					<input class="button mat-button" type="submit" value="Update filters" form="all-posts">
				</li>
                <!-- COMMING SOON -->
                <!--<li>
                    <button class="button red-button mat-button" type="submit" value="<?php 
$x_button;
?>
"><?php 
echo ucfirst($x_button);
?>
 Selected</button>
                </li>-->
			</ul>
		</div>
	</footer>
</article>
<?php 
$_SESSION['pubc'] = count(get_posts_list('ACTIVE'));
$_SESSION['drac'] = count(get_posts_list('DRAFT'));
$_SESSION['trac'] = count(get_posts_list('INACTIVE'));