Exemple #1
0
function show_latest_posts($nb)
{
    $m = get_latest_post(10);
    ?>
	<div class="box">
		<h3>Dernières news</h3>
		<div class="boxdata">
		<ul>
			<?php 
    for ($i = 0; $i < count($m); $i++) {
        ?>

			<li><a href="<?php 
        echo $m[$i]['path'];
        ?>
" ><?php 
        echo $m[$i]['title'];
        ?>
</a></li>
				
			<?php 
    }
    //end for loop
    ?>
	
		</ul><br style="clear:both" />
	</div>
</div>
	
	
	<?php 
}
Exemple #2
0
         echo get_latest_post();
     } else {
         $post_id = (int) $_GET['post_id'];
         if ($post_id < 1) {
             echo get_latest_post();
         } else {
             echo get_post($post_id);
         }
     }
 } else {
     if ($action == 'get_draft') {
         $post_id = get_var('post_id');
         echo get_draft_json($post_id);
     } else {
         if ($action == 'get_latest_post') {
             echo get_latest_post();
         } else {
             if ($action == 'get_recent_post_listing') {
                 if (!isset($_GET['num_posts'])) {
                     $num_posts = $DEFAULT_NUM_POSTS;
                 } else {
                     $num_posts = (int) $_GET['num_posts'];
                     if ($num_posts < 1) {
                         $num_posts = $DEFAULT_NUM_POSTS;
                     }
                 }
                 echo get_recent_post_listing($num_posts);
             } else {
                 if ($action == 'delete_post') {
                     $post_id = get_var('post_id');
                     echo delete_post($post_id);