Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,826 through 9,850 (of 32,505 total)
  • Author
    Search Results
  • pazzaglia
    Participant

    Thanks, @Robkk I didn’t know how to use that – I didn’t realize it was as easy as adding it to my functions file.

    Thanks for the addition @undergroundnetwork!

    Since I posted I’ve been using this outdated-but-it-works plug-in.
    https://wordpress.org/plugins/search-bbpress/

    Although that plug-in, works, it also displays shows links to slides that I have on the homepage in the results – not a big deal as I don’t have too many slides but I’d rather that not happen.

    In an effort to reduce plug-ins I’m going to give this code a shot.

    Ciao,

    L

    undergroundnetwork
    Participant

    I’ve added to the code as the above code does not search for Forum Titles, this code includes titles in the search as well:

    
    /**
     * Include bbPress 'topic' custom post type in WordPress' search results */
     
    function ntwb_bbp_topic_cpt_search( $topic_search ) {
    	$topic_search['exclude_from_search'] = false;
    	return $topic_search;
    }
    add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' );
    
    /**
     * Include bbPress 'forum' custom post type in WordPress' search results */
    
    function ntwb_bbp_forum_cpt_search( $forum_search ) {
    	$forum_search['exclude_from_search'] = false;
    	return $forum_search;
    }
    add_filter( 'bbp_register_forum_post_type', 'ntwb_bbp_forum_cpt_search' );
    
    /**
     * Include bbPress 'reply' custom post type in WordPress' search results  */
    
    function ntwb_bbp_reply_cpt_search( $reply_search ) {
    	$reply_search['exclude_from_search'] = false;
    	return $reply_search;
    }
    add_filter( 'bbp_register_reply_post_type', 'ntwb_bbp_reply_cpt_search' );
    
    #156327
    Robin W
    Moderator

    ok, the post count is being out in by something called the bbps ranking system

    the line in the browser comes out as

    <div class=”bbps-post-count”>Post count: 0</div>

    The only reference I can find to this is in this topic

    (CSS Review Needed) Switching poster picture and link to UserPro

    where the plugin author talks about adding different bbpress templates, which add this line – in the example in the link above it shows as

    <div class="bbps-post-count"><?php printf( __( 'Post count: %s', 'Avada' ), bbp_get_user_reply_count_raw(bbp_get_reply_author_id()) ); ?></div>
    
    

    which of course references the avada theme !!!

    If Avada hasn’t asked you to change bbpress files, then I suspect that they might be using the same hook I use to make this appear – suggest you refer Avada back to this post, and ask then if they have a hook to

    do_action (‘bbp_theme_after_reply_author_details’) or can explain why that line appears

    #156321
    j0n4h
    Participant

    Is it not a default feature? When I installed bbpress, it was already a feature from the start. I’ve contacted my Theme dev and they said:

    Hey Jonah,

    I’m not aware of Avada touching the post count code at all. I can see you have a thread open over at the bbPress forum:

    Post Count Incorrect, Repair Tools Don't Fix the Problem.

    I think it would be best to see what they have to say. Hopefully we can use the information they provide to find where the issue is coming from.

    Thanks!

    Ryan

    #156316
    arpitg
    Participant

    i’ve changed previous code

    #156315
    Robin W
    Moderator

    ok, can’t immediately see what it is unhappy with

    need to work out if it is position or what I added

    try

    moving it to where it was
    putting the previous code into the new position

    that should tell us which

    #156312
    arpitg
    Participant

    hello Robin,

    When I copied this code above </form> tag
    <p class=”bbp-user-topic-count”><?php printf( __( ‘Topics Started: %s’, ‘bbpress’ ), bbp_get_user_topic_count_raw($user_id) ); ?></p>
    <p class=”bbp-user-reply-count”><?php printf( __( ‘Replies Created: %s’, ‘bbpress’ ), bbp_get_user_reply_count_raw($user_id) ); ?></p>

    then find a syntax error
    Parse error: syntax error, unexpected ‘Started’ (T_STRING) in /home/cahiveco/public_html/wp-content/plugins/userpro/templates/view.php on line 110

    #156309
    Robin W
    Moderator
    #156308
    Robin W
    Moderator

    ok, I’d do two things

    1. move the code to above </form> line
    2. Try it with the following to force bbpress to take the id

    <p class=”bbp-user-topic-count”><?php printf( __( ‘Topics Started: %s’, ‘bbpress’ ), bbp_get_user_topic_count_raw($user_id) ); ?></p>
     <p class=”bbp-user-reply-count”><?php printf( __( ‘Replies Created: %s’, ‘bbpress’ ), bbp_get_user_reply_count_raw($user_id) ); ?></p>

    `

    #156306
    siddardha
    Participant

    hey robin, here is the entire code:

    <div class=”userpro userpro-<?php echo $i; ?> userpro-id-<?php echo $user_id; ?> userpro-<?php echo $layout; ?>” <?php userpro_args_to_data( $args ); ?>>

    <?php _e(‘Close’,’userpro’); ?>

    <div class=”userpro-centered <?php if (isset($header_only)) { echo ‘userpro-centered-header-only’; } ?>”>

    <?php if ( userpro_get_option(‘lightbox’) && userpro_get_option(‘profile_lightbox’) ) { ?>
    <div class=”userpro-profile-img” data-key=”profilepicture”>profile_photo_url($user_id); ?>” class=”userpro-tip-fade lightview” data-lightview-caption=”<?php echo $userpro->profile_photo_title( $user_id ); ?>” title=”<?php _e(‘View member photo’,’userpro’); ?>”><?php echo get_avatar( $user_id, $profile_thumb_size ); ?></div>
    <?php } else { ?>
    <div class=”userpro-profile-img” data-key=”profilepicture”>permalink($user_id); ?>” title=”<?php _e(‘View Profile’,’userpro’); ?>”><?php echo get_avatar( $user_id, $profile_thumb_size ); ?></div>
    <?php } ?>
    <div class=”userpro-profile-img-after”>
    <div class=”userpro-profile-name”>
    permalink($user_id); ?>”><?php echo userpro_profile_data(‘display_name’, $user_id); ?><?php echo userpro_show_badges( $user_id ); ?>
    </div>
    <?php do_action(‘userpro_after_profile_img’ , $user_id); ?>
    <?php if ( userpro_can_edit_user( $user_id ) ) { ?>
    <div class=”userpro-profile-img-btn”>
    <?php if (isset($header_only)){ ?>
    permalink($user_id, ‘edit’); ?>” class=”userpro-button secondary”><?php _e(‘Edit Profile’,’userpro’) ?>
    <?php } else { ?>
    id_to_member($user_id); ?>” data-template=”edit” class=”userpro-button secondary”><?php _e(‘Edit Profile’,’userpro’); ?>
    <?php } ?>
    skin_url(); ?>loading.gif” alt=”” class=”userpro-loading” />
    </div>
    <?php } ?>
    </div>

    <div class=”userpro-profile-icons top”>
    <?php if (isset($args[‘permalink’])) {
    userpro_logout_link( $user_id, $args[‘permalink’], $args[‘logout_redirect’] );
    } else {
    userpro_logout_link( $user_id );
    } ?>
    </div>

    <?php echo $userpro->show_social_bar( $args, $user_id, ‘userpro-centered-icons’ ); ?>

    <div class=”userpro-clear”></div>

    </div>

    <?php if (!isset($header_only)) { ?>

    <?php
    // action hook after user header
    if (!isset($args[‘disable_head_hooks’])){
    if (!isset($user_id)) $user_id = 0;
    $hook_args = array_merge($args, array(‘user_id’ => $user_id, ‘unique_id’ => $i));
    do_action(‘userpro_after_profile_head’, $hook_args);
    }
    ?>

    <div class=”userpro-body”>

    <?php do_action(‘userpro_pre_form_message’); ?>

    <form action=”” method=”post” data-action=”<?php echo $template; ?>”>

    <input type=”hidden” name=”user_id-<?php echo $i; ?>” id=”user_id-<?php echo $i; ?>” value=”<?php echo $user_id; ?>” />

    <?php // Hook into fields $args, $user_id
    if (!isset($user_id)) $user_id = 0;
    $hook_args = array_merge($args, array(‘user_id’ => $user_id, ‘unique_id’ => $i));
    do_action(‘userpro_before_fields’, $hook_args);
    ?>

    <?php foreach( userpro_fields_group_by_template( $template, $args[“{$template}_group”] ) as $key => $array ) { ?>

    <?php if ($array) echo userpro_show_field( $key, $array, $i, $args, $user_id ) ?>

    <?php } ?>

    <?php // Hook into fields $args, $user_id
    if (!isset($user_id)) $user_id = 0;
    $hook_args = array_merge($args, array(‘user_id’ => $user_id, ‘unique_id’ => $i));
    do_action(‘userpro_after_fields’, $hook_args);
    ?>

    <?php // Hook into fields $args, $user_id
    if (!isset($user_id)) $user_id = 0;
    $hook_args = array_merge($args, array(‘user_id’ => $user_id, ‘unique_id’ => $i));
    do_action(‘userpro_before_form_submit’, $hook_args);
    ?>

    <?php if ( userpro_can_delete_user($user_id) || $userpro->request_verification($user_id) || isset( $args[“{$template}_button_primary”] ) || isset( $args[“{$template}_button_secondary”] ) ) { ?>
    <div class=”userpro-field userpro-submit userpro-column”>

    <?php if ( $userpro->request_verification($user_id) ) { ?>
    <input type=”button” value=”<?php _e(‘Request Verification’,’userpro’); ?>” class=”popup-request_verify userpro-button secondary” data-up_username=”<?php echo $userpro->id_to_member($user_id); ?>” />
    <?php } ?>

    <?php if ( userpro_can_delete_user($user_id) ) { ?>
    <input type=”button” value=”<?php _e(‘Delete Profile’,’userpro’); ?>” class=”userpro-button red” data-template=”delete” data-up_username=”<?php echo $userpro->id_to_member($user_id); ?>” />
    <?php } ?>

    <?php if (isset($args[“{$template}_button_primary”]) ) { ?>
    <input type=”submit” value=”<?php echo $args[“{$template}_button_primary”]; ?>” class=”userpro-button” />
    <?php } ?>

    <?php if (isset( $args[“{$template}_button_secondary”] )) { ?>
    <input type=”button” value=”<?php echo $args[“{$template}_button_secondary”]; ?>” class=”userpro-button secondary” data-template=”<?php echo $args[“{$template}_button_action”]; ?>” />
    <?php } ?>

    skin_url(); ?>loading.gif” alt=”” class=”userpro-loading” />
    <div class=”userpro-clear”></div>

    </div>
    <?php } ?>

    </form>

    </div>

    <?php } ?>

    </div>
    <p class=”bbp-user-topic-count”><?php printf( __( ‘Topics Started: %s’, ‘bbpress’ ), bbp_get_user_topic_count_raw() ); ?></p>
    <p class=”bbp-user-reply-count”><?php printf( __( ‘Replies Created: %s’, ‘bbpress’ ), bbp_get_user_reply_count_raw() ); ?></p>

    #156304

    In reply to: How to start?

    Toni
    Participant

    Because of the intructions I got from the forum – I knew what to look for and found this:

    Step by step guide to setting up a bbPress forum – Part 1


    So I have now The Shortcode. I don’t want to even read the “other” method in detail.
    My opinion: I don’t understand why this set-up must be so laborious.

    #156303
    Toni
    Participant

    Somehow the menu is in order this time. And…

    I found what you were explaining to me, and the shortcode (what I was searching for):

    Step by step guide to setting up a bbPress forum – Part 1

    Thanks again, I knew exactly what to look for this time.

    #156300
    2cats
    Participant

    I am using WP 4.0.1 and bbPress 2.5.4; forums are for members only so I can’t send you a link. I have topics and replies set to show 20; this limitation is also applying to my search results, even if there are more than 20 results for a search term, when I search I am told I’m viewing 20 of 20 found, with no option to see anything more. Is there a way around this? Have I missed a setting, or is there a code snippet I can slip in somewhere? Ideally I’d get 20 results per page, with pagination and the total number of results found. Any help would be greatly appreciated!

    #156295
    Toni
    Participant

    Wait – what is the shortcode? I know how to use them – but I don’t know them.

    #156294

    In reply to: How to start?

    Toni
    Participant

    Also – I had to get instruction from the forum about the purpose and what to do with the /forums/ page that is blank. I still have not found the shortcode.

    #156291

    In reply to: How to start?

    Toni
    Participant

    https://codex.bbpress.org/getting-started-with-bbpress/

    Odd that it takes a couple of links to get there.

    #156286
    Robin W
    Moderator

    can you post the view.php template with your added code here please

    #156280
    Robin W
    Moderator

    ok, the function needs the existence of a variable called $user_id (being the wordpress usreid of the profile user.

    How/where are you adding this code?

    #156274
    Robin W
    Moderator

    That is what the original code does in profile – what happens when you click the links?

    #156267

    In reply to: New Topic/Reply button

    Robin W
    Moderator

    you can call the page using an html button

    Just get the permalink for the new topic page (at the top of the dit screen for that page)

    the where you want it put

    <button type="button" onclick="window.location.href='http://www.mysite.com/page1'">Read More</button>
    

    with the correct url

    #156265
    Robin W
    Moderator

    the code that profile uses is

    <p class="bbp-user-topic-count"><?php printf( __( 'Topics Started: %s',  'bbpress' ), bbp_get_user_topic_count_raw() ); ?></p>
    			<p class="bbp-user-reply-count"><?php printf( __( 'Replies Created: %s', 'bbpress' ), bbp_get_user_reply_count_raw() ); ?></p>

    The function is expecting the profile user to be in a variable called $user_id

    Suggest you refer to the userpro support site for how to integrate this

    #156250
    Doulacare
    Participant

    This also doesn’t explain why this shortcode doesn’t work either http://ontariodoulas.org/forums/

    [bbp-forum-index]

    #156211
    siddardha
    Participant

    yes, i have done that, but with no result.

    ok, first i created a new page and put the short code [bbp-single-forum id=105] as per my forum id and then changed the required parent page and published. thats it right?

    #156203
    siddardha
    Participant

    hello,

    i am using a plugin “user pro for social login”

    with custom css the profile of bbpress is changed into user pro profile page, you can have a look at cahive.com/profile/siddardha

    i want to insert the “topics and replies posted” by the user using shortcodes or any other method possible on the users profile page.

    thank you for your help.

    #156183
    Robin W
    Moderator

    Depends what the issue is.

    I suggest this approach as it helps define whether on a ‘clean’ default theme with no other plugins bbpress is experiencing issues.

    If it is ok in a clean site, then I’d suggest talking to your host provider – most are good with wordpress, and may identify any issues.

    If you can identify a conflict, then we can look at a solution, sometimes it is easy, often it might be harder 🙂

    I presume your test site is on a local server?

    If you’re ok/good with web stuff, then you might consider putting a test site on-line so that it is an exact match for the live environment, most host providers allow sub-domains and if you switch on discourage search then it doesn’t interfere see

    https://codex.bbpress.org/creating-a-test-site/

    then you can be happier that live will work.

    Anyway just a thought !!

Viewing 25 results - 9,826 through 9,850 (of 32,505 total)
Skip to toolbar