Skip to:
Content
Pages
Categories
Search
Top
Bottom

The Relate categories to Groups plugin

  • Avatar of monkfish13
    monkfish13
    Participant

    @monkfish13

    Hello

    My installation of buddy press is going well, however i appear to have activated something that i am unsure how to turn off.

    In all of the groups I create, there is now a tab for “blog”

    Where has this come from and how can I turn it off ?

    I don’t need individual group blogs, and this tab click through to a blank page.

    With thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    BP Groups do not have blogs, so you have activated something else; check your plugins.

    Avatar of monkfish13
    monkfish13
    Participant

    @monkfish13

    I have found what is was thank Hugo, but that has now given me another challenge.

    I am using the ‘Blog Catagories for Groups’ plugin, which provides a blog feed for each group depending on the assigned category(s).

    This plugin works however in a nested fashion – so within the group area on BP ( like the group forums do)

    When clicking on the group Blog button, users see a list of blog posts relative to their group and category.

    If you click on the post permalinks – it displays the post in a nested fashion, still under the group header.

    I would like these title permalinks to take users back to the original blog post rather than a nested version.

    I believe that the code I need to change is this:

    `

    <a href="” rel=”bookmark” title=”

    `

    But what do I need to change it to make it link back to the original blog post?

    So to change this permalink -
    http://www.racecraftmodels.co.uk/groups/gt-and-le-mans/blog/martini-racing-porsche-935

    into this
    http://www.racecraftmodels.co.uk/martini-racing-porsche-935

    Any ideas? I am sure it is simple, but I don’t have the knowledge to make it work.

    With thanks

    Avatar of monkfish13
    monkfish13
    Participant

    @monkfish13

    Further to the request above, through a process of elimination I have managed this:

    Using the following code from the plugin’s template_tag file thus :

    `//get post permalink which leads to group blog single post page
    function bcg_get_post_permalink($post){
    global $bp;
    return bp_get_group_permalink($bp).$post->post_name;
    }
    function bcg_pagination($q) {

    $posts_per_page = intval(get_query_var(‘posts_per_page’));
    $paged = intval(get_query_var(‘paged’));
    $numposts = $q->found_posts;
    $max_page = $q->max_num_pages;
    if(empty($paged) || $paged == 0) {
    $paged = 1;
    }

    $pag_links = paginate_links( array(
    ‘base’ => add_query_arg( array( ‘paged’ => ‘%#%’, ‘num’ => $posts_per_page ) ),
    ‘format’ => ”,
    ‘total’ => ceil($numposts / $posts_per_page),
    ‘current’ => $paged,
    ‘prev_text’ => ‘?’,
    ‘next_text’ => ‘?’,
    ‘mid_size’ => 1
    ));
    echo $pag_links;
    }`

    It renders the permalinks like so – http://www.racecraftmodels.co.uk/groups/mercedes-b

    It appears to be the return function on line 4 that controls the post permalink.

    What do I need to do to this line to make the rendered permalink point to the original post – NOT within a group – like so;

    http://www.racecraftmodels.co.uk/mercedes-b

    Any assistance would be very much appriciated.

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    @monkfish13 line 4 change to -> `return $post->post_name;`
    HOWEVER, this might not work or could go seriously awry if there other other references to the post with group permalink in the other parts of the plugin. Best place to ask is at BuddyDev forums where the plugin dev knows the code inside and out.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.