get_results( "SELECT blog_id FROM $wpdb->blogs WHERE public = 1 ORDER BY blog_id ASC" ); $num = count ( $select ); foreach ( $select as $table ) { $return = $wpmuBaseTablePrefix . $table->blog_id . '_posts'; $i++; if ( $i == $num ) { //echo ''; $return .= ''; } elseif ( $i == $num -1 ) { //echo ','; $return .= ','; } else { //echo ','; $return .= ','; } } return $return; } function recent_posts($limit='20') { global $wpdb, $wpmuBaseTablePrefix; echo '

Recent Posts

'; // then we take our new found Id's, convert them to table names and query for our post content $content = $wpdb->get_results( "SELECT * FROM " . realty_front::tables() . " ORDER by 'post_date' DESC LIMIT $limit" ); foreach ( $content as $data ) { $author = $wpdb->get_row( "SELECT * from $wpdb->users WHERE ID = $data->post_author" ); echo '
'; echo '

' . $data->post_title . '

'; echo '

Contributed by ' . $author->display_name . ' posted on ' . mysql2date('F j, Y, g:i a', $data->post_date_gmt) . '

'; echo $data->post_content; echo '

Permalink | Comments

'; echo '
'; } } // and we're done with this bit. function paged_vars() { $rowsPerPage = 5; $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } } function list_posts($num) { global $wpdb, $pageNum, $rowsPerPage, $content; $count = count($content); echo 'The number is ' . $count; } // And now we find the newest post by post_date from all of our 'featured' bloggers function featured_post() { global $wpdb, $wpmuBaseTablePrefix; // first we grab the featured authors, if there are any from the database //$authors = get_option( 'featured_authors' ); $authors = 'wp_1_posts,wp_5_posts,wp_6_posts'; // then we pass that value on to our query so that we can get the most recently published post from these authors $content = $wpdb->get_results( "SELECT * FROM $authors ORDER BY 'post_date' DESC LIMIT 1" ); echo '

Featured Post

'; // the go ahead and display that post foreach ( $content as $data ) { $author = $wpdb->get_row( "SELECT * from $wpdb->users WHERE ID = $data->post_author" ); echo '
'; echo '

' . $data->post_title . '

'; echo '

Contributed by ' . $author->display_name . ' posted on ' . mysql2date('F j, Y, g:i a', $data->post_date_gmt) . '

'; echo $data->post_content; echo '

Permalink | Comments

'; echo '
'; } } } // here we get the id of the blog we need to query against, we then pass it on to the $content query. //$user_info = $wpdb->get_row( "SELECT meta_value FROM user_meta WHERE user_id = $id AND meta_key = 'primary_blog'" ); ?> '; realty_front::recent_posts(); ?>