[buddypress-trac] [BuddyPress] #1346: Function bp_is_profile_component() is catching non-buddypress blog pages as profile components.

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sun Nov 15 12:26:49 UTC 2009


#1346: Function bp_is_profile_component() is catching non-buddypress blog pages as
profile components.
--------------------+-------------------------------------------------------
Reporter:  trusktr  |       Owner:     
    Type:  defect   |      Status:  new
Priority:  major    |   Milestone:     
Keywords:           |  
--------------------+-------------------------------------------------------
 I'm using conditional tags to apply different titles on my pages (not
 <title> tags, just headings)

 However, the bp_is_profile_component() function is catching normal blog
 pages as profile components so the incorrect statement is executed.

 For example, on my blog page at
 http://bettafootwear.com/CrownYourFeet/store

 bp_is_profile_component() is assuming that this page is a profile
 component. Obviously, it's not and has nothing to do with BuddyPress.

 If you visit the site, you'll notice a "»3" where the title should be.  I
 put the number 3 there in order to catch the culprit function. Here's the
 code I'm using in my template:


 {{{
                         <div class="titlewords"><span>
 <?php
 if (is_home()) { echo '» Betta Footwear'; }
 elseif (is_category('footwear')) { echo '» Collection.'; }
 elseif (is_category('meet-your-quotea')) { echo '» Quotes.'; }
 elseif (is_archive()) { echo '» Archives.'; } //this also catches
 categories not listed above
 elseif (is_single()) { echo '» Features.'; }
 elseif (is_404()) { echo '» 404: Not found.'; }
 elseif (is_search()) { echo '» Search results:'; }
 elseif (bp_is_page('register')) { echo '» Create account.'; }
 elseif (bp_is_page('blogs')) { echo '» Blogs.'; }
 elseif (bp_is_blogs_component()) { echo '»1 '; bp_user_fullname(); }
 elseif (bp_is_page('members')) { echo '» Skaters.'; }
 elseif (bp_is_page('forums')) { echo '» Forums.'; }
 elseif (bp_is_page('groups')) { echo '» Groups.'; }
 elseif (bp_is_groups_component()) { echo '»2 '; bp_user_fullname(); }
 elseif (bp_is_page('activate')) { echo '» Activation.'; }
 elseif (bp_is_profile_component()) { echo '»3 '; bp_user_fullname(); }
 //This is the culprit! ^^
 elseif (bp_is_activity_component()) { echo '»4 '; bp_user_fullname(); }
 elseif (bp_is_friends_component()) { echo '»5 '; bp_user_fullname(); }
 else { echo '» final'; }
 ?>
                         </span></div>
 }}}

 There you can see that "»3" corresponds to the bp_is_profile_component()
 function

-- 
Ticket URL: <http://trac.buddypress.org/ticket/1346>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list