Changeset 1691
- Timestamp:
- 08/25/2009 12:44:29 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 7 edited
-
bp-activity.php (modified) (1 diff)
-
bp-activity/bp-activity-classes.php (modified) (3 diffs)
-
bp-activity/bp-activity-filters.php (modified) (1 diff)
-
bp-activity/bp-activity-templatetags.php (modified) (4 diffs)
-
bp-forums/bp-forums-cssjs.php (deleted)
-
bp-themes/bp-default/_inc/css/screen.css (modified) (6 diffs)
-
bp-themes/bp-sn-framework/_inc/js/custom (deleted)
-
bp-themes/bp-sn-framework/activity/my-friends.php (modified) (1 diff)
-
bp-wire/bp-wire-templatetags.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r1687 r1691 120 120 * back to the default screen after execution. 121 121 */ 122 123 function bp_activity_action_delete_activity() { 124 global $bp; 125 126 if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'delete' ) 127 return false; 128 129 if ( empty( $bp->action_variables[0] ) || !is_numeric( $bp->action_variables[0] ) ) 130 return false; 131 132 /* Check the nonce */ 133 check_admin_referer( 'bp_activity_delete_link' ); 134 135 $activity_id = $bp->action_variables[0]; 136 137 /* Check access */ 138 if ( !is_site_admin() ) { 139 $activity = new BP_Activity_Activity( $activity_id ); 140 141 if ( $activity->user_id != $bp->loggedin_user->id ) 142 return false; 143 } 144 145 /* Now delete the activity item */ 146 if ( bp_activity_delete_by_activity_id( $activity_id ) ) 147 bp_core_add_message( __( 'Activity deleted', 'buddypress' ) ); 148 else 149 bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' ); 150 151 bp_core_redirect( $_SERVER['HTTP_REFERER'] ); 152 } 153 add_action( 'wp', 'bp_activity_action_delete_activity', 3 ); 154 122 155 123 156 function bp_activity_action_sitewide_feed() { -
trunk/bp-activity/bp-activity-classes.php
r1670 r1691 12 12 var $hide_sitewide = false; 13 13 14 function bp_activity_activity( $ args = false, $populate= false ) {14 function bp_activity_activity( $id = false ) { 15 15 global $bp; 16 16 17 if ( $args && is_array($args) ) { 18 extract( $args ); 19 20 $this->user_id = $user_id; 21 $this->component_name = $component_name; 22 $this->component_action = $component_action; 23 $this->item_id = $item_id; 24 $this->secondary_item_id = $secondary_item_id; 25 26 if ( $populate ) 27 $this->populate(); 17 if ( $id ) { 18 $this->id = $id; 19 $this->populate(); 28 20 } 29 21 } … … 171 163 172 164 for ( $i = 0; $i < count( $activities ); $i++ ) { 165 $activities_formatted[$i]['id'] = $activities[$i]->id; 173 166 $activities_formatted[$i]['user_id'] = $activities[$i]->user_id; 174 167 $activities_formatted[$i]['content'] = $activities[$i]->content; … … 238 231 239 232 for ( $i = 0; $i < count( $activities ); $i++ ) { 233 $activities_formatted[$i]['id'] = $activities[$i]->id; 240 234 $activities_formatted[$i]['user_id'] = $activities[$i]->user_id; 241 235 $activities_formatted[$i]['content'] = $activities[$i]->content; -
trunk/bp-activity/bp-activity-filters.php
r1608 r1691 14 14 $allowedtags['span'] = array(); 15 15 $allowedtags['span']['class'] = array(); 16 $allowedtags['a']['class'] = array(); 17 $allowedtags['img'] = array(); 16 18 return $allowedtags; 17 19 } -
trunk/bp-activity/bp-activity-templatetags.php
r1670 r1691 249 249 } 250 250 function bp_get_activity_content() { 251 global $activities_template, $allowed_tags ;252 253 if ( bp_is_home() && $activities_template->activity_type == 'personal' ) {251 global $activities_template, $allowed_tags, $bp; 252 253 if ( bp_is_home() && $activities_template->activity_type == 'personal' ) 254 254 $content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name ); 255 } else { 256 $activities_template->activity->content = bp_activity_insert_time_since( $activities_template->activity->content, $activities_template->activity->date_recorded ); 257 $content = $activities_template->activity->content; 258 } 259 255 else 256 $content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name, true, false, false ); 257 260 258 return apply_filters( 'bp_get_activity_content', $content ); 261 259 } 262 260 263 261 function bp_activity_content_filter( $content, $date_recorded, $full_name, $insert_time = true, $filter_words = true, $filter_you = true ) { 262 global $activities_template, $bp; 263 264 264 if ( !$content ) 265 265 return false; … … 274 274 if ( $insert_time ) 275 275 $content[0] = bp_activity_insert_time_since( $content[0], $date_recorded ); 276 276 277 277 // The "You" and "Your" conversion is only done in english, if a translation file is present 278 278 // then do not translate as it causes problems in other languages. … … 288 288 } 289 289 } 290 291 /* Add the delete link if the user has permission on this item */ 292 if ( ( $activities_template->activity->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() ) 293 $content[1] = '</span> <span class="activity-delete-link">' . bp_get_activity_delete_link() . '</span>' . $content[1]; 290 294 291 295 $content_new = ''; … … 314 318 315 319 return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component_name ); 320 } 321 322 function bp_activity_delete_link() { 323 echo bp_get_activity_delete_link(); 324 } 325 function bp_get_activity_delete_link() { 326 global $activities_template, $bp; 327 328 return apply_filters( 'bp_get_activity_delete_link', '<a href="' . wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . $activities_template->activity->id, 'bp_activity_delete_link' ) . '" class="item-button delete confirm">' . __( 'Delete', 'buddypress' ) . '</a>' ); 316 329 } 317 330 -
trunk/bp-themes/bp-default/_inc/css/screen.css
r1687 r1691 675 675 } 676 676 677 a.item-button { 678 border: 1px solid #eee; 679 background: #f5f5f5; 680 color: #999; 681 padding: 0 3px; 682 -moz-border-radius: 3px; 683 -webkit-border-radius: 3px; 684 border-radius: 3px; 685 font-size: 0.8em; 686 text-decoration: none; 687 } 688 a.item-button:hover { 689 border-color: #ccc; 690 color: #777; 691 } 692 693 .activity-list li a.item-button { 694 display: none; 695 position: absolute; 696 right: 0 !important; 697 top: 0 !important; 698 } 699 .item-list li a.item-button { 700 display: none; 701 position: absolute; 702 top: 10px; 703 right: 10px; 704 } 705 706 .activity-list li:hover a.item-button, .item-list li:hover a.item-button { 707 display: inline; 708 } 677 709 678 710 /*** Standard Form Styles ***************************************************/ … … 1212 1244 1213 1245 .activity-list li { 1246 position: relative; 1214 1247 margin: 5px 15px; 1215 padding: 0 00 34px !important;1248 padding: 0 50px 0 34px !important; 1216 1249 background: none !important; 1217 1250 } … … 1258 1291 padding: 7px 15px 7px 40px; 1259 1292 background: url(../images/quotes_background.gif) 10px 9px no-repeat #eee; 1260 margin: -10px 015px 0;1293 margin: -10px -50px 15px 0; 1261 1294 border-radius: 5px; 1262 1295 -moz-border-radius: 5px; … … 1320 1353 overflow: hidden; 1321 1354 } 1355 1356 1322 1357 /**** BLOGS *****************/ 1323 1358 … … 1767 1802 } 1768 1803 1769 a.delete {1804 table#message-threads a.delete { 1770 1805 overflow: hidden; 1771 1806 text-indent: -999px; … … 1778 1813 } 1779 1814 1780 span.unread-count {1815 table#message-threads span.unread-count { 1781 1816 background: #c2582b; 1782 1817 border: 2px solid #c2582b; -
trunk/bp-themes/bp-sn-framework/activity/my-friends.php
r1670 r1691 48 48 49 49 <?php bp_activity_content() ?> 50 50 51 51 <?php do_action( 'bp_friends_activity_item' ) ?> 52 52 </li> -
trunk/bp-wire/bp-wire-templatetags.php
r1688 r1691 364 364 if ( ( $wire_posts_template->wire_post->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() ) { 365 365 if ( $bp->wire->slug == $bp->current_component || $bp->profile->slug == $bp->current_component ) { 366 return apply_filters( 'bp_get_wire_delete_link', '<a class=" confirm" href="' . wp_nonce_url( $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id, 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );366 return apply_filters( 'bp_get_wire_delete_link', '<a class="item-button delete confirm" href="' . wp_nonce_url( $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id, 'bp_wire_delete_link' ) . '">' . __('Delete', 'buddypress') . '</a>' ); 367 367 } else { 368 return apply_filters( 'bp_get_wire_delete_link', '<a class=" confirm" href="' . wp_nonce_url( site_url( $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );368 return apply_filters( 'bp_get_wire_delete_link', '<a class="item-button delete confirm" href="' . wp_nonce_url( site_url( $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">' . __('Delete', 'buddypress') . '</a>' ); 369 369 } 370 370 }
Note: See TracChangeset
for help on using the changeset viewer.