Sorry, I think I misunderstood your question from the beginning. You’re not trying to display topics on the front page of a group. You’re trying to show topics on the site’s front page? If so, what I’ve talked about won’t help at all. 🙁
In looking into bbPress, I can’t really see how a particular forum is associated with a group. So I’m afraid I’m not going to be much help. Maybe someone else knows more about bbPress’s group forum integration?
i’m using a premium theme, cinimatix…
if i remove the “if bp_group_is_visible” conditional it works fine but shows all topics… i didnt try the second conditional bc its not even reading the group id..
That’s too bad. A couple of questions I should have asked at the beginning:
- What theme are you using?
- If you remove the conditional we added, does bbPress return topics for the correct group?
Put this before the code we’ve been talking about, and see what it displays on the page:
$test_id = bp_get_current_group_id();
echo 'The current group ID is:' . $test_id;
If it returns a number besides zero (zero means that it can’t figure out which group is the current group, a non-zero number is the current group ID), then you could probably adjust the conditional code:
if ( bp_group_is_visible( bp_get_current_group_id() ) ) {
//do the topics loop here
}
Fingers crossed.
it doesnt work as in: no posts show up at all :/
it is on the sidebar… how would i pass the group_id and give bbp_topics access… pretty much a noob here, sorry…
thanks in advance!
When you say it didn’t work, do you mean that people who should see the topics couldn’t, or that no one could see the topics, or that everyone could see the topics? Was it too generous in letting people through or did it keep everyone out? 😉
Also, could it be that this is this being used in a sidebar? I’m wondering if the placement on the page means that the group context is not certain, so you’d need to pass the group_id into bp_group_is_visible. Although I’d expect the bbp_topics to need to access the group_id as well.
i tried using the code you provided but nothing i tried worked… the latest forum topic is a widget so i tried putting it around the widget but that of course didnt work…
so i dug deeper and found the template for the actual link and wrapped the code around that and it didnt work either 🙁
the widget code: http://pastebin.com/cWrRkF1H
the mytopics code: http://pastebin.com/PxJGi76N
the single topic code where i put the code you provided: http://pastebin.com/X8VuwWpe
not sure where else to put it…
any help would be appreciated, thanks!
You should be able to wrap your bbp_has_topics output in a conditional like:
if ( bp_group_is_visible() ) {
//do the topics loop here
}
bp_group_is_visible checks to see if the group is public or private, and if it’s public, returns true. If not public, then it checks to see if the user is a member of the current group; if yes, it returns true. It’s located at /bp-groups/bp-groups-template.php -> line 377.
function bp_group_is_visible( $group = false ) {
378 global $groups_template;
379
380 if ( bp_current_user_can( 'bp_moderate' ) )
381 return true;
382
383 if ( empty( $group ) )
384 $group =& $groups_template->group;
385
386 if ( 'public' == $group->status ) {
387 return true;
388 } else {
389 if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
390 return true;
391 }
392 }
393
394 return false;
395 }
Hi,
I display recent topics on the frontpage using bbp_has_topics. I would like to hide topics of private groups for non-members of group. How to do it?
I’ve looked through the threads and nothing I’ve found has worked to remove the sidebar from the Register page. I saw a thread from a few months ago advising to remove the sidebar code in register.php and adding the line of CSS but that didn’t work either. I want to keep member listings, groups, etc. private and not appearing to the public on the registration page.
I’m using the MesoColumn theme. Thanks for any help you can provide!
@jais-p removed the extra posts 😉
Thank you for posting back with your solution. Cheers.
Sorry for the multi-posting, bug. Thanks for your help!
@asdevargas
I removed the github version in favor of using the version in the official WP repository which has been improved. You can get it here:
https://wordpress.org/plugins/private-community-for-bp-lite/
Allright, I’ve solved the problem.
I needed to activate the “always include” option for JS. Although the “include JS” & “include CSS” options were checked, apparently the third option is required in order to upload files attached to private group posts.
Thanks for the clue!
Dear Mercime,
Thanks for your reply.
I have tried to attach PDF, DOCX and simple TXT files.
I do use GD-bbPress-attachments Version 1.9.2. I have checked the settings, they all seem correct.
Strangely, the behaviour of the posting page doesn’t seem to upload the file I’ve selected, e.g. when I attach a file to any post, the uploading time of the page takes a few second (uploading of the file), whereas when I do the same on a private forum, the uploading time is almost instantaneous, as if the file was simple not uploaded
Hi,
First of all, thanks for this wonderfull plugin that I’ve been extensively using on several websites for a couple of years now.
I’m facing a problem that I hope somebody we’ll be able to solve.
I have implemented private groups with forums. It’s all working fine regarding posted messages, but I cannot attach files to posts for these private groups.
I have checked the file size limit (which is correct), tried several different files, checked CHMOD on my server: nothing will do. I simply cannot attach files to private groups’ posts.
It is working perfectly well on any other forums, not liked with private groups.
I am using BP 1.7.2 and bbPress 2.3.2.
Does anybody have a clue?
Kind regards !
@bphelp. Upon a little further research, I wanted to note that I created a new User Profile Group, created a private field seen by Admins Only in that group, and the settings seem to be working fine in that group. In my Base (Primary) group though, all profile fields still remain visible to all users. Does the Base (Primary) group automatically force all fields visibility public by default? If so, is there way to override?
If there is no way to change the visibility in the Base (Primary), I suppose I can just put private info in the other Profile Group, but I’m curious if or how that may effect my database import..
Hi @bphelp, is there a way I can privately send you a private link and/or set you up with a user account for my site’s user information? I just don’t want a public link with all of the user’s info public. I currently have all plugin’s deactivated and the twentytwelve theme active. I also did a clean install of Buddypress, still no luck, all the extended profile information is still visibile to everyone.
@bphelp Agree, every project is different and maybe will need a different solution. Thanks for creating the plugin though. 🙂
@shameermohamed50
Something is getting lost in the translation here. I know there is a BuddyPress plugin hence we are in the BuddyPress support forums but you keep mentioning a “BuddyPress Forum Plugin.” If you want forums then you will need to install bbpress and use the links I supplied. You can get bbpress here:
https://wordpress.org/plugins/bbpress/
BuddyPress just adds the social networking side of things like activity stream, members directories, extended profiles, adding friends, private messaging etc. If you need to have a forum you will need bbpress. Please do not take this offensively but you need to have a clear understanding of what BuddyPress is and what bbpress is because as stated before as of BuuddyPress 1.7 you will need to install bbpress which is a seperate plugin if forums is a requirement for your project. Have a look in the codex documentation to get a better understanding. Do a google search for BuddyPress and another for bbpress.
@espellcaste
Thank you, and in future releases I will be using the comments I get to make adjustments but the thing is I will never be able to satisfy everyone’s requirements. You may want it that way but another user may like it the way it is, or want something totally different. I do appreciate the positive comment, I may bump it up to 5 unblocked pages but I plan to release a premium version so I am not certain yet but I do take everything into consideration. Thanks again! 🙂