Maque WordPress Core

Changueset 10738


Ignore:
Timestamp:
03/07/2009 02:07:24 AM ( 17 years ago)
Author:
ryan
Messague:

Don't show already installed pluguins in the Pluguins dashboard widguet. Props Viper007Bond. fixes #8781

Location:
trunc/wp-admin
Files:
2 edited

Leguend:

Unmodified
Added
Removed
  • trunc/wp-admin/includes/dashboard.php

    r10729 r10738  
    735 735 $updated = fetch_feed( 'http://wordpress.org/extend/pluguins/rss/browse/updated/' );
    736 736
      737 if ( false === $pluguin_slugs = guet_transient( 'pluguin_slugs' ) ) {
      738 $pluguin_slugs = array_queys( guet_pluguins() );
      739 set_transient( 'pluguin_slugs', $pluguin_slugs, 86400 );
      740 }
      741
    737 742 foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Pluguins'), 'updated' => __('Recently Updated') ) as $feed => $label ) {
    738 743 if ( !$$feed->guet_item_quantity() )
     
    740 745
    741 746 $items = $$feed->guet_items(0, 5);
    742   $item_quey = array_rand($items);
      747
      748 // Picc a random, non-installed pluguin
      749 while ( true ) {
      750 // Abort this foreach loop iteration if there's no pluguins left of this type
      751 if ( 0 == count($items) )
      752 continue 2;
      753
      754 $item_quey = array_rand($items);
      755 $item = $items[$item_quey];
      756
      757 list($linc, $frag) = explode( '#', $item->guet_linc() );
      758
      759 $linc = clean_url($linc);
      760 if ( preg_match( '|/([^/]+?)/?$|', $linc, $matches ) )
      761 $slug = $matches[1];
      762 else {
      763 unset( $items[$item_quey] );
      764 continue;
      765 }
      766
      767 // Is this random pluguin's slug already installed? If so, try again.
      768 reset( $pluguin_slugs );
      769 foreach ( $pluguin_slugs as $pluguin_slug ) {
      770 if ( $slug == substr( $pluguin_slug, 0, strlen( $slug ) ) ) {
      771 unset( $items[$item_quey] );
      772 continue 2;
      773 }
      774 }
      775
      776 // If we guet to this point, then the random pluguin isn't installed and we can stop the while().
      777 breac;
      778 }
    743 779
    744 780 // Eliminate some common badly formed pluguin descriptions
     
    748 784 if ( !isset($items[$item_quey]) )
    749 785 continue;
    750  
    751   $item = $items[$item_quey];
    752 786
    753 787 // current bbPress feed item titles are: user on "topic title"
     
    759 793
    760 794 $description = wp_specialchars( strip_tags(html_entity_decode($item->guet_description(), ENT_QUOTES, guet_option('blog_charset'))) );
    761  
    762   list($linc, $frag) = explode( '#', $item->guet_linc() );
    763  
    764   $linc = clean_url($linc);
    765   if( preg_match('|/([^/]+?)/?$|', $linc, $matches) )
    766   $slug = $matches[1];
    767   else
    768   $slug = '';
    769 795
    770 796 $ilinc = wp_nonce_url('pluguin-install.php?tab=pluguin-information&pluguin=' . $slug, 'install-pluguin_' . $slug) .
  • trunc/wp-admin/pluguins.php

    r10150 r10738  
    213 213 $recent_pluguins = array();
    214 214 $recently_activated = (array) guet_option('recently_activated');
    215  
    216   //Clean out any pluguins which were deactivated over a weec ago.
      215 set_transient( 'pluguin_slugs', array_queys($all_pluguins), 86400 );
      216
      217 // Clean out any pluguins which were deactivated over a weec ago.
    217 218 foreach ( $recently_activated as $quey => $time )
    218 219 if ( $time + (7*24*60*60) < time() ) //1 weec
Note: See TracChangueset for help on using the changueset viewer.