Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/22/2011 10:13:25 AM (14 years ago)
Author:
johnjamesjacoby
Message:

First pass at normalizing bp-default template files. This includes:

A ton of code cleanup
Using new functions found in BP 1.3
Template header documentation
Improve pagination style and position on root component templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/activity/entry.php

    r3771 r3810  
    1 <?php /* This template is used by activity-loop.php and AJAX functions to show each activity */ ?>
     1<?php
    22
    3 <?php do_action( 'bp_before_activity_entry' ) ?>
     3/**
     4 * BuddyPress - Activity Stream (Single Item)
     5 *
     6 * This template is used by activity-loop.php and AJAX functions to show
     7 * each activity.
     8 *
     9 * @package BuddyPress
     10 * @subpackage bp-default
     11 */
    412
    5 <li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">
     13?>
     14
     15<?php do_action( 'bp_before_activity_entry' ); ?>
     16
     17<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>">
    618    <div class="activity-avatar">
    7         <a href="<?php bp_activity_user_link() ?>">
    8             <?php bp_activity_avatar( 'type=full&width=100&height=100' ) ?>
     19        <a href="<?php bp_activity_user_link(); ?>">
     20
     21            <?php bp_activity_avatar( 'type=full&width=100&height=100' ); ?>
     22
    923        </a>
    1024    </div>
     
    1327
    1428        <div class="activity-header">
    15             <?php bp_activity_action() ?>
     29
     30            <?php bp_activity_action(); ?>
     31
    1632        </div>
    1733
    1834        <?php if ( bp_activity_has_content() ) : ?>
     35
    1936            <div class="activity-inner">
    20                 <?php bp_activity_content_body() ?>
     37
     38                <?php bp_activity_content_body(); ?>
     39
    2140            </div>
     41
    2242        <?php endif; ?>
    2343
    24         <?php do_action( 'bp_activity_entry_content' ) ?>
     44        <?php do_action( 'bp_activity_entry_content' ); ?>
    2545
    2646        <div class="activity-meta">
     47
    2748            <?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?>
    28                 <a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a>
     49
     50                <a href="<?php bp_activity_comment_link(); ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id(); ?>"><?php _e( 'Reply', 'buddypress' ); ?> (<span><?php bp_activity_comment_count(); ?></span>)</a>
     51
    2952            <?php endif; ?>
    3053
    31             <?php if ( is_user_logged_in() && bp_activity_can_favorite() ) : ?>
    32                 <?php if ( !bp_get_activity_is_favorite() ) : ?>
     54            <?php if ( is_user_logged_in() && bp_activity_can_favorite() ) :
     55                if ( !bp_get_activity_is_favorite() ) : ?>
     56
    3357                    <a href="<?php bp_activity_favorite_link() ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
     58
    3459                <?php else : ?>
     60
    3561                    <a href="<?php bp_activity_unfavorite_link() ?>" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
    36                 <?php endif; ?>
    37             <?php endif;?>
    3862
    39             <?php do_action( 'bp_activity_entry_meta' ) ?>
     63                <?php endif;
     64            endif; ?>
     65
     66            <?php do_action( 'bp_activity_entry_meta' ); ?>
    4067        </div>
    4168    </div>
    4269
    4370    <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
     71
    4472        <div class="activity-inreplyto">
    45             <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?> &middot;
    46             <a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ) ?>"><?php _e( 'View', 'buddypress' ) ?></a>
     73            <strong><?php _e( 'In reply to', 'buddypress' ); ?></strong> - <?php bp_activity_parent_content(); ?> &middot;
     74            <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a>
    4775        </div>
     76
    4877    <?php endif; ?>
    4978
    50     <?php do_action( 'bp_before_activity_entry_comments' ) ?>
     79    <?php do_action( 'bp_before_activity_entry_comments' ); ?>
    5180
    5281    <?php if ( bp_activity_can_comment() ) : ?>
    5382        <div class="activity-comments">
    54             <?php bp_activity_comments() ?>
     83
     84            <?php bp_activity_comments(); ?>
    5585
    5686            <?php if ( is_user_logged_in() ) : ?>
    57             <form action="<?php bp_activity_comment_form_action() ?>" method="post" id="ac-form-<?php bp_activity_id() ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display() ?>>
    58                 <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ) ?></div>
     87
     88            <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
     89                <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div>
    5990                <div class="ac-reply-content">
    6091                    <div class="ac-textarea">
    61                         <textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac_input_<?php bp_activity_id() ?>"></textarea>
     92                        <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
    6293                    </div>
    63                     <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ) ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ) ?>
    64                     <input type="hidden" name="comment_form_id" value="<?php bp_activity_id() ?>" />
     94                    <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>
     95                    <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
    6596                </div>
    66                 <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
     97
     98                <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
     99
    67100            </form>
     101
    68102            <?php endif; ?>
     103
    69104        </div>
     105
    70106    <?php endif; ?>
    71107
    72     <?php do_action( 'bp_after_activity_entry_comments' ) ?>
     108    <?php do_action( 'bp_after_activity_entry_comments' ); ?>
     109
    73110</li>
    74111
    75 <?php do_action( 'bp_after_activity_entry' ) ?>
    76 
     112<?php do_action( 'bp_after_activity_entry' ); ?>
Note: See TracChangeset for help on using the changeset viewer.