<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[1156] sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes: WP.org Themes: Improve server-side rendering of themes.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/1156">1156</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/1156","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>obenland</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-01-16 22:48:01 +0000 (Fri, 16 Jan 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WP.org Themes: Improve server-side rendering of themes.
* Takes into account all possible views.
* Actually render markup for single themes.
See <a href="http://meta.trac.wordpress.org/ticket/745">#745</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentsinglephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesindexphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemessinglephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentsinglephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php 2015-01-16 18:05:10 UTC (rev 1155)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php 2015-01-16 22:48:01 UTC (rev 1156)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,171 +1,166 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-include ABSPATH . 'wp-admin/includes/theme.php';
-$theme = themes_api( 'theme_information', array( 'slug' => get_post()->post_name ) );
-?>
-<div id="themes" class="wrap">
- <div class="theme-wrap">
- <div class="theme-about">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php global $theme; ?>
+<div class="theme-wrap">
+ <div class="theme-about">
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( strtotime( '-2 years' ) > strtotime( $theme->last_updated ) ) : ?>
- <div class="theme-notice notice notice-warning">
- <p><?php _e( 'This theme <strong>hasn’t been updated in over 2 years</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-themes' ); ?></p>
- </div><!-- .theme-info -->
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( strtotime( '-2 years' ) > strtotime( $theme->last_updated ) ) : ?>
+ <div class="theme-notice notice notice-warning">
+ <p><?php _e( 'This theme <strong>hasn’t been updated in over 2 years</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-themes' ); ?></p>
+ </div><!-- .theme-info -->
+ <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-screenshots">
- <div class="screenshot"><?php the_post_thumbnail(); ?></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-screenshots">
+ <div class="screenshot"><?php the_post_thumbnail(); ?></div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-actions">
- <a href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>" class="button button-primary"><?php _e( 'Download' ); ?></a>
- <a href="<?php echo esc_url( $theme->preview_url ); ?>" class="button button-secondary"><?php _e( 'Preview' ); ?></a>
- </div>
- </div><!-- .theme-screenshots -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-actions">
+ <a href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>" class="button button-primary"><?php _e( 'Download' ); ?></a>
+ <a href="<?php echo esc_url( $theme->preview_url ); ?>" class="button button-secondary"><?php _e( 'Preview' ); ?></a>
+ </div>
+ </div><!-- .theme-screenshots -->
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-info">
- <div class="hentry">
- <h3 class="theme-name entry-title"><?php the_title(); ?></h3>
- <span class="theme-version">
- <?php
- printf( __( 'Version: %s' ),
- sprintf( '<abbr title="%1$s">%2$s</abbr>',
- esc_attr( sprintf( __( 'Last updated: %s' ), date_i18n( get_option( 'date_format' ), strtotime( $theme->last_updated ) ) ) ),
- $theme->version
- )
- );
- ?>
- </span>
- <h4 class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></h4>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-info">
+ <div class="hentry">
+ <h3 class="theme-name entry-title"><?php the_title(); ?></h3>
+ <span class="theme-version">
+ <?php
+ printf( __( 'Version: %s' ),
+ sprintf( '<abbr title="%1$s">%2$s</abbr>',
+ esc_attr( sprintf( __( 'Last updated: %s' ), date_i18n( get_option( 'date_format' ), strtotime( $theme->last_updated ) ) ) ),
+ $theme->version
+ )
+ );
+ ?>
+ </span>
+ <h4 class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></h4>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-description entry-summary"><?php the_content(); ?></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-description entry-summary"><?php the_content(); ?></div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( ! empty( $theme->parent ) ) : ?>
- <div class="theme-notice notice notice-info">
- <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), sprintf( '<a href="/%1$s">%2$s</a>', $theme->parent->slug, $theme->parent->name ) ); ?></p>
- </div>
- <?php endif; ?>
- </div><!-- .theme-info -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( ! empty( $theme->parent ) ) : ?>
+ <div class="theme-notice notice notice-info">
+ <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), sprintf( '<a href="/%1$s">%2$s</a>', $theme->parent->slug, $theme->parent->name ) ); ?></p>
+ </div>
+ <?php endif; ?>
+ </div><!-- .theme-info -->
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-ratings" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
- <meta itemprop="ratingValue" content="<?php echo esc_attr( number_format_i18n( $theme->rating / 20, 1 ) ); ?>"/>
- <meta itemprop="ratingCount" content="<?php echo esc_attr( $theme->num_ratings ); ?>"/>
- <h4><?php _e( 'Ratings', 'wporg-themes' ); ?></h4>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-ratings" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
+ <meta itemprop="ratingValue" content="<?php echo esc_attr( number_format_i18n( $theme->rating / 20, 1 ) ); ?>"/>
+ <meta itemprop="ratingCount" content="<?php echo esc_attr( $theme->num_ratings ); ?>"/>
+ <h4><?php _e( 'Ratings', 'wporg-themes' ); ?></h4>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="star-holder">
- <div class="star-rating" style="width: <?php echo esc_attr( number_format_i18n( $theme->rating, 1 ) ); ?>%">
- <?php printf( __( '%d stars', 'wporg-themes' ), number_format_i18n( $theme->rating / 20 ) ); ?>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="star-holder">
+ <div class="star-rating" style="width: <?php echo esc_attr( number_format_i18n( $theme->rating, 1 ) ); ?>%">
+ <?php printf( __( '%d stars', 'wporg-themes' ), number_format_i18n( $theme->rating / 20 ) ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), number_format_i18n( $theme->rating / 20, 1 ) ); ?></span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </div>
+ <span><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), number_format_i18n( $theme->rating / 20, 1 ) ); ?></span>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php
- if ( ! empty( $theme->ratings ) ) :
- foreach ( $theme->ratings as $key => $rate_count ) :
- ?>
- <div class="counter-container">
- <a href="//wordpress.org/support/view/theme-reviews/<?php echo esc_attr( $theme->slug ); ?>?filter=<?php echo $key; ?>" title="<?php printf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key, 'wporg-themes' ), $key ); ?>">
- <span class="counter-label"><?php printf( __( '%d stars', 'wporg-themes' ), $key ); ?></span>
- <span class="counter-back">
- <span class="counter-bar" style="width: <?php echo 92 * ( $rate_count / $theme->num_ratings ); ?>px;"></span>
- </span>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( ! empty( $theme->ratings ) && ! empty( $theme->num_ratings ) ) :
+ foreach ( $theme->ratings as $key => $rate_count ) :
+ ?>
+ <div class="counter-container">
+ <a href="//wordpress.org/support/view/theme-reviews/<?php echo esc_attr( $theme->slug ); ?>?filter=<?php echo $key; ?>" title="<?php printf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key, 'wporg-themes' ), $key ); ?>">
+ <span class="counter-label"><?php printf( __( '%d stars', 'wporg-themes' ), $key ); ?></span>
+ <span class="counter-back">
+ <span class="counter-bar" style="width: <?php echo 92 * ( $rate_count / $theme->num_ratings ); ?>px;"></span>
+ </span>
+ </a>
+ <span class="counter-count"><?php echo $rate_count; ?></span>
+ </div>
+ <?php
+ endforeach;
+ endif;
+ ?>
+ </div><!-- .theme-rating -->
+
+ <div class="theme-devs">
+ <h4><?php _e( 'Development', 'wporg-themes' ); ?></h4>
+ <h5><?php _e( 'Subscribe', 'wporg-themes' ); ?></h5>
+ <ul class="unmarked-list">
+ <li>
+ <a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $theme->slug ); ?>?limit=100&mode=stop_on_copy&format=rss">
+ <img src="//s.w.org/style/images/feedicon.png" style="vertical-align:text-top;"/>
+ <?php _e( 'Development Log', 'wporg' ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </a>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <span class="counter-count"><?php echo $rate_count; ?></span>
- </div>
- <?php
- endforeach;
- endif;
- ?>
- </div><!-- .theme-rating -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </li>
+ </ul>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-devs">
- <h4><?php _e( 'Development', 'wporg-themes' ); ?></h4>
- <h5><?php _e( 'Subscribe', 'wporg-themes' ); ?></h5>
- <ul class="unmarked-list">
- <li>
- <a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $theme->slug ); ?>?limit=100&mode=stop_on_copy&format=rss">
- <img src="//s.w.org/style/images/feedicon.png" style="vertical-align:text-top;"/>
- <?php _e( 'Development Log', 'wporg' ); ?>
- </a>
- </li>
- </ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <h5><?php _e( 'Browse the Code', 'wporg-themes' ); ?></h5>
+ <ul class="unmarked-list">
+ <li><a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Development Log', 'wporg-themes' ); ?></a></li>
+ <li><a href="//themes.svn.wordpress.org/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-themes' ); ?></a></li>
+ <li><a href="//themes.trac.wordpress.org/browser/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-themes' ); ?></a></li>
+ </ul>
+ </div><!-- .theme-devs -->
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <h5><?php _e( 'Browse the Code', 'wporg-themes' ); ?></h5>
- <ul class="unmarked-list">
- <li><a href="//themes.trac.wordpress.org/log/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Development Log', 'wporg-themes' ); ?></a></li>
- <li><a href="//themes.svn.wordpress.org/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-themes' ); ?></a></li>
- <li><a href="//themes.trac.wordpress.org/browser/<?php echo esc_attr( $theme->slug ); ?>/" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-themes' ); ?></a></li>
- </ul>
- </div><!-- .theme-devs -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-downloads">
+ <h4><?php _e( 'Downloads', 'wporg-themes' ); ?></h4>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-downloads">
- <h4><?php _e( 'Downloads', 'wporg-themes' ); ?></h4>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div id="theme-download-stats-<?php echo esc_attr( $theme->slug ); ?>" class="chart"></div>
+ <script type="text/javascript">
+ google.load("visualization", "1", {packages:["corechart"]});
+ google.setOnLoadCallback(drawThemeDownloadsChart);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div id="theme-download-stats-<?php echo esc_attr( $theme->slug ); ?>" class="chart"></div>
- <script type="text/javascript">
- google.load("visualization", "1", {packages:["corechart"]});
- google.setOnLoadCallback(drawThemeDownloadsChart);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function drawThemeDownloadsChart() {
+ jQuery(document).ready(function($){
+ jQuery.getJSON('https://api.wordpress.org/stats/themes/1.0/downloads.php?slug=<?php echo $theme->slug; ?>&limit=267&callback=?', function (downloads) {
+ var data = new google.visualization.DataTable(),
+ count = 0,
+ sml;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function drawThemeDownloadsChart() {
- jQuery(document).ready(function($){
- jQuery.getJSON('https://api.wordpress.org/stats/themes/1.0/downloads.php?slug=<?php echo $theme->slug; ?>&limit=267&callback=?', function (downloads) {
- var data = new google.visualization.DataTable(),
- count = 0,
- sml;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ data.addColumn('string', _wpThemeSettings.l10n.date);
+ data.addColumn('number', _wpThemeSettings.l10n.downloads);
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- data.addColumn('string', _wpThemeSettings.l10n.date);
- data.addColumn('number', _wpThemeSettings.l10n.downloads);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $.each(downloads, function (key, value) {
+ data.addRow();
+ data.setValue(count, 0, new Date(key).toLocaleDateString() );
+ data.setValue(count, 1, Number(value));
+ count++;
+ });
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $.each(downloads, function (key, value) {
- data.addRow();
- data.setValue(count, 0, new Date(key).toLocaleDateString() );
- data.setValue(count, 1, Number(value));
- count++;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ sml = data.getNumberOfRows() < 225;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sml = data.getNumberOfRows() < 225;
-
- new google.visualization.ColumnChart(document.getElementById('theme-download-stats-<?php echo esc_attr( $theme->slug ); ?>')).draw(data, {
- colors: ['#253578'],
- legend: {
- position: 'none'
- },
- titlePosition: 'in',
- axisTitlesPosition: 'in',
- chartArea: {
- height: 280,
- left: sml ? 30 : 0,
- width: sml ? '80%' : '100%'
- },
- hAxis: {
- textStyle: {color: 'black', fontSize: 9}
- },
- vAxis: {
- format: '###,###',
- textPosition: sml ? 'out' : 'in',
- viewWindowMode: 'explicit',
- viewWindow: {min: 0}
- },
- bar: {
- groupWidth: ( data.getNumberOfRows() > 100 ) ? "100%" : null
- },
- height: 350
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ new google.visualization.ColumnChart(document.getElementById('theme-download-stats-<?php echo esc_attr( $theme->slug ); ?>')).draw(data, {
+ colors: ['#253578'],
+ legend: {
+ position: 'none'
+ },
+ titlePosition: 'in',
+ axisTitlesPosition: 'in',
+ chartArea: {
+ height: 280,
+ left: sml ? 30 : 0,
+ width: sml ? '80%' : '100%'
+ },
+ hAxis: {
+ textStyle: {color: 'black', fontSize: 9}
+ },
+ vAxis: {
+ format: '###,###',
+ textPosition: sml ? 'out' : 'in',
+ viewWindowMode: 'explicit',
+ viewWindow: {min: 0}
+ },
+ bar: {
+ groupWidth: ( data.getNumberOfRows() > 100 ) ? "100%" : null
+ },
+ height: 350
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- </script>
- <p class="total-downloads"><?php printf( __( 'Total downloads: %s' ), '<strong>' . number_format_i18n( $theme->downloaded ) . '</strong>' ); ?></p>
- </div><!-- .theme-downloads -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ </script>
+ <p class="total-downloads"><?php printf( __( 'Total downloads: %s' ), '<strong>' . number_format_i18n( $theme->downloaded ) . '</strong>' ); ?></p>
+ </div><!-- .theme-downloads -->
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="theme-tags">
- <h4><?php _e( 'Tags:' ); ?></h4>
- <?php
- foreach( $theme->tags as &$tag ) :
- $tag = sprintf( '<a href="/tag/%1$s/">%1$s</a>', $tag );
- endforeach;
- echo implode( ', ', $theme->tags );
- ?>
- </div><!-- .theme-tags -->
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="theme-tags">
+ <h4><?php _e( 'Tags:' ); ?></h4>
+ <?php
+ foreach( $theme->tags as &$tag ) :
+ $tag = sprintf( '<a href="/tag/%1$s/">%1$s</a>', $tag );
+ endforeach;
+ echo implode( ', ', $theme->tags );
+ ?>
+ </div><!-- .theme-tags -->
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php 2015-01-16 18:05:10 UTC (rev 1155)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php 2015-01-16 22:48:01 UTC (rev 1156)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * as indicating support for post thumbnails.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_themes_setup() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $themes_allowedtags, $theme_field_defaults;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $themes_allowedtags;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> load_theme_textdomain( 'wporg-themes' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,24 +50,68 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'h6' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'img' => array( 'src' => array(), 'class' => array(), 'alt' => array() ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $theme_field_defaults = array(
- 'description' => true,
- 'sections' => false,
- 'tested' => true,
- 'requires' => true,
- 'rating' => true,
- 'downloaded' => true,
- 'downloadlink' => true,
- 'last_updated' => true,
- 'homepage' => true,
- 'tags' => true,
- 'num_ratings' => true,
- );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'after_setup_theme', 'wporg_themes_setup' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Makes an API request to retrieve the right themes for the current query.
+ *
+ * @param WP_Query $query
+ * @return WP_Query
+ */
+function wporg_themes_set_up_query( $query ) {
+ if ( ! is_admin() && ! in_array( $query->query_vars['pagename'], array( 'upload', 'commercial' ) ) ) {
+
+ $query->set( 'post_type', 'repopackage' );
+
+ $args = array(
+ 'per_page' => 15,
+ 'fields' => array(
+ 'description' => true,
+ 'sections' => false,
+ 'tested' => true,
+ 'requires' => true,
+ 'rating' => true,
+ 'downloaded' => true,
+ 'downloadlink' => true,
+ 'last_updated' => true,
+ 'homepage' => true,
+ 'tags' => true,
+ 'num_ratings' => true,
+ 'parent' => true,
+ ),
+ );
+
+ if ( $query->query_vars['tag'] ) {
+ $args['tag'][] = $query->query_vars['tag'];
+ }
+ elseif ( $query->query_vars['author_name'] ) {
+ $args['author'] = $query->query_vars['author_name'];
+ }
+ elseif ( $query->query_vars['pagename'] ) {
+ $slugs = explode( '/', $query->query_vars['pagename'] );
+
+ if ( count( $slugs ) > 1 && 'browse' == $slugs[0] ) {
+ $args['browse'] = $slugs[1];
+ } else {
+ $args['theme'] = $slugs[0];
+ }
+ }
+ else {
+ $args['browse'] = 'featured';
+ }
+
+ if ( ! function_exists( 'themes_api' ) ) {
+ include ABSPATH . 'wp-admin/includes/theme.php';
+ }
+ $GLOBALS['themes'] = themes_api( 'query_themes', $args );
+ }
+
+ return $query;
+}
+add_filter( 'pre_get_posts', 'wporg_themes_set_up_query' );
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Enqueue scripts and styles.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_themes_scripts() {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php 2015-01-16 18:05:10 UTC (rev 1155)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php 2015-01-16 22:48:01 UTC (rev 1156)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,31 +11,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @package wporg-themes
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-include ABSPATH . 'wp-admin/includes/theme.php';
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$args = array(
- 'per_page' => 15,
- 'fields' => array_merge( $GLOBALS['theme_field_defaults'], array(
- 'parent' => true,
- ) ),
-);
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( get_query_var( 'tag' ) ) {
- $args['tag'][] = get_query_var( 'tag' );
-}
-elseif ( get_query_var( 'author_name' ) ) {
- $args['author'] = get_query_var( 'author_name' );
-}
-else {
- $args['browse'] = 'featured';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+get_header();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( get_query_var( 'name' ), array( 'featured', 'popular', 'new' ) ) ) {
- $args['browse'] = get_query_var( 'name' );
- }
-}
-$themes = themes_api( 'query_themes', $args );
-
-get_header();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+global $themes;
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="themes" class="wrap">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,9 +66,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="themes" style="display: none;">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_wp_error( $themes ) ) :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $themes->themes as $theme ) :
- get_template_part( 'content', 'index' );
- endforeach;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_single() ) :
+ $theme = array_shift( $themes->themes );
+ get_template_part( 'content', 'single' );
+ else :
+ foreach ( $themes->themes as $theme ) :
+ get_template_part( 'content', 'index' );
+ endforeach;
+ endif;
</ins><span class="cx" style="display: block; padding: 0 10px"> endif;
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemessinglephp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php 2015-01-16 18:05:10 UTC (rev 1155)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php 2015-01-16 22:48:01 UTC (rev 1156)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,26 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-/**
- * The main template file.
- *
- * This is the most generic template file in a WordPress theme
- * and one of the two required files for a theme (the other being style.css).
- * It is used to display a page when nothing more specific matches a query.
- * E.g., it puts together the home page when no home.php file exists.
- * Learn more: http://codex.wordpress.org/Template_Hierarchy
- *
- * @package wporg-themes
- */
-
-get_header();
-
-if ( have_posts() ) :
- while ( have_posts() ) :
- the_post();
-
- get_template_part( 'content', 'single' );
- endwhile;
-else :
- get_template_part( 'content', 'none' );
-endif;
-
-get_footer();
</del></span></pre>
</div>
</div>
</body>
</html>