Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter designtoday

    (@designtoday)

    well i scrapped that and started again – i finally got what i was looking for. this is designed to work with feedwordpress plug in so if you want to use it normally change get_syndication_feed_id() to $post->post_author

    hope this helps for anyone else whos been looking for it 🙂

    <?php query_posts('cat=5');
    	global $last_author, $posts_limit; $last_author = ''; $posts_limit=4;
    	while (have_posts()) : the_post(); global $last_author;
            if(get_syndication_feed_id() == $last_author) continue;
    	$last_syn = get_syndication_feed_id();?>
    	<li>h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <small>Posted: <?php the_time('g:i A  F jS Y');?>
                   </small>
           </li>
    
    	<?php global $post, $last_author, $posts_limit; if($posts_limit-- <=0) break; $last_author = get_syndication_feed_id(); ?>
    	<?php endwhile; ?>
    Thread Starter designtoday

    (@designtoday)

    This doesnt seem to work – which doesnt make sense to me 🙁

    $blogusers = the_last_post_per_user();
    if ($blogusers) {
      foreach ($blogusers as $bloguser) {
        $args = array(
        'author' => $bloguser->post_author,
        'showposts' => 1,
    	'caller_get_posts' => 1,
    	'cat'=> 12
        );
    Thread Starter designtoday

    (@designtoday)

    ps code looks like this so far

    <?php
    function the_last_post_per_user(){
    global $wpdb;
    $the_authors = $wpdb->get_results( "
    SELECT DISTINCT ID, post_author
    FROM $wpdb->posts
     INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
    NNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
     WHERE
    1=1
    AND post_status='publish'
    AND wp_term_taxonomy.taxonomy = 'category'
    AND wp_term_taxonomy.term_id IN ('12')
    AND post_type='post'
    AND post_author !='1'
    ORDER BY post_date DESC LIMIT 0, 5");
    return $the_authors;
    }
    
    //get all users, iterate through users, query for one post for the user,
    //if there is a post then display the post title, author, content info
    $blogusers = the_last_post_per_user();
    if ($blogusers) {
      foreach ($blogusers as $bloguser) {
        $args = array(
        'author' => $bloguser->post_author,
        'showposts' => 1,
    	'caller_get_posts' => 5
        );
        $my_query = new WP_Query($args);
    
        if( $my_query->have_posts() ) {
          // $user = get_userdata($bloguser->user_id);
          // echo 'This is one post for author with User ID: ' . $user->ID . ' ' . $user->user_firstname . ' ' . $user->user_lastname;
          while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <ul>
    	<li>
       				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small>
    				Source: <a href="<?php the_syndication_source_link(); ?>"><?php the_syndication_source(); ?></a><br />
                    <?php the_time('F jS, Y');?> <br />
    				<?php the_tags('Location: '); ?><br />
                    <?php the_category(); ?>
                   </small>
           </li>
    </ul>
    
    		<?php
          endwhile;
        }
      }
    }
    ?>
    Thread Starter designtoday

    (@designtoday)

    Ok tried this now only one post comes up repeated 🙁
    oh well at least it picked the correct category – any ideas anyone?

    SELECT DISTINCT ID, post_author
    		FROM $wpdb->posts
    		 INNER JOIN wp_term_relationships
                      ON (wp_posts.ID = wp_term_relationships.object_id)
    		INNER JOIN wp_term_taxonomy
                   ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
    
    	 WHERE
    	1=1
    	AND post_status='publish'
    	 AND wp_term_taxonomy.taxonomy = 'category'
    	AND wp_term_taxonomy.term_id IN ('12')
    	  AND post_type='post'
    	AND post_author !='1'
    	ORDER BY post_date DESC LIMIT 0, 5");
    Thread Starter designtoday

    (@designtoday)

    i think ive tried everything but all i get is errors 🙁

    Is there any version that you guys rolled back too? ive got serious issues with the latest upgrade thats crashed my site with MagpieRSS errors?? 🙁

    Im getting this problem too though im not sure if it happened on an upgrade or not??

Viewing 7 replies - 1 through 7 (of 7 total)