Forum Replies Created
-
In reply to: customizing bbpress admin links
where are you putting this code – is it in a bbpress template?
ok thanks for that, I’ll see what’s needed.
The original bbpress will group together things, you child theme can then pick and change individuals.
So for instance if you were describing your family in a style.css you might have
mother, daughter 1, daughter 2 {
wearing : dress
}
father, son {
wearing : jeans
}Say you decided that daughter 2 should have tshirt and jeans, so in your child theme you’d put
daughter 2 {
Wearing : tshirt&jeans ;
}This will leave mother and daughter 1 as they were and only change daughter 2
silly example, but hopefully explains !
In reply to: Very simple question — changing font sizethe example is based on you having a page template in your theme that doesn’t display bbpress well, but works for other pages.
In that example you could use a different class for bbpress pages to get them to render how you would like. So you would have the if/else.
the article explains the other way, which is to rename a template to bbpress.php or forums.php, and then simply alter that for whatever bbpress display you want.
Finally if it’s only bbpress display that you want to alter, you can simply change the bbpress styles in your theme style folder.
Lots more in documentation, if you are trying to achieve something specific come back and detail it, and I’ll try and help
In reply to: customizing bbpress admin linksgreat, glad you’ve got most of it working.
ok, on that last bit
tried using this function to post a single admin link for a topic
and also just by replacing return with echo
but I cant seem to get that to workCan you explain a bit more about what you’re trying to do and where?
In reply to: Very simple question — changing font sizeif (is_bbpress()) : div class=”abc” else : div class=”xyz” endif;
translates to
if you are on a bbpress screen/page/display [as opposed to a wordpress blog post or page, a home page or anything that isn’t bbpress]
the use div class abc
if you are on any other type of page use class xyz.
Many themes use if statements checking against ‘conditional tags’ to style areas for instance the conditional tag is_home() checks whether this is the home or index page.
Hey never apologise for posting interim solutions – great to see your workings and thinking.
Any plugin that works is good enough to be published, my first was very basic !
Can you post your final css please, it can be wrapped into the plugin so that it becomes a package.
In reply to: Remove Private Tagyes put this code in your functions file
add_filter('protected_title_format', 'ntwb_remove_protected_title'); function ntwb_remove_protected_title($title) { return '%s'; } add_filter('private_title_format', 'ntwb_remove_private_title'); function ntwb_remove_private_title($title) { return '%s'; }
for information on functions files see
@peter-Hamilton – great, knew someone who is better at css would come along !
ok,
the dots are coming from your style.css line 118
ul {
list-style: disc outside none;
}change to
ul {
list-style: none outside none;
}although you may need to make this forum specific.
In reply to: 404 after logout from private forumgreat – glad you’re fixed !
In reply to: bbbPress performanceCan you just say what happens if you disable the plugin, does it just return to as before?
In reply to: Display some submenu only for specific group userIf you’ve cracked the code for the submenu, then groups are a buddypress thing, so their forum might be better.
But from total ignorance try….
If you’ve phpmyadmin access, you could set up a user for a group, and see what changes in the usermeta, and then use this to create your filter
eg
if say you found that buddypress_group was what was used for groups, you could set the group using$current_user = wp_get_current_user(); $group=get_user_meta( $current_user , 'buddypress_group', true);
then dependant on group
if ($group==22) then... if ($group==23) then....
In reply to: bbpress should offer to login in forumgreat, come back if you need further help
Regards
Robin
In reply to: customizing bbpress admin linksIn essence if I understand it you want to change the
reply/edit/merge/trash/close/trash/reply links that come up with a topic or reply so that only some show, and others are in a dropdown list.
is that correct?
if so then
my goal with this is to call each admin link individually and make only 2 or 3 to be visible
(reply,edit,maybe quote link from gd bbpress tools)simply requires you to filter for those you want to display
open up
bbpress/includes/replies/template.php
and you’ll see the admin links function line starting at line 1811
On lines 1840 to 1848 you’ll see the default links are added.
So lets create a function to just have the first two
you’ll see a filter in line 1841 (‘apply_filters’) and we can hook to that
so
//change admin links displayed function change_admin_links ($r) { $r['links'] = apply_filters( 'rw_reply_admin_links', array( 'edit' => bbp_get_reply_edit_link ( $r ), 'move' => bbp_get_reply_move_link ( $r ) ), $r['id'] ); return $r['links'] ; } add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
just leaves us with edit and move.
This also gives you the ability to add a new link, with say your dropdown list.
You’ll also see that this function checks if it is a topic on line 1825, and you’ll need to similarly create a function for that – I’ll leave you to work that one out.
Come back if you need more help, and when you crack this, can you post the finished code to this site so we can see what it looks like.
In reply to: 404 after logout from private forumno the file is one that belongs to your theme called just functions.php
you’ll find it at
wp-content/themes/%yourthemename%/functions.php
where %yourthemename% is the name of your theme.
If you don’t have a child theme, then you should create one, see
In reply to: 404 after logout from private forumyes, drop this into your functions file.
This will send users to the /forums/ page whenever they log out -whether private or public forum or on a topic or reply, or anywhere within bbpress. If you logout, you’re saying your done, so taking you back to the index seems a logical place to end up !
You can change the $url to say ‘/home/’ if you want the home page,
//sends the user to $url - in this case '/forums/' function rw_logout ($redirect_to) { $url='/forums/' ; $redirect_to = '<a href="' . wp_logout_url( $url ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>' ; return $redirect_to ; } add_filter ('bbp_get_logout_link', 'rw_logout') ;
In reply to: Specific User Write AccessIt could be coded, but it’s not possible at the moment.
My private groups plugin is probably the closest – it lets you assign users to forums, but as the name suggests keeps the forums private. http://www.rewweb.co.uk/bbp-private-groups/
I don’t currently have plans to offer that possibility.
In reply to: Specific User Write Accessbbpress has its own roles
so user not registered would see all public forums but not able to post, but would not see private forums
registered users with wordpress roles would be able to do all wordpress things but with ‘no role’ in the user profile under forum would not be able to post in the forum.
registered users with forum roles (eg participant, moderator) would be able to see public and private forums, and if wordpress roles set would be able to carry out wordpress roles
registered users with spectator role would be able to view both public & private forums but not participate.you should be able to achieve whatever you want with a role based solution.
come back with further details if this is not what you are trying to achieve
In reply to: No forum after BBP Private Groups plugin updateI have now fixed the issue, and posted the new version to my website
I have posted the new version in
I will post this to the wordpress plugins page in the next few days.
Robin
In reply to: Content Not Showingnot sure quite how threatening to remove something that is free, cost you nothing, and is supported by volunteers who are paid nothing and have tried to help you to get something working that you had working perfectly well at the start, but has somehow got messed up is really s’posed to progress to a resolution.
I know you are frustrated, but taking it out on here is not really the answer 🙂
I hope you are able to get it working, but if not find another solution, and wish you the best for the future.
In reply to: add_role on my site and influence of bbpressbbpress has a separate set of capabilities, so you can set permissions for the wordpress part of your site totally separately to the capabilities for bbpress.
see
https://codex.bbpress.org/bbpress-user-roles-and-capabilities/
and if needbe
In reply to: Content Not Showingdo you mean the permalink for your topic is
/edit.php?post_type=topic
as in example below where the permalink is under the title
long answer I’m afraid and in two parts
part 1 – setting the user permission to allow delete topic and delete reply
delete is easy, making it only trash is in part 2 !
Basically you’ll need to change a couple of capabilities of the participant role
see
https://codex.bbpress.org/bbpress-user-roles-and-capabilities/
you see the abilities delete topics and delete replies (as distinct from delete others topics and delete others replies)
Whilst you could amend the participant role, I haven’t documented that, so easiest is just for you to create a new role and give it the participant capabilities plus the ‘delete topics’ and ‘delete replies’. This article explains how
add this code to your functions file – see
part 2 – changing the function, so that delete is only shown for keymasters
This code will only allow a keymaster to permanently delete a topic
add the following to your functions file
add_filter ('bbp_get_topic_trash_link', 'topic_dont_delete'); add_filter ('bbp_get_reply_trash_link', 'reply_dont_delete'); function topic_dont_delete( $args = '') { // Parse arguments against default values $r = bbp_parse_args( $args, array( 'id' => 0, 'link_before' => '', 'link_after' => '', 'sep' => ' | ', 'trash_text' => esc_html__( 'Trash', 'bbpress' ), 'restore_text' => esc_html__( 'Restore', 'bbpress' ), 'delete_text' => esc_html__( 'Delete', 'bbpress' ) ), 'get_topic_trash_link' ); $actions = array(); $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) ); if ( empty( $topic ) || !current_user_can( 'delete_topic', $topic->ID ) ) { return; } if ( bbp_is_topic_trash( $topic->ID ) ) { $actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-restore-link">' . $r['restore_text'] . '</a>'; } elseif ( EMPTY_TRASH_DAYS ) { $actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash', 'topic_id' => $topic->ID ) ), 'trash-' . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-trash-link">' . $r['trash_text'] . '</a>'; } if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) { if ( bbp_is_user_keymaster()) { $actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete', 'topic_id' => $topic->ID ) ), 'delete-' . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-topic-delete-link">' . $r['delete_text'] . '</a>'; } } // Process the admin links $retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after']; return $retval ; } function reply_dont_delete( $args = '' ) { // Parse arguments against default values $r = bbp_parse_args( $args, array( 'id' => 0, 'link_before' => '', 'link_after' => '', 'sep' => ' | ', 'trash_text' => esc_html__( 'Trash', 'bbpress' ), 'restore_text' => esc_html__( 'Restore', 'bbpress' ), 'delete_text' => esc_html__( 'Delete', 'bbpress' ) ), 'get_reply_trash_link' ); $actions = array(); $reply = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) ); if ( empty( $reply ) || !current_user_can( 'delete_reply', $reply->ID ) ) { return; } if ( bbp_is_reply_trash( $reply->ID ) ) { $actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-restore-link">' . $r['restore_text'] . '</a>'; } elseif ( EMPTY_TRASH_DAYS ) { $actions['trash'] = '<a title="' . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash', 'reply_id' => $reply->ID ) ), 'trash-' . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-trash-link">' . $r['trash_text'] . '</a>'; } if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) { if ( bbp_is_user_keymaster()) { $actions['delete'] = '<a title="' . esc_attr__( 'Delete this item permanently', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete', 'reply_id' => $reply->ID ) ), 'delete-' . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-reply-delete-link">' . $r['delete_text'] . '</a>'; } } // Process the admin links $retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after']; return $retval ; }
I haven’t fully tested this code as my test site is in some disarray whilst I test something else, so you’ll need to check that it works
In reply to: Forum Structure error1. go into dashboard>forums and under the title you will see the forum’s permalink. It should read forum-2. change it to forum
2. go into dashboard>settings>forums and look for forum prefix, and untick
In reply to: Content Not Showingok, thanks for that info
if you go into
Dashboard>topics>all topics –
1. can you see and edit the topic?
2. what is the topics permalink? (just under the heading)
(this is just for my info)
then reset the permalinks
dashboard>settings>permalinks
see what they are set to, change them to anything else and save, and then change them back and save.
The come back and tell me what happened !