Search Results for 'code'
-
AuthorSearch Results
-
July 1, 2016 at 12:31 am #176086
In reply to: How to stop Topic Revisions Log on this one topic?
Robkk
ModeratorYou can turn off the revisions in Settings > Forums.
July 1, 2016 at 12:18 am #176080In reply to: Showing Profile Information
Robkk
ModeratorI couldn’t get it to see anything I put in my child theme, because it is accessed through plugins, not themes. I know I’ll have to update the file again manually as soon as I update bbPress.
You don’t need to change anything in bbPress to do this type of thing, just put any template files in a child theme or custom theme package plugin (there is no info on this but this is possible too).
https://codex.bbpress.org/themes/theme-compatibility/
Also, that plugin only allows you to add new fields, not display existing ones. Doesn’t it seem odd that you would be prompted to enter data in fields on user profile edit, but then not have any of them show on view? By default the user fields should be available to show, at least standard ones like description, website, and social media profiles.
This is the only plugin I can think of that might be easy for some users to display content. If you want contact Robin later in the support forum to see if he would add existing fields to it.
How are some people not caring about this? It just seems so fundamental to me.
There is a plan to add certain fields to the profile page in the future, mostly default existing fields for now.
June 30, 2016 at 11:58 pm #176078In reply to: search function still available after searching
Robkk
ModeratorUse this PHP code place it into a child theme functions.php file or use a plugin like functionality.
//display bbPress search form in search results function rk_bbp_search_form_in_search_results(){ if ( bbp_allow_search() && bbp_is_search_results() ) { ?> <div class="bbp-search-form"> <?php bbp_get_template_part( 'form', 'search' ); ?> </div> <?php } } add_action( 'bbp_template_before_search', 'rk_bbp_search_form_in_search_results' );Also look at this guide.
June 30, 2016 at 11:14 pm #176075In reply to: Styling nested replies
Robkk
ModeratorYou can use this class before another class in a reply to style the threads.
.bbp-threaded-repliesThis class only appears if you enabled threaded replies.
June 30, 2016 at 2:48 pm #176060In reply to: How do you put the "My Profile" link on the menu?
khunmax
ParticipantBUMP
Robin I have installed your OK FINAL ANSWER code listed above and all works as it should with one small BUG.
If I am logged in as admin and then click on your MY profile link I am not taken to my BBpress front end profile page but rather to an error page:
———-
Oops! That page can’t be found.It looks like nothing was found at this location. Maybe try searching?
———-
Can anyone assist me to edit the code so when someone logged in as admin click on the my profile link they are taken to his or her BBpress front end profile.Thanks in advance for any assistance you can provide.
Kind Regards
Max
June 30, 2016 at 12:47 pm #176055khunmax
ParticipantBUMP
I can confirm that if you install the above code in your functionality plugin and then use the
WP NICE SEARCH plugin set to all you can display your bbpress content in a nice ajax drop down in your sidebar.Nice Search also has the option to limit the search parameters by configuring its shortcode:
[wpns_search_form only_search=”my_custom_post_type”]
I want to use this shortcode in the sidebars for my forum conent and limit the search to just Forums, Topics and Replies (no WP stuff included). However, I can not figure out what I should put in the NICE SEARCH shortcode as the BBpress custom post types.
I have tried both of the following as a trial but they didn’t work:
[wpns_search_form only_search=”bbp_register_topic_post_type”]
and
[wpns_search_form only_search=”ntwb_bbp_topic_cpt_search”]
Can anyone assist me with what the correct format of the BBpress custom post type(s) that I should be entering into the NICE SEARCH short code.
Thanks in advance for any assistance that is offered.
Kind Regards
Max
June 30, 2016 at 9:02 am #176049In reply to: How to stop Topic Creations allouw Replys
Robin W
ModeratorJune 30, 2016 at 2:51 am #176043In reply to: Freshness Link
Fuskeduske
ParticipantFound a solution, if anyone is looking for the same i found the following in /includes/forums/template.php
bbp_forum_last_reply_urlwhich seems to have resolved my issue.June 30, 2016 at 12:37 am #176038In reply to: Freshness Link
Fuskeduske
ParticipantNoone? 🙂
I have tried the following
bbp_forum_last_reply_permalinkinstead of bbp_forum_last_topic_permalink but that links to the reply only.I have too tried using bbp_reply_url, but that does not seem to work either.
Is it true that there are no function for this yet, and it therefore have to be created? If so, where is bbp_reply_url – bbp_forum_last_reply_permalink – bbp_forum_last_topic_permalink located? Because then i might be able to figure the rest out myself.
June 29, 2016 at 12:30 pm #176028In reply to: Display 5 recent topics or forums on the home page
Robin W
ModeratorThis plugin has a shortcode that lets you display recent topics by forum or forums
https://wordpress.org/plugins/bbp-style-pack/
see dashboard>settings>bbp style pack>shortcodes for options
June 29, 2016 at 4:54 am #176016In reply to: Post count functions broken
arnalyse
ParticipantI encountered the same Problem as Loc: The count returned by
bbp_get_user_reply_countdoes not update with the user’s activities in the forums. Thebbp_get_user_reply_count_rawcomputes the count directly from the database, which is computationally more expensive, but delivers a correct count.Furthermore Robkk is right: I just had a look at the source code of bbPress 2.6-alpha, and has added and hooked some functions to correctly increase and decrease the post count on user’s actions such as creating and deleting posts.
June 29, 2016 at 3:17 am #176015In reply to: Search not working
Robin W
ModeratorThis is probably because in the bbPress default theme package, there is a template called content-search.php. In some newer themes there is also a template of the same name. And since the bbPress templates don’t necessarily need to be in a bbPress folder, the bbPress plugin is choosing the template from your theme before the template that is actually in bbPress.
Copy content-search.php from the bbPress plugin templates and place it in a child theme in a folder called bbpress.
https://bbpress.org/forums/topic/bbpress-search-only-showing-last-item/#post-175880
So create a directory on your child theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/content-search.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/content-search.php
bbPress will now use this template instead of the originalJune 27, 2016 at 1:49 pm #175992In reply to: Adding User Profile Button
IndigoO
ParticipantOh, wait. I got that one too! LOL
I found that a code block had been added to my member home page by the second code snippet. I deleted that block and all good now.
Thanks for your help!
June 27, 2016 at 1:25 pm #175990In reply to: Adding User Profile Button
IndigoO
ParticipantEDITED: I first added the second code snippet you provided, then realized I needed to other one, so I deleted that second snippet and used the first at the end of the functions.php file in my child theme. It does not place a small “edit profile” link centered at the top of my forum main page, which is a help (thanks), but it also places the following text at the bottom of my members home page when logged in: “Click edit button to change this code.”
That is not a clickable link and it is also not in the right location. Also, I can’t see where that specific text is being defined to edit the wording, which I’d want if it was a working link. It would be great to also have the edit link on the members home page, not just the forum main page, or even better to be able to add it to the sidebar that shows on all member area pages, but at least I’d like to remove this text from the non-forum page.
Thanks in advance if you can sort this.
June 27, 2016 at 1:05 pm #175989In reply to: Site blank when bbPress deactivated
Robin W
Moderatorok, I’d either
change the theme to parent briefly and try it again – see if this fixes
or try replicating to a test site, where you can play with it
https://codex.bbpress.org/getting-started/testing-your-bbpress-installation/creating-a-test-site/
June 27, 2016 at 7:21 am #175980In reply to: Is there any way to get forum root slug field value?
MD FAKRUL ISLAM
ParticipantThanks Robin W, it worked!. The working code is below for others help.
/** * Add bbp user profile link in WP nav menu * Filter wp_nav_menu() to add profile link */ function prefix_bbp_profile_link_nav_menu($menu) { if ( !is_user_logged_in() ) return $menu; else $current_user = wp_get_current_user(); $user = $current_user->ID; $bbp_profile_url = bbp_get_user_profile_url( $user); $bbp_profile_menu_link = '<li> <a href=" '. esc_url( $bbp_profile_url ) .' "> '. __('Edit Profile', 'text-domain' ) .' </a> </li>'; $menu = $menu . $bbp_profile_menu_link; return $menu; } add_filter( 'wp_nav_menu_items', 'prefix_bbp_profile_link_nav_menu' );June 27, 2016 at 3:15 am #175976In reply to: Is there any way to get forum root slug field value?
Robin W
Moderatorthe last set of code in this thread should give you what you want
https://bbpress.org/forums/topic/adding-user-profile-button/
June 27, 2016 at 1:43 am #175975In reply to: Converter for Dizkus Forums
Stephen Edgar
KeymasterIt’s been a while since I tried it, I’ll have to re-attempt it in a couple of days when I have an opportunity to try it again.
Cool
As I recall, it imported the users fine, and then it looked like it was doing the posts, but after, I want to say about 150 posts, it froze there, never indicated further imports. When I checked the database tables, it didn’t appear that it actually brought the content from Dizkus over to bbPress at all.
Ok, so it did something, thats a good sign in that the database name and password were correct.
If you’ve ever used Chrome/Firefox “inspect” debugger, you can right click and select “inspect” or (view the source code of the web page) and there is some extra debugging MySQL statements you will see there, if when testing you have issues take a look at the last query and include that MySQL code here when posting back, it will help determine what went wrong.
As to the localhost problem, I mirrored the Zikula site to my local WIn 10 machine, and then tried to import on a local WP/bbP site and it didn’t do anything. Seems like it just couldn’t find data.
If it can’t find any data it should thrown an error message to that affect, if you don’t select
Dizkusfrom the dropdown menu on the importer screen and use the defaultAEFthat can be one of the causes, another is that the database is not in the same database server as your WordPress install.Did you import that database to your Win 10 machine or were you trying to connect to it remotely?
June 26, 2016 at 7:48 pm #175971Topic: Is there any way to get forum root slug field value?
in forum TroubleshootingMD FAKRUL ISLAM
ParticipantHi, I am trying to add forum user profile link into wp_nav_menu_items.
Is there any way to get the forum root slug field value dynamically (just like user nickname, see $user in below code) to making the profile link dynamic? I am thinking to adding a setting option for getting the forum root slug from users in case no way to get the forum root slug fieled value.Could anyone help? Thanks in advance.
/** * Add bbp user profile link in WP nav menu * Filter wp_nav_menu() to add profile link */ function prefix_bbp_profile_link_nav_menu($menu) { if ( !is_user_logged_in() ) return $menu; else $home_url = home_url( '/' ); $current_user = wp_get_current_user(); $user = $current_user->user_nicename ; $profilelink = '<li> <a href="' . esc_url( $home_url ) . '/forum-slug/users/' . $user . '/edit"> '. __('Edit Profile', 'text-domain' ) .' </a> </li>'; $menu = $menu . $profilelink; return $menu; } add_filter( 'wp_nav_menu_items', 'prefix_bbp_profile_link_nav_menu' );June 26, 2016 at 8:10 am #175962In reply to: Site blank when bbPress deactivated
Robin W
ModeratorI’d look in wp-config for
define( 'WP_DEBUG', false );and change it to
define( 'WP_DEBUG', true );This will switch debugging on, and you should get an error shown when you try and access the site.
Post this error back here, and we’ll try to help further.
June 26, 2016 at 2:42 am #175958In reply to: Adding User Profile Button
Robin W
Moderatoryes it goes in the functions file of your child theme
June 25, 2016 at 11:15 pm #175957In reply to: Adding User Profile Button
IndigoO
ParticipantWhere would this code be added? I’m trying to do the same by adding it to my child theme’s bbpress.php file, but is just showing the raw code on the page. I may be in the wrong file, or else have something else missing. Thanks if you can direct.
June 25, 2016 at 6:38 pm #175954In reply to: Showing Profile Information
IndigoO
ParticipantIt took me a ridiculous amount of time to find where to make this change and make it, and even then it is in the main bbPress code. I couldn’t get it to see anything I put in my child theme, because it is accessed through plugins, not themes. I know I’ll have to update the file again manually as soon as I update bbPress.
Also, that plugin only allows you to add new fields, not display existing ones. Doesn’t it seem odd that you would be prompted to enter data in fields on user profile edit, but then not have any of them show on view? By default the user fields should be available to show, at least standard ones like description, website, and social media profiles.
If you use that plugin to manually create some of those fields, your users will see two of each, the original ones that won’t show in view mode, and the custom ones you created. Not workable.
So really I see nothing to do other than manually editing the user-profile.php file to line by line include each field you want to show. How are some people not caring about this? It just seems so fundamental to me. Why go all the way to something like BuddyPress when all you want is field data already being collected to actually show?
June 25, 2016 at 4:59 pm #175953In reply to: Site blank when bbPress deactivated
Robin W
ModeratorThe functions file of your theme might hold code that relies on bbpress – look for lines that include
add_action (‘bbp_something…
or
add_filter (‘bbp_something…June 25, 2016 at 12:39 pm #175951danbp
ParticipantAnswering to myself:
bbp_buddypress_loadedfires before everything is, in fact, fully loaded. bbPress’s component-specific extensions aren’t loaded until bp_init:7 (ty @boonebgorges for this explanation).Changing add_action to
bp_initwith a priority of 8 did the job !This may work for Site Activities, Members and Group activities
function bpfr_remove_activity_dropdown_label() { // Remove forum filters in site wide activity streams remove_action( 'bp_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 ); // Remove forum filters in single member activity streams remove_action( 'bp_member_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 ); // Remove forum filters in single group activity streams remove_action( 'bp_group_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 ); } add_action( 'bp_init', 'bpfr_remove_activity_dropdown_label', 8 ); -
AuthorSearch Results