Skip to:
Content

BuddyPress.org

Changeset 4226


Ignore:
Timestamp:
04/22/2011 11:24:11 AM (14 years ago)
Author:
djpaul
Message:

Update styling of attachment template to better match rest of theme, and removes a PHP notice. Fixes #3164

Location:
trunk/bp-themes/bp-default
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r4225 r4226  
    19551955
    19561956div.page,
    1957 div.post {
     1957div.post,
     1958div.attachment {
    19581959    margin: 0 0 40px 0;
    19591960    overflow: hidden;
  • trunk/bp-themes/bp-default/attachment.php

    r4186 r4226  
    22
    33    <div id="content">
     4        <div class="padder">
    45
    5         <?php do_action( 'bp_before_attachment' ) ?>
     6            <?php do_action( 'bp_before_attachment' ); ?>
    67
    7         <div class="page" id="attachments-page">
    8 
    9             <h2 class="pagetitle"><?php _e( 'Blog', 'buddypress' ) ?></h2>
     8            <div class="page" id="attachments-page" role="main">
    109
    1110                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
     
    1312                    <?php do_action( 'bp_before_blog_post' ) ?>
    1413
    15                     <?php $attachment_link = wp_get_attachment_link($post->ID, array(450, 800)); // This also populates the iconsize for the next line ?>
    16                     <?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?>
    17 
    1814                    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1915
    20                         <h2 class="posttitle"><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a> &rarr; <a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>
     16                        <div class="author-box">
     17                            <?php echo get_avatar( get_the_author_meta( 'user_email' ), '50' ); ?>
     18                            <p><?php printf( _x( 'by %s', 'Post written by...', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></p>
     19                        </div>
    2120
    22                         <div class="entry">
    23                             <p class="<?php echo $classname; ?>"><?php echo $attachment_link; ?><br /><?php echo basename($post->guid); ?></p>
     21                        <div class="post-content">
     22                            <h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    2423
    25                             <?php the_content( __('<p class="serif">Read the rest of this entry &rarr;</p>', 'buddypress' ) ); ?>
     24                            <p class="date">
     25                                <?php printf( __( '%1$s <span>by %2$s</span>', 'buddypress' ), get_the_date(), bp_core_get_userlink( $post->post_author ) ); ?>
     26                                <span class="post-utility alignright"><?php edit_post_link( __( 'Edit this entry', 'buddypress' ) ); ?></span>
     27                            </p>
    2628
    27                             <?php wp_link_pages( array( 'before' => '<div class="page-link"><p>' . __( '<strong>Pages:</strong> ', 'buddypress' ), 'after' => '</p></div>', 'next_or_number' => 'number')); ?>
     29                            <div class="entry">
     30                                <a href="#"><?php echo wp_get_attachment_image( $post->ID, 'large', false, array( 'class' => 'size-large aligncenter' ) ); ?></a>
     31
     32                                <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
     33                                <?php the_content(); ?>
     34                            </div>
     35
     36                            <p class="postmetadata">
     37                                <?php
     38                                    if ( wp_attachment_is_image() ) :
     39                                        $metadata = wp_get_attachment_metadata();
     40                                        printf( __( 'Full size is %s pixels', 'buddypress' ),
     41                                            sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
     42                                                wp_get_attachment_url(),
     43                                                esc_attr( __( 'Link to full size image', 'buddypress' ) ),
     44                                                $metadata['width'],
     45                                                $metadata['height']
     46                                            )
     47                                        );
     48                                    endif;
     49                                ?>
     50                                <span class="comments"><?php comments_popup_link( __( 'No Comments &#187;', 'buddypress' ), __( '1 Comment &#187;', 'buddypress' ), __( '% Comments &#187;', 'buddypress' ) ); ?></span>
     51                            </p>
    2852                        </div>
    2953
     
    3256                    <?php do_action( 'bp_after_blog_post' ) ?>
    3357
    34                 <?php comments_template(); ?>
     58                    <?php comments_template(); ?>
    3559
    3660                <?php endwhile; else: ?>
     
    3963
    4064                <?php endif; ?>
    41         </div>
     65
     66            </div>
    4267
    4368        <?php do_action( 'bp_after_attachment' ) ?>
    4469
    45     </div>
     70        </div><!-- .padder -->
     71    </div><!-- #content -->
     72
     73    <?php get_sidebar(); ?>
    4674
    4775<?php get_footer(); ?>
Note: See TracChangeset for help on using the changeset viewer.