function blogger_getUserRecentPosts($blogid, $username, $password, $numUserPosts, $checkInPosts) { // Get all the posts from 0->$checkInPosts $posts = blogger_getRecentPosts($blogid, $username, $password, $checkInPosts); if (is_array($posts)) { // get info on the user so we know which ones to filter $user = blogger_getUserInfo($username, $password); $userid = $user["userid"]; // Now pull out each post that belongs to this user, until $numPosts is reached $post_num = 0; $user_posts = array(); foreach ($posts as $post) { if ($post["userid"] == $userid && $post_num < $numUserPosts) { $user_posts[] = $post; } $post_num++; } if (sizeof($user_posts) > 0) { return $user_posts; } else { return false; } } else { return $posts; } }
<ul> <li> <form action="new.php" method="get"> <input type="submit" class="submit" name="go" value="בוא צור" /> <label for="go">פוסט חדש.</label> </form> </li> <li> <form action="edit.php" method="get"> <label for="postid">בחר אחד מה-20 האחרונים:</label><br /> <select name="postid" size="20" id="postslist" style="float: right;"> <?php $posts = blogger_getRecentPosts('n0nick', 'n0nick', N0_PASS, 20); $titles = array(); $first = TRUE; foreach ($posts as $post) { $title = eregi('<title>((.*\\n*)*)</title>', $post['content'], $matches); $title = @$matches[1]; $matches = 0; ?> <option value="<?php echo $post['postid']; ?> "<?if ($first) {?> selected="selected"<?}?>><?php echo $post['postid']; ?> : <?php