The MU forums have moved to WordPress.org

How to do like An-Archos do (8 posts)

  1. LockeAG
    Member
    Posted 17 years ago #

    http://blogger.an-archos.com/

    I would like to know how to make the Latest Post, RSS and Blogs like show in the web of An-Archos.

    I try with this plug in WPMU Sitewide Feed, but I'm having a lot of troubles trying to make work this plug in

    Hope you someone can help me.

    PD sorry my english is not so good

  2. LockeAG
    Member
    Posted 17 years ago #

    Nobody? :(

  3. zeug
    Member
    Posted 17 years ago #

    Hi LockeAG,

    I just trawl this forum and the mu core files for example code then hack bits together like:

    $blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE blog_id!='1' AND last_updated!='0000-00-00 00:00:00' ORDER BY last_updated DESC LIMIT 50");
    foreach ($blogs as $blog) :
    // we need _posts and _options tables for this to work
    $blogOptionsTable = "wp_".$blog."_options";
    $blogPostsTable = "wp_".$blog."_posts";
    $site = $wpdb->get_col("SELECT option_value FROM $blogOptionsTable WHERE option_name='siteurl'");
    $name = $wpdb->get_col("SELECT option_value FROM $blogOptionsTable WHERE option_name='blogname'");
    // we fetch the posttitle for the latest post
    $posttitle = $wpdb->get_col("SELECT post_title FROM $blogPostsTable WHERE post_status = 'publish' AND post_type='post' ORDER BY id DESC LIMIT 0,1");
    // untitled posts get a title
    if ($posttitle[0] == '') { $posttitle[0] = 'Untitled';}
    // we fetch the link for the latest post
    $posturl = $wpdb->get_col("SELECT guid FROM $blogPostsTable WHERE post_status = 'publish' AND post_type='post' ORDER BY id DESC LIMIT 0,1");
    // and now we build the table of latest blog posts
    if ($posttitle[0] == 'Hello world!') { /*ignore Hello world!*/
    } else {
    print "<tr><td><a href='$site[0]' title='$name[0]' target='_blank'>".ucfirst($name[0])."</a></td>n";
    print "<td><a href='$posturl[0]' title='$posturl[0]' target='_blank'>$posttitle[0]</a></td>n";
    print "<td><a href='$site[0]feed' title='$name[0] RSS Feed'><img src='$site[0]wp-content/themes/home/images/feed-icon16x16.png' align='right' alt='$name[0] RSS Feed' /></a></td></tr>n";
    }
    endforeach;

    It's a hack though, more just me finding out how stuff works and seeing what's possible. Use at you own risk as there's no guarantee it won't hose whatever install of the everchanging mu you might have.

    You can also do quite a lot with itdamager's sitewide feed or the "list all posts" plugin, just search around and see what's what.

  4. LockeAG
    Member
    Posted 17 years ago #

    uhm how do I use the code , sorry to newbe, and I'm lerning based on error behind errors

  5. LockeAG
    Member
    Posted 17 years ago #

    I have figure it out, its woderfull 1000% working

    Thanks Zeug

  6. suleiman
    Member
    Posted 17 years ago #

    LockeAG, could you provide a link to your site so we could see it in action?

  7. LockeAG
    Member
    Posted 17 years ago #

  8. suleiman
    Member
    Posted 16 years ago #

    wow, that site is definitely down.

About this Topic

  • Started 17 years ago by LockeAG
  • Latest reply from suleiman