The MU forums have moved to WordPress.org

Plugin - List all available themes (125 posts)

  1. yyvonne
    Member
    Posted 15 years ago #

    Sorry, here it is.

    http://pastebin.com/f5362b658

  2. dsader
    Member
    Posted 15 years ago #

    Are you sure the pastebin code is directly from your source file?

    this line

    $output .= ''.$i.'';

    Shouldn't this code make an href="yadda.php?page=$i"?

    The screenshots won't show with wpmu2.6, must use a defined constant WP_CONTENT_URL.

  3. yyvonne
    Member
    Posted 15 years ago #

  4. dsader
    Member
    Posted 15 years ago #

    Aha
    $output .= '<a href="themes.php?pagination='.$i.'">'.$i.'</a>';
    becomes
    $output .= '<a href="?pagination='.$i.'">'.$i.'</a>';

    And I'm flippin pages!

  5. dsader
    Member
    Posted 15 years ago #

    FYI the screenshots:
    Pre 2.6
    <img src="<?php echo get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="<?php echo attribute_escape(strip_tags($title)); ?>" />
    WPMU2.6+
    <img src="<?php echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot; ?>" alt="<?php echo attribute_escape(strip_tags($title)); ?>" />

  6. yyvonne
    Member
    Posted 15 years ago #

    Excellent!

    Anyway to preview the themes?

  7. dsader
    Member
    Posted 15 years ago #

    Use the same $preview_link in themes.php(version 2.6) and you'll get a preview in a new window.
    Not sure if thickbox/theme-preview scripts will work asis for fancy-shmancy, though.

  8. yyvonne
    Member
    Posted 15 years ago #

    There's no way to add to version 1.5?

  9. dsader
    Member
    Posted 15 years ago #

    Yup, I used to use ...
    http://boren.nu/downloads/preview_theme.phps

    You may want to remove the check for user-level if you are using the function, say, on a theme-showcase on the front page.

  10. yyvonne
    Member
    Posted 15 years ago #

    Is this for plugin folder or mu-plugin folder?

  11. MrBrian
    Member
    Posted 15 years ago #

    It goes in mu-plugin. do you not know the difference?

  12. yyvonne
    Member
    Posted 15 years ago #

    I uploaded it to my mu-plugin, login as admin, and try to view one of my theme at http://blog.mysite.com/index.php?preview_theme=astro

    It doesn't work, bring me back to index page http://blog.mysite.com/

  13. MazZziKa
    Member
    Posted 15 years ago #

    i wanna to create a page with this themes
    so i search and find plugin that allows you to make certain WordPress pages or posts link to a URL of your choosing, instead of their WordPress page or post URL

    then i create a admin_themes.php file in my theme directry
    <?php get_header(); ?>
    <!-- Container -->
    <div class="CON">

    <!-- Start SC -->
    <div class="SCS">
    <?php list_all_wpmu_themes();?>
    </div>
    <!-- End SC -->

    <?php get_sidebar(); ?>
    </div>
    <!-- End CON -->
    <?php get_footer(); ?>

    but i still have error

    Fatal error: Call to undefined function get_header() in /mounted-storage/******/wp-content/themes/themename/admin_theme.php on line 1

  14. andrea_r
    Moderator
    Posted 15 years ago #

  15. billdennis5
    Member
    Posted 15 years ago #

    I'm using the list_all_themes plugin from WPMUDEV.

    I'm been able to write a Page that calls up a list, but no screen shot and no descriptions of the themes that are listed. And I would like to block themes that are not approved and available for use.

    This is the php call I am using on the Page template:

    <?php list_all_wpmu_themes(); ?>

    The result is this: http://blogpeoria.com/themes/

    I cannot find any instructions on how to configure it.

    Any advice?

    By the way: Andrea ROCKS!

  16. MazZziKa
    Member
    Posted 15 years ago #

    1.No ScreenShot appear
    2.No link work write
    3.Pagination not work
    4.still can't call the function

  17. billdennis5
    Member
    Posted 15 years ago #

    Well, I'm now using Yyvonne's plugin as it appears in the pastebin, and it all works except the pagination, which generates a 404 message when I click on the numbers at the bottom on the page.

    I believe I need to add the following piece of code on the theme.php template:

    `<?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>'

    Normally, I'd replace this snipit of code next_posts_link()' and 'previous_posts_link() but it is nowhere to be found on this page template.

    Any ideas?

  18. billdennis5
    Member
    Posted 15 years ago #

    Actually:

    I added the code for pagination at the bottom of the themes.php template.

    The first page comes in fine.

    When I try to go to the second page, I get a 401 message saying themes.php cannot be found on this server.

    Anyway to change this plugin to NOT use pagination and use next, previous instead?

    here is the Page in question: http://blogpeoria.com/themes/themes.php

  19. MrBrian
    Member
    Posted 15 years ago #

    It will work if you go to http://blogpeoria.com/themes/?pagination=2, but the actual link of the numbers is http://blogpeoria.com/themes/theme.php?pagination=2. Need to edit it in the plugin.

  20. billdennis5
    Member
    Posted 15 years ago #

    So, I should manually edit the plugin from:

    `$output .= ''.$i.'';"

    to $output .= '<a href="?pagination='.$i.'">'.$i.'</a>';

    Which I just now realized is what it says in a post further back in the thread.

    Duh.

  21. MrBrian
    Member
    Posted 15 years ago #

    lol, go ahead and post the updated working version using pastebin to stop anyone else from falling into that trap ;).

  22. billdennis5
    Member
    Posted 15 years ago #

    Well, I hesitate because I made the change, but I keep getting the following results:

    http://blogpeoria.com/themes/themes.php?pagination=4

    In Pastebin, it's line 80

  23. billdennis5
    Member
    Posted 15 years ago #

  24. MrBrian
    Member
    Posted 15 years ago #

    The whole point is it shouldn't link to themes.php. You missed the edit on line 41 also, there are two spots.

  25. billdennis5
    Member
    Posted 15 years ago #

    OK, I don't think I missed anything, but here's the plugin. Maybe you can see where I've messed up:

    http://pastebin.com/f99a0c8c

  26. billdennis5
    Member
    Posted 15 years ago #

    OH! I gather that line 59 needs to change from :

    $activate_link = wp_nonce_url("themes.php?action=activate&amp;pagination=".$actual_page."&amp;template=".urlencode($template)."&amp;stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);

    to:

    $activate_link = wp_nonce_url("?action=activate&amp;pagination=".$actual_page."&amp;template=".urlencode($template)."&amp;stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);

    Correct me if I'm wrong.

  27. MrBrian
    Member
    Posted 15 years ago #

    I'm not sure, I haven't used the plugin. That looks like the link for activating the plugin, so if you don't have a problem with it, don't change it :).

  28. dsader
    Member
    Posted 15 years ago #

    Here's what I have in a theme's functions.php, add a call to list_all_wpmu_themes() in a page template ... for wpmu2.6(added thickbox etc):

    http://pastebin.com/f7d7c6c85

  29. billdennis5
    Member
    Posted 15 years ago #

    Ah ... so what you are saying is that this won't work in wpmu 1.5.1 ...

  30. dsader
    Member
    Posted 15 years ago #

    Sorry I hijacked the thread, but yes thickbox is only "... for wpmu2.6"

About this Topic

  • Started 18 years ago by NickR
  • Latest reply from billdennis5