The MU forums have moved to WordPress.org

Fake RSS (7 posts)

  1. peiqinglong
    Member
    Posted 16 years ago #

    I can conceptually visualize this, but can't quite put it down in code. I have an internal WPMU site that is using Windows Active Directory DNS to serve the fake domain so that only users inside my Forest can access the site. I also have sub domain sites for all the individual units in our company.

    We want to display the 5 latest posts from each of the subdomain sites. I know the best choice would be to use the RSS widgets and call it a day. Unfortunately, because of the tricky DNS issues, the subdomain RSS feeds don't always work and we need a higher level of reliability.

    So what I was thinking was, couldn't I hardcode a query on the main site for each of the blogs and pull up the latest 5 posts? Basically I want to do what the RSS widgets do, but for reliability purposes I want to directly query the database.

    I've tried searching and most people are trying to accomplish Latest Posts from all blogs in one feed. Thanks for any help!

  2. andrea_r
    Moderator
    Posted 16 years ago #

    "couldn't I hardcode a query on the main site for each of the blogs and pull up the latest 5 posts?"

    Well, yeah. That's what the most recent posts plugins do. :)

    http://wpmudevorg.wordpress.com, check under Projects.

  3. peiqinglong
    Member
    Posted 16 years ago #

    Andrea, thanks for the response! Your most recent posts plugin is almost everything I want, but this is exactly what I'm looking for, except it doesn't work:

    $blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY) ORDER BY last_updated DESC");

    I want to select a specific blog and pull posts from that specific blog only.

  4. andrea_r
    Moderator
    Posted 16 years ago #

    Take the blog_id an put in the ID of the specific blog you want?

  5. peiqinglong
    Member
    Posted 16 years ago #

    I tried that. Didn't work :(

  6. andrea_r
    Moderator
    Posted 16 years ago #

    Gimmie a bit so I can hassle the mister when he comes home from work.

  7. peiqinglong
    Member
    Posted 16 years ago #

    Thanks Andrea!

About this Topic

  • Started 16 years ago by peiqinglong
  • Latest reply from peiqinglong