Forum Replies Created
-
Any ideas on this? Thanks.
@Ousep — I don’t have a bp-custom.php file (WPMU? I’m using single-user WP), but I put your function in my child theme functions.php file, and it did something, though it didn’t quite work.
It did not output a count of favorites next to the Favorites button in the Profile sub-nav bar (oddly, such a favorite count does is being displayed in the site-wide Activity stream navigation, however), which is what it should do, but it did output either a “(1)” or a “(2)” just to the right of the “Remove Favorite” button in each of the Favorites listed in Profile –> Activity (Personal) and Profile –> Activity — Favorites. It also posted a “(1)” or a “(2)” just to the right of the “Remove Favorite” button in Activity –> All Members and Activity — Favorites.
Any ideas?
Can you point me in the right direction? Not sure how to code it and especially how to find the right file to edit. Thanks.
Thanks for the links, @r-a-y — those discussions were helpful, and I can see that this has been an ongoing discussion for at least the last couple months.
For now I’ve disabled Forum replies in the activity stream, to avoid the “forked conversation” issue of having some topic relies in the Forum and some in the AS. I’m still wrestling with the whole Groups thing and the Groups comment box at the top of each Groups page — I know for a fact that when I open this up to 10k+ members of my current forum, many, many of them will just start posting their topics in the Group page, rather than creating a Topic in a Group Forum. Maybe I should just open it all up and let it be chaotic, and let the user community figure out how to self-regulate?
The other thing I’m still looking for is a sitewide Favorites option, so users can mark Forum Topics, Group AS posts, or blog posts as Favorites — currently you can only do that with Group AS posts. It looks like @JohnJamesJacoby is working on such a plugin — see https://buddypress.org/forums/topic/favorite-button-available-on-singlephp — which hopefully will be ready soon and solve this particular issue.
I’l love such a plugin. Looking forward to it.
Any ideas for better user management in the admin?
Ok. I found the General BP setting to “Disable activity stream commenting on blog and forum posts?”, which I set to “disable”. I think this is a good solution — users can reply to Group or Activity posts, which are synced in both places, but now if they want to reply to a Forum post that they are reading in the Activity stream, they have to click through to the Forum post and reply there. This will keep the site from generating two sets of conversations.
As to my point #3, I’m still hoping for a site-wide “Favorites” option, but especially for Forum topics and replies. This is why I have filed a trac ticket for it, which others seem to agree is an issue to be fixed.
Thanks for the tip!
I have confirmed that in the final 1.2 release of BP, edits and deletions of topics and topic replies in the Forum are now propagated to the Activity stream. Thanks for fixing this problem.
Thanks @DJPaul. I created a new Trac ticket to request this as a future enhancement: https://trac.buddypress.org/ticket/1988
Perfect, @DJPaul, that did the trick. Thanks. I’m starting to get the hang of this.
Anyone?
Anyone?
Ok, cool, I didn’t know that was required, and I haven’t made it public because it’s just in testing mode right now. Thanks.
Any ideas on a function for this?
Any ideas on this? Basically looking to match the tag adding and editing ability that you have here on this Buddypress forum.
Ok, I figured it out. In the RC3 version of bp-forums-templatetags.php, it says the old function this was calling has been deprecated, and what to replace it with:
/* DEPRECATED use bp_has_forum_topic_posts() */
function bp_has_topic_posts() { return bp_has_forum_topic_posts( $args ); }
function bp_forum_topic_posts() {
global $topic_template;
return $topic_template->user_posts();
}
/* DEPRECATED use bp_forum_topic_posts() */
function bp_topic_posts() { return bp_forum_topic_posts(); }
function bp_the_forum_topic_post() {
global $topic_template;
return $topic_template->the_post();
}
/* DEPRECATED use bp_the_forum_topic_post() */
function bp_the_topic_post() { return bp_the_forum_topic_post(); }
So I swapped the offending line and now have it working again using this function in my child theme functions.php file:
/* Custom function to re-write Forum title tags */
function my_page_title( $title, $b ) {
global $bp;
if ( $bp->current_action == ‘forum’ && $bp->action_variables[0] == ‘topic’ ) {
if ( bp_has_forum_topic_posts() ) {
$topic_title = bp_get_the_topic_title();
$title .= ‘ | ‘ . $topic_title;
$title = str_replace( ‘ | Groups’, ”, $title );
$title = str_replace( ‘ | Forum’, ”, $title );
}
}
return $title;
}
add_filter( ‘bp_page_title’, ‘my_page_title’, 10, 2 );
?>
@r-a-y @boonegorges — Unfortunately, this function just broke under BP1.2-RC3:
Fatal error: Call to undefined function: bp_has_topic_posts() in…
Here is the complete function from you guys provided above:
/* Custom function to re-write Forum title tags */
function my_page_title( $title, $b ) {
global $bp;
if ( $bp->current_action == ‘forum’ && $bp->action_variables[0] == ‘topic’ ) {
if ( bp_has_topic_posts() ) {
$topic_title = bp_get_the_topic_title();
$title .= ‘ | ‘ . $topic_title;
$title = str_replace( ‘ | Groups’, ”, $title );
$title = str_replace( ‘ | Forum’, ”, $title );
}
}
return $title;
}
add_filter( ‘bp_page_title’, ‘my_page_title’, 10, 2 );
?>
Any help on this greatly appreciated. Thanks.
I found this code that can be wrapped around anything to hide it from everyone but administrators or ediors:
<?php if ( current_user_can( ‘delete_others_posts’ ) ) { //only admins and editors can see this ?>
(Items to be hidden here)
<?php } ?>
To make it work specifically for hiding that “Create a Group” button, I made a new version of the default template’s groups –> index.php file in my child theme, replacing this:
<h3><?php _e( ‘Groups Directory’, ‘buddypress’ ) ?><?php if ( is_user_logged_in() ) : ?> Â “><?php _e( ‘Create a Group’, ‘buddypress’ ) ?><?php endif; ?></h3>
With this:
<h3><?php _e( ‘Groups Directory’, ‘buddypress’ ) ?><?php if ( current_user_can( ‘delete_others_posts’ ) ) : //only admins and editors can see this ?> Â “><?php _e( ‘Create a Group’, ‘buddypress’ ) ?><?php endif; ?></h3>
It worked like a charm! Now only Admins and Editors can create groups on my site.
Thank you thank you thank you @Dwenaus! It was a simple answer, which is probably why I found not documentation for it anywhere. What tripped me up is that I created some groups under the “admin” login, but then after that I was using a different user login that also had the Role of Admin in the WP backend, but that didn’t automatically give it Admin ability for Groups/Forums, so I never even saw the “manage members” tab under group admin. Doh!
Now I’ve got it all sorted out, with only one out-standing question:
Is it possible to block users below a certain level of user Role from being able to create new groups in the first place? I don’t want a mass proliferation and duplication of groups.
Thanks!
Where can you assign these Roles to Groups? Sorry if this is somehow obvious, but I can’t find any documentation on User Roles on the Buddypress site or anywhere else. And I have these fundamental questions:
1. Is there a way to assign user roles to Groups/Forums?
2. Is the creator of a group the “admin” for that group? I assume so, but then, who is the Moderator, and how does a Group Admin assign a Moderator to their group?
3. How do I give any user that has the role “Moderator” the ability to edit/delete any Group or Forum topics or posts created by any user below the Moderator level (such as Subscribers)?
4. Can I turn off the “Create a Group” function for anybody but Admins and Moderators?
What I’d like to do is have it so only Moderators and above can create groups, but Moderators and above can also edit and delete groups, forum topics, group/forum posts, etc. Is this possible?
I see there’s a line in the file bp-forums-templatetags.php as part of the function that seems to be controlling user authority:
if ( $bp->is_item_admin || $bp->is_item_mod || is_site_admin() )
Does “mod” here mean “moderator”? If so, this seems to be saying, show the editing options to the item admin (the user who created it?), the item moderator (?), and the site admin. It’s that one in the middle that I’m stuck on, as in my installation Moderator is not able to moderate anything — cannot edit or deletes Forum topics or post that have been posted by Subscribers. I have just installed 1.2RC2-trunk2685, but the problem still persists.
Any ideas?
Thank you both, Boone and Ray, that worked perfectly! I now have the Forums title just how I wanted, and I’m sure many others will benefit from this. Great work!