Search Results for 'code'
-
AuthorSearch Results
-
January 3, 2015 at 2:57 am #156362
pazzaglia
ParticipantThanks, @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
January 3, 2015 at 1:27 am #156361undergroundnetwork
ParticipantI’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' );January 1, 2015 at 6:56 pm #156327Robin W
Moderatorok, 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
January 1, 2015 at 3:23 pm #156321j0n4h
ParticipantIs 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:
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
January 1, 2015 at 1:19 pm #156316In reply to: userpro topics replies for users in profile page
arpitg
Participanti’ve changed previous code
January 1, 2015 at 1:11 pm #156315In reply to: userpro topics replies for users in profile page
Robin W
Moderatorok, 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 positionthat should tell us which
January 1, 2015 at 12:18 pm #156312In reply to: userpro topics replies for users in profile page
arpitg
Participanthello 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 110January 1, 2015 at 8:10 am #156309In reply to: Topic: "Page not found" error
Robin W
Moderatorok, have you been through the setup
January 1, 2015 at 8:03 am #156308In reply to: userpro topics replies for users in profile page
Robin W
Moderatorok, 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>`
January 1, 2015 at 6:06 am #156306In reply to: userpro topics replies for users in profile page
siddardha
Participanthey 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>January 1, 2015 at 3:31 am #156304In reply to: How to start?
Toni
ParticipantBecause of the intructions I got from the forum – I knew what to look for and found this:
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.January 1, 2015 at 3:24 am #156303In reply to: Forum landing page link in site menu – how?
Toni
ParticipantSomehow the menu is in order this time. And…
I found what you were explaining to me, and the shortcode (what I was searching for):
Thanks again, I knew exactly what to look for this time.
December 31, 2014 at 9:38 pm #156300Topic: Increase quantity of search results
in forum Troubleshooting2cats
ParticipantI 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!
December 31, 2014 at 4:51 pm #156295In reply to: Forum landing page link in site menu – how?
Toni
ParticipantWait – what is the shortcode? I know how to use them – but I don’t know them.
December 31, 2014 at 4:39 pm #156294In reply to: How to start?
Toni
ParticipantAlso – 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.
December 31, 2014 at 2:11 pm #156291In reply to: How to start?
Toni
Participanthttps://codex.bbpress.org/getting-started-with-bbpress/
Odd that it takes a couple of links to get there.
December 31, 2014 at 11:26 am #156286In reply to: userpro topics replies for users in profile page
Robin W
Moderatorcan you post the view.php template with your added code here please
December 31, 2014 at 9:45 am #156280In reply to: userpro topics replies for users in profile page
Robin W
Moderatorok, 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?
December 31, 2014 at 9:12 am #156274In reply to: userpro topics replies for users in profile page
Robin W
ModeratorThat is what the original code does in profile – what happens when you click the links?
December 31, 2014 at 7:57 am #156267In reply to: New Topic/Reply button
Robin W
Moderatoryou 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
December 31, 2014 at 7:50 am #156265In reply to: userpro topics replies for users in profile page
Robin W
Moderatorthe 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
December 30, 2014 at 11:46 pm #156250In reply to: New Installation 404 error
Doulacare
ParticipantThis also doesn’t explain why this shortcode doesn’t work either http://ontariodoulas.org/forums/
[bbp-forum-index]
December 30, 2014 at 9:24 am #156211In reply to: how to make bbpress categories and forums as pages
siddardha
Participantyes, 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?
December 30, 2014 at 3:43 am #156203Topic: userpro topics replies for users in profile page
in forum Installationsiddardha
Participanthello,
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.
December 29, 2014 at 2:49 pm #156183In reply to: Fatal error: ob_end_flush()
Robin W
ModeratorDepends 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 !!
-
AuthorSearch Results