WordPress.org

Make WordPress Core

Changeset 10668


Ignore:
Timestamp:
02/27/2009 09:22:49 PM (9 years ago)
Author:
ryan
Message:

Display more theme info. see #8652

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/theme-install.css

    r10560 r10668  
     1/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
     2div.star-holder {
     3    position: relative;
     4    height: 19px;
     5    width: 100px;
     6    font-size: 19px;
     7}
     8
     9div.star {
     10    height: 100%;
     11    position: absolute;
     12    top: 0;
     13    left: 0;
     14    background-color: transparent;
     15    letter-spacing: 1ex;
     16    border: none;
     17}
     18
     19.star1 { width: 20%; }
     20.star2 { width: 40%; }
     21.star3 { width: 60%; }
     22.star4 { width: 80%; }
     23.star5 { width: 100%; }
     24
     25.star img, div.star a, div.star a:hover, div.star a:visited {
     26    display: block;
     27    position: absolute;
     28    right: 0;
     29    border: none;
     30    text-decoration: none;
     31}
     32
     33div.star img {
     34    width: 19px;
     35    height: 19px;
     36    border-left: 1px solid #fff;
     37    border-right: 1px solid #fff;
     38}
     39
    140.theme-listing .theme-item {
    241    display: inline-block;
  • trunk/wp-admin/includes/theme-install.php

    r10667 r10668  
    88
    99$themes_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array()),
    10                                 'abbr' => array('title' => array()), 'acronym' => array('title' => array()),
    11                                 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),
    12                                 'div' => array(), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(),
    13                                 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(),
    14                                 'img' => array('src' => array(), 'class' => array(), 'alt' => array()));
     10    'abbr' => array('title' => array()), 'acronym' => array('title' => array()),
     11    'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),
     12    'div' => array(), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(),
     13    'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(),
     14    'img' => array('src' => array(), 'class' => array(), 'alt' => array())
     15);
     16
     17$theme_field_defaults = array( 'description' => true, 'sections' => false, 'tested' => true, 'requires' => true,
     18    'rating' => true, 'downloaded' => true, 'downloadlink' => true, 'last_updated' => true, 'homepage' => true,
     19    'tags' => true, 'num_ratings' => true
     20);
     21 
    1522
    1623/**
     
    6875 */
    6976function install_themes_popular_tags( $args = array() ) {
     77    global $theme_field_defaults;
    7078    if ( !$cache = get_option('wporg_theme_popular_tags') )
    7179        add_option('wporg_theme_popular_tags', array(), '', 'no'); ///No autoload.
     
    7381    if ( $cache && $cache->timeout + 3 * 60 * 60 > time() )
    7482        return $cache->cached;
     83
     84    $args['fields'] = $theme_field_defaults;
    7585
    7686    $tags = themes_api('hot_tags', $args);
     
    116126
    117127    $args['page'] = $page;
     128    $args['fields'] = $theme_field_defaults;
    118129
    119130    $api = themes_api('query_themes', $args);
     
    195206 */
    196207function install_themes_featured($page = 1) {
    197     $args = array('browse' => 'featured', 'page' => $page);
     208    global $theme_field_defaults;
     209    $args = array('browse' => 'featured', 'page' => $page, 'fields' => $theme_field_defaults);
    198210    $api = themes_api('query_themes', $args);
    199211    if ( is_wp_error($api) )
     
    211223 */
    212224function install_themes_popular($page = 1) {
    213     $args = array('browse' => 'popular', 'page' => $page);
     225    global $theme_field_defaults;
     226    $args = array('browse' => 'popular', 'page' => $page, 'fields' => $theme_field_defaults);
    214227    $api = themes_api('query_themes', $args);
    215228    display_themes($api->themes, $api->info['page'], $api->info['pages']);
     
    225238 */
    226239function install_themes_new($page = 1) {
    227     $args = array('browse' => 'new', 'page' => $page);
     240    global $theme_field_defaults;
     241    $args = array('browse' => 'new', 'page' => $page, 'fields' => $theme_field_defaults);
    228242    $api = themes_api('query_themes', $args);
    229243    if ( is_wp_error($api) )
     
    241255 */
    242256function install_themes_updated($page = 1) {
    243     $args = array('browse' => 'updated', 'page' => $page);
     257    global $theme_field_defaults;
     258    $args = array('browse' => 'updated', 'page' => $page, 'fields' => $theme_field_defaults);
    244259    $api = themes_api('query_themes', $args);
    245260    display_themes($api->themes, $api->info['page'], $api->info['pages']);
     
    292307<p><strong><?php _e('Version:') ?></strong> <?php echo wp_kses($theme->version, $themes_allowedtags) ?></p>
    293308<p><strong><?php _e('Author:') ?></strong> <?php echo wp_kses($theme->author, $themes_allowedtags) ?></p>
     309<p><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $theme->last_updated ?>"><?php printf( __('%s ago'), human_time_diff(strtotime($theme->last_updated)) ) ?></span></p>
     310<?php if ( ! empty($theme->requires) ) : ?>         
     311<p><strong><?php _e('Requires WordPress Version:') ?></strong> <?php printf(__('%s or higher'), $theme->requires) ?></p>         
     312<?php endif; if ( ! empty($theme->tested) ) : ?>         
     313<p><strong><?php _e('Compatible up to:') ?></strong> <?php echo $theme->tested ?></p>           
     314<?php endif; if ( !empty($theme->downloaded) ) : ?>
     315<p><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $theme->downloaded), number_format_i18n($theme->downloaded)) ?></p>
     316<?php endif; ?>
     317<div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $theme->num_ratings), number_format_i18n($theme->num_ratings)) ?>">
     318    <div class="star star-rating" style="width: <?php echo attribute_escape($theme->rating) ?>px"></div>
     319    <div class="star star5"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('5 stars') ?>" /></div>
     320    <div class="star star4"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('4 stars') ?>" /></div>
     321    <div class="star star3"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('3 stars') ?>" /></div>
     322    <div class="star star2"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('2 stars') ?>" /></div>
     323    <div class="star star1"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('1 star') ?>" /></div>
     324</div>
    294325</div>
    295326<?php }
  • trunk/wp-includes/script-loader.php

    r10655 r10668  
    446446    $styles->add( 'login', '/wp-admin/css/login.css', array(), '20081210' );
    447447    $styles->add( 'plugin-install', '/wp-admin/css/plugin-install.css', array(), '20081210' );
     448    $styles->add( 'theme-install', '/wp-admin/css/theme-install.css', array(), '20090227' );
    448449    $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
    449450
Note: See TracChangeset for help on using the changeset viewer.