<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[13105] trunk/wp-content/themes/twentyten: Remove Direct SQL,
Use new esc_html() function, Correct the case of the ID keys.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13105">13105</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-02-13 09:59:16 +0000 (Sat, 13 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove Direct SQL, Use new esc_html() function, Correct the case of the ID keys. See <a href="http://trac.wordpress.org/ticket/9015">#9015</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpcontentthemestwentytenattachmentphp">trunk/wp-content/themes/twentyten/attachment.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenheaderphp">trunk/wp-content/themes/twentyten/header.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenindexphp">trunk/wp-content/themes/twentyten/index.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpcontentthemestwentytenattachmentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/attachment.php (13104 => 13105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/attachment.php        2010-02-13 09:49:44 UTC (rev 13104)
+++ trunk/wp-content/themes/twentyten/attachment.php        2010-02-13 09:59:16 UTC (rev 13105)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">
</span><span class="cx"> <?php the_post(); ?>
</span><span class="cx">
</span><del>-                                <p class="page-title"><a href="<?php echo get_permalink($post->post_parent) ?>" title="<?php printf( esc_attr__( 'Return to %s', 'twentyten' ), wp_specialchars( get_the_title($post->post_parent), 1 ) ) ?>" rel="gallery">&larr; <?php echo get_the_title($post->post_parent) ?></a></p>
</del><ins>+                                <p class="page-title"><a href="<?php echo get_permalink($post->post_parent) ?>" title="<?php printf( esc_attr__( 'Return to %s', 'twentyten' ), esc_html( get_the_title($post->post_parent), 1 ) ) ?>" rel="gallery">&larr; <?php echo get_the_title($post->post_parent) ?></a></p>
</ins><span class="cx">
</span><span class="cx">                                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
</span><span class="cx">                                         <h2 class="entry-title"><?php the_title(); ?></h2>
</span><span class="lines">@@ -21,8 +21,8 @@
</span><span class="cx">
</span><span class="cx">                                         <div class="entry-content">
</span><span class="cx">                                                 <div class="entry-attachment">
</span><del>-<?php if ( wp_attachment_is_image( $post->id ) ) : $att_image = wp_get_attachment_image_src( $post->id, array(640,640)); ?>
-                                                <p class="attachment"><a href="<?php echo wp_get_attachment_url($post->id); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[2];?>" class="attachment-medium" alt="<?php $post->post_excerpt; ?>" /></a>
</del><ins>+<?php if ( wp_attachment_is_image( $post->ID ) ) : $att_image = wp_get_attachment_image_src( $post->ID, array(640, 640)); ?>
+                                                <p class="attachment"><a href="<?php echo wp_get_attachment_url($post->ID); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><img src="<?php echo $att_image[0];?>" width="<?php echo $att_image[1];?>" height="<?php echo $att_image[2];?>" class="attachment-medium" alt="<?php $post->post_excerpt; ?>" /></a>
</ins><span class="cx">                                                 </p>
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">                                                 get_the_tag_list( __( ' and tagged ', 'twentyten' ), ', ', '' ),
</span><span class="cx">                                                 get_permalink(),
</span><span class="cx">                                                 the_title_attribute('echo=0'),
</span><del>-                                                comments_rss() ) ?>
</del><ins>+                                                get_post_comments_feed_link() ) ?>
</ins><span class="cx">
</span><span class="cx"> <?php if ( comments_open() && pings_open() ) : // Comments and trackbacks open ?>
</span><span class="cx">                                                 <?php printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'twentyten' ), get_trackback_url() ) ?>
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/header.php (13104 => 13105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/header.php        2010-02-13 09:49:44 UTC (rev 13104)
+++ trunk/wp-content/themes/twentyten/header.php        2010-02-13 09:59:16 UTC (rev 13105)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> if ( is_single() ) { single_post_title(); print ' | '; bloginfo('name'); }
</span><span class="cx"> elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }
</span><span class="cx"> elseif ( is_page() ) { single_post_title(''); print ' | '; bloginfo('name'); }
</span><del>- elseif ( is_search() ) { print 'Search results for ' . wp_specialchars($s); get_page_number(); print ' | '; bloginfo('name'); }
</del><ins>+ elseif ( is_search() ) { print 'Search results for ' . esc_html($s); get_page_number(); print ' | '; bloginfo('name'); }
</ins><span class="cx"> elseif ( is_404() ) { print 'Not Found | '; bloginfo('name'); }
</span><span class="cx"> else { bloginfo('name'); wp_title('|'); get_page_number(); }
</span><span class="cx"> ?></title>
</span><span class="lines">@@ -20,8 +20,8 @@
</span><span class="cx">
</span><span class="cx">         <?php wp_head(); ?>
</span><span class="cx">
</span><del>-        <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf( esc_attr__( '%s latest posts', 'twentyten' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
-        <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php printf( esc_attr__( '%s latest comments', 'twentyten' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
</del><ins>+        <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf( esc_attr__( '%s latest posts', 'twentyten' ), esc_html( get_bloginfo('name') ) ); ?>" />
+        <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php printf( esc_attr__( '%s latest comments', 'twentyten' ), esc_html( get_bloginfo('name') ) ); ?>" />
</ins><span class="cx">         <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
</span><span class="cx"> </head>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenindexphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/index.php (13104 => 13105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/index.php        2010-02-13 09:49:44 UTC (rev 13104)
+++ trunk/wp-content/themes/twentyten/index.php        2010-02-13 09:59:16 UTC (rev 13105)
</span><span class="lines">@@ -24,10 +24,14 @@
</span><span class="cx">                         </div><!-- .entry-meta -->
</span><span class="cx">
</span><span class="cx">                         <div class="entry-content">
</span><del>-                                <div class="gallery-thumb"><a class="size-thumbnail" href="<?php permalink_link() ?>"><?php $hilite = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE post_parent = '$post->ID' AND post_type = 'attachment' LIMIT 1" ); echo wp_get_attachment_image( $hilite, 'thumbnail' );?></a></div>
</del><ins>+                                <div class="gallery-thumb"><a class="size-thumbnail" href="<?php permalink_link() ?>"><?php
+                                $images =& get_children( array('post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999) );
+                                $total_images = count($images);
+                                $image = array_shift($images);
+                                echo wp_get_attachment_image( $image->ID, 'thumbnail' );
+                                ?></a></div>
+                                <p><em><?php printf( __('This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten'), 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ) . '" rel="bookmark"', $total_images ); ?></em></p>
</ins><span class="cx">
</span><del>-                                <p><em><?php printf( __('This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten'), 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ) . '" rel="bookmark"', $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_parent = '$post->ID' AND post_type = 'attachment'" )); ?></em></p>
-
</del><span class="cx">                                 <?php the_excerpt(''); ?>
</span><span class="cx">                         </div><!-- .entry-content -->
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>