Search Results for 'code'
-
AuthorSearch Results
-
March 5, 2014 at 8:01 am #143288
In reply to: No toolbar available
Liberty
ParticipantOk, I switched to “Twenty Ten” and the toolbar appears. I don’t saw an mistake in my code. I hope you can see it: http://snippi.com/s/r6mpul7
March 5, 2014 at 6:35 am #143285In reply to: Titles – Roles
full moon
ParticipantHello,
I have been searching for something very similar. The “plugin author” label on all the plugin pages on wordpress.org is what I am after. The “plugin contributor” option too would be useful. Although I don’t want the text as it is, but this ability to label to indicate the users importance within a forum is essential to my project. My issue is that they Keymaster, participant, ect ect labels are useless as the forum master wont have any moderation/admin capabilities. So i need to be able to select a user to have a custom label like “offical representative”. I was looking at the code above, but I’m not sure if it would work as I need, and across a multisite install.
I guess I am asking the same question, but is there a plugin that can allow a user to be given a unique label in the forum per site?
Thanks in advance for any responce
Leigh
March 5, 2014 at 4:56 am #143281In reply to: how can i show latest thred
Robin W
Moderatorok, so drop the following into your functions file
// Display just latest topic function display_latest_topic() { $topics_query = array( 'post_type' => bbp_get_topic_post_type(), 'post_parent' => $settings['parent_forum'], 'posts_per_page' => '1', 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'order' => 'DESC' ); $lt_query = new WP_Query( $topics_query ); while ( $lt_query->have_posts() ) { $lt_query->the_post(); $topic_id = bbp_get_topic_id( $lt_query->post->ID ); ?> <h2> Latest topic </h2> <h3> <a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink"><?php bbp_topic_title($topic_id); ?></a></h3> <div id="bbpress-forums"> <div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header"> <div class="bbp-meta"> <span class="bbp-reply-post-date"><?php bbp_reply_post_date(); ?></span> <a href="<?php bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php bbp_reply_id($topic_id); ?></a> </div><!-- .bbp-meta --> </div><!-- #post-<?php bbp_reply_id(); ?> --> <div <?php bbp_reply_class(); ?>> <div class="bbp-reply-author"> <?php bbp_reply_author_link( array( 'post_id' => $topic_id, 'sep' => '<br />', 'show_role' => true ) ); ?> </div><!-- .bbp-reply-author --> <div class="bbp-reply-content"> <?php bbp_reply_content(); ?> </div><!-- .bbp-reply-content --> </div><!-- .reply --> </div><!--div bbpress-forums---> <?php } }and then on your page template add this function where you want it. I’ve wrapped it in an if is_front_page statement so it only shows on the frontpage. You night need to use is_home instead depending on how your blog is set up.
If you want it in the body, you should put it within the content div, either before or after the loop depending if you want it at the of or bottom of the page. You may need to play a bit !
March 5, 2014 at 2:14 am #143275Topic: Guide for making bbpress not so unusably slow ?
in forum Troubleshootingeternal noob
ParticipantHi all.
What can be done to get bbpress page load faster ? What are best practices ? Is there a tutorial I have missed ?
It appears as if I have a redirection-problem, where my browser is stalling ?
Is there still a gravatar-issue where I have to remove some code for speed optimization ?
What ressources can be cached with htaccess or otherwise ?
And so on …. ?BBpress is really looking better and better and the bbpress-for-wordpress-comments in 2.6 feature would be quite a fix for wordpress which doesnt even have an edit feature for commenteers. I like how things have gone so far. But seriously – SPEED, SPEED, SPEED.
I am definately no coder just an annoying end-user. But it is simply not decent for such a relatively simple set of functionalities to be so slow as it appears to me. I simply cannot annoy forum members with such page loads and also making wordpress load slower with bbpress installed.
What is a boy to do if he really would like to use bbpress ?
Thanks for anything.
March 4, 2014 at 10:52 pm #143271In reply to: how can i show latest thred
surangaudimedia
ParticipantYeah I can do it.. Could you please post the code for me? Thanks
March 4, 2014 at 6:14 pm #143265In reply to: Displaying a custom field in profile page
Robin W
Moderatorquickest way would be for you to check out the code in the plugin bbp-user-information on my website.
This adds 4 fields to the display under the forum role in topics/replies and in the profile (and make those field editable for later on), and you can see how these are set up and used.
In particular under the /includes folder you’ll find the display.php shows how to create function to add this to the correct area via a filter.
add_action ('bbp_theme_after_reply_author_details', 'bbp_user_information') ;and
add_action ('bbp_template_after_user_profile', 'user_profile_bbp_user_information') ;and within this you’ll see the code
$usermeta = get_userdata( $user_id, 'ui_label1' ); echo $usermeta->ui_label1;where ‘ui_label1’ is the metadata field and takes the data from the usermeta table and displays it.
March 4, 2014 at 4:45 pm #143261In reply to: Forum Issue
rumbu
ParticipantHow you solve ? the problem becouse me I have the same problem…..
Everybody can see my forum but when a users log in all forum dissapear.
If i Log in with Admin don’t disappear.http://www.pescuit-sportiv.ro/wordpress/forum
Not Found Apologies, but the page you requested could not be found. Perhaps searching will help.Thanks
March 4, 2014 at 3:57 pm #143256In reply to: No toolbar available
Liberty
ParticipantHello Robin,
I’m missing this toolbar:

it’s not available on my site:

I have the newest versions of WordPress and bbPress and have done this steps to fix this problem but nothing happened:
I have deleted every JavaScript and tested it. Nothing!
I deleted the code of the function.php. Nothing!
I deactivated every plug-in. Nothing!
…and the CSS can’t be the fault because the toolbar is not disabled. It’s not there.I opened my forum for guests and created a test forum. Now you can take a look on it: http://plusthemes.de/forum/test
Thank you so much for your answer. I try to give as much information as possible. 🙂
March 4, 2014 at 3:12 pm #143254In reply to: how can i show latest thred
Robin W
ModeratorOk I have worked a way to do it.
But you will need to
a) add some code to your child theme’s function file and
b) add a line of code into the page template your home page is usingHow much capability do you have to do that?
March 4, 2014 at 2:00 pm #143251In reply to: Fatal error
John James Jacoby
KeymasterThat function calls
wp_get_current_user()so it might be related to the$current_userglobal. WordPress’sget_currentuserinfo()function callswp_set_current_user()which overrides the global with fresh data.It’s plausible some other plugin is loading the current user too early, or that it’s trying to initialize WordPress more than once via a subsequent call to
$wp->init().It’s unlikely that bbPress is directly causing this, as bbPress doesn’t do any of the above things on its own. It does however reference currently logged in user data quite liberally using WordPress’s built in API functions, so it’s not entirely impossible.
Keep us posted, and we’ll try to help out where we can.
March 4, 2014 at 11:36 am #143247In reply to: Misunderstanding: buddypress groupforums usage
jyd44
ParticipantYou are right. Having the same requirement, I was facing the same issue (and you will discover very soon that it is not the only one !).
As far as I understand, the integration between bbPress and BuddyPress is not fully completed. In bbPress, the user capabilities based on their role in the forums are only mapped to WP capabilities. (see for example the function bbp_current_user_can_publish_replies() or bbp_current_user_can_access_create_reply_form() (invoqued in the form-reply.php part of the bbPress theme) in bbpress/includes/users/template.php .
My way to overcome this issue is to add my own filter on the ‘bbp_current_user_can_publish_replies’ filter and to check in this function if the current_user is a member of the group associated with the root_forum (the one associated with the group) of the topic currently displayed.below my function:
function my_bbp_current_user_can_publish_replies($input) { $topic_id = bbp_topic_id(); $root_forum = alsb_get_post_root_forum($topic_id); $groups_id = bbp_get_forum_group_ids($root_forum); $user_id = get_current_user_id(); if (groups_is_user_admin( $user_id, $groups_id[0]) || groups_is_user_mod ($user_id, $groups_id[0]) || groups_is_user_member ($user_id, $groups_id[0]) ) return true; else return false; } whith the help function function alsb_get_post_root_forum($post_id) { $post = get_post($post_id); do { $post = get_post($post->post_parent); }while ($post->post_parent != 0); return $post->ID; }another way is perhaps to setup a filter on the ‘user_has_cap’ WP filter, but I did not test it.
good luck for your integration !March 4, 2014 at 10:53 am #143244kokocipher
ParticipantI want to place it on the homepage.
I’m using Sahifa, in its homepage builder, you can have custom contents of html, scripts, and shortcodes.
March 4, 2014 at 4:21 am #143234Stephen Edgar
KeymasterKeep the
forum rootandforumslugs different.i.e. Name your page
forums, useforumsas your forum slug and your single forum slugforumMarch 4, 2014 at 3:50 am #143230Topic: forum(in breadcrumb) vs Forum goes to different pages
in forum Troubleshootingroyliew
ParticipantHi guys,
I’ve added a page ‘/forum’ with the bbpress shortcode. When i visit this page with ‘Forum’, I get this:

This is what i’ve created (with the login widget)However, when I visit the page by clicking the ‘forum’ text in the breadcrumb, shit I got this page without the login widget:

This is my forum setup:

How do I make sure that the breadcrumb ‘forum’ goes to the page with the login widget?
Thank you!
JasonMarch 4, 2014 at 12:36 am #143225In reply to: tag appears in posts submitted by "Participants"
John James Jacoby
KeymasterThe
bbp_kses_allowed_tags()function ensures thatciteattribute of theblockquotetag is allowed, but not the actualcitetag itself.Users with the Keymaster role are allowed to bypass these rules, and can post literally anything they want, completely unrestricted.
Two solutions:
- The “quote” plugin you’re using needs an update to not use
citetags - bbPress needs to allow
citetags
March 3, 2014 at 9:11 pm #143222In reply to: Pagination issue when threaded replies are enabled
Doremdou
ParticipantYes I understand, I would prefer to use threaded replies with pagination too but just now we can’t… 500 replies on a single page is not possible…
but I continue to think it was done in purpose looking at the bbpress codex:
https://codex.bbpress.org/forum-settings/Reply Threading
This will allow your users to reply to specific replies, providing context to the discussion in a ‘threaded’ view. This will also remove topic pagination so the topic and all replies will only be a single page.Let’s just hope someone will see our post and help us… :/
March 3, 2014 at 5:22 pm #143210In reply to: theme shortcode not working in forum
Robin W
Moderatordo you have an actual forum page
viz
https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ section 3, and which way is I set up?
March 3, 2014 at 2:05 pm #143196In reply to: Titles – Roles
Robin W
Moderatorok, just tested and this code seems to work
function add_custom_role( $bbp_roles ) { $bbp_roles['my_custom_role1'] = array( 'name' => 'name 1', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role2'] = array( 'name' => 'name 2', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants ); $bbp_roles['my_custom_role3'] = array( 'name' => 'name 3', 'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );So this adds 3 roles, you/your experts can duplicate the code and add more or remove unnecessary.
Basically you’ll just need to
1. tell the what to put as the names – currently the new roles are name 1, Name2 and name 3 (where it says ‘name’ => ‘name 1’ , so they’ll just overwrite that with what you want.
2. for each what capability. You’ll see the first two have the code bbp_get_participant_role() so that sets them to participant and the last sets to keymaster using bbp_get_keymaster_role() . You can guess that you just change the words for other roles such as spectator, or moderator.
They need to add this to your theme’s functions file.
please come back if any of this is not clear
March 3, 2014 at 1:45 pm #143192In reply to: Titles – Roles
Robin W
ModeratorI don’t like giving no answers so in between I have a little look, and found an answer from someone else on your second question ie adding roles with existing capabilities.
I just need to test it, and I’ll be back.
in the meantime if I said “add this code to your functions file” would you know what I mean?
March 3, 2014 at 1:33 pm #143189Robin W
Moderator‘So the pagination works fine on a standalone page, but if you embed it on your wordpress homepage, it’d fail. ‘
Is this a statement or a question?
What theme are you using?
and can you respond to previous questions
Where have you put the shortcode? on the homepage, on a page or on a post?
and where would you like the shortcode to go on the homepage, on a page or on a post?
I’ll then try to help you further.
March 3, 2014 at 11:08 am #143178kokocipher
ParticipantThanks for the replies, Robin W 🙂
So the pagination works fine on a standalone page, but if you embed it on your wordpress homepage, it’d fail.
It’s not that I have a page called “Topics,” the pagination simply uses the Topics Started slug. Even if I make a standalone page with bbp-topic-index, the pagination will still pick use Topics Started slug.
Because of this problem, I think a better solution would be to simply get rid of pagination for the shortcode, bbp-topic-index. Do you happen to know the temple file for that shortcode?
March 3, 2014 at 10:22 am #143176Robin W
ModeratorNot quite sure what you’re asking
Where have you put the shortcode? on the homepage, on a page or on a post?
and where would you like the shortcode to go on the homepage, on a page or on a post?
March 3, 2014 at 10:12 am #143175kokocipher
Participantis there a way to insert a page as a shortcode in the homepage area? I think the problem is that I didn’t create a page for bbp-topic-index
March 3, 2014 at 9:02 am #143172In reply to: Fatal error
Robin W
ModeratorI have been on your site 6 times, and seen the error twice. It comes and goes, so is unlikely to be pure code related, as that stuff either works or doesn’t.
There seems to be a bit of buz about at the moment about a similar error, in particular for go-daddy customers
eg
https://wordpress.org/support/topic/fatal-error-1002?replies=14
although both refer to a different line, and maybe entirely unrelated, but posted just in case.
Let us know if this is you also?
March 3, 2014 at 9:00 am #143171Topic: how can i show latest thred
in forum Themessurangaudimedia
Participanthow can i show letest thred (only last one) on my home page template. http://codex.bbpress.org/shortcodes/ i tried all this short cods in this page but nothing worked.
- The “quote” plugin you’re using needs an update to not use
-
AuthorSearch Results

