Forum Replies Created
-
In reply to: Can't change forum's index meta title
@saulmarq – I didn’t read your second post and completely misunderstood. I use Yoast SEO and set the page title there.
In reply to: Can't change forum's index meta title@robinw – I just came across this too and thought exactly the same as you, that it needed that filter or something like that. I was trying to change the “Topic tags: ” (or something like that) bit of the tags archive pages.
It was picking up the default taxonomy-topic-tags.php file. This must have been picked up from the plugin default theme, not mine – it’s in /extras in my theme folder but changing it there had no effect, I had to move it out of there to the root of the theme folder. This totally makes sense from a WordPress standpoint but was non-obvious because I was looking in the bbPress folder in my theme.
ANYWAY it’s sorted now but if someone else comes across it, check for some hidden template. I couldn’t get that filter to work for anything. I tried very very hard to make it work. It didn’t.
@saulmarq – what you can do is make a new page and make the permalink your forum root. So my forum root (in settings) is forums and the page is at example.com/forums. Then use the [bbp-forum-index] shortcode. The gotcha is that this page will *only* use the bbPress template, I think – you can’t make a custom template for it. I might be misremembering that, but I do know you can’t change the default template. Someone tried to tell me this was a good thing, whatever.Doing it this way is nice because then you can write an intro like:
Hi! Welcome to our forums. Dive right in. Post a lot, whoo!
[bbp-forum-index]
In reply to: Pagination for user replies not workingWell, I didn’t solve this but worked around in a completely absurd manner. The “paged” query var was causing the problems, so I made a new query var, thepage, and used that to re-do the query for user replies using the ‘bbp_get_user_replies_created’ filter. Then, instead of messing around with the slightly insane way bbPress writes the pagination links, I added in Waypoints (http://imakewebthings.com/jquery-waypoints/) and used the Infinite Scroll shortcut to load the next pages. It seems to work ok (fingers crossed, it’s just gone live, something could still go very wrong).
The links for the next pages are like this – I didn’t make them pretty because they’re not in the browser address bar.
/forums/users/vicki/replies/?thepage=2In reply to: Pagination for user replies not workingI realise I’m talking to myself, sorry, I’m using this to remember what I’ve tried.
On the sites it’s working, this is also working: /?bbp_user=vicki&bbp_reps=1&paged=2 — however on the sites it’s *not* working, that gives a redirect loop. WHY? Why is it doing it to me? What have a done wrong to deserve this? (Or what am I doing wrong?)
In reply to: Update user roles with mysql query.Sorry, I’m not really sure. But good luck with it!
In reply to: Pagination for user replies not workingIt looks like it’s a known issue – I think it’s this:
https://core.trac.wordpress.org/ticket/15551I’ve tried everything. Rewriting the query, trying the redirect_canonical filter, whatever. I can’t get it to work.
However why it’s working on one site and not the other? No clue. And omg, it’s now working on the staging version of the live site (it wasn’t before) as well as the dev site. I moved a widget and poof! it works. HOWEVER, moving the same widget on the live site does *not* work.
Utterly bizarre.
In reply to: Update user roles with mysql query.If it were me, I’d start by looking through here:
http://www.sourcexref.com/xref/bbpress/nav.html?includes/users/capabilities.php.source.htmland probably try using bbp_set_user_role (starting on line 58) to change the role.
But I haven’t done it, so that who knows if that would work!
In reply to: Pagination for user replies not workingI’m updating this because it’s not a bbPress issue. I mean, it’s in bbPress but it’s not a bug. I have a dev site made from the site in March and user reply pagination is working on there. As far as I can tell, *nothing* is different about the two. I updated the dev site, one bit at a time, it was tedious, to match the live site and the pagination still works correctly.
So I don’t know. If anyone has any ideas, please shout (and then type it down). I had a similar-ish problem on a different site and it was a WP_query issue, so I think something might be affecting that. But where? And why only there? All the other pagination is working correctly.
We may never know.
In reply to: I think I found a bug in bbp_topic_subscription_linkHi Mike – to filter the ajax call try this :
function hide_before2 ($args = array() ) { $args['before'] = ' '; $args['subscribe'] = '<i class="genericon genericon-subscribe"></i>Subscribe'; $args['unsubscribe'] = '<i class="genericon genericon-unsubscribe"></i>Unsubscribe'; // or whatever return $args; } add_filter('bbp_before_get_user_subscribe_link_parse_args', 'hide_before2');
<can people see edits? I’m just wondering if anyone can see my stupid errors>
Anyway, you should, I think, be able to use the above *instead* of your copied functions as it will work with the initial ones too not just after the ajax call.
In reply to: Check if on page/blog or forumI am totally guessing with this – but I think you’ll be using this on a single topic right? So maybe try bbp_is_single_topic() . Here is the list of conditional tags I looked at: https://codex.bbpress.org/bbpress-conditional-tags/
Ah – I think it’s because you have the Google form (and its submit button) in your topic form and bbPress doesn’t check to see that the submit being clicked is its submit. I’m not completely sure on that, so it’s just a guess.
Unfortunately, the hook bbp_theme_before_topic_form doesn’t actually go before the topic form, it’s just after the opening form tag so you shouldn’t use that. But I think you’re editing the template? If that’s the case, just add the Google book search before the opening form tag eg :
<form id=”new-post” name=”new-post” method=”post” action=”<?php the_permalink(); ?>”>You might need to re-style but I think that might work.
In reply to: Moderator Unable To Post To Forum: iPhone iPadAh ha – and hmm, would it still pick up the rest of the defaults, eg img and blockquote and those? The correct answer to this question is “You have a test install, play with it and figure it out yourself.” so I will. Later.
I know what you mean about the amount that can be learned in 12 months. 12 months I was trying and trying to convince a client that they didn’t want a forum! Of course, that was for reasons other than development but it has turned out very well – cheap and easy (ok maybe not cheap and maybe not super simple when you count in moderation and user issues and all that) but an excellent way to get constantly updated content.
In reply to: bbcodeIf you go to Settings -> Forum and untick the Post Formatting box where it says “Add toolbar & buttons to textareas to help with HTML formatting”, they should go away.
In reply to: Redirect User Profile LinkTo change the user profile url, you can use this – it will build a link to the /profile/username and return that in the bbp_get_user_profile_url function in includes/users/template.php :
add_filter('bbp_pre_get_user_profile_url', 'mjj_profile_link'); function mjj_profile_link( $user_id ){ $user_info = get_userdata( $user_id ); $user_nicename = $user_info -> user_nicename; return '/profile/' . $user_nicename; }
This would go in your functions.php file or bbpress-functions.php if you’re using that. Never modify those files in the admin area, only do them if you have ftp access and can undo anything that goes wrong!
In reply to: bbpress custom user role ?bbpress-functions.php should go in the main theme directory eg /twentythirteen/bbpress-functions.php. It doesn’t go in the /twentythirteen/bbpress/ directory. This is also true for the default bbpress template, bbpress.php.
So for bbpress custom templates, you’ll have eg :
/mytheme/bbpress-functions.php <– custom functions file, overwrites plugin file
/mytheme/bbpress.php <– custom main bbpress index file, overwrites plugin file
/mytheme/bbpress/*.php (eg /mytheme/bbpress/loop-forums.php) <– all the template files you want to overwrite from the plugin folder /bbpress/templates/default/bbpress/Did you ever get this sorted? I looked at it but couldn’t figure it out. My first guess is that there’s something named incorrectly and it triggers an event it’s not meant to – this is what happens to me more often than not. But I couldn’t figure out how to reproduce it on your site.
In reply to: force strong password at registrationThis probably won’t help but just in case – I use Gravity Forms for a custom registration page and can enable various password strengths on the password field: http://www.gravityhelp.com/documentation/page/Password
I know what you mean about “too strong”!
In reply to: Moderator Unable To Post To Forum: iPhone iPad@netweb – with filters, do they only add or modify the function? I mean, can you only add or modify parameters in them, not delete? Eg if I had this:
add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' ); function ntwb_bbpress_custom_kses_allowed_tags() { return array( // Links 'a' => array( 'class' => true, ) }
would I *only* be allowed to add a tags with a class (no, I don’t know why either but just pretend…) and not able to add the default img, blockquote, etc tags? I guess I’m asking is it like a child functions.php file (which overwrites) or a child css file (which adds to / modifies)? I am hoping I’ve got my analogies right, hmm.
I had a similar question last year but never really figured it out – gave up when I decided it didn’t matter: https://bbpress.org/forums/topic/using-wp_filter_kses-filter-for-bbpress-posts/
I fully appreciate this highlights how little I know these things! And thank you. 🙂 This has been a really interesting discussion.
In reply to: Moderator Unable To Post To Forum: iPhone iPadThank you so much for the update! I’m glad it’s working. 🙂
I have just now finished helping troubleshoot a bug with copying and pasting text from pdfs into the new WP visual editor. The guy thought it was a problem with WP 3.9 but it is an issue with one of his plugins – however, I can see why he thought that. (I didn’t go all the way through to finding out which plugin it is – this is just some guy I follow on twitter.) So it’s happened to someone I’ve come across, too.
I want to use Parsedown in my forums and got as far as making a plugin that got it to work when writing posts but then realised I needed something like “Parseup” (current status: imaginary) to make the editing posts possible and sane. Doh.
Perhaps there will be a plugin in the future that will allow moderators with administrator rights to have these tools directly in the forum, but not have them accessible to the general public?
Your users can still use a limited number of html tags, although they probably don’t know it because now it doesn’t say so anywhere. I think that’s true… it’s in includes/common/formatting.php
Note that they can’t upload images but can simply hotlink them. I was worried about this initially but it hasn’t been a problem so far although now I’ve probably jinxed it./** Kses **********************************************************************/ /** * Custom allowed tags for forum topics and replies * * Allows all users to post links, quotes, code, formatting, lists, and images * * @since bbPress (r4603) * * @return array Associative array of allowed tags and attributes */ function bbp_kses_allowed_tags() { return apply_filters( 'bbp_kses_allowed_tags', array( // Links 'a' => array( 'href' => array(), 'title' => array(), 'rel' => array(), 'target' => array() ), // Quotes 'blockquote' => array( 'cite' => array() ), // Code 'code' => array(), 'pre' => array(), // Formatting 'em' => array(), 'strong' => array(), 'del' => array( 'datetime' => true, ), // Lists 'ul' => array(), 'ol' => array( 'start' => true, ), 'li' => array(), // Images 'img' => array( 'src' => true, 'border' => true, 'alt' => true, 'height' => true, 'width' => true, ) ) ); }
In reply to: Theme problemOh good! Glad it’s all going well now.
Ha – I just got a “slow down; you move too fast” posting error. Trust me bbpress.org website, I’m human.
Excellent! That sounds great – congrats on your contribution. 🙂
In reply to: Adding Login To Bottom of Forums and TopicsOh good! That should work, actually. If I had done that and it didn’t work for me, it would have been because I only added it to one function and not the other, so maybe check that… 🙂
Here is the full code with “Register here” linked to /register-now –
//this adds the login form with a register here link underneath on a single topic so someone can leave a reply. It uses the same logic as form-reply function mjj_new_reply_login(){ if( !bbp_current_user_can_access_create_reply_form() && !bbp_is_topic_closed() && !bbp_is_forum_closed( bbp_get_topic_forum_id() ) ){ bbp_get_template_part('form', 'user-login'); echo '<a href="/register-now">Register here</a>'; } } add_action('bbp_template_after_single_topic', 'mjj_new_reply_login'); //this adds the login form with a register here link underneath on a single forum so someone can start a topic. It uses the same logic as form-topic function mjj_new_topic_login(){ if( !bbp_current_user_can_access_create_topic_form() && !bbp_is_forum_closed() ){ bbp_get_template_part('form', 'user-login'); echo '<a href="/register-now">Register here</a>'; } } add_action('bbp_template_after_single_forum', 'mjj_new_topic_login');
In reply to: Theme problemYeah, it might have been a dns propagation issue, I didn’t think of that. It didn’t work, then you disabled bbpress and then it worked a couple of hours later (I did check a few times) then wasn’t working the next morning.
Do you have bbpress-functions.php in your WP theme folder? You could try editing that to give the correct path.
OR what you could do is just ignore the 404 and add them in separately. So workaround rather than fix. I’m guessing all your css and js files in your template directory are not getting included. But they’re there – I can see them.
This isn’t pretty and will stop working if you change themes or hosts, it’s like fixing trousers with duct tape, but it might work – you can and should keep trying to fix things in the meantime.
It goes into functions.php but don’t add using the admin area editor as if something goes wrong and you don’t have another way of editing files, you’re in deep trouble. I say that because I’m not really convinced it’s completely right, there’s no conditional logic for the js files so you need to be prepared to fix it if needs be (or ask, that’s fine, too!).
add_action('wp_enqueue_scripts', 'mjj_readd_scripts'); function mjj_readd_scripts(){ wp_register_style( 'ifuture-styles', '/ifuture/plugins/bbpress/templates/default/css/bbpress.css' ); wp_register_script( 'ifuture-editor', '/ifuture/plugins/bbpress/templates/default/js/editor.js' ); wp_register_script( 'ifuture-reply', '/ifuture/plugins/bbpress/templates/default/js/reply.js' ); wp_register_script( 'ifuture-topic', '/ifuture/plugins/bbpress/templates/default/js/topic.js' ); wp_register_script( 'ifuture-user', '/ifuture/plugins/bbpress/templates/default/js/user.js' ); wp_enqueue_script( 'ifuture-editor' ); wp_enqueue_script( 'ifuture-reply' ); wp_enqueue_script( 'ifuture-topic' ); wp_enqueue_script( 'ifuture-user' ); wp_enqueue_style( 'ifuture-styles' ); }
In reply to: can't change background colorYou’re looking for a:hover – that’s the style for a link when someone is hovering over it. So I think if you add the following it will all work as you’d like and be the same colour as your other links. This changes the default link hover colour. There might be something somewhere tucked away that overwrites it in certain circumstances but this should work on the forum index page at least.
a:hover{ color: #31485a; }
@hardeepasrani just did this, yay! Here is his post on how to add it in:
http://www.trickspanda.com/2014/01/add-replies-topics-count-bbpress/