Changeset 4147
- Timestamp:
- 03/23/2011 08:36:24 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-functions.php
r4010 r4147 186 186 'topic_id' => false, 187 187 'topic_title' => '', 188 'topic_text' => '' 189 ); 190 191 $r = wp_parse_args( $args, $defaults ); 192 extract( $r, EXTR_SKIP ); 193 194 if ( !$topic_id = bb_insert_topic( array( 'topic_id' => $topic_id, 'topic_title' => stripslashes( $topic_title ) ) ) ) 188 'topic_text' => '', 189 'topic_tags' => false 190 ); 191 192 $r = wp_parse_args( $args, $defaults ); 193 extract( $r, EXTR_SKIP ); 194 195 if ( !$topic_id = bb_insert_topic( array( 'topic_id' => $topic_id, 'topic_title' => stripslashes( $topic_title ), 'tags' => $topic_tags ) ) ) 195 196 return false; 196 197 -
trunk/bp-forums/bp-forums-template.php
r4124 r4147 1174 1174 } 1175 1175 1176 /** 1177 * Echo the current topic's tag list, comma-separated 1178 * 1179 * @package BuddyPress 1180 * @since 1.3 1181 */ 1182 function bp_forum_topic_tag_list() { 1183 echo bp_get_forum_topic_tag_list(); 1184 } 1185 /** 1186 * Get the current topic's tag list 1187 * 1188 * @package BuddyPress 1189 * @since 1.3 1190 * 1191 * @param str $format 'string' returns comma-separated string; otherwise returns array 1192 * @return mixed $tags 1193 */ 1194 function bp_get_forum_topic_tag_list( $format = 'string' ) { 1195 do_action( 'bbpress_init' ); 1196 1197 // Pull up the tag objects 1198 $tags_data = bb_get_topic_tags( bp_get_the_topic_id() ); 1199 1200 // Convert them to a comma-separated string 1201 $tags = array(); 1202 foreach( $tags_data as $tag_data ) { 1203 $tags[] = $tag_data->name; 1204 } 1205 1206 if ( 'string' == $format ) 1207 $tags = implode( ', ', $tags ); 1208 1209 return apply_filters( 'bp_forum_topic_tag_list', $tags, $format ); 1210 } 1211 1176 1212 function bp_forum_action() { 1177 1213 echo bp_get_forum_action(); -
trunk/bp-groups/bp-groups-forums.php
r4137 r4147 112 112 } 113 113 114 function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text ) {114 function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) { 115 115 global $bp; 116 116 … … 118 118 $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text ); 119 119 120 if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id ) ) ) {120 if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id, 'topic_tags' => $topic_tags ) ) ) { 121 121 // Update the activity stream item 122 122 if ( bp_is_active( 'activity' ) ) -
trunk/bp-groups/bp-groups-screens.php
r4137 r4147 232 232 check_admin_referer( 'bp_forums_edit_topic' ); 233 233 234 if ( !groups_update_group_forum_topic( $topic_id, $_POST['topic_title'], $_POST['topic_text'] ) ) 234 $topic_tags = !empty( $_POST['topic_tags'] ) ? $_POST['topic_tags'] : false; 235 236 if ( !groups_update_group_forum_topic( $topic_id, $_POST['topic_title'], $_POST['topic_text'], $topic_tags ) ) 235 237 bp_core_add_message( __( 'There was an error when editing that topic', 'buddypress'), 'error' ); 236 238 else -
trunk/bp-themes/bp-default/groups/single/forum/edit.php
r3912 r4147 52 52 <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label> 53 53 <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea> 54 55 <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label> 56 <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list() ?>" /> 54 57 55 58 <?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
Note: See TracChangeset
for help on using the changeset viewer.