Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Support: Creating & Extending

Existing and new plugins/components and themes.

Issue with a special navigation’s bar since BP is 1.5.1 (from 1.2.10) (5 posts)

Started 6 months ago by: LesChampsLibres

  • Profile picture of LesChampsLibres LesChampsLibres said 6 months ago:

    Hi,

    I would like to update a Buddypress 1.2.10 to 1.5.1. But I have a special navigation bar probably included in a modified theme twentyten. I have a local installation for testing this update but you can see the actual installation in 1.2.10 on this website : http://blogs.leschampslibres.fr . Sorry it is in french.
    When I try to navigate with it, pages doesn’t found. Does functions have been changed in BP 1.5.1?

    This is the a part of my header of my modified twentyten :

    <div id="access" role="navigation">
    			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    				<div class="menu">
    	<ul>
    				<li<?php if ( bp_is_front_page() ) : ?> class="current_page_item"<?php endif; ?>>
    					<a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
    				</li>
    
    				<?php if ( 'activity' != bp_dtheme_page_on_front() && bp_is_active( 'activity' ) ) : ?>
    					<li<?php if ( bp_is_page( BP_ACTIVITY_SLUG ) ) : ?> class="current_page_item"<?php endif; ?>>
    						<a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/" title="<?php _e( 'Activity', 'buddypress' ) ?>"><?php _e( 'Activity', 'buddypress' ) ?></a>
    					</li>
    				<?php endif; ?>
    
    				<li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) : ?> class="current_page_item"<?php endif; ?>>
    					<a href="<?php echo site_url() ?>/<?php echo BP_MEMBERS_SLUG ?>/" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a>
    				</li>
    
    				<?php if ( bp_is_active( 'groups' ) ) : ?>
    					<li<?php if ( bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ) : ?> class="current_page_item"<?php endif; ?>>
    						<a href="<?php echo site_url() ?>/<?php echo BP_GROUPS_SLUG ?>/" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a>
    					</li>
    
    					<?php if ( bp_is_active( 'forums' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) bp_get_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
    						<li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="current_page_item"<?php endif; ?>>
    							<a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a>
    						</li>
    					<?php endif; ?>
    				<?php endif; ?>
    
    				<?php if ( bp_is_active( 'blogs' ) && bp_core_is_multisite() ) : ?>
    					<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="current_page_item"<?php endif; ?>>
    						<a href="<?php echo site_url() ?>/<?php echo BP_BLOGS_SLUG ?>/" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a>
    					</li>
    				<?php endif; ?>> "

    Thanks !

    Edit:
    It is impossible to post the header…

  • Profile picture of LesChampsLibres LesChampsLibres said 5 months, 3 weeks ago:

    I don’t know how to post the html code…

    thanks for your help

  • Profile picture of @mercime @mercime said 5 months, 3 weeks ago:

    @LesChampsLibres to post code here, wrap the code with backticks (`) the symbol within the parentheses.

    You’re using an outdated theme that’s no longer supported and has deprecated template tags. I see that you have made some modifications to the theme as well. Backup that old theme, you could still re-use most of the styling/customizations you’ve added.

    The best way forward is to create a child theme of Twenty Ten and install the BP Template Pack plugin and go through the compatibility process. Here’s a tutorial to help you out. http://codex.buddypress.org/theme-development/theme-dev-bp-template-pack-walkthrough-twenty-ten-bp-1-5/

  • Profile picture of LesChampsLibres LesChampsLibres said 5 months, 3 weeks ago:

    Thanks.

    So I’ve done a twentyten child theme based on twentyten 1.2 (actual released apparently).
    But it doesn’t appear like my old customized BP twentyten. It doesn’t work with my

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * <a href='http://buddypress.org/community/members/since/&#039; rel='nofollow'>@since</a> Twenty Ten 1.0
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
    
    	?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11&quot; />
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <?php
    	/* We add some JavaScript to pages with the comment form
    	 * to support sites with threaded comments (when in use).
    	 */
    	if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );
    
    	/* Always have wp_head() just before the closing </head>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to add elements to <head> such
    	 * as styles, scripts, and meta tags.
    	 */
    	wp_head();
    ?>
    <script type="text/javascript">
    function getElementsByClass(searchClass,node,tag) {
      var classElements = new Array();
      if (node == null)
        node = document;
      if (tag == null)
        tag = '*';
      var els = node.getElementsByTagName(tag);
      var elsLen = els.length;
      var pattern = new RegExp("(^|s)"+searchClass+"(s|$)");
      for (i = 0, j = 0; i < elsLen; i++) {
        if (pattern.test(els[i].className) ) {
          classElements[j] = els[i];
          j++;
        }
      }
      return classElements;
    }
    function switchClassElements(className) {
    	var elems = getElementsByClass(className);
    	for(var i=0; i<elems.length ; i++) {
    		if(elems[i].style.display!="none")
    			elems[i].style.display = "none";
    		else
    			elems[i].style.display = "block";
    	}
    }
    window.onload = function() { switchClassElements('quick_post_widget_hide'); }
    </script>
    
    </head>
    
    <body <?php body_class(); ?>>
    <div id="wrapper" class="hfeed">
    	<div id="header">
    		<div id="masthead">
    			<div id="branding" role="banner">
    				<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>
    				<div id="site-description"><?php bloginfo( 'description' ); ?></div>
    
    				<?php
    					// Check if this is a post or page, if it has a thumbnail, and if it's a big one
    					if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
    							has_post_thumbnail( $post->ID ) &&
    							( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    							$image[1] >= HEADER_IMAGE_WIDTH ) :
    						// Houston, we have a new header image!
    						echo get_the_post_thumbnail( $post->ID );
    					elseif ( get_header_image() ) : ?>
    						<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    					<?php endif; ?>
    			</div><!-- #branding -->
    
    			<div id="access" role="navigation">
    			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    				<div class="menu">
    	<ul>
    				<li<?php if ( bp_is_front_page() ) : ?> class="current_page_item"<?php endif; ?>>
    					<a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
    				</li>
    
    				<?php if ( 'activity' != bp_dtheme_page_on_front() && bp_is_active( 'activity' ) ) : ?>
    					<li<?php if ( bp_is_page( BP_ACTIVITY_SLUG ) ) : ?> class="current_page_item"<?php endif; ?>>
    						<a href="<?php echo site_url() ?>/<?php echo BP_ACTIVITY_SLUG ?>/" title="<?php _e( 'Activity', 'buddypress' ) ?>"><?php _e( 'Activity', 'buddypress' ) ?></a>
    					</li>
    				<?php endif; ?>
    
    				<li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) : ?> class="current_page_item"<?php endif; ?>>
    					<a href="<?php echo site_url() ?>/<?php echo BP_MEMBERS_SLUG ?>/" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a>
    				</li>
    
    				<?php if ( bp_is_active( 'groups' ) ) : ?>
    					<li<?php if ( bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() ) : ?> class="current_page_item"<?php endif; ?>>
    						<a href="<?php echo site_url() ?>/<?php echo BP_GROUPS_SLUG ?>/" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a>
    					</li>
    
    					<?php if ( bp_is_active( 'forums' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) bp_get_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
    						<li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="current_page_item"<?php endif; ?>>
    							<a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a>
    						</li>
    					<?php endif; ?>
    				<?php endif; ?>
    
    				<?php if ( bp_is_active( 'blogs' ) && bp_core_is_multisite() ) : ?>
    					<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="current_page_item"<?php endif; ?>>
    						<a href="<?php echo site_url() ?>/<?php echo BP_BLOGS_SLUG ?>/" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a>
    					</li>
    				<?php endif; ?>
    
    				<?php wp_list_pages( 'title_li=&depth=1&exclude=' . bp_dtheme_page_on_front() ); ?>
    
    				<?php do_action( 'bp_nav_items' ); ?>
    		</ul>
    	</div>
    			</div><!-- #access -->
    		</div><!-- #masthead -->
    	</div><!-- #header -->
    
    	<div id="main">
    <div id="container"> )

    Any ideas?

    Thanks

  • Profile picture of LesChampsLibres LesChampsLibres said 4 months, 1 week ago:

    Sorry but my BP 1.2.10 causes lot of troubles with WP 3.3.1 …