Changeset 4668
- Timestamp:
- 07/17/2011 05:39:42 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-template.php
r4646 r4668 708 708 // Insert the permalink 709 709 if ( !bp_is_single_activity() ) 710 $content .= apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( ' about <a href="%1$s" class="view" title="%2$s">%3$s</a>', bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) );710 $content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) ); 711 711 else 712 712 $content .= $time_since; 713 714 if ( is_user_logged_in() && bp_activity_can_comment() )715 $content .= sprintf( '<a href="%1$s" class="acomment-reply bp-primary-action" id="acomment-comment-%2$d">%3$s</a>', bp_get_activity_comment_link(), bp_get_activity_id(), sprintf( __( 'Reply (<span>%s</span>)', 'buddypress' ), bp_activity_get_comment_count() ) );716 713 717 714 return apply_filters( 'bp_insert_activity_meta', $content ); -
trunk/bp-themes/bp-default/_inc/ajax.php
r4648 r4668 178 178 global $bp; 179 179 180 / * Check the nonce */180 // Check the nonce 181 181 check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' ); 182 182 … … 198 198 $comment_id = bp_activity_new_comment( array( 199 199 'activity_id' => $_POST['form_id'], 200 'content' => $_POST['content'],201 'parent_id' => $_POST['comment_id']202 ) );200 'content' => $_POST['content'], 201 'parent_id' => $_POST['comment_id'] 202 ) ); 203 203 204 204 if ( !$comment_id ) { … … 207 207 } 208 208 209 if ( bp_has_activities ( 'display_comments=stream&include=' . $comment_id ) ) : ?> 210 <?php while ( bp_activities() ) : bp_the_activity(); ?> 211 <li id="acomment-<?php bp_activity_id() ?>"> 212 <div class="acomment-avatar"> 213 <a href="<?php echo bp_core_get_userlink( bp_get_activity_user_id(), false, true ); ?>"><?php bp_activity_avatar( array( 'height' => 30, 'width' => 30 ) ); ?></a> 214 </div> 215 216 <div class="acomment-meta"> 217 <?php 218 /* translators: 1: user profile link + username, 2: activity item permalink, 3: activity item timestamp */ 219 printf( __( '%1$s replied <a href="%2$s">%3$s ago</a>', 'buddypress' ), bp_core_get_userlink( bp_get_activity_user_id() ), bp_get_activity_thread_permalink(), bp_core_time_since( bp_core_current_time() ) ); 220 ?> 221 222 <a class="acomment-reply bp-primary-action" href="#acomment-<?php bp_activity_id() ?>" id="acomment-reply-<?php echo esc_attr( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ); ?></a> 223 224 <?php if ( bp_activity_user_can_delete() ) : ?> 225 <div class="acomment-options"> 226 <a href="<?php echo wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . bp_get_activity_id() . '?cid=' . $comment_id, 'bp_activity_delete_link' ) ?>" class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php _e( 'Delete', 'buddypress' ); ?></a> 227 </div> 228 <?php endif; ?> 229 </div> 230 231 <div class="acomment-content"> 232 <?php bp_activity_content_body(); ?> 233 </div> 234 </li> 235 <?php endwhile; ?> 236 <?php endif; 209 global $activities_template; 210 211 // Load the nem activity item into the $activities_template global 212 bp_has_activities( 'display_comments=stream&include=' . $comment_id ); 213 214 // Swap the current comment with the activity item we just loaded 215 $activities_template->activity->id = $activities_template->activities[0]->item_id; 216 $activities_template->activity->current_comment = $activities_template->activities[0]; 217 218 $template = locate_template( 'activity/comment.php', false, false ); 219 220 // Backward compatibility. In older versions of BP, the markup was 221 // generated in the PHP instead of a template. This ensures that 222 // older themes (which are not children of bp-default and won't 223 // have the new template) will still work. 224 if ( empty( $template ) ) 225 $template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php'; 226 227 load_template( $template, false ); 228 229 unset( $activities_template ); 237 230 } 238 231 add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' ); -
trunk/bp-themes/bp-default/_inc/css/default.css
r4611 r4668 763 763 font-style: normal; 764 764 } 765 a.bp-secondary-action:hover {766 background: #059AE7;767 border-color: #059AE7;768 color: #fff;769 }770 765 #reply-title { 771 766 margin-top: 0; … … 1043 1038 6.1 - Activity 1044 1039 --------------------------------------------------------------*/ 1040 #activity-stream { 1041 margin-top: -5px; 1042 } 1045 1043 #item-body form#whats-new-form { 1046 1044 border-bottom: 1px solid #ddd; … … 1118 1116 position: relative; 1119 1117 } 1120 .activity-list li.mini div.activity-meta {1121 margin: 0;1122 }1123 .activity-list li.mini div.activity-meta a {1124 padding: 3px 8px;1125 }1126 1118 .activity-list li.mini .activity-avatar img.avatar, 1127 1119 .activity-list li.mini .activity-avatar img.FB_profile_pic { 1128 1120 height: 20px; 1129 margin-left: 76px;1121 margin-left: 30px; 1130 1122 width: 20px; 1131 1123 } … … 1149 1141 } 1150 1142 .activity-list li.mini .activity-content p { 1151 float: left;1152 1143 margin: 0; 1153 1144 } 1154 .activity-list li .activity-meta {1155 position: absolute;1156 right: 0;1157 top: 0;1158 }1159 body.activity-permalink .activity-list .activity-meta {1160 right: 10px;1161 top: 18px;1162 }1163 body.activity-permalink .activity-list li.mini .activity-meta {1164 position: absolute;1165 right: 15px;1166 }1167 1145 .activity-list li.mini .activity-comments { 1168 clear: left;1146 clear: both; 1169 1147 font-size: 12px; 1170 1148 margin-top: 30px; … … 1172 1150 .activity-list li .activity-inreplyto { 1173 1151 background: url( ../images/replyto_arrow.gif ) 7px 0 no-repeat; 1174 color: # 888;1175 font-size: 11px; 1176 margin-left: 70px;1152 color: #bbb; 1153 font-size: 11px; 1154 margin-left: 0; 1177 1155 margin-bottom: 15px; 1178 1156 padding-left: 25px; … … 1230 1208 } 1231 1209 .activity-header { 1232 margin-right: 130px;1210 margin-right: 20px; 1233 1211 } 1234 1212 .activity-header a, … … 1243 1221 a.bp-secondary-action, 1244 1222 span.highlight { 1245 background: #ebf7ff; 1246 border-bottom: 1px solid #a1dcfa; 1247 border-right: 1px solid #a1dcfa; 1248 -moz-border-radius: 4px; 1249 -webkit-border-radius: 4px; 1250 border-radius: 4px; 1251 color: #059ae7; 1252 font-size: 11px; 1253 padding: 3px 8px; 1223 font-size: 11px; 1224 padding: 0; 1225 margin-right: 10px; 1254 1226 text-decoration: none; 1255 1227 } 1256 1228 .activity-list .activity-content .activity-inner, 1257 1229 .activity-list .activity-content blockquote { 1258 margin: 1 5px 0;1230 margin: 10px 10px 5px 0; 1259 1231 overflow: hidden; 1260 1232 } … … 1277 1249 .activity-read-more { 1278 1250 margin-left: 1em; 1251 white-space: nowrap; 1279 1252 } 1280 1253 .activity-list li.load-more { … … 1299 1272 --------------------------------------------------------------*/ 1300 1273 div.activity-meta { 1301 clear: left; 1302 margin: 0 10px 20px 0; 1274 float: left; 1275 margin: 5px 0 10px 0; 1276 clear: both; 1277 } 1278 div.activity-meta a { 1279 color: #999; 1280 } 1281 div.activity-meta a:hover { 1282 color: inherit; 1303 1283 } 1304 1284 a.bp-primary-action, 1305 1285 .comment-reply-link, 1306 1286 #reply-title small a { 1307 background: #fff9db; 1308 border-bottom: 1px solid #ffe8c4; 1309 -moz-border-radius: 4px; 1310 -webkit-border-radius: 4px; 1311 border-radius: 4px; 1312 border-right: 1px solid #ffe8c4; 1313 color: #ffa200; 1314 font-size: 11px; 1315 padding: 3px 8px; 1287 font-size: 11px; 1288 margin-right: 10px; 1316 1289 text-decoration: none; 1317 1290 } … … 1319 1292 .comment-reply-link:hover, 1320 1293 #reply-title small a:hover { 1321 background: #f7740a;1322 border-color: #f7740a;1323 color: #fff;1324 1294 } 1325 1295 div.activity-comments { … … 1328 1298 position: relative; 1329 1299 width: auto; 1300 clear: both; 1330 1301 } 1331 1302 body.activity-permalink div.activity-comments { … … 1347 1318 } 1348 1319 div.activity-comments ul { 1349 clear: left;1320 clear: both; 1350 1321 } 1351 1322 div.activity-comments ul li { … … 1385 1356 div.activity-comments div.acomment-content { 1386 1357 font-size: 11px; 1387 margin-left: 39px; 1388 margin-top: 5px; 1389 margin-bottom: 10px; 1358 margin: 5px 20px 0 40px; 1390 1359 } 1391 1360 div.acomment-content .time-since, … … 1413 1382 div.activity-comments li form.ac-form { 1414 1383 margin-right: 15px; 1384 clear: both; 1415 1385 } 1416 1386 div.activity-comments form.root { … … 1460 1430 } 1461 1431 .acomment-options { 1462 float: right; 1463 margin-right: 10px; 1432 float: left; 1433 margin: 5px 0 5px 40px; 1434 } 1435 .acomment-options a { 1436 color: #999; 1437 } 1438 .acomment-options a:hover { 1439 color: inherit; 1464 1440 } 1465 1441 -
trunk/bp-themes/bp-default/activity/comment.php
r4611 r4668 27 27 printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s">%4$s</a>', 'buddypress' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_thread_permalink(), bp_get_activity_comment_date_recorded() ); 28 28 ?> 29 </div> 30 31 <div class="acomment-content"><?php bp_activity_comment_content(); ?></div> 32 33 <div class="acomment-options"> 29 34 30 35 <?php if ( is_user_logged_in() && bp_activity_can_comment_reply( bp_activity_current_comment() ) ) : ?> 31 <a href="#acomment-<?php bp_activity_comment_id(); ?>" class="acomment-reply bp-primary-action" id="acomment-reply-<?php bp_activity_id() ?>-from-<?php bp_activity_comment_id() ?>"><?php _e( 'Reply', 'buddypress' ); ?></a> 36 37 <a href="#acomment-<?php bp_activity_comment_id(); ?>" class="acomment-reply bp-primary-action" id="acomment-reply-<?php bp_activity_id() ?>-from-<?php bp_activity_comment_id() ?>"><?php _e( 'Comment', 'buddypress' ); ?></a> 38 32 39 <?php endif; ?> 33 40 34 41 <?php if ( bp_activity_user_can_delete() ) : ?> 35 <div class="acomment-options"> 36 37 </div> 42 43 <a href="<?php bp_activity_comment_delete_link(); ?>" class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php _e( 'Delete', 'buddypress' ); ?></a> 44 38 45 <?php endif; ?> 46 39 47 </div> 40 48 41 <div class="acomment-content">42 <?php bp_activity_comment_content(); ?>43 </div>44 45 49 <?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?> 46 50 </li> -
trunk/bp-themes/bp-default/activity/entry.php
r4632 r4668 32 32 </div> 33 33 34 <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?> 35 36 <div class="activity-inreplyto"> 37 <strong><?php _e( 'In reply to', 'buddypress' ); ?></strong> - <?php bp_activity_parent_content(); ?> · 38 <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a> 39 </div> 40 41 <?php endif; ?> 42 34 43 <?php if ( bp_activity_has_content() ) : ?> 35 44 … … 44 53 <?php do_action( 'bp_activity_entry_content' ); ?> 45 54 46 <div class="activity-meta"> 47 <?php 48 // Add the delete link if the user has permission on this item 49 if ( bp_activity_user_can_delete() ) 50 bp_activity_delete_link(); 51 ?> 55 <?php if ( is_user_logged_in() ) : ?> 52 56 53 <?php if ( is_user_logged_in() && bp_activity_can_favorite() ) : ?> 54 <?php if ( !bp_get_activity_is_favorite() ) : ?> 55 <a href="<?php bp_activity_favorite_link(); ?>" class="fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'buddypress' ); ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a> 56 <?php else : ?> 57 <a href="<?php bp_activity_unfavorite_link(); ?>" class="unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'buddypress' ); ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a> 57 <div class="activity-meta"> 58 59 <?php if ( bp_activity_can_comment() ) : ?> 60 61 <a href="<?php bp_get_activity_comment_link(); ?>" class="acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment (<span>%s</span>)', 'buddypress' ), bp_activity_get_comment_count() ); ?></a> 62 58 63 <?php endif; ?> 59 <?php endif; ?>60 64 61 <?php do_action( 'bp_activity_entry_meta' ); ?> 62 </div> 65 <?php if ( bp_activity_can_favorite() ) : ?> 66 67 <?php if ( !bp_get_activity_is_favorite() ) : ?> 68 69 <a href="<?php bp_activity_favorite_link(); ?>" class="fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'buddypress' ); ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a> 70 71 <?php else : ?> 72 73 <a href="<?php bp_activity_unfavorite_link(); ?>" class="unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'buddypress' ); ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a> 74 75 <?php endif; ?> 76 77 <?php endif; ?> 78 79 <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?> 80 81 <?php do_action( 'bp_activity_entry_meta' ); ?> 82 83 </div> 84 85 <?php endif; ?> 86 63 87 </div> 64 65 <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>66 67 <div class="activity-inreplyto">68 <strong><?php _e( 'In reply to', 'buddypress' ); ?></strong> - <?php bp_activity_parent_content(); ?> ·69 <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a>70 </div>71 72 <?php endif; ?>73 88 74 89 <?php do_action( 'bp_before_activity_entry_comments' ); ?> 75 90 76 91 <?php if ( bp_activity_can_comment() ) : ?> 92 77 93 <div class="activity-comments"> 78 94 … … 81 97 <?php if ( is_user_logged_in() ) : ?> 82 98 83 <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(); ?>> 84 <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?></div> 85 <div class="ac-reply-content"> 86 <div class="ac-textarea"> 87 <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea> 99 <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(); ?>> 100 <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div> 101 <div class="ac-reply-content"> 102 <div class="ac-textarea"> 103 <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea> 104 </div> 105 <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?> →" /> <?php _e( 'or press esc to cancel.', 'buddypress' ); ?> 106 <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" /> 88 107 </div> 89 <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?> →" /> <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>90 <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />91 </div>92 108 93 <?php do_action( 'bp_activity_entry_comments' ); ?> 94 <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?> 109 <?php do_action( 'bp_activity_entry_comments' ); ?> 95 110 96 </form> 111 <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?> 112 113 </form> 97 114 98 115 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.