Ticket #187: 187-wporg-p2.diff
File 187-wporg-p2.diff, 10.5 KB (added by , 11 years ago) |
---|
-
wp-content/themes/pub/wporg-p2/category.php
1 <?php 2 /** 3 * Category Archive Template. 4 */ 5 ?> 6 <?php get_header(); ?> 7 <?php $tag_obj = $wp_query->get_queried_object(); ?> 8 9 <div class="sleeve_main"> 10 11 <?php if ( 30 == get_current_blog_id() && p2_user_can_post() ) : // 30 is /community ?> 12 <?php locate_template( array( 'post-form.php' ), true ); ?> 13 <?php endif; ?> 14 15 <div id="main"> 16 <h2><?php printf( __( 'Category: %s', 'p2' ), single_cat_title( '', false) ); ?> 17 <span class="controls"> 18 <a href="#" id="togglecomments"> <?php _e( 'Toggle Comment Threads', 'p2' ); ?></a> | <a href="#directions" id="directions-keyboard"><?php _e( 'Keyboard Shortcuts', 'p2' ); ?></a> 19 </span> 20 </h2> 21 22 <?php if ( 30 == get_current_blog_id() ) : // 30 is /community ?> 23 <div id="category-description"><?php echo category_description(); ?></div> 24 <?php endif; ?> 25 26 <?php if ( have_posts() ) : ?> 27 28 <ul id="postlist"> 29 <?php while ( have_posts() ) : the_post(); ?> 30 31 <?php p2_load_entry(); ?> 32 33 <?php endwhile; ?> 34 </ul> 35 36 <?php else : ?> 37 38 <div class="no-posts"> 39 <h3><?php _e( 'No posts found!', 'p2' ); ?></h3> 40 </div> 41 42 <?php endif ?> 43 44 <div class="navigation"> 45 <p class="nav-older"><?php next_posts_link( __( '← Older posts', 'p2' ) ); ?></p> 46 <p class="nav-newer"><?php previous_posts_link( __( 'Newer posts →', 'p2' ) ); ?></p> 47 </div> 48 49 </div> <!-- main --> 50 51 </div> <!-- sleeve --> 52 53 <?php get_footer(); ?> 54 No newline at end of file -
wp-content/themes/pub/wporg-p2/entry.php
Property changes on: wp-content/themes/pub/wporg-p2/category.php ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 <?php 2 /** 3 * Displays the content and meta information for a post object. 4 * 5 * @package P2 6 */ 7 ?> 8 <li id="prologue-<?php the_ID(); ?>" <?php post_class(); ?>> 9 <?php 10 11 /* 12 * Post meta 13 */ 14 15 if ( ! is_page() ): 16 $author_posts_url = get_author_posts_url( get_the_author_meta( 'ID' ) ); 17 $posts_by_title = sprintf( 18 __( 'Posts by %1$s ( @%2$s )', 'p2' ), 19 get_the_author_meta( 'display_name' ), 20 get_the_author_meta( 'user_nicename' ) 21 ); ?> 22 23 <a href="<?php echo esc_attr( $author_posts_url ); ?>" title="<?php echo esc_attr( $posts_by_title ); ?>" class="post-avatar"> 24 <?php echo get_avatar( get_the_author_meta('user_email'), 48 ); ?> 25 </a> 26 <?php endif; ?> 27 <h4> 28 <?php if ( ! is_page() ): ?> 29 <a href="<?php echo esc_attr( $author_posts_url ); ?>" title="<?php echo esc_attr( $posts_by_title ); ?>"><?php the_author(); ?></a> 30 <?php endif; ?> 31 <span class="meta"> 32 <?php 33 if ( ! is_page() ) { 34 echo p2_date_time_with_microformat(); 35 } ?> 36 <span class="actions"> 37 <a href="<?php the_permalink(); ?>" class="thepermalink<?php if ( is_singular() ) { ?> printer-only<?php } ?>" title="<?php esc_attr_e( 'Permalink', 'p2' ); ?>"><?php _e( 'Permalink', 'p2' ); ?></a> 38 <?php 39 if ( ! is_singular() ) 40 $before_reply_link = ' | '; 41 42 if ( comments_open() && ! post_password_required() ) { 43 echo post_reply_link( array( 44 'before' => isset( $before_reply_link ) ? $before_reply_link : '', 45 'after' => '', 46 'reply_text' => __( 'Reply', 'p2' ), 47 'add_below' => 'comments' 48 ), get_the_ID() ); 49 } 50 51 if ( current_user_can( 'edit_post', get_the_ID() ) ) : ?> | <a href="<?php echo ( get_edit_post_link( get_the_ID() ) ); ?>" class="edit-post-link" rel="<?php the_ID(); ?>" title="<?php esc_attr_e( 'Edit', 'p2' ); ?>"><?php _e( 'Edit', 'p2' ); ?></a> 52 <?php endif; ?> 53 54 <?php do_action( 'p2_action_links' ); ?> 55 </span> 56 57 <?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : ?> 58 <span class="tags"> 59 <?php tags_with_count( '', __( '<br />Tags:' , 'p2' ) .' ', ', ', ' ' ); ?> 60 </span> 61 <?php endif; ?> 62 63 <?php if ( 30 == get_current_blog_id() && is_object_in_taxonomy( get_post_type(), 'category' ) ) : // 30 is /community ?> 64 <span class="categories"> 65 <?php echo wporg_p2_get_cats_with_count( $post, '', __( '<br />Categories: ' , 'p2' ), ', ', '' ); ?> 66 </span> 67 <?php endif; ?> 68 </span> 69 </h4> 70 71 <?php 72 /* 73 * Content 74 */ 75 ?> 76 77 <div id="content-<?php the_ID(); ?>" class="postcontent"> 78 <?php 79 /* 80 * Check the post format and display content accordingly. 81 * The value should be a valid post format or one of the back compat categories. 82 */ 83 switch ( p2_get_post_format( $post->ID ) ) { 84 case 'status': 85 case 'link': 86 the_content( __( '(More ...)' , 'p2' ) ); 87 break; 88 case 'quote': 89 p2_quote_content(); 90 break; 91 case 'post': 92 case 'standard': 93 default: 94 p2_title(); 95 the_content( __( '(More ...)' , 'p2' ) ); 96 break; 97 } ?> 98 </div> 99 100 <?php 101 /* 102 * Comments 103 */ 104 105 $comment_field = '<div class="form"><textarea id="comment" class="expand50-100" name="comment" cols="45" rows="3"></textarea></div> <label class="post-error" for="comment" id="commenttext_error"></label>'; 106 107 $comment_notes_before = '<p class="comment-notes">' . ( get_option( 'require_name_email' ) ? sprintf( ' ' . __( 'Required fields are marked %s', 'p2' ), '<span class="required">*</span>' ) : '' ) . '</p>'; 108 109 $p2_comment_args = array( 110 'title_reply' => __( 'Reply', 'p2' ), 111 'comment_field' => $comment_field, 112 'comment_notes_before' => $comment_notes_before, 113 'comment_notes_after' => '<span class="progress spinner-comment-new"></span>', 114 'label_submit' => __( 'Reply', 'p2' ), 115 'id_submit' => 'comment-submit', 116 ); 117 118 ?> 119 120 <?php if ( get_comments_number() > 0 && ! post_password_required() ) : ?> 121 <div class="discussion" style="display: none"> 122 <p> 123 <?php p2_discussion_links(); ?> 124 <a href="#" class="show-comments"><?php _e( 'Toggle Comments', 'p2' ); ?></a> 125 </p> 126 </div> 127 <?php endif; 128 129 wp_link_pages( array( 'before' => '<p class="page-nav">' . __( 'Pages:', 'p2' ) ) ); ?> 130 131 <div class="bottom-of-entry"> </div> 132 133 <?php if ( p2_is_ajax_request() ) : ?> 134 <ul id="comments-<?php the_ID(); ?>" class="commentlist inlinecomments"></ul> 135 <?php else : 136 comments_template(); 137 $pc = 0; 138 if ( p2_show_comment_form() && $pc == 0 && ! post_password_required() ) : 139 $pc++; ?> 140 <div class="respond-wrap" <?php echo ( ! is_singular() ) ? 'style="display: none; "' : ''; ?>> 141 <?php comment_form( $p2_comment_args ); ?> 142 </div><?php 143 endif; 144 endif; ?> 145 </li> -
wp-content/themes/pub/wporg-p2/functions.php
Property changes on: wp-content/themes/pub/wporg-p2/entry.php ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
23 23 return $url; 24 24 } 25 25 26 // Return a list of link categories applied to the current post, unless it is uncategorized 27 function wporg_p2_get_cats_with_count( $post, $format = 'list', $before = '', $sep = '', $after = '' ) { 28 $cat_links = array(); 29 $post_cats = get_the_terms( $post->ID, 'category' ); 30 31 if ( ! $post_cats ) 32 return ''; 33 34 foreach ( $post_cats as $cat ) { 35 if ( 'uncategorized' == $cat->slug ) { 36 continue; 37 } 38 39 if ( $cat->count > 1 && ! is_category( $cat->slug ) ) { 40 $cat_link = '<a href="' . get_term_link( $cat, 'category' ) . '" rel="category">' . $cat->name . ' ( ' . number_format_i18n( $cat->count ) . ' )</a>'; 41 } else { 42 $cat_link = $cat->name; 43 } 44 45 if ( $format == 'list' ) 46 $cat_link = '<li>' . $cat_link . '</li>'; 47 48 $cat_links[] = $cat_link; 49 } 50 51 if ( empty( $cat_links ) ) { 52 return ''; 53 } 54 55 return apply_filters( 'cats_with_count', $before . join( $sep, $cat_links ) . $after, $post ); 56 } 57 No newline at end of file -
wp-content/themes/pub/wporg-p2/style.css
171 171 vertical-align: top; 172 172 } 173 173 174 /* Add some space below tag/category descriptions */ 175 #tag-description, 176 #category-description { 177 margin-bottom: 2em; 178 } 179 174 180 /*- bbPress Specific Styles ----------*/ 175 181 body.bbPress #main ul#postlist li { 176 182 border-top-style: none; -
wp-content/themes/pub/wporg-p2/tag.php
1 <?php 2 /** 3 * Tag Archive Template. 4 * 5 * @package P2 6 */ 7 ?> 8 <?php get_header(); ?> 9 <?php $tag_obj = $wp_query->get_queried_object(); ?> 10 11 <div class="sleeve_main"> 12 13 <div id="main"> 14 <h2><?php printf( __( 'Tagged: %s', 'p2' ), single_tag_title( '', false) ); ?> 15 <span class="controls"> 16 <a href="#" id="togglecomments"> <?php _e( 'Toggle Comment Threads', 'p2' ); ?></a> | <a href="#directions" id="directions-keyboard"><?php _e( 'Keyboard Shortcuts', 'p2' ); ?></a> 17 </span> 18 </h2> 19 20 <?php if ( 30 == get_current_blog_id() ) : // 30 is /community ?> 21 <div id="tag-description"><?php echo tag_description(); ?></div> 22 <?php endif; ?> 23 24 <?php if ( have_posts() ) : ?> 25 26 <ul id="postlist"> 27 <?php while ( have_posts() ) : the_post(); ?> 28 29 <?php p2_load_entry(); ?> 30 31 <?php endwhile; ?> 32 </ul> 33 34 <?php else : ?> 35 36 <div class="no-posts"> 37 <h3><?php _e( 'No posts found!', 'p2' ); ?></h3> 38 </div> 39 40 <?php endif ?> 41 42 <div class="navigation"> 43 <p class="nav-older"><?php next_posts_link( __( '← Older posts', 'p2' ) ); ?></p> 44 <p class="nav-newer"><?php previous_posts_link( __( 'Newer posts →', 'p2' ) ); ?></p> 45 </div> 46 47 </div> <!-- main --> 48 49 </div> <!-- sleeve --> 50 51 <?php get_footer(); ?> 52 No newline at end of file