Ticket #5911: 5911-24.diff
File 5911-24.diff, 6.5 KB (added by , 16 years ago) |
---|
-
wp-includes/media.php
338 338 return $output; 339 339 } 340 340 341 function previous_image_link() { 342 adjacent_image_link(true); 343 } 344 345 function next_image_link() { 346 adjacent_image_link(false); 347 } 348 349 function adjacent_image_link($prev = true) { 350 global $post; 351 $post = get_post($post); 352 $attachments = array_values(get_children("post_parent=$post->post_parent&post_type=attachment&post_mime_type=image&orderby=\"menu_order ASC, ID ASC\"")); 353 354 foreach ( $attachments as $k => $attachment ) 355 if ( $attachment->ID == $post->ID ) 356 break; 357 358 $k = $prev ? $k - 1 : $k + 1; 359 360 if ( isset($attachments[$k]) ) 361 echo get_the_attachment_link($attachments[$k]->ID, true, array(128, 96), true); 362 } 363 341 364 ?> -
wp-content/themes/default/image.php
1 <?php get_header(); ?> 2 3 <div id="content" class="widecolumn"> 4 5 <?php if (have_posts()) : while (have_posts()) : the_post(); ?> 6 7 <div class="post" id="post-<?php the_ID(); ?>"> 8 <h2><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> » <?php the_title(); ?></h2> 9 <div class="entry"> 10 <p class="attachment"><?php echo wp_get_attachment_link(0, 'medium', false); ?></p> 11 12 <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?> 13 14 <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> 15 16 <div class="navigation"> 17 <div class="alignleft"><?php previous_image_link() ?></div> 18 <div class="alignright"><?php next_image_link() ?></div> 19 </div> 20 <br class="clear" /> 21 22 <p class="postmetadata alt"> 23 <small> 24 This entry was posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?> 25 and is filed under <?php the_category(', ') ?>. 26 You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed. 27 28 <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { 29 // Both Comments and Pings are open ?> 30 You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site. 31 32 <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) { 33 // Only Pings are Open ?> 34 Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site. 35 36 <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) { 37 // Comments are open, Pings are not ?> 38 You can skip to the end and leave a response. Pinging is currently not allowed. 39 40 <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) { 41 // Neither Comments, nor Pings are open ?> 42 Both comments and pings are currently closed. 43 44 <?php } edit_post_link('Edit this entry.','',''); ?> 45 46 </small> 47 </p> 48 49 </div> 50 51 </div> 52 53 <?php comments_template(); ?> 54 55 <?php endwhile; else: ?> 56 57 <p>Sorry, no attachments matched your criteria.</p> 58 59 <?php endif; ?> 60 61 </div> 62 63 <?php get_footer(); ?> -
wp-content/themes/default/attachment.php
1 <?php get_header(); ?>2 3 <div id="content" class="widecolumn">4 5 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>6 7 <div class="navigation">8 <div class="alignleft"> </div>9 <div class="alignright"> </div>10 </div>11 <div class="post" id="post-<?php the_ID(); ?>">12 <h2><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> » <a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>13 <div class="entry">14 <p class="attachment"><?php echo wp_get_attachment_link(0, 'medium', false); ?></p>15 16 <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>17 18 <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>19 20 <p class="postmetadata alt">21 <small>22 This entry was posted23 <?php /* This is commented, because it requires a little adjusting sometimes.24 You'll need to download this plugin, and follow the instructions:25 http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */26 /* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>27 on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>28 and is filed under <?php the_category(', ') ?>.29 You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed.30 31 <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {32 // Both Comments and Pings are open ?>33 You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.34 35 <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {36 // Only Pings are Open ?>37 Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.38 39 <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {40 // Comments are open, Pings are not ?>41 You can skip to the end and leave a response. Pinging is currently not allowed.42 43 <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {44 // Neither Comments, nor Pings are open ?>45 Both comments and pings are currently closed.46 47 <?php } edit_post_link('Edit this entry.','',''); ?>48 49 </small>50 </p>51 52 </div>53 </div>54 55 <?php comments_template(); ?>56 57 <?php endwhile; else: ?>58 59 <p>Sorry, no attachments matched your criteria.</p>60 61 <?php endif; ?>62 63 </div>64 65 <?php get_footer(); ?>