Search Results for 'code'
-
AuthorSearch Results
-
March 8, 2014 at 3:13 am #143446
In reply to: Show WordPress role in place of bbPress role
Robin W
Moderatoryes, go to
and no. 15 if you want to change capabilities
March 7, 2014 at 11:54 pm #143443Topic: bbpress forums disappearing after changing permalinks
in forum Troubleshootingsremy
ParticipantHi,
I recently installed bbpress on my site and had no issues with it – it worked really well. But I changed my permalinks to %category% for the category base. And suddenly the forums stopped working. I tried copying the short code, and even clicking “view forum” direct from the forum creator, and it keeps coming up as a 404, even though they are clearly visible in the back end.
When I remove the %category% permalink, it returns to normal, but then of course that stops me being able to permalink my categories (which is something I need to do for this site). I have tried un installing and re installing the plugin, but it doesn’t seem to have any effect. Any idea what might be going on, and how to resolve it?
March 7, 2014 at 8:44 pm #143438In reply to: Import from phpbb to bbpress – robot id shifting
Stephen Edgar
KeymasterSomeone else here has done the import/conversion when using
wp-united, here it is, should be some good tips for you: https://bbpress.org/forums/topic/phpbb3-import-incomplete-and-switches-authors/Also https://codex.bbpress.org/import-forums/ & https://codex.bbpress.org/import-forums/phpbb
March 7, 2014 at 4:18 pm #143432In reply to: No toolbar available
Liberty
ParticipantI already tried this code but I had the same problem with this editor.
function add_tiny() { bbp_get_the_content(array ( 'tinymce' => true, )); } add_filter ('bbp_before_get_the_content_parse_args','add_tiny') ;I think the problem is in the bbpress.php file. I will change same code on weekend and hope I will find the problem.
March 7, 2014 at 2:56 pm #143427In reply to: No toolbar available
Robin W
Moderatorok, I had a look, and yours is definitely trying to use the wp-editor not the tinymce one.
My forum calls
<div id="qt_bbp_topic_content_toolbar" class="quicktags-toolbar">under the title.
Yours calls
<div id="wp-bbp_topic_content-editor-container" class="wp-editor-container">As to why, I can’t say. You could try
function add_tiny() { bbp_get_the_content(array ( 'tinymce' => true, )); } add_filter ('bbp_before_get_the_content_parse_args','add_tiny') ;in your functions file to force it to use the mce editor
(I haven’t tried that code so may need some editing)
The function in form-topic uses bbp_the_content which calls bbp_get-the_content – both functions are in
bbpress/includes/common/template.php
if you want a look.
I am now away for the weekend !
March 7, 2014 at 9:29 am #143408In reply to: Delete topic doesn't delete replies
John James Jacoby
KeymasterThat will definitely cause you some grief.
pre_get_postsis called on every posts query that fires, even non-bbPress ones.In this case, you’re filtering every admin query and looking for a meta value that won’t exist for certain post types (like revisions, pages, posts, attachments, navigation menus, etc…)
You’ll want to target your code much more specifically than you are here, so that you’re only matching the correct query conditions for what you’re trying to accomplish. This might be hard if you’re also trying to filter sidebars and widgets, since you want something broad, but not too broad.
March 7, 2014 at 4:25 am #143403In reply to: Delete topic doesn't delete replies
inspirationally
Participantok, got it.
I was sorting the topics by number of replies with this:<?php /* Plugin Name: Set Post Order In Admin Version: 0.1 Plugin URI: https://wordpress.org/support/topic/336715/ Description: In Posts->Edit, display posts in title order. Author: MichaelH Author URI: https://codex.wordpress.org/User:MichaelH/MyPlugins */ function set_post_order_in_admin( $wp_query ) { if ( is_admin()) { $wp_query->set( 'orderby', 'meta_value_num' ); $wp_query->set( 'meta_key', '_bbp_reply_count' ); $wp_query->set( 'order', 'DESC' ); }} add_filter('pre_get_posts', 'set_post_order_in_admin' ); ?>this seems to cause the replies not to be deleted, too, curiously.`
Any idea why this happens? And how to delete the orphan replies + postmeta.
March 6, 2014 at 7:38 pm #143382In reply to: Any suggestions for redirects after mingle import?
kvr28
Participantthanks, actually one of my forum members has been working on it as well, I had shown the wpengine desk his code and above is what they came up with, so he made a change and it works
here was his thoughts on it
The reason I asked if you still had an old version running was to check if there might be any variations to the old urls that we might want to process. But as long as people can get to the main threads, its better than them hitting 404s (not found).
So I tried it and it worked. A bit of redundancy in there, but its working. Very close to mine, not entirely sure where mine went wrong other than that I gobbled across a “/” to “-forum/”. I’m also puzzled by the .* instead of .+ I think his choice to leave off the end-of-line $ is interesting.
The redundancy I refer to is he captures garbage twice, then uses the 3rd capture. Would you humor me and try…
Source = ^/forum/.+/.+/(.+)-thread.+
Destination = /forums/topic/$1/I did and it works well, so his might be a better option
March 6, 2014 at 6:18 pm #143377In reply to: Plugin to choose name and avatar
Robin W
ModeratorThe display name is currently a user choice. You could disable that by some code, but you would need to decide what to display instead eg username, email etc. But this is now completely opposite to your starting point to “allow users to choose a name and avatar before posting on a forum”.
Perhaps it would be easier if you described what it is that you would like to achieve and why in both profile and in the topic/reply display, rather than specific queries without any explanation.
I will try and assist you further
March 6, 2014 at 5:06 pm #143372Robin W
Moderatorok,
What I’d suggest you do is look in the main theme for a 404.php, and edit this to give a login link.
(If it doesn’t have a 404.php, then copy a page.php or index.php file across to your child theme and rename it 404.php. Look for the “loop” part of the code, and put the stuff in there instead)
You could then edit this file to have a link to your login and some different text.
So for instance if the 404.php files says “oops sorry this link appears to be broken”
you could amend this to :
This page cannot display. This maybe because you are not logged in. To login click here
or however your users login on.
They will probably go to the home page once logged in, so having the relevant posts in say the sidebar (eg latest topics widget) will let them quickly navigate to the post.
If any of the above not clear, please do come back.
March 6, 2014 at 2:36 pm #143354In reply to: By activating plugin, other sites give a 404 page
Robin W
Moderator“I needed to add the form, topic and forum manually [bbp-topic-index] [bbp-topic-form][bbp-forum-index] and have not found a manual solution for the login ([bbp-topic-login] didn’t work..))”
See the documentation for set up details including login in sidebar
and
for setting up menu and modal loginsAs for your 404 error, I presume that the urls are correct, for instance
http://www.hightearecepten.nl/recipe/vijgencompote/
works with bbpress deactivated, but not when it is activated?
I’d check first whether there is a plugin conflict, and then a theme conflict viz ;
Check other plugins
Check that no other plugins are affecting this.
Turn off all other plugins, and see if that fixes the problem. If the problem is resolved, add back one at a time to see which is causing the conflict.
Check themes
If plugins are not the cause, then it may be a theme issue. Switch to a default theme, such as twentytwelve, and test.
If it is Themeforest, I’d raise it with them, as it is a paid theme, and with over 1 million bbpress downloads they should have seen it, or know what to do. I have seen some comments that some themeforest themes do not support bbPress, but don’t know about this one.
March 6, 2014 at 1:27 pm #143349In reply to: Forum Question
Robin W
Moderatorok, so create the forum as ‘private’ – you see a visibility setting on the forum page when you create it.
Then drop this code into your (child)themes functions file.
//code to add tutor role function add_tutor_role( $bbp_roles ) { /* Add a role called Tutor */ $bbp_roles['bbp_tutor'] = array( 'name' => 'Tutor', 'capabilities' => custom_capabilities( 'bbp_tutor' ) ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_tutor_role', 1 ); function tutor_role_caps_filter( $caps, $role ) { /* Only filter for roles we are interested in! */ if( $role == 'bbp_tutor' ) $caps = custom_capabilities( $role ); return $caps; } add_filter( 'bbp_get_caps_for_role', 'tutor_role_caps_filter', 10, 2 ); function custom_capabilities( $role ) { switch ( $role ) { /* Capabilities for 'tutor' role */ case 'bbp_tutor': return array( // Primary caps 'spectate' => true, 'participate' => false, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => true, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => false, 'edit_topics' => false, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => true, // Reply caps 'publish_replies' => false, 'edit_replies' => false, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => true, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => false, ); break; default : return $role; } }The set any tutors up with the tutor role in dashboard>users> user and at the bottom of the set up you’ll see forum role.
If any of that’s not clear or beyond your knowledge, do come back, and I’ll help further
March 6, 2014 at 1:05 pm #143348Topic: bbPress menus not appearing in some of my sites
in forum TroubleshootingMike
ParticipantHi,
The menu options Forums, Topics and Replies appear on some of my sites in a multisite install, but not all.If I change this in bbpress.php:
'show_ui' => current_user_can( 'bbp_topics_admin' ),to
'show_ui' => current_user_can( 'manage_options' ),I can see the Topics menu. Same if I change the permissions for the Forums and Replies menu.
Why should it be that the Forums, Topics and Replies menus are showing in some of my sites, but not others? I am administrator and keyholder in all of my sites.I am using WordPress 3.8.1 and Buddypress 1.9.1 and I’ve set up bbPress for Sitewide and Group forums.
March 6, 2014 at 12:28 pm #143345Topic: Display forum'description on the front-end
in forum ThemesGilles Vauvarin
ParticipantHello,
I would like to display on the front-end (over forum list on bbpress root page) the forum’s description (see here: http://i.imgur.com/o3c5iA1.png … to see what i’m speaking about).
I know there is a hook to put some content in this area “bbp_template_before_forums_index” but is there a function or a shortcode to get the forum’s description (http://i.imgur.com/o3c5iA1.png) ?
Thx
March 6, 2014 at 12:09 pm #143344In reply to: Misunderstanding: buddypress groupforums usage
Apokh
ParticipantOkay the first part is to replace the function within the template.php but where goes the second one?
function alsb_get_post_root_forum($post_id)I´m not php common, so di I have to replace the whole
function bbp_current_user_can_publish_replies()function within the template.php with your code?March 6, 2014 at 8:40 am #143339In reply to: Voting on user-submitted posts
dtbaker
ParticipantI couldn’t find a working (simple) voting system for bbpress so I rolled my own:
If it continues to work over the coming weeks I’ll clean up the code and share it.
March 6, 2014 at 8:38 am #143338In reply to: Working rating/vote up feature for bbpress
dtbaker
ParticipantI couldn’t find a working (simple) voting system for bbpress so I rolled my own:
If it continues to work over the coming weeks I’ll clean up the code and share it.
March 6, 2014 at 5:44 am #143336In reply to: Printing threads (WP 3.8.1, bbPress 3.5.2)
Stephen Edgar
KeymasterTo achieve this you would just make an alternate CSS stylesheet based of the main bbPress stylesheet and enqueue it as part of your theme.
You’d simply use
display: nonefor the bits you don’t need.<link rel="stylesheet" id="bbpress-print-css" href="http://example.com/bbpress-print-css.css" type="text/css" media="print">March 6, 2014 at 5:36 am #143334In reply to: Any suggestions for redirects after mingle import?
Stephen Edgar
KeymasterSee this thread on how one user did it for SimplePress:
Also a search with a few of these keyowrds:
mod_rewrite,phpbborvbulletinat Stack Overflow will give you some good examples to go by: http://stackoverflow.com/March 5, 2014 at 7:02 pm #143322mshane8
ParticipantI have imported through WP Dashboard Import – Forums, Topics and Replies but they are not displaying properly. It shows Forums and then a # of Topics but on the far right it shows 0 topics in a forum and when I click on the specific forum it says “there are 0 topics” even though the topics and replies have all been imported and show in the WP Dashboard.
I have a static page with shortcode: [bbp-forum-index] used to call the forum index. Maybe it is a permalink problem.
March 5, 2014 at 6:55 pm #143321In reply to: Forums, Topics, Replies – Migration Help!
mshane8
ParticipantHi Robin –
I am too far along. That is not an option.
Do you know where bbPress places the database tables. What is the default table prefix?
I am not sure why this is so complex. I have imported through WP/Dashboard/Tools/Import – Forums, Topics and Replies individually through xml files.
I have a static page that calls the forum index using the shortcode : [bbp-forum-index]
This page displays OK. It will show the # of topics but when I click on the forum itself it opens up the forum but shows 0 topics. All the topics, forums and replies are in the WP Dashboard assigned to the proper author.
March 5, 2014 at 5:11 pm #143314In reply to: Forum Question
Robin W
Moderatorok, I’ll do some code tomorrow and come back !
March 5, 2014 at 9:57 am #143294In reply to: Sticky Posts not showing in correct order
Robin W
ModeratorSort of think that’s how it is designed to work, the idea being that you eye is drawn to the latest unstuck post, and then immediately above it is the latest stuck post, so it works
sticky – early to late.
unsticky – late to early.Suspect there’s a bit of code you can do to change the order.
The function bbp_get_stickiessits in
\bbpress\includes\topics\functions.php
March 5, 2014 at 9:41 am #143292In reply to: Creating a new forum
Robin W
ModeratorI don’t directly have any experience of maintenance plugins.
However creating a test/backup site, whilst requiring some further learning, is of great benefit, and discussed in the documentation here
March 5, 2014 at 9:27 am #143291In reply to: how can i show latest thred
Robin W
ModeratorSorry, I failed to add the other bit of code you need !!
The last paragraph should have read :
…and then on your page template add this function where you want it.
<?php if(is_front_page() ) { display_latest_topic () ; } ?>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 !
If any of that isn’t clear, do come back, but let me know what theme you’re using as well
-
AuthorSearch Results