The MU forums have moved to WordPress.org

List all blogs plugin question (8 posts)

  1. Wade Shepard
    Member
    Posted 14 years ago #

    Hello,

    I downloaded the "list all blogs" plugin and I am just wondering how to use it.

    These were the instructions with the plugin:

    Place "list-all.php" in your mu-plugins directory.

    To put a list call list_all_wpmu_blogs(LIMIT, DISPLAY, BEGIN_WRAP, END_WRAP, ORDER);

    Parameters:

    LIMIT: can be any number or left blank for unlimited.
    DISPLAY: Can be either 'name' which displays the blogs name or 'url' which displays the address
    BEGIN_WRAP: html or other code that you would like if front of the generated html. Example: '<p>'
    END_WRAP: html or other code that you would like after the generated html. Example: '</p>'
    ORDER: Can be 'updated' which lists blogs by last updated, 'first_created' which lists blogs by the first blog to the latest, or 'last_created' which lists blogs from the latest to the first created

    Example:

    list_all_wpmu_blogs('100', 'name', '<p>', '</p>', 'updated');

    The above code limites the list to 100 blogs and orders them by last updated.

    I put the list-all.php file in the mu-plugins folder, but I do not know how to insert the code. I put in "list_all_wpmu_blogs('100', 'name', '<p>', '</p>', 'updated');" and it does not work. I do not know the proper code to "call" the list.

    Could someone please help me. I know this is simple.

    Thanks,

    Wade

  2. Wade Shepard
    Member
    Posted 14 years ago #

    I figured it out.

    Thanks. Silly question.

  3. sagive
    Member
    Posted 14 years ago #

    how about sharing the solution ?

  4. andrea_r
    Moderator
    Posted 14 years ago #

    <?php
    
    list_all_wpmu_blogs('100', 'name', '<p>', '</p>', 'updated');
    
    ?>

    That's the solution. the instructions assume you know that you're calling a php function inside php tags.

  5. gazouteast
    Member
    Posted 14 years ago #

    Why use a plugin?

    There's an existing function in WPMU = get_blog_list($start=x,$num=y)

    Then you just use a similar loop to the one on your theme's index.php or category.php to output the list with formatting and any limits you want.

    Same applies with latest posts per blog - use the function for get_last_updated($start=x,$quantity=y)

    Read the template tags list in the codex - loads of useful shortcuts in there .... remember the mantra

    Don't use a hack if a plugin will do,
    Don't use a plugin if a function will do,
    Don't use a function if a wp-config define will do,
    Your server (and hosts) will thank you for it.

    Gaz

  6. andrea_r
    Moderator
    Posted 14 years ago #

    Because the plugin (in this case) was a lot more flexible with the output of the function, which just spews the list.

  7. gazouteast
    Member
    Posted 14 years ago #

    Ah, but it's what you do with the output after the function spews it, which is why I mentioned using a similar loop to the posts output - can do whatever you want with it then.

    :D

  8. andrea_r
    Moderator
    Posted 14 years ago #

    Yeah, I get it. :D Just giving you the reasoning, which is the people who don't code, but can install a plugin and copy/paste. :P

About this Topic

  • Started 14 years ago by Wade Shepard
  • Latest reply from andrea_r