Changeset 2288
- Timestamp:
- 01/10/2010 09:55:51 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
bp-activity/bp-activity-filters.php (modified) (2 diffs)
-
bp-activity/bp-activity-templatetags.php (modified) (1 diff)
-
bp-forums.php (modified) (2 diffs)
-
bp-forums/bp-forums-filters.php (modified) (2 diffs)
-
bp-groups.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-filters.php
r2287 r2288 59 59 $activity_allowedtags['img']['class'] = array(); 60 60 $activity_allowedtags['img']['id'] = array(); 61 $activity_allowedtags['code'] = array(); 61 62 63 $activity_allowedtags = apply_filters( 'bp_activity_allowed_tags', $activity_allowedtags ); 62 64 return wp_kses( $content, $activity_allowedtags ); 63 65 } … … 88 90 add_filter( 'bp_activity_new_update_content', 'bp_activity_at_name_filter' ); 89 91 add_filter( 'groups_activity_new_update_content', 'bp_activity_at_name_filter' ); 90 add_filter( 'bp_activity_comment_content', 'bp_activity_at_name_filter' ); 91 add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_at_name_filter' ); 92 add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' ); 93 add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' ); 94 add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' ); 92 95 93 96 ?> -
trunk/bp-activity/bp-activity-templatetags.php
r2287 r2288 351 351 352 352 /* Add the permalink */ 353 $meta = ' · <a href="' . bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '" class="view" title="' . __( 'View Thread / Permalink', 'buddypress' ) . '"> #</a>';353 $meta = ' · <a href="' . bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '" class="view" title="' . __( 'View Thread / Permalink', 'buddypress' ) . '">' . __( 'View', 'buddypress' ) . '</a>'; 354 354 355 355 /* Add the delete link if the user has permission on this item */ -
trunk/bp-forums.php
r2239 r2288 195 195 'topic_title' => '', 196 196 'topic_slug' => '', 197 'topic_text' => '', 197 198 'topic_poster' => $bp->loggedin_user->id, // accepts ids 198 199 'topic_poster_name' => $bp->loggedin_user->fullname, // accept names … … 243 244 244 245 /* Update the first post */ 245 if ( !$post = b b_insert_post( array( 'post_id' => $post->post_id, 'topic_id' => $topic_id, 'post_text' => $topic_text, 'post_time' => $post->post_time, 'poster_id' => $post->poster_id, 'poster_ip' => $post->poster_ip, 'post_status' => $post->post_status, 'post_position' => $post->post_position ) ) )246 if ( !$post = bp_forums_insert_post( array( 'post_id' => $post->post_id, 'topic_id' => $topic_id, 'post_text' => $topic_text, 'post_time' => $post->post_time, 'poster_id' => $post->poster_id, 'poster_ip' => $post->poster_ip, 'post_status' => $post->post_status, 'post_position' => $post->post_position ) ) ) 246 247 return false; 247 248 -
trunk/bp-forums/bp-forums-filters.php
r2198 r2288 5 5 add_filter( 'bp_forums_bbconfig_location', 'attribute_escape', 1 ); 6 6 7 add_filter( 'bp_get_the_topic_title', 'wp_filter_kses', 1 ); 8 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'wp_filter_kses', 1 ); 9 add_filter( 'bp_get_the_topic_post_content', 'wp_filter_kses', 1 ); 10 11 add_filter( 'bp_get_the_topic_title', 'attribute_escape' ); 12 add_filter( 'bp_get_the_topic_post_content', 'attribute_escape' ); 7 add_filter( 'bp_get_the_topic_title', 'bp_forums_filter_kses', 1 ); 8 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_filter_kses', 1 ); 9 add_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_kses', 1 ); 13 10 14 11 add_filter( 'bp_get_the_topic_title', 'wptexturize' ); … … 38 35 add_filter( 'bp_get_forum_topic_count', 'number_format' ); 39 36 40 function bp_forums_add_allowed_tags( $allowedtags ) { 41 $allowedtags['p'] = array(); 42 $allowedtags['br'] = array(); 37 function bp_forums_filter_kses( $content ) { 38 global $allowedtags; 43 39 44 return $allowedtags; 40 $forums_allowedtags = $allowedtags; 41 $forums_allowedtags['span'] = array(); 42 $forums_allowedtags['span']['class'] = array(); 43 $forums_allowedtags['div'] = array(); 44 $forums_allowedtags['div']['class'] = array(); 45 $forums_allowedtags['div']['id'] = array(); 46 $forums_allowedtags['a']['class'] = array(); 47 $forums_allowedtags['img'] = array(); 48 $forums_allowedtags['br'] = array(); 49 $forums_allowedtags['p'] = array(); 50 $forums_allowedtags['img']['src'] = array(); 51 $forums_allowedtags['img']['alt'] = array(); 52 $forums_allowedtags['img']['class'] = array(); 53 $forums_allowedtags['img']['width'] = array(); 54 $forums_allowedtags['img']['height'] = array(); 55 $forums_allowedtags['img']['class'] = array(); 56 $forums_allowedtags['img']['id'] = array(); 57 $forums_allowedtags['code'] = array(); 58 $forums_allowedtags['blockquote'] = array(); 59 60 $forums_allowedtags = apply_filters( 'bp_forums_allowed_tags', $forums_allowedtags ); 61 return wp_kses( $content, $forums_allowedtags ); 45 62 } 46 add_filter( 'edit_allowedtags', 'bp_forums_add_allowed_tags' );47 63 48 64 function bp_forums_filter_tag_link( $link, $tag, $page, $context ) { -
trunk/bp-groups.php
r2285 r2288 2082 2082 return false; 2083 2083 2084 $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text ); 2085 $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id ); 2086 2084 2087 if ( $forum_post = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) { 2085 2088 $topic = bp_forums_get_topic_details( $topic_id ); 2086 2089 2087 2090 $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2088 $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $post_text )) . '</blockquote>';2091 $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 2089 2092 2090 2093 /* Record this in activity streams */ … … 2111 2114 return false; 2112 2115 2116 $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title ); 2117 $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text ); 2118 $topic_tags = apply_filters( 'group_forum_topic_tags_before_save', $topic_tags ); 2119 $forum_id = apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id ); 2120 2113 2121 if ( $topic_id = bp_forums_new_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_tags' => $topic_tags, 'forum_id' => $forum_id ) ) ) { 2114 2122 $topic = bp_forums_get_topic_details( $topic_id ); 2115 2123 2116 2124 $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2117 $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $topic_text )) . '</blockquote>';2125 $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>'; 2118 2126 2119 2127 /* Record this in activity streams */ … … 2137 2145 global $bp; 2138 2146 2147 $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title ); 2148 $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text ); 2149 2139 2150 if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id ) ) ) { 2140 2151 /* Update the activity stream item */ … … 2143 2154 2144 2155 $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2145 $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $topic_text )) . '</blockquote>';2156 $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>'; 2146 2157 2147 2158 /* Record this in activity streams */ … … 2167 2178 global $bp; 2168 2179 2180 $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text ); 2181 $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id ); 2182 2169 2183 $post = bp_forums_get_post( $post_id ); 2170 2184 … … 2177 2191 2178 2192 $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); 2179 $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $post_text )) . '</blockquote>';2193 $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>'; 2180 2194 2181 2195 /* Record this in activity streams */
Note: See TracChangeset
for help on using the changeset viewer.