Martin ( Martin_C ) (@martin_c)

Forum Replies Created

Viewing 18 replies - 1 through 18 (of 18 total)
  • @martin_c

    Participant

    I think you can use bbp_is_single_user

    In reply to: Google Authorship

    @martin_c

    Participant

    I think I will do that, but what do mean by dynamically hooking into the user edit page?

    In reply to: Google Authorship

    @martin_c

    Participant

    Of course the user has to add his G+ profile URL manually (so that the rel=”me” link points to his/her profile) for his picture to show up in SERPs, but having a rel=author in the links from topics or replies to his/her profile still makes sence.

    If future versions of bbpress would start using more HTML5 each reply could be an <article/> element which would be more semantic for Google authorship.

    But for now only one author for a page counts ( the first one ). Thats why I suggested using lead topics so that the topic creator get the authorship on paged topics.

    In reply to: Google Authorship

    @martin_c

    Participant

    Yes thats what I’m referring to as well :-). It doesn’t matter if you use meta links in the head section ( <link rel=”author” …) or content links such as &lta rel=”author”.

    You can for example try my welcome topic at appglobe.com by searching google.com with the frase: appglobe.com welcome

    …or you could try the google rich snippet tool for the welcome topic URL here: here

    …but still there’s a problem with Google seeing only full pages as authored by an single author, not sections within a page( such as replies ), but they probably get to multi authored pages pretty soon

     

    @martin_c

    Participant

    I got it to work in firefox by adding this when I had the same problem at appglobe.com:

    #bbpress-forums .bbp-user-section ul.bbp-topics {

    float: left !important;

    width:100% !important; /*forgot this one on my last post @mamasaywhat */

    }

    Try that or the code above by Jared Atcihison and it should work in firefox.

    @martin_c

    Participant

    Hmm, tried overflow:auto on .bbp-user-section, but it didn’t work. The stuff I posted above worked for me at AppGlobe:

    Try it with firefox here:

    http://appglobe.com/forums/users/martin/topics/

    …I think I’ve added a width of 100% as well as W3c suggests.

     

    @martin_c

    Participant

    Oh, I see I forgot a “{” in my first code….it should be:

     

    #bbpress-forums .bbp-user-section ul.bbp-topics {float: left !important;}

    @martin_c

    Participant

    Thats strange, I checked out your profile topics page in firebug and added a float left at this section:

    #bbpress-forums ul.bbp-lead-topic, #bbpress-forums ul.bbp-topics, #bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-replies {

    border: 1px solid #EEEEEE;
    clear: both;
    float: left; // Added this
    font-size: 12px;
    margin-bottom: 20px;
    overflow: hidden;

    }

    and when I did so it got visible.

    Try this instead at the bottom of your style.css:

    #bbpress-forums ul.bbp-topics { float: left !important; }

    @martin_c

    Participant

    Try this at the bottom of your  CSS file:

    #bbpress-forums .bbp-user-section ul.bbp-topics
    float: left !important;
    }

    In reply to: Google Authorship

    @martin_c

    Participant

    The following is what I use at AppGlobe:

    /* Add Google+ profile URL as profile contact method  */
    
    function appglobe_add_google_profile( $contactmethods ) {
    
       $contactmethods['google_profile_url'] = 'Google Profile URL';
    
       return $contactmethods;
    
    }
    add_filter( 'user_contactmethods', 'appglobe_add_google_profile', 10, 1);
    
    /* Remove nofollow, and ad author to the profile link */
    
    function appglobe_switch_nofollow_for_author($str) {
    
       $str = preg_replace(
    
       '~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U',
    
       '<a ${1}${2}${3}>', $str);
    
       return str_replace(array(' rel=""', " rel=''"), 'rel=author', $str);
    
    }
    
    add_filter( 'bbp_get_topic_author_link', 'appglobe_switch_nofollow_for_author' );

    And then in your user-profile.php (create a bbpress folder in your theme root, and copy it over) you can add this:

    
    <?php if( bbp_get_displayed_user_field( 'google_profile_url' ) ) : ?>
    
    <h2 class="author-subtitle">Google Profile</h2>
    
    <?php if( bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_keymaster' || bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_moderator') : ?>
    
    <a rel="me" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url' )); ?>"><?php bbp_displayed_user_field( 'google_profile_url' ); ?>
    
    </a>
    
    <?php else : ?>
    
    <a rel="me nofollow" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url')); ?>"><?php bbp_displayed_user_field( 'google_profile_url'); ?>
    
    </a>
    
    <?php endif; ?>

    Since I beleave only the first rel=me link on a page counts there would be best to use topic lead:

    add_filter( 'bbp_show_lead_topic', '__return_true' );

    …by doing so each page will be considered authored by the topic creator even if its paged.

    In reply to: Forum page title ?

    @martin_c

    Participant

    It sounds like it is using the default page.php template for forum pages. Did you create a page that make use of  templete page-front-forums.php? (I.e. not only uploaded the template file )

    In reply to: Forum Icons ?

    @martin_c

    Participant

    If you know CSS you can easily add some styles to your to style sheet. If you use the default templete, it could look like this:

    .bbPress.forum .entry-title {

    /*Styles to add icon image to the left of this element goes here*/

    }

    In reply to: Forum page title ?

    @martin_c

    Participant

    You could copy the page templete page-front-forums.php (found in the extras folder of the plugin) into your theme directory, and create a page using that template.

    Or you could copy the archive file archive-forum.php and manually change the title in it.

    @martin_c

    Participant

    This can of course be easiely changed in the default template files, but I think the default template should change the link text “Created Replies” to “Posts” or “Created Posts”, or change the content to display replies only ( as I did on AppGlobe ).

    In the default template the text in “in reply to:” (followed by the link to the topic) doesn’t make sence if it isn’t a reply.

    @martin_c

    Participant

    Since I wan’t only replies ( not created topics and replies) I’ve created a filter function:


    function ag_force_replies_only( $query, $user_id ) {

    if( bbp_is_single_user() ) { // Just in case

    $query = bbp_has_replies( array(
    ‘post_type’ => array( bbp_get_reply_post_type() ),
    ‘post_parent’ => ‘any’,
    ‘posts_per_page’ => bbp_get_replies_per_page(),
    ‘paged’ => bbp_get_paged(),
    ‘orderby’ => ‘date’,
    ‘order’ => ‘DESC’,
    ‘author’ => $user_id,
    ‘show_stickies’ => false,
    ) );
    }

    return $query;

    }
    add_filter(‘bbp_get_user_replies_created’, ‘ag_force_replies_only’, 10, 2);

     

    Now is shows replies only: http://appglobe.com/forums/users/martin/replies/

    @martin_c

    Participant

    Ok, maybe this is by design. I see the same thing on  profiles here at bbpress.

    Replies meaning both topic start posts and reply posts that is.

    Perhaps it would be better to use the “Posts Created” or simply Posts instead of  “Replies Created” .

    @martin_c

    Participant

    Ok forget the stuff I said about bbp_get_topic_tag_tax_id always returning “topic-tag”. Thought the return value was the chosen setting.

    Anyway, the above code does seem to work to make the loop display only those topics that’ve been tagged with the currently displayed tag.

    @martin_c

    Participant

    It seems bbp_get_topic_tag_tax_id() always returns the default topic tag slug, i.e. “topic-tag” no matter what you use in your forum settings.

    However, provided you use the default topic tag slug you can add some args to bbp-has-topics in taxonomy-topic-tag.php, like this:

    if( bbp_has_topics( array( bbp_get_topic_tag_tax_id() => bbp_get_topic_tag_slug() ) ) )

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