Changeset 4846
- Timestamp:
- 07/25/2011 12:21:20 AM (13 years ago)
- Location:
- trunk/bp-forums
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-filters.php
r4821 r4846 107 107 global $bp; 108 108 109 if ( $bp->current_action == 'forum' && !empty( $bp->action_variables[0] ) && 'topic' == $bp->action_variables[0])109 if ( bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) ) 110 110 if ( bp_has_forum_topic_posts() ) 111 111 $title .= bp_get_the_topic_title() . " $sep "; -
trunk/bp-forums/bp-forums-screens.php
r4821 r4846 105 105 global $bp; 106 106 107 if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || empty( $bp->action_variables[0]) )107 if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || !bp_action_variable( 0 ) ) 108 108 return false; 109 109 … … 117 117 global $bp; 118 118 119 if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || empty( $bp->action_variables[0]) )119 if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || !bp_action_variable( 0 ) ) 120 120 return false; 121 121 -
trunk/bp-forums/bp-forums-template.php
r4844 r4846 313 313 // If we're viewing a tag URL in the directory, let's override the type and 314 314 // set it to tags and the filter to the tag name 315 if ( 'tag' == $bp->current_action && !empty( $bp->action_variables[0] ) ) { 316 $search_terms = $bp->action_variables[0]; 315 if ( bp_is_current_action( 'tag' ) && $search_terms = bp_action_variable( 0 ) ) { 317 316 $type = 'tags'; 318 317 } … … 858 857 } 859 858 859 /** 860 * Echoes the output of bp_get_forums_tag_name() 861 * 862 * @package BuddyPress 863 * @todo Deprecate? 864 */ 860 865 function bp_forums_tag_name() { 861 866 echo bp_get_forums_tag_name(); 862 } 867 } 868 /** 869 * Outputs the currently viewed tag name 870 * 871 * @package BuddyPress 872 * @todo Deprecate? Seems unused 873 */ 863 874 function bp_get_forums_tag_name() { 864 global $bp; 865 866 if ( bp_is_directory() && bp_is_forums_component() && !empty( $bp->action_variables[0] ) ) 867 $tag_name = $bp->action_variables[0]; 868 else 869 $tag_name = false; 870 875 $tag_name = bp_is_directory() && bp_is_forums_component() ? bp_action_variable( 0 ) : false; 876 871 877 return apply_filters( 'bp_get_forums_tag_name', $tag_name ); 872 878 } … … 902 908 global $bp; 903 909 904 if ( in_array( 'post', (array)$bp->action_variables ) && in_array( 'edit', (array)$bp->action_variables) )910 if ( bp_is_action_variable( 'post' ) && bp_is_action_variable( 'edit' ) ) 905 911 return false; 906 912 … … 1036 1042 1037 1043 function bp_has_forum_topic_posts( $args = '' ) { 1038 global $topic_template , $bp;1044 global $topic_template; 1039 1045 1040 1046 $defaults = array( … … 1048 1054 extract( $r, EXTR_SKIP ); 1049 1055 1050 if ( empty( $topic_id ) && bp_is_current_component( 'groups') && bp_is_current_action( 'forum' ) && !empty( $bp->action_variables[0] ) && 'topic' == $bp->action_variables[0] && !empty( $bp->action_variables[1]) )1051 $topic_id = bp_forums_get_topic_id_from_slug( $bp->action_variables[1]);1052 elseif ( empty( $topic_id ) && bp_is_current_component( 'forums') && bp_is_current_action( 'topic' ) && !empty( $bp->action_variables[0]) )1053 $topic_id = bp_forums_get_topic_id_from_slug( $bp->action_variables[0]);1056 if ( empty( $topic_id ) && bp_is_current_component( 'groups') && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) ) 1057 $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) ); 1058 elseif ( empty( $topic_id ) && bp_is_current_component( 'forums') && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) ) 1059 $topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) ); 1054 1060 1055 1061 if ( empty( $topic_id ) ) { … … 1060 1066 1061 1067 // Current topic forum_id needs to match current_group forum_id 1062 if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ) )1068 if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) ) 1063 1069 return false; 1064 1070 } … … 1206 1212 } 1207 1213 function bp_get_the_topic_post_edit_text() { 1208 global $bp; 1209 1210 $post = bp_forums_get_post( $bp->action_variables[4] ); 1214 $post = bp_forums_get_post( bp_action_variable( 4 ) ); 1211 1215 return apply_filters( 'bp_get_the_topic_post_edit_text', esc_attr( $post->post_text ) ); 1212 1216 }
Note: See TracChangeset
for help on using the changeset viewer.