Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 16 replies - 1 through 16 (of 16 total)
  • @chrisknade

    Participant

    Hi Guys

    Sorry to come back to this after a while but, its literally just the name change of the domain Im wanting. Fortunately nothing like the location of the database or folder names etc are changing, so Im ok just to use Jeff’s recommendation and do the domain part of the Changing site url?

    Cheers

    Chris

    @chrisknade

    Participant

    Thanks Gerikg.

    Can anyone else confirm that this is a suitable method, as Its not something I want to mess up?

    Cheers

    @chrisknade

    Participant

    So what did you end up using from that other post?

    Just this in the header?

    if ( $bp->current_component == 'activity' || $bp->current_component == 'profile' || $bp->current_component == 'wire' || $bp->current_component == 'messages' || $bp->current_component == 'friends')
    $c[] = 'members';

    if ( bp_is_page( BP_MEMBERS_SLUG ) )
    $c[] = 'members';

    @chrisknade

    Participant

    Yep that worked, thanks for that and your patience with the caching issue with regards to the the forum updating.

    @chrisknade

    Participant

    YAY MY POSTS HAVE FINALLY APPEARED.

    Can anyone now help me lol ?

    Chris

    @chrisknade

    Participant

    Im not sure how you mean that, can you see the two replys i posted above? I couldn’t see them there until i logged in again? Im basically just trying to use the page title to get a group.

    In the simpliest way I can put it.

    If my page title is pagetitle

    <?php if ( bp_has_groups( ‘type=single-group&slug=pagetitle’ ) ) : ?>

    Im just trying to use the page title dynamically you see, because Im using this code in a template page. so gonna have page titles based on people names that have corresponding group slugs.

    @chrisknade

    Participant

    Im not trying to use the group title, im trying to use the page title.

    Basically if I’ve got a page called page1 I want to retrieve the group details for the group called page1. I’m trying to do it dynamically because I want to use the same template instead of making up 50 odd templates for this particular project.

    I can get it to work if I pass in the slug as a string ie just

    `<?php if ( bp_has_groups( ‘type=single-group&slug=page1’) ) : ?>

    Chris

    @chrisknade

    Participant

    Basically im trying to take the title of the page which matches my group slugs and get the info from the groups. trying to make the page completely dynamic. In the content of the whole thing the codes like this.

    <?php if ( bp_has_groups( 'type=single-group&slug=' . the_title() ) ) : ?>

    <dl class="featured_network_info">
    <?php while ( bp_groups() ) : bp_the_group(); ?>

    <!-- Example template tags you can use -->

    <dt><a href="<?php bp_group_permalink() ?>"></a></dt>
    <dd class="featured_title"><?php bp_group_name() ?></dd><?php bp_group_avatar_thumb() ?>
    <dd class="featured_members">Members : <?php bp_group_total_members() ?></dd>
    <dd> <?php bp_group_description_excerpt() ?></dd>

    <?php endwhile; ?>
    </dl>

    <?php else: ?>

    <div id="message" class="info">
    <p>There are no groups to display.</p>
    </div>

    <?php endif; ?>

    But I can’t get any output from anything.

    @chrisknade

    Participant

    Right to clarify abit more this is what I have so far.

    <?php echo the_title(); ?>
    <?php if ( bp_has_groups( 'type=single-group&slug=USA' ) ) : ?>

    <div class="pagination-links" id="group-count">
    <?php bp_group_pagination_count() ?>
    </div>

    <div class="pagination-links" id="group-pag">
    <?php bp_group_pagination() ?>
    </div>

    <ul id="group-list">
    <?php while ( bp_groups() ) : bp_the_group(); ?>
    <li>
    <!-- Example template tags you can use -->
    <?php bp_group_avatar_thumb() ?>
    <?php $group_Id_Featured = bp_group_id() ?>
    <?php bp_group_permalink() ?>
    <?php bp_group_name() ?>
    <?php bp_group_total_members() ?>
    <?php bp_group_description_excerpt() ?>
    </li>
    <?php endwhile; ?>
    </ul>

    <?php else: ?>

    <div id="message" class="info">
    <p>There are no groups to display.</p>
    </div>

    <?php endif; ?>

    <?php if ( bp_group_has_members('group_id=2&per_page=8') ) : ?>

    <div id="member-count" class="pag-count">
    <?php bp_group_member_pagination_count() ?>
    </div>

    <div id="member-pagination" class="pagination-links">
    <?php bp_group_member_pagination() ?>
    </div>

    <ul id="member-list" class="item-list">
    <?php while ( bp_group_members() ) : bp_group_the_member(); ?>

    <li>
    <!-- Example template tags you can use -->

    <?php bp_group_member_avatar() ?>
    <?php bp_group_member_link() ?>
    <?php bp_group_member_joined_since() ?>
    </li>
    <?php endwhile; ?>
    </ul>

    <?php else: ?>

    <div id="message" class="info">
    <p>This group has no members.</p>
    </div>

    <?php endif;?>

    As you can see I’ve got <?php $group_Id_Featured = bp_group_id() ?> in there.

    Im trying to say if

    <?php if ( bp_group_has_members(‘group_id=2&per_page=8’) ) : ?> and use group_id=$group_Id_Featured . Anyone have any idea for the syntax for that. Tried loads of different variations none of which work.

    @chrisknade

    Participant

    Right I’ve tried the single quote on it now. still no luck, my face is currently like my avatar! glum!

    Any further ideas? I can’t see how something as simple as doing a check on existing data in the loop should be some troublesome.

    @chrisknade

    Participant

    I’ve tried with and without spaces, I’ll try the single condition, I’ll be in touch tomorrow no doubt! Thanks for your help so far ray. Night

    @chrisknade

    Participant

    Thanks for your input Jeff. Ray i get all 3 groups outputting fine when i echo localPhone. Could it be that i need to assign test group to say $testgroup and try the comparison that way? Is there some syntax conflict that won’t let me compare them the way i currently am?

    Anyway off to bed now, its 1am uk time.

    @chrisknade

    Participant

    Hmmm, thats got rid of the semi colon as you said. Now im just getting the solitary echo as in none of my conditions are satisfied. They should be coz both groups are there. Have i made a mistake regarding the get.

    @chrisknade

    Participant

    I have tried it, with this code

    <?php get_header(); ?>

    <div id="content" class="widecolumn">
    <h2 class="widgettitle"></h2>
    <div id="localphone">
    <?php if ( bp_has_site_groups() ) : ?>

    <div class="pag-count" id="group-dir-count">
    <?php bp_site_groups_pagination_count() ?>
    </div>

    <div class="pagination-links" id="group-dir-pag">
    <?php bp_site_groups_pagination_links() ?>
    </div>
    <?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
    <?php $localPhone = bp_get_the_site_group_name() ?>;
    <?php if ($localPhone=="Manchester" || $localPhone=="Test Group") {
    echo '<dl>';
    echo '<dt><a href="http://business-chamber.com/featured-<?php bp_get_the_site_group_name() ?>/" title=""><?php bp_get_the_site_group_avatar_thumb() ?></a></dt>';
    echo '<dd><?php bp_get_the_site_group_name() ?></dd>';
    echo '</dl>';
    } else {
    echo 'hello';
    }
    ?>
    <?php endwhile; ?>

    <?php else: ?>

    <div id="message" class="info">
    <p><?php _e( 'There were no groups found.', 'buddypress' ) ?></p>
    </div>

    <?php endif; ?>

    </div>

    <?php get_footer(); ?>

    Im now getting

    ;

    ;

    hello;

    I definately have the 2 test groups there and it is doing something right, as in only returning the hello for the last one where I don’t have a || condition.

    @chrisknade

    Participant

    Otherwise Andy do you think that should work?

    @chrisknade

    Participant

    Thanks for the reply Ray. Yeah i’ve went back too far on my undos. I had it the way you’ve suggested. Any other reason’s why it wouldn’t work, as in logically rather than in my example poor syntax?

Viewing 16 replies - 1 through 16 (of 16 total)
Skip to toolbar