The MU forums have moved to WordPress.org

List All Posts plugin shows up nothing (29 posts)

  1. animation
    Member
    Posted 18 years ago #

    I'm using the list all posts plugin to call up the blog posts.
    <?php list_all_wpmu_posts(20, 200, '', '', '<h3>', '</h3>','show','show','show'); ?>

    but nuthin shows up in the page,I tried to add up some more posts,still none post appeared.Is there anyone once faced the same problem or got some ideas about it?

    TIA

  2. mrjcleaver
    Member
    Posted 18 years ago #

    Ensure your individual blogs have have ticked this Option:

    "Search Engines: I would like my blog to appear in search engines like Google and Technorati, and in public listings around WordPress.com. (more)" .

    I admit this label is somewhat misleading. If you object to hacking your core WPMU files, maybe you can change your localisation file?

  3. animation
    Member
    Posted 18 years ago #

    thanx mrjcleaver,after ticked the privacy option,that works...

  4. mrjcleaver
    Member
    Posted 18 years ago #

  5. drmike
    Member
    Posted 18 years ago #

    *chuckle* That's when you impress your clients with your wonderful customer service skills when you explain it to them.

  6. andrea_r
    Moderator
    Posted 18 years ago #

    I thought it was pretty clear.

  7. andrewbillits
    Member
    Posted 18 years ago #

    Apparently it's not all that clear. I get one or two emails a week asking the same question as animation.

  8. kahless
    Member
    Posted 18 years ago #

    Well, here is a better one. In my blog http://blogs.wooster.edu the recent posts show but the links are incorrect and point back to http://blogs.wooster.edu instead of the blog for the post. The two up now are both Hello world! posts and I don't know if that is the reason. Can we get it to ignore Hello world!?

  9. mrjcleaver
    Member
    Posted 18 years ago #

  10. kahless
    Member
    Posted 18 years ago #

    Really hard trying to decipher the stuff in the chat. It refers to wpmufeeds which this is not. Are you saying the solution for the feeds works for this? Or do they spell out exactly what to do somewhere? Am I supposed to alter the blog $blog_list query to exclude Hello world!?

  11. mrjcleaver
    Member
    Posted 18 years ago #

    Ok. Two things: 1) You don't like the Hello World default posts. You are not alone: we've asked for this to be a config option. http://codex.wordpress.org/WPMU_Commonly_Edited_Core_Files

    The 2nd) deeper problem is that 'list all posts' does not list permalinks of the posts, it shows the URLs names of the blogs containing those posts. So instead of returning blog1.site.com/permalink1 and blog2.site.com/permalink2, it just returns blog1.site.com and blog2.site.com; that's what the conversation was about.

  12. kahless
    Member
    Posted 18 years ago #

    mrjcleaver,

    OK. One problem. Mine is not pointing to blog1.domain.tld but to domain.tld for the Hello world! posts. I think for regular posts it points to blog1.domain.tld as it is supposed to, so I am trying to figure out why only the Hello world! posts have the incorrect URL. Any thoughts? I looked through list-all-posts and I think there must be a different way to do this. Looking at the login form hacks which pull the blogs of the current user and some of the other list type hacks I just feel like there has to be a different approach. It is highly likely I am missing something which really complicates this. But I wonder if anyone else thinks there is a different approach that might be simpler.

  13. mrjcleaver
    Member
    Posted 18 years ago #

    I'm currently on http://codex.wordpress.org/WPMU_IRC_Channel - can you join?

  14. kahless
    Member
    Posted 18 years ago #

    Not right now. But I can say that I updated a blog with a real post and list-all-posts is linking to the permalink of the post, which others have indicated it doesn't do.

  15. andrea_r
    Moderator
    Posted 18 years ago #

    kahless, I use my own code to grab the most recent posts instead of the list all plugin. See main page here:
    http;//homeschooljournal.net
    (scroll down)

    I'd be happy to send you/pastebin the code.

  16. kahless
    Member
    Posted 18 years ago #

    andrea_r,

    That would be great.

    For those interested you can get it to ignore the Hello world! posts. After $tmp_path in list-all-post I replaced the next 10 lines with
    if ($tmp_post_title == 'Hello world!') { /*ignore Hello world!*/
    } else {
    echo $title_begin_wrap . "<a href='" . $tmp_post_guid . "'>" . $tmp_post_title $
    if ($word_limit == '') {
    echo $begin_wrap . strip_tags($tmp_post_content) . $end_wrap; $
    } else {
    if ($read_more == 'show') {
    echo $begin_wrap . strip_tags(list_all_posts_summary($tmp_post_$
    } else {
    echo $begin_wrap . strip_tags(list_all_posts_summary($tmp_post_$
    }
    }
    }

    But this will not obey the number of recent post setting as the Hello world!s were part of the count. So if you want the 10 most recent and 5 of them are Hello world! you'll only get 5 recent posts.

  17. andrea_r
    Moderator
    Posted 18 years ago #

    Here it is as a plugin. Scrape and change extension to .php, dump in MU folder.
    http://www.atypicalhomeschool.net/wordpress-plugins/ah-recent-posts-mu.txt

    (How do I stick this on WPMUdev.org?)

  18. kahless
    Member
    Posted 18 years ago #

    Cool, thanks. Have you tried adding AND post_title != 'Hello world!' in the $thispost query? Just curious. I'll try it my self.

  19. andrea_r
    Moderator
    Posted 18 years ago #

    Go ahead and try. :) I know it purposely skips the hello world posts. And it also updates the list if the post is updated with a new comment.

  20. kahless
    Member
    Posted 18 years ago #

    Even if you've removed the code to update the blog update time from comments?

  21. andrea_r
    Moderator
    Posted 18 years ago #

    Dunno. I haven't done that. (yet - been busy.)

  22. kahless
    Member
    Posted 18 years ago #

    Andrea_r,

    Interesting. Even yours shows Hello world! and the link on the post title for Hello world! goes to the main blog and not userblog.domain.tld. Is it something about my setup?

  23. andrea_r
    Moderator
    Posted 18 years ago #

    I'm guessing that yeah, it's something with your setup because that is weird. Dunno what it could be though. ;-/ My code there has been running on my site like that for quite some time, with a fiar number of signups, and never once has shown the Hello World ones. like I said, odd.

  24. designmission
    Member
    Posted 18 years ago #

    I've hacked the list-all-posts.php file in two ways:

    1. To remove the "Hello world!" posts from the lists

    2. To make certain that posts that are published as private do not get listed here. They were...

    Here's what I did:

    The Hello World fix -

    Add:

    if ($tmp_post_title != 'Hello world!')

    just above the line with ->

    if ($show_blog == "show"){

    You'll need to add another closing bracket before the end of the function. I put mine above the final four }'s above
    the line for function list_all_wpmu_posts.

    Private Post fix -

    Add -

    AND post_status = 'publish' to the three tmp queries.

    $tmp_post_content = $wpdb->get_var("SELECT post_content FROM " . "wp_" . $bid . "_posts" . " WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC");
    $tmp_post_title = $wpdb->get_var("SELECT post_title FROM " . "wp_" . $bid . "_posts" . " WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC");
    $tmp_post_author_id = $wpdb->get_var("SELECT post_author FROM " . "wp_" . $bid . "_posts" . " WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC");

    This worked for me.

  25. designmission
    Member
    Posted 18 years ago #

    One MORE thing - I made the checkbox for "Search Engines: I would like my blog to appear in search engines like Google and Technorati, and in public listings around WordPress.com. (more)" a hidden field that is indeed checked. Since we're running a public website, this seemed reasonable. Private posts are still private and that is what matters more.

  26. parakeet
    Member
    Posted 17 years ago #

    I have this plugin installed but all of my networks blogs are private (the entire site is private).

    Please could someone help me come up with a fix so that private blogs' entries ARE listed?

    Thanks v much.

  27. parakeet
    Member
    Posted 17 years ago #

    Okay, so I see this line...

    $blog_list = $wpdb->get_results( "SELECT blog_id, last_updated FROM " . $wpdb->blogs. " WHERE public = '1' " . $order . " " . $limit . "", ARRAY_A );

    ... that looks intriguing. If you switch the 1 to a 0, you see posts only from blogs that are not public. How in SQL would you say "either 0 or 1"?

    More importantly, however, I'm witnessing mrjcleaver's earlier problem - whether I display public or private posts, the link only points to the blog root url, not the post permalink url.

    Any ideas on that please?

  28. parakeet
    Member
    Posted 17 years ago #

    Okay, I think I've cracked the problem of 1) the list-all-posts plugin pointing to the blog root and not the permalink, and 2) the problem where posts to private blogs are not shown. I wanted to put this information in the public domain for anyone else (and for my own future benefit!)...

    *1. Getting feeds to point to permalinks...*

    Open up list-all-posts.php.
    The function echoArrayPostList goes to the database and fetches back a number of fields from both the options table, the posts table, etc. You'll see (line 63) it fetches siteurl, which is self-explanatory - but it doesn't fetch guid, which is the technical way of saying "permalink". You need to add the following line after the siteurl fetch...

    $tmp_guid = $wpdb->get_var("SELECT guid FROM " . "wp_" . $bid . "_posts" . " WHERE post_type = 'post' ORDER BY post_date_gmt DESC");

    You now have the permalink to play with. To correct the output, find this line...

    echo $title_begin_wrap . "" . $tmp_post_title . "" . $info . $title_end_wrap;

    and swap it for this...

    echo $title_begin_wrap . "" . $tmp_post_title . "" . $info . $title_end_wrap;

    That uses the permalink rather than the siteurl.

    *2. Listing private posts....*

    Scroll down to the end of the plugin code. You'll see this line...

    $blog_list = $wpdb->get_results( "SELECT blog_id, last_updated FROM " . $wpdb->blogs. " WHERE public = '1' . $order . " "

    To output both public and private posts, modify as follows...

    $blog_list = $wpdb->get_results( "SELECT blog_id, last_updated FROM " . $wpdb->blogs. " WHERE public = '1' OR public = '0' " . $order . " "

    Now it's time to play with this thing...

  29. parakeet
    Member
    Posted 17 years ago #

    Is this a bug... ? Upon saving a privacy setting for one of my blogs, its latest entry jumps to the top of my list of ALL latest entries, even though - by date - it is not the most recent at all - there are newer!!

About this Topic

  • Started 18 years ago by animation
  • Latest reply from parakeet